For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
    • Overview
  • Tracing
  • Gateway
      • OpenAI Agents
      • Claude Agent SDK
      • Vercel AI SDK
      • Pydantic AI
      • CrewAI
      • Haystack
      • LangChain
      • LangGraph
      • Langflow
      • LlamaIndex
      • AutoGen
      • DSPy
      • Google ADK
      • Smolagents
      • Strands Agents
      • AgentSpec
      • Guardrails
      • Agno
      • MCP
      • BeeAI
      • Pipecat
      • Superagent
  • Others
  • Migrating
    • Braintrust
    • Portkey
    • Langfuse
LogoLogo
DiscordPlatform
On this page
  • Setup
  • Switch models
GatewayAgent Frameworks

AutoGen (gateway)

Was this page helpful?
Previous

DSPy (gateway)

Next
Built with

Route AutoGen model calls through the Respan gateway to use 250+ models. Only your Respan API key is needed — no separate provider key is required in the example process.

Setup

1

Install packages

$pip install respan-ai respan-instrumentation-autogen
2

Set environment variables

$export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
$export RESPAN_BASE_URL="https://api.respan.ai/api"
$export RESPAN_MODEL="gpt-4o-mini"
3

Point AutoGen to the Respan gateway

1import os
2
3from autogen_ext.models.openai import OpenAIChatCompletionClient
4
5model_client = OpenAIChatCompletionClient(
6 model=os.getenv("RESPAN_MODEL", "gpt-4o-mini"),
7 api_key=os.environ["RESPAN_API_KEY"],
8 base_url=os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api"),
9 model_info={
10 "vision": False,
11 "function_calling": True,
12 "json_output": True,
13 "structured_output": True,
14 "family": "unknown",
15 },
16)

Switch models

Change RESPAN_MODEL to use a different model through the same gateway.

$export RESPAN_MODEL="claude-sonnet-4-5-20250929"

See the full model list.