Migrating to Waibee
The router accepts requests in OpenAI and Anthropic formats, so when you migrate, you change the base URL, the key, and the model IDs. Your request code stays the same.
The public API has six endpoints: GET /v1/models, POST /v1/chat/completions, POST /v1/responses, POST /v1/messages, POST /v1/embeddings, and POST /v1/systemone. There are no file uploads, batch processing, or token counting.
From OpenAI
Section titled “From OpenAI”client = OpenAI( base_url="https://api.openai.com/v1", api_key=os.environ["OPENAI_API_KEY"], base_url="https://api.waibee.com/v1", api_key=os.environ["WAIBEE_API_KEY"],)
response = client.chat.completions.create( model="gpt-5.2", model="openai/gpt-5.2", messages=[{"role": "user", "content": "Hello!"}],)What to keep in mind:
- Model names carry a provider prefix.
gpt-5.2without the prefix is rejected with422; useopenai/gpt-5.2. The exact IDs are inGET /v1/models. - Models from other vendors work with the same code. The same client calls
anthropic/...andgoogle/...without switching SDKs. stream_optionsis not required. The counters arrive in the stream on their own, in the last chunk before[DONE].- Responses does not store history on the server.
previous_response_id,conversation,"store": true, and"background": trueare rejected withfeature_not_supported; send the whole conversation ininput. See Responses.
From Anthropic
Section titled “From Anthropic”client = anthropic.Anthropic( base_url="https://api.anthropic.com", api_key=os.environ["ANTHROPIC_API_KEY"], base_url="https://api.waibee.com", api_key=os.environ["WAIBEE_API_KEY"],)What to keep in mind:
- The base URL has no
/v1: the SDK adds the path itself. - Short Claude model names work. The router reads a name without a provider, in the form the SDK sends it (
claude-sonnet-4-6), asanthropic/claude-sonnet-4.6. On/v1/messages, a short name always means an Anthropic model. cache_control,thinking,output_config, anddocumentblocks pass through as is. You can pass themaxlevel on all three endpoints; support depends on the model.- There is no MCP connector. The
mcp_serversfield and MCP tools are rejected withfeature_not_supported.
From another gateway
Section titled “From another gateway”If your client is already set up for an OpenAI-compatible gateway, change the address and the key:
| Setting | Value |
|---|---|
| Base URL | https://api.waibee.com/v1 for Chat Completions and Responses, https://api.waibee.com for Messages |
| API key | sk_live_... from the Waibee console |
| Model ID | <provider>/<model> from GET /v1/models |
What the router does not have, in case you relied on it:
- Routing fields in the request body (provider lists, ordering, fallback chains). You choose a model by its explicit ID or through Autorouting. Build a fallback chain on the client side; see the recipe.
- Some of the provider’s server-side tools. Web search works on all three endpoints, and the router runs it. Page fetching, code execution, and MCP tools are rejected with
feature_not_supported. See Tool calling. - Cost fields in the response. Calculate cost from
usageand the catalog prices. See Tokens and usage.
Checking after the switch
Section titled “Checking after the switch”# 1. The key and access to the catalogcurl -s https://api.waibee.com/v1/models \ -H "Authorization: Bearer $WAIBEE_API_KEY" | jq -r '.data[].id' | head
# 2. One request on the model your code usescurl -s https://api.waibee.com/v1/chat/completions \ -H "Authorization: Bearer $WAIBEE_API_KEY" -H "Content-Type: application/json" \ -d '{"model":"openai/gpt-5.2","messages":[{"role":"user","content":"ping"}]}' | jq '.model, .usage'Then run your integration tests. The router has its own error codes (for example, provider_rate_limited and insufficient_funds); they are listed in Errors.
Setting up ready-made tools
Section titled “Setting up ready-made tools”To connect Claude Code, Codex CLI, OpenCode, and other clients, see Integrations.