Create a message (Anthropic format)
const url = 'https://api.aderra.ai/v1/messages';const options = { method: 'POST', headers: { 'anthropic-version': '2023-06-01', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"model":"deepseek-v4.1-flash-uncensored","max_tokens":1024,"messages":[{"role":"user","content":"Write a haiku about the sea."}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.aderra.ai/v1/messages \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --header 'x-api-key: <x-api-key>' \ --data '{ "model": "deepseek-v4.1-flash-uncensored", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Write a haiku about the sea." } ] }'Anthropic Messages. With the Anthropic SDK, set the base URL to https://api.aderra.ai
(without /v1). The key can be sent as x-api-key or Authorization: Bearer.
max_tokens is optional here: when absent, the model’s output limit is used. When
present it must be a positive integer. The answer comes without extended thinking unless
you send thinking, reasoning_effort or reasoning.
A web_search server tool ({"type": "web_search_20250305", "name": "web_search"}) is
supported. Each search is billed on top of the tokens. A web-search turn is answered in
one piece: with stream: true the events arrive together at the end.
Errors use Anthropic’s types (authentication_error, billing_error,
rate_limit_error, invalid_request_error, api_error) with the reason in the message.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Example
2023-06-01Sent by the Anthropic SDKs. Accepted; it does not change the response.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
Your system prompt, a string or text blocks. Passed through untouched with an API key; Aderra adds one safety line after it.
object
Optional. Capped at the model’s output limit; absent means the limit.
Function tools, and the web_search_* server tool.
object
object
{"type": "enabled", "budget_tokens": n} turns thinking on; the budget is kept under max_tokens.
object
Example
{ "model": "deepseek-v4.1-flash-uncensored", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Write a haiku about the sea." } ]}Responses
Section titled “Responses”The message. JSON, or Anthropic’s server-sent events when stream is true (message_start, content_block_delta, message_delta with the usage, message_stop).
object
object
object
Example
{ "type": "message", "role": "assistant"}Headers
Section titled “Headers”The id of the credit hold for this call. Quote it when you contact support about a charge.
invalid_request_error: invalid JSON, unknown model <id>, n other than 1, or a max_tokens that is not a positive integer.
object
object
Example
{ "type": "error", "error": { "type": "invalid_request_error", "message": "unknown model gpt-4o" }}authentication_error: invalid api key or unauthorized.
object
object
Example
{ "type": "error", "error": { "type": "invalid_request_error" }}billing_error: the API wallet is empty, the key hit its monthly cap, or (terminal keys) the plan is out of credits. The reason is in the message.
object
object
Example
{ "type": "error", "error": { "type": "invalid_request_error" }}permission_error: the account is suspended.
object
object
Example
{ "type": "error", "error": { "type": "invalid_request_error" }}request_too_large: the request is too big to send to the model.
object
object
Example
{ "type": "error", "error": { "type": "invalid_request_error" }}rate_limit_error: the key passed its requests per minute, or the account has 8 requests in progress.
object
object
Example
{ "type": "error", "error": { "type": "invalid_request_error" }}Headers
Section titled “Headers”Example
12Whole seconds to wait before trying again.
api_error: the model failed or could not be reached. Not charged. The status can also be the upstream status (for example 429 when the model is busy).
object
object
Example
{ "type": "error", "error": { "type": "invalid_request_error" }}overloaded_error: Aderra is busy receiving other large requests. Retry after Retry-After (5) seconds.
object
object
Example
{ "type": "error", "error": { "type": "invalid_request_error" }}Headers
Section titled “Headers”Example
12Whole seconds to wait before trying again.