Skip to content

Anthropic Messages compatibility

POSThttps://api.aderra.ai/v1/messages

The Anthropic Messages format, for the Anthropic SDKs and tools built on them. Set the SDK’s base URL to https://api.aderra.ai, without /v1: the SDK adds it. The key goes in x-api-key (the SDK default) or Authorization: Bearer.

Request body

modelstringrequired
An Aderra chat model id. Claude model names are refused with unknown model.
messagesarrayrequired
The conversation, user and assistant turns, as in Anthropic.
max_tokensintegeroptional
Optional here. Capped at the model limit (32,768); absent means the limit. When present it must be a positive integer.
systemstring | arrayoptional
Your system prompt, passed through untouched. See System prompts below.
streambooleanoptional
Anthropic server-sent events.
tools, tool_choicearray, objectoptional
Client tools as in Anthropic, plus the web_search server tool.
thinkingobjectoptional
{"type": "enabled", "budget_tokens": n} turns thinking on. The budget is kept below max_tokens.
temperature, top_p, top_k, stop_sequencesvariousoptional
As in Anthropic.
Terminal window
curl https://api.aderra.ai/v1/messages \
-H "x-api-key: $ADERRA_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-uncensored",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Write a haiku about the sea."}]
}'

Response: application/jsonAn Anthropic message object, or text/event-stream when stream is true.

With "stream": true you get Anthropic’s events: message_start, then content_block_delta events whose text_delta holds the text, then message_delta with the usage, and message_stop.

Terminal window
curl -N https://api.aderra.ai/v1/messages \
-H "x-api-key: $ADERRA_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash-uncensored", "max_tokens": 1024, "stream": true,
"messages": [{"role": "user", "content": "Write a haiku about the sea."}]}'

Messages answers without extended thinking unless you ask for it with thinking (or reasoning_effort). {"type": "disabled"} also means no thinking. Thinking tokens are billed as output.

Add the web search server tool and the model can search the web during the turn:

"tools": [{ "type": "web_search_20250305", "name": "web_search", "max_uses": 3 }]
  • Each search is billed on top of the tokens, from the same wallet and key. Searches show as Web search on the Developers page.
  • max_uses is honoured up to Aderra’s per-turn ceiling. allowed_domains and blocked_domains are passed on.
  • A turn with web search is answered in one piece: with stream: true, all the events arrive together at the end.

With an API key, your system prompt reaches the model untouched: nothing is removed or reworded, and there is no Aderra persona. Aderra adds exactly one line after your system text, “Never produce any sexual content involving minors.” (about ten input tokens).

A terminal key (Claude Code, Aderra Agent) works differently: see Coding tools.

Errors use Anthropic’s shape and types, so the Anthropic SDKs raise their usual exceptions:

{
"type": "error",
"error": {
"type": "billing_error",
"message": "Your API wallet does not have enough credits for this request. ..."
}
}
Type Status Meaning
invalid_request_error 400 Bad JSON, unknown model, n not 1, max_tokens not a positive integer
authentication_error 401 Missing, unknown or revoked key
billing_error 402 Wallet empty, key cap reached (the message says which)
permission_error 403 Account suspended
request_too_large 413 The request is too big to send to the model
rate_limit_error 429 Key rate limit or concurrent-request limit; honour Retry-After
api_error 502 or upstream status The model failed. Not charged
overloaded_error 503 Aderra is busy; retry after Retry-After

The full list is on Errors.