Call Claude, GPT, Gemini and 50+ models with the OpenAI SDK
KeepRouter exposes an OpenAI-compatible endpoint at https://keeprouter.com/v1. Point the OpenAI SDK's base_url at it, keep the rest of your code, and the same calls reach 50+ models across makers — Claude, GPT, Gemini, Mistral, Qwen, Kimi, GLM, DeepSeek and more — just by changing the model id. One prepaid key, billed at cost.
Change two things
Your existing OpenAI code stays the same except the base URL and key:
from openai import OpenAI
client = OpenAI(
base_url="https://keeprouter.com/v1", # changed
api_key="sk-kr-your-key", # changed
)
r = client.chat.completions.create(
model="claude-opus-4-8", # now any model works
messages=[{"role": "user", "content": "Hello"}],
)Node / TypeScript is the same idea:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://keeprouter.com/v1", // changed
apiKey: process.env.KEEPROUTER_KEY, // changed
});
const r = await client.chat.completions.create({
model: "gemini-3.5-flash", // swap the model id, same code
messages: [{ role: "user", content: "Hello" }],
});One codebase, every model
Set model to any id from the catalog — no provider-specific SDK per maker:
| Model | Maker | Price /1M (in / out) |
|---|---|---|
claude-opus-4-8 | Anthropic | $5.00 / $25.00 |
gpt-4o | OpenAI | $2.50 / $10.00 |
gemini-3.5-flash | Google DeepMind | (see catalog) |
deepseek-v3.2 | DeepSeek | $0.23 / $0.34 |
free | — | $0 / $0 |
See every model and price on Models & pricing.
Frequently asked questions
Do I need to change my code beyond base_url and the key?
No — the OpenAI SDK talks to KeepRouter unchanged. Just set the model id.
Can I really call Claude with the OpenAI SDK?
Yes. KeepRouter translates between the OpenAI and Anthropic formats internally, so OpenAI-style calls reach Claude and every other model.
Does streaming work?
Yes — pass stream=True / stream: true as usual.
Do tool calls / function calling work?
Yes — tool calls are passed through and translated across both wire protocols.
Which clients work?
Any OpenAI-compatible client or library — Python, Node, Go, and the many tools that accept an OpenAI base URL.