Skip to content
docs

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.

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.2 without the prefix is rejected with 422; use openai/gpt-5.2. The exact IDs are in GET /v1/models.
  • Models from other vendors work with the same code. The same client calls anthropic/... and google/... without switching SDKs.
  • stream_options is 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": true are rejected with feature_not_supported; send the whole conversation in input. See Responses.
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), as anthropic/claude-sonnet-4.6. On /v1/messages, a short name always means an Anthropic model.
  • cache_control, thinking, output_config, and document blocks pass through as is. You can pass the max level on all three endpoints; support depends on the model.
  • There is no MCP connector. The mcp_servers field and MCP tools are rejected with feature_not_supported.

If your client is already set up for an OpenAI-compatible gateway, change the address and the key:

SettingValue
Base URLhttps://api.waibee.com/v1 for Chat Completions and Responses, https://api.waibee.com for Messages
API keysk_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 usage and the catalog prices. See Tokens and usage.
Terminal window
# 1. The key and access to the catalog
curl -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 uses
curl -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.

To connect Claude Code, Codex CLI, OpenCode, and other clients, see Integrations.