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,
userandassistantturns, 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_searchserver tool. thinkingobjectoptional{"type": "enabled", "budget_tokens": n}turns thinking on. The budget is kept belowmax_tokens.temperature, top_p, top_k, stop_sequencesvariousoptional- As in Anthropic.
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."}] }'import osimport anthropic
# No /v1 here: the SDK adds it.client = anthropic.Anthropic( base_url="https://api.aderra.ai", api_key=os.environ["ADERRA_API_KEY"],)
message = client.messages.create( model="deepseek-v4.1-flash-uncensored", max_tokens=1024, messages=[{"role": "user", "content": "Write a haiku about the sea."}],)print(message.content[0].text)import Anthropic from '@anthropic-ai/sdk';
// No /v1 here: the SDK adds it.const client = new Anthropic({ baseURL: 'https://api.aderra.ai', apiKey: process.env.ADERRA_API_KEY,});
const message = await client.messages.create({ model: 'deepseek-v4.1-flash-uncensored', max_tokens: 1024, messages: [{ role: 'user', content: 'Write a haiku about the sea.' }],});console.log(message.content[0].text);Response: application/jsonAn Anthropic message object, or text/event-stream when stream is true.
Streaming
Section titled “Streaming”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.
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."}]}'with client.messages.stream( model="deepseek-v4.1-flash-uncensored", max_tokens=1024, messages=[{"role": "user", "content": "Write a haiku about the sea."}],) as stream: for text in stream.text_stream: print(text, end="", flush=True)print()const stream = client.messages.stream({ model: 'deepseek-v4.1-flash-uncensored', max_tokens: 1024, messages: [{ role: 'user', content: 'Write a haiku about the sea.' }],});stream.on('text', (text) => process.stdout.write(text));await stream.finalMessage();process.stdout.write('\n');Thinking
Section titled “Thinking”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.
Web search
Section titled “Web search”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_usesis honoured up to Aderra’s per-turn ceiling.allowed_domainsandblocked_domainsare passed on.- A turn with web search is answered in one piece: with
stream: true, all the events arrive together at the end.
System prompts
Section titled “System prompts”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
Section titled “Errors”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.