Key facts
| Plugsky endpoint | POST https://api.plugsky.com/v1/chat/completions |
| AutoGen integration | Set base_url to https://api.plugsky.com/v1 in the model client or config list |
| Auth | api_key: sk-live-… per agent config or loaded from the environment |
| Models | 30+ models; use plugsky-pro for planning and plugsky-lite for cheap worker agents |
| Tools | OpenAI-style function calling; AutoGen registers Python functions as tools |
| Streaming | Supported at the API level; AutoGen renders chunks as they arrive |
| Known gotcha | AutoGen 0.4 clients expect model_info for non-OpenAI model names |
| Product status | Live; 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
- Install AutoGen: pip install pyautogen (or the autogen-agentchat and autogen-ext packages for 0.4+).
- Create a Plugsky API key and export it as PLUGSKY_API_KEY.
- Add a model config with base_url https://api.plugsky.com/v1 and model plugsky-pro.
- Create an AssistantAgent and a UserProxyAgent using that config.
- Start a chat and confirm the conversation runs through Plugsky.
- Register Python tools so agents can call your functions, and constrain code execution.
- Set round and token limits, then monitor usage per agent.
Original data
Try it yourself
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_turnsand 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
| Capability | Plugsky + AutoGen | OpenAI-only AutoGen | Custom agent loop |
|---|---|---|---|
| Setup | base_url and model in the config | Default OpenAI config | You build everything |
| Model choice | 30+ models, mix per agent | OpenAI models | Whatever you wire up |
| Cost control | Flat self-serve plans; cheap models for worker agents | Per-token across every turn | Your own metering |
| Tools | Function calling through AutoGen | Same | Custom dispatch |
| Framework compatibility | 0.2 config lists and 0.4 clients | Native | None |
| Ops | Managed API | Managed API | You 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.