Create message
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!" }] }'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);Anthropic-compatible Messages endpoint, used by Claude Code and the
Anthropic SDK. max_tokens is required. Accepts x-api-key or
Authorization: Bearer. Streaming uses Anthropic SSE events and ends
after message_stop (no [DONE] frame).
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»object
Required by the Anthropic spec.
object
System prompt (string or array of text blocks).
Function/tool definition for function calling.
object
object
JSON Schema of the tool arguments.
object
Extended thinking configuration (Anthropic).
object
Token budget for the thinking phase.
Anthropic output configuration (Messages endpoint only).
object
Reasoning effort. max is available here (Messages), unlike chat completions.
Structured output format.
object
Per-request plugins.
object
Data-loss-prevention scan, mask or block. Optional: a DLP policy set for your API key applies as a floor of strictness even when this object is absent, and this object can only make the check stricter. entity_types is unioned with the policy’s categories, so the scan may be wider than the list you send.
object
Applies to the rules you declare yourself. Where the key’s policy declares the same rule, the stricter of the two modes wins; the policy’s own categories keep the mode the administrator set.
Unioned with the categories of the key’s policy, never narrowing them.
Which messages’ findings come back to you. Narrowing it does not narrow the scan: every message is still scanned, and the block decision counts every finding.
Values that are a finding on their own, whatever the categories say. Unioned with the key’s policy.
object
Exceptions, matched on the whole value only. They reach your own rules only: an exception never lifts a finding raised by a rule of the key’s policy. Within your own config a stop word beats an exception on the same value.
object
Exact only. A substring exception would exempt every lookalike containing it.
Named patterns, run by RE2. Unioned with the key’s policy.
object
Marks a message as inserted by the platform rather than typed by a person, by the value of its name field, and takes it out of the scan. Ignored while a policy applies to your key: on this path the same caller supplies both the marker and the content, so it would be a way to opt out of the check.
Reserved, and currently changes nothing: alert reports the findings and forwards the request, so there is no hold to confirm.
Responses
Заголовок раздела «Responses»Model response.
object
object
object
Example
{ "id": "gen-...", "type": "message", "role": "assistant", "model": "anthropic/claude-sonnet-4.6", "stop_reason": "end_turn", "content": [ { "type": "text", "text": "Paris" } ], "usage": { "input_tokens": 16, "output_tokens": 4, "cache_read_input_tokens": 0, "cache_creation_input_tokens": 0 }}Invalid request (Anthropic format). Includes unsupported-feature rejections.
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Example
{ "type": "error", "error": { "type": "invalid_request_error", "message": "Invalid request" }}Missing or invalid API key (Anthropic format).
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Example
{ "type": "error", "error": { "type": "authentication_error", "message": "x-api-key or Authorization: Bearer header required" }}Rate limited or insufficient credits (Anthropic format).
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Example
{ "type": "error", "error": { "type": "rate_limit_error", "message": "Rate limit exceeded" }}Request blocked by an access policy or by DLP (Anthropic format). One permission_error covers both, so branch on error.code.
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Examples
Model not allowed for this group
{ "type": "error", "error": { "type": "permission_error", "code": "policy_violation", "message": "Model not allowed for this group" }}Sensitive data detected in block mode
{ "type": "error", "error": { "type": "permission_error", "code": "dlp_violation", "message": "Request blocked: sensitive data detected", "details": { "dlp": [ { "category": "pii", "entity_type": "EMAIL", "message_index": 0, "location": "messages[0].content", "start": 12, "end": 28, "confidence": 0.98 } ], "findings_count": 1, "block_scope": "in_report_scope" } }}Model not found (Anthropic format).
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Example
{ "type": "error", "error": { "type": "not_found_error", "message": "Model does not exist in the catalog" }}Internal error (Anthropic format).
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Example
{ "type": "error", "error": { "type": "api_error", "message": "Internal error" }}Request body or an attachment exceeds the limit (Anthropic format).
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Example
{ "type": "error", "error": { "type": "invalid_request_error", "message": "Request body too large" }}Request failed validation (Anthropic format).
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Example
{ "type": "error", "error": { "type": "invalid_request_error", "message": "Invalid request" }}Rate limited or insufficient credits (Anthropic format).
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Example
{ "type": "error", "error": { "type": "rate_limit_error", "message": "Rate limit exceeded" }}Internal error (Anthropic format).
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Example
{ "type": "error", "error": { "type": "api_error", "message": "Internal error" }}Temporarily unavailable (Anthropic format). dlp_policy_unavailable arrives as api_error, the type a client retries by the standard, and carries Retry-After. dlp_unavailable arrives as invalid_request_error, because a retry never fixes it.
Anthropic-format error envelope (used by /v1/messages).
object
object
Machine-readable code, same value as error.code in the OpenAI format. Several causes share one Anthropic type, so branch on this.
Additional error data; fields depend on the code.
object
Examples
DLP policy could not be resolved (retryable)
{ "type": "error", "error": { "type": "api_error", "code": "dlp_policy_unavailable", "message": "DLP policy is temporarily unavailable; retry the request" }}plugins.dlp sent where DLP is not enforced
{ "type": "error", "error": { "type": "invalid_request_error", "code": "dlp_unavailable", "message": "DLP plugin config was provided, but router DLP enforcement is disabled" }}Headers
Заголовок раздела «Headers»Seconds to wait before retrying.