Skip to Content
Gateway

BeeAI (gateway)

Route BeeAI’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 are required.

Paste this into your coding agent:

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

Setup

Install packages

Terminal
pip install beeai-framework

Set environment variables

Terminal
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"

The code below passes RESPAN_API_KEY and the Respan base URL to BeeAI’s OpenAI-compatible LLM wrapper. No real OpenAI key is needed.

Initialize and run

Python
import asyncio import os from beeai_framework.backend import ChatModel, UserMessage llm = ChatModel.from_name( "openai:gpt-5.5", api_key=os.environ["RESPAN_API_KEY"], base_url=os.getenv("RESPAN_BASE_URL", "https://gateway.respan.ai"), ) async def main() -> None: response = await llm.run([UserMessage("Tell me about recursion.")], max_tokens=256) print(response.get_text_content()) asyncio.run(main())

Switch models

Use another OpenAI model ID through the same gateway-backed chat model. BeeAI separates the provider and model with a colon.

Python
llm = ChatModel.from_name("openai:gpt-5.5", api_key=..., base_url="https://gateway.respan.ai") llm = ChatModel.from_name("openai:gpt-5-mini", api_key=..., base_url="https://gateway.respan.ai")

BeeAI uses LiteLLM under the hood. Avoid documenting Claude or Gemini behind an openai/ model prefix because that makes the transport provider look like the model provider. Use the Respan API or OpenAI SDK gateway pages for provider-neutral Claude and Gemini examples.

See the full model list .