Skip to navigation

Route CrewAI’s underlying LLM calls through the Respan gateway to use 1000+ models from different providers. Only your RESPAN_API_KEY is needed - no separate provider keys required.

Setup

1

Install packages

pip install crewai
2

Set environment variables

export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"

No separate OpenAI provider key is needed. The code below points CrewAI’s OpenAI-compatible traffic to the Respan gateway.

3

Point CrewAI to the Respan gateway

import os
from crewai import Agent, Crew, LLM, Task
respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = "https://api.respan.ai/api"
os.environ["OPENAI_API_KEY"] = respan_api_key
os.environ["OPENAI_BASE_URL"] = respan_base_url
llm = LLM(
model="gpt-5.5",
api_key=respan_api_key,
base_url=respan_base_url,
)
researcher = Agent(
role="Researcher",
goal="Research the latest AI trends",
backstory="Senior AI researcher.",
llm=llm,
)
task = Task(
description="Research the latest trends in AI agent frameworks.",
expected_output="A summary of key trends.",
agent=researcher,
)
crew = Crew(agents=[researcher], tasks=[task])
print(crew.kickoff())

CrewAI and its underlying LLM adapter may read OpenAI-shaped environment variables. The example maps those values from RESPAN_API_KEY; it does not require an OpenAI provider key.

Switch models

Change the model parameter on LLM to use 1000+ models from different providers through the same gateway. Keep the openai/ prefix on non-OpenAI slugs, otherwise CrewAI switches to its native provider for that model family and ignores base_url.

llm = LLM(
model="openai/claude-sonnet-4-5-20250929",
api_key=respan_api_key,
base_url=respan_base_url,
)

See the full model list.