OpenAI Agents (gateway)
Route LLM calls through the Respan gateway to use 1000+ models from different providers. Only your Respan API key is needed. No separate provider keys are required.
Paste this into your coding agent:
Help me set up the Respan gateway with the OpenAI Agents integration.
Follow https://www.respan.ai/docs/integrations/gateway/open-ai-agents.mdSetup
Install packages
pip install openai-agentsSet environment variables
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"No OPENAI_API_KEY needed. The Respan gateway handles provider authentication.
Point to the Respan gateway
import os
import asyncio
from openai import AsyncOpenAI
from agents import (
Agent,
Runner,
set_default_openai_api,
set_default_openai_client,
set_tracing_disabled,
)
client = AsyncOpenAI(
api_key=os.environ["RESPAN_API_KEY"],
base_url="https://gateway.respan.ai",
)
set_default_openai_client(client)
set_default_openai_api("chat_completions")
set_tracing_disabled(True)
agent = Agent(
name="Assistant",
model="gpt-5.5",
instructions="You only respond in haikus.",
)
async def main():
result = await Runner.run(agent, "Tell me about recursion.")
print(result.final_output)
asyncio.run(main())OpenAI Agents defaults to the Responses API, which the gateway serves for OpenAI models only. Set the SDK to chat_completions so the same agent can also run non-OpenAI models, such as the Claude example below.
Switch models
Change the model parameter on any agent to use 1000+ models from different providers through the same gateway.
agent = Agent(
name="Assistant",
model="claude-sonnet-4-5-20250929", # Use Anthropic via gateway
instructions="You are a helpful assistant.",
)See the full model list .