---
title: "Agno (gateway)"
description: "Set up Agno with the Respan gateway."
---

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

Paste this into your coding agent:

```text
Help me set up the Respan gateway with the Agno integration.
Follow https://www.respan.ai/docs/integrations/gateway/agno.md
```

## Setup

<Steps>
<Step title="Install packages">

```bash
pip install agno openai
```

</Step>

<Step title="Set environment variables">

```bash
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
export RESPAN_BASE_URL="https://gateway.respan.ai"
```

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

</Step>

<Step title="Point Agno to the Respan gateway">

```python
import os

from agno.agent import Agent
from agno.models.openai import OpenAIChat

respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = os.getenv("RESPAN_BASE_URL", "https://gateway.respan.ai")

agent = Agent(
    name="Gateway Agent",
    model=OpenAIChat(
        id="gpt-5-mini",
        api_key=respan_api_key,
        base_url=respan_base_url,
    ),
    instructions="Keep the answer short and concrete.",
)

result = agent.run("Name two practical uses for distributed tracing.")
print(result.content)
```

</Step>
</Steps>

## Switch models

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

```python
agent = Agent(
    model=OpenAIChat(
        id="gpt-5.5",
        api_key=os.environ["RESPAN_API_KEY"],
        base_url=os.getenv("RESPAN_BASE_URL", "https://gateway.respan.ai"),
    ),
)
```

<Note>
`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.
</Note>

See the [full model list](https://platform.respan.ai/platform/models).
