Anthropic-compatible clients
A client that uses the Anthropic Messages API connects to Waibee with no code changes. You set two values:
- **Base URL**: `https://api.waibee.com`
- **API key**: `sk_live_...`
Requests go to `POST /v1/messages`. Pass the key in `x-api-key` or in `Authorization: Bearer`; see [Authentication](/router/authentication/). The `max_tokens` field is required.
Specify the model as `<provider>/<model>` from the [catalog](/router/models/). The router converts Anthropic names without a prefix, such as `claude-sonnet-4-6` or the same name with a date at the end, to the catalog form on its own. A ready-made recipe for Claude Code is on a [separate page](/router/integrations/claude-code/).
## SDK
```python title="python"
import anthropic
client = anthropic.Anthropic(
base_url="https://api.waibee.com",
api_key="sk_live_...",
)
msg = client.messages.create(
model="anthropic/claude-sonnet-4.6",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
print(msg.content[0].text)
```
```ts title="node"
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.waibee.com",
apiKey: process.env.WAIBEE_API_KEY,
});
const msg = await client.messages.create({
model: "anthropic/claude-sonnet-4.6",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello!" }],
});
console.log(msg.content[0].text);
```
## curl
```bash frame="terminal"
curl https://api.waibee.com/v1/messages \
-H "x-api-key: $WAIBEE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4.6",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "Hello!" }]
}'
```
:::tip
The response comes in Anthropic format (`content`, `stop_reason`, `usage`), and with `"stream": true` the stream arrives as SSE events in Anthropic format. All parameters are described in the [API Reference](/router/api/).
:::
A client that uses the Anthropic Messages API connects to Waibee with no code changes. You set two values:
- Base URL:
https://api.waibee.com - API key:
sk_live_...
Requests go to POST /v1/messages. Pass the key in x-api-key or in Authorization: Bearer; see Authentication. The max_tokens field is required.
Specify the model as <provider>/<model> from the catalog. The router converts Anthropic names without a prefix, such as claude-sonnet-4-6 or the same name with a date at the end, to the catalog form on its own. A ready-made recipe for Claude Code is on a separate page.
import anthropic
client = anthropic.Anthropic( base_url="https://api.waibee.com", api_key="sk_live_...",)msg = client.messages.create( model="anthropic/claude-sonnet-4.6", max_tokens=1024, messages=[{"role": "user", "content": "Hello!"}],)print(msg.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ baseURL: "https://api.waibee.com", apiKey: process.env.WAIBEE_API_KEY,});const msg = await client.messages.create({ model: "anthropic/claude-sonnet-4.6", max_tokens: 1024, messages: [{ role: "user", content: "Hello!" }],});console.log(msg.content[0].text);curl https://api.waibee.com/v1/messages \ -H "x-api-key: $WAIBEE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-4.6", "max_tokens": 1024, "messages": [{ "role": "user", "content": "Hello!" }] }'