Developer + API

How do you use Plugsky with AutoGen?

AutoGen talks to any OpenAI-compatible endpoint, so you add a config entry with base_url set to https://api.plugsky.com/v1, your sk-live-… key and a Plugsky model id such as plugsky-pro. In AutoGen 0.2 that is a config_list; in 0.4+ it is an OpenAIChatCompletionClient with model_info. Agents, code execution and group chats then work unchanged.

Key facts

Plugsky endpointPOST https://api.plugsky.com/v1/chat/completions
AutoGen integrationSet base_url to https://api.plugsky.com/v1 in the model client or config list
Authapi_key: sk-live-… per agent config or loaded from the environment
Models30+ models; use plugsky-pro for planning and plugsky-lite for cheap worker agents
ToolsOpenAI-style function calling; AutoGen registers Python functions as tools
StreamingSupported at the API level; AutoGen renders chunks as they arrive
Known gotchaAutoGen 0.4 clients expect model_info for non-OpenAI model names
Product statusLive; assistants and responses endpoints are coming soon, so run agents on chat completions

TL;DR

  • One base_url entry connects every AutoGen agent to Plugsky.
  • Config lists work on AutoGen 0.2; model clients work on 0.4+.
  • Provide model_info on 0.4 clients for non-OpenAI model ids.
  • Give each agent a model that matches its job and cost.
  • Assistants-style APIs are coming soon — use chat completions plus tools today.

How it works, step by step

  1. Install AutoGen: pip install pyautogen (or the autogen-agentchat and autogen-ext packages for 0.4+).
  2. Create a Plugsky API key and export it as PLUGSKY_API_KEY.
  3. Add a model config with base_url https://api.plugsky.com/v1 and model plugsky-pro.
  4. Create an AssistantAgent and a UserProxyAgent using that config.
  5. Start a chat and confirm the conversation runs through Plugsky.
  6. Register Python tools so agents can call your functions, and constrain code execution.
  7. Set round and token limits, then monitor usage per agent.
1Install AutoGen:pip installpyautogen (or the2Create a PlugskyAPI key and exportit as3Add a model configwith base_urlhttps://api.plugsky.com/v14Create anAssistantAgent anda UserProxyAgent5Start a chat andconfirm theconversation runs6Register Pythontools so agents cancall your

Original data

POST https://aPlugsky endpointSet base_url tAutoGen integratio30+ models; usModelsAutoGen 0.4 clKnown gotchaSource: Plugsky facts table · updated 2026-09-25

Try it yourself

Open the AI agent builder →

Configure AutoGen for Plugsky

AutoGen's model config accepts any OpenAI-compatible endpoint. On 0.2-style APIs, use a config list:

import autogen

config_list = [{
    "model": "plugsky-pro",
    "api_key": "sk-live-…",   # or os.environ["PLUGSKY_API_KEY"]
    "base_url": "https://api.plugsky.com/v1",
}]

llm_config = {"config_list": config_list, "temperature": 0, "timeout": 60}

On 0.4 and newer, the equivalent is an OpenAIChatCompletionClient from autogen_ext:

from autogen_ext.models.openai import OpenAIChatCompletionClient

client = OpenAIChatCompletionClient(
    model="plugsky-pro",
    base_url="https://api.plugsky.com/v1",
    api_key="sk-live-…",
    model_info={
        "vision": False,
        "function_calling": True,
        "json_output": True,
        "family": "unknown",
    },
)

The model_info block matters: without it, the 0.4 client may assume OpenAI-only capabilities for an id it does not recognize. Check the exact ModelInfo fields for your AutoGen version.

A minimal two-agent conversation

Once the model config is in place, the rest of AutoGen behaves normally. A planner agent and a reviewer agent both use Plugsky:

assistant = autogen.AssistantAgent(
    name="engineer",
    llm_config={"config_list": config_list, "temperature": 0},
)

reviewer = autogen.AssistantAgent(
    name="reviewer",
    llm_config={"config_list": [
        {**config_list[0], "model": "plugsky-pro"}
    ]},
)

user = autogen.UserProxyAgent(
    name="requester",
    human_input_mode="NEVER",
    code_execution_config={"work_dir": "workspace", "use_docker": True},
)

user.initiate_chat(
    assistant,
    message="Write a Python retry helper with exponential backoff and tests.",
    max_turns=6,
)

Mixed-model teams are a genuine advantage: run the bulk of the conversation on plugsky-lite and escalate only the final review to plugsky-pro.

Tools, code execution and guardrails

AutoGen turns registered Python functions into OpenAI-style tools, and Plugsky's function calling handles the round trip. Keep the tool surface small and explicit:

  • Allowlist tools: expose only the functions an agent needs for its role.
  • Constrain code execution: run generated code in Docker, never on the host, and set a working directory.
  • Cap the loop: max_turns and max consecutive auto-replies prevent runaway conversations.
  • Approve risky actions: use human-in-the-loop mode for anything that writes to external systems.
  • Log every call: persist the model, prompt, tool calls and token usage per turn.

These are not optional in production. Multi-agent loops multiply a single bad tool call across many turns, so the cost of a missing guardrail scales with the group size.

Production considerations

Set a request timeout on the model config so a slow turn cannot stall a group chat, and handle 429 responses with backoff — AutoGen retries some errors but your policy should be explicit. Keep API keys in your environment or a secret manager, one key per agent fleet, so a compromised worker can be revoked alone.

Because Plugsky's assistants and responses endpoints are coming soon, build agent state in your own database and pass the message history explicitly today. That design also makes migration between frameworks easier later, since the conversation log becomes portable data rather than a provider-owned thread.

Honest comparison

CapabilityPlugsky + AutoGenOpenAI-only AutoGenCustom agent loop
Setupbase_url and model in the configDefault OpenAI configYou build everything
Model choice30+ models, mix per agentOpenAI modelsWhatever you wire up
Cost controlFlat self-serve plans; cheap models for worker agentsPer-token across every turnYour own metering
ToolsFunction calling through AutoGenSameCustom dispatch
Framework compatibility0.2 config lists and 0.4 clientsNativeNone
OpsManaged APIManaged APIYou operate the loop

Frequently asked questions

Does AutoGen support custom OpenAI-compatible endpoints?

Yes. Both config lists and model clients accept a base_url, so you point them at https://api.plugsky.com/v1 with a Plugsky key.

What is model_info and why do I need it?

AutoGen 0.4 clients describe model capabilities in a model_info object. For non-OpenAI model ids such as plugsky-pro, set vision, function_calling and json_output explicitly so the client does not guess.

Can different agents use different models?

Yes. Give each agent its own config. A common pattern is plugsky-lite for routine turns and plugsky-pro for planning or final review.

How do I keep keys out of code?

Load PLUGSKY_API_KEY from the environment or a secret manager and reference it in the config rather than pasting the key inline.

Does code execution still work?

Yes. AutoGen runs generated code through its code executor; keep Docker isolation and an explicit work directory in production.

How do I stop runaway conversations?

Set max_turns and max_consecutive_auto_reply, cap token usage, and use human-in-the-loop mode for actions that touch external systems.

Are assistants and threads available on Plugsky?

They are coming soon. Today, store conversation state yourself and drive agents through chat completions with tools.

Can agents stream output?

Yes. AutoGen can render responses as they stream, and the Plugsky chat endpoint supports server-sent events.