SDK & Framework Integrations
Every SDK connects to GateLLM the same three steps. Find your SDK, note its base_url convention and gotcha, then copy the pattern.
The gateway is protocol-oriented: whatever SDK you use, as long as it speaks OpenAI / Anthropic / Gemini / DashScope / Realtime / MCP, pointing its base_url at the gateway and swapping in an access key lets you call any configured model — including cross-protocol calls to other vendors' models.
Point base_url at the gateway
Default https://your-gateway.gatellm.io — whether it includes /v1 depends on the SDK (each example gives the exact value).
Swap in a gateway access key
Not an upstream sk-… key — the same access key mounts into whichever header your SDK expects.
Use the gateway model name
Whatever you configured in the console — not the vendor's official name.
Authorization: Bearer <key>x-api-key: <key>x-goog-api-key: <key>| SDK / framework | Language | Protocol | Docs |
|---|---|---|---|
| Official vendor SDKs | |||
| OpenAI SDK | Python, Node.js | OpenAI | Examples |
| Anthropic SDK | Python, Node.js | Anthropic | Examples |
| Google GenAI SDK | Python, JavaScript | Gemini | Examples |
| OpenAI-compatible third parties | Python, Node.js | OpenAI-compatible | Examples |
| DashScope native | |||
| DashScope SDK | Python | DashScope | Examples |
| Unified SDKs & gateways | |||
| Vercel AI SDK | TypeScript | OpenAI / Anthropic | Examples |
| LiteLLM | Python | OpenAI-compatible | Examples |
| Portkey | Node.js, Python | OpenAI-compatible | Examples |
| Braintrust / Langbase | TypeScript, Python | OpenAI-compatible | Examples |
| Semantic Kernel | Python, .NET | OpenAI-compatible | Examples |
| Spring AI | Java | OpenAI-compatible | Examples |
| Orchestration frameworks | |||
| LangChain | Python, TypeScript | OpenAI / Anthropic | Examples |
| LangGraph | Python, TypeScript | OpenAI / Anthropic | Examples |
| LlamaIndex | Python, TypeScript | OpenAI-compatible | Examples |
| CrewAI | Python | OpenAI-compatible (LiteLLM) | Examples |
| AutoGen / AG2 | Python | OpenAI-compatible | Examples |
| DSPy | Python | OpenAI-compatible | Examples |
| Haystack | Python | OpenAI-compatible | Examples |
| Llama Stack | Python | OpenAI-compatible | Examples |
| Agent SDKs | |||
| OpenAI Agents SDK | Python, TypeScript | OpenAI Responses | Examples |
| Claude Agent SDK | Python, TypeScript | Anthropic | Examples |
| Pydantic AI | Python | OpenAI-compatible | Examples |
| Google ADK | Python | OpenAI-compatible (LiteLLM) | Examples |
| Mastra | TypeScript | OpenAI-compatible | Examples |
| Microsoft Agent Framework | .NET, Python | OpenAI-compatible | Examples |
| MCP SDK | Python, TypeScript | MCP | Examples |
| Realtime & audio | |||
| Realtime WebSocket | Any WS client | OpenAI Realtime | Examples |
| openai_audio (ASR / TTS) | Python, Node.js | OpenAI audio | Examples |
| Local / self-hosted | |||
| Ollama | REST | OpenAI-compatible (upstream) | Examples |
| vLLM | REST | OpenAI-compatible (upstream) | Examples |
| llama.cpp server | REST | OpenAI-compatible (upstream) | Examples |
| SGLang | REST | OpenAI-compatible (upstream) | Examples |
| Text Generation Inference (TGI) | REST | OpenAI-compatible (upstream) | Examples |
| LM Studio | REST | OpenAI-compatible (upstream) | Examples |
Gotchas
Not the vendor's official name, not the upstream model ID — whatever you named it in the console. Wrong name → 404 model_not_found.
OpenAI SDK takes /v1; the Anthropic SDK takes the root (it appends /v1/messages); the Vercel AI SDK's createAnthropic takes /v1 (it appends /messages). Getting it wrong adds or drops a path segment.
A max_tokens may become max_output_tokens with a lower bound (e.g. ≥16) when the upstream is a Responses-protocol model — too small → 400.
Claude / Gemini thinking content and signatures are passed through or stripped — take the type == "text" element of the content array, don't assume content[0] is text.
It calls the Responses API, not Chat Completions. If the upstream is openai (Chat), switch explicitly with OpenAIChatCompletionsModel; if openai_response, a string model name works as-is.
The OpenAI class only accepts families it recognizes and rejects custom gateway names — use OpenAILike (Python) or declare the model info explicitly.
base_url isn't a framework parameter — it's the OPENAI_API_BASE env var, and model needs the openai/ prefix.
Unknown model names error on the default list — declare model_info explicitly to bypass the check.
base_url goes via http_options.base_url (no /v1) and the key mounts in the x-goog-api-key header.