Agno (gateway)

Route Agno’s underlying OpenAI-compatible LLM calls through the Respan gateway to use 250+ models from different providers. Only your Respan API key is needed when provider access is configured in Respan.

Setup

1

Install packages

$pip install agno openai
2

Set environment variables

$export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
$export RESPAN_BASE_URL="https://api.respan.ai/api"

No OPENAI_API_KEY is needed when the request is routed through the Respan gateway.

3

Point Agno to the Respan gateway

1import os
2
3from agno.agent import Agent
4from agno.models.openai import OpenAIChat
5
6respan_api_key = os.environ["RESPAN_API_KEY"]
7respan_base_url = os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api")
8
9agent = Agent(
10 name="Gateway Agent",
11 model=OpenAIChat(
12 id="gpt-5-mini",
13 api_key=respan_api_key,
14 base_url=respan_base_url,
15 ),
16 instructions="Keep the answer short and concrete.",
17)
18
19result = agent.run("Name two practical uses for distributed tracing.")
20print(result.content)

Switch models

Change the id passed to OpenAIChat to use another OpenAI model through the same gateway-backed endpoint.

1agent = Agent(
2 model=OpenAIChat(
3 id="gpt-5.5",
4 api_key=os.environ["RESPAN_API_KEY"],
5 base_url=os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api"),
6 ),
7)

OpenAIChat is Agno’s OpenAI-compatible adapter. This page avoids showing Claude or Gemini inside that OpenAI-named adapter; use the Respan API or OpenAI SDK gateway pages for provider-neutral Claude and Gemini examples.

See the full model list.