Anthropic Messages API
Use /v1/messages to call any model with the Anthropic SDK. The proxy translates requests to OpenAI chat-completions and back.
POST /v1/messages accepts the Anthropic Messages API request shape. The proxy
translates it to OpenAI chat-completions, routes it through your enabled
upstreams, and translates the response (including SSE) back into Anthropic's
format. This lets you use the Anthropic SDK to reach models hosted on any
provider — not just Anthropic.
Authentication
Authorization: Bearer sk-rc-...Use your Ada AI proxy key (an sk-rc-… value), not an Anthropic API key.
Request
curl https://api.ada.ai/v1/messages \
-H "Authorization: Bearer sk-rc-..." \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4.7",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]
}'The body follows Anthropic's schema. Notable fields:
| Field | Required | Notes |
|---|---|---|
model | yes | Must match a model ID from one of your enabled upstreams. The model is not restricted to Anthropic models — any model you've enabled works. |
max_tokens | yes | Anthropic requires this field. |
messages | yes | Anthropic message array. content may be a string or an array of content blocks. |
system | no | Top-level system prompt (Anthropic convention). |
stream | no | true returns Anthropic-format SSE. |
tools | no | Anthropic-style tool definitions. |
Text, image, tool-use, and tool-result content blocks are all supported and translated to their OpenAI equivalents.
Response
Anthropic-shaped:
{
"id": "msg_...",
"type": "message",
"role": "assistant",
"model": "glm-4.7",
"content": [{ "type": "text", "text": "Hello! How can I help?" }],
"stop_reason": "end_turn",
"usage": { "input_tokens": 8, "output_tokens": 7 }
}Streaming
Set "stream": true to receive Anthropic-format SSE. The proxy synthesizes it
from the upstream OpenAI chunks, so you see the standard Anthropic events:
event: message_start
event: content_block_start
event: content_block_delta
event: content_block_stop
event: message_delta
event: message_stopUsing the Anthropic SDK
Point the SDK's baseURL at Ada AI and pass your proxy key as apiKey:
import anthropic
client = anthropic.Anthropic(
api_key="sk-rc-...",
base_url="https://api.ada.ai",
)
message = client.messages.create(
model="glm-4.7",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)base_url has no /v1
The Anthropic SDK appends /v1/messages itself, so set base_url (Python) or
baseURL (JS) to https://api.ada.ai — without a trailing /v1. The
OpenAI SDK, by contrast, takes https://api.ada.ai/v1.
When to use which endpoint
| You have... | Use |
|---|---|
| OpenAI client code already | /v1/chat/completions |
| Anthropic client code already | /v1/messages (this page) |
| A free choice | Either — same routing, same upstreams, same key |
Both endpoints resolve against the same scoped upstreams for your key, so the model you request reaches the same provider either way.
Chat Completions API
The /v1/chat/completions endpoint is a drop-in replacement for OpenAI's chat API. Use any OpenAI-compatible SDK against any provider's model.
Models & Routing
How Ada AI discovers models across your upstreams, picks one by priority, and fails over on 5xx — without ever silently substituting a model.