Gateway
AutoGen (gateway)
Route AutoGen model calls through the Respan gateway to use 1000+ models. Only your Respan API key is needed. No separate provider key is required in the example process.
Paste this into your coding agent:
Help me set up the Respan gateway with the AutoGen integration.
Follow https://www.respan.ai/docs/integrations/gateway/auto-gen.mdSetup
Install packages
pip install autogen-agentchat "autogen-ext[openai]"Set environment variables
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"Point AutoGen to the Respan gateway
import os
from autogen_ext.models.openai import OpenAIChatCompletionClient
model_client = OpenAIChatCompletionClient(
model="gpt-5-mini",
api_key=os.environ["RESPAN_API_KEY"],
base_url="https://gateway.respan.ai",
model_info={
"vision": False,
"function_calling": True,
"json_output": True,
"structured_output": True,
"family": "unknown",
},
)Switch models
Change the model value to use a different model through the same gateway.
model_client = OpenAIChatCompletionClient(
model="claude-sonnet-4-5-20250929",
api_key=os.environ["RESPAN_API_KEY"],
base_url="https://gateway.respan.ai",
model_info={
"vision": False,
"function_calling": True,
"json_output": True,
"structured_output": True,
"family": "unknown",
},
)AutoGen requires model_info for any model name it does not recognize as an OpenAI model.
See the full model list .