Skip to Content
Launching the open-source gateway

CrewAI (gateway)

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.

Paste this into your coding agent:

Help me set up the Respan gateway with the CrewAI integration. Follow https://www.respan.ai/docs/integrations/gateway/crew-ai.md

Setup

Install packages

Terminal
pip install crewai

Set environment variables

Terminal
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.

Point CrewAI to the Respan gateway

Python
import os from crewai import Agent, Crew, LLM, Task respan_api_key = os.environ["RESPAN_API_KEY"] respan_base_url = "https://gateway.respan.ai" 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.

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

See the full model list .