Messages
Anthropic's Messages API, for the Anthropic SDK and the tools built on it. The key may also come in x-api-key. Errors keep Anthropic's error body.
curl -X POST https://api.llm.buzz/api/v1/messages \
-H "Authorization: Bearer $LLM_BUZZ_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-haiku-5.5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Say hello in one word."
}
]
}'import os
from anthropic import Anthropic
client = Anthropic(base_url="https://api.llm.buzz/api", api_key=os.environ["LLM_BUZZ_KEY"])
message = client.messages.create(
model="anthropic/claude-haiku-5.5",
max_tokens=256,
messages=[{"role": "user", "content": "Say hello in one word."}],
)
print(message.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ baseURL: "https://api.llm.buzz/api", apiKey: process.env.LLM_BUZZ_KEY });
const message = await client.messages.create({
model: "anthropic/claude-haiku-5.5",
max_tokens: 256,
messages: [{ role: "user", content: "Say hello in one word." }],
});{
"id": "msg_...",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-haiku-5.5",
"content": [
{
"type": "text",
"text": "Hello!"
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 14,
"output_tokens": 4,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"cost": 0.0000034
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "..."
}
}{
"type": "error",
"error": {
"type": "authentication_error",
"message": "A valid API key is required: send x-api-key or Authorization: Bearer."
}
}Authorization
An inference key, as Authorization: Bearer KEY or in x-api-key, the header the Anthropic SDK sends.
Parameters
x-session-idstringheaderNames the conversation, as
session_iddoes, so its turns stay on the provider that holds its cache.
Body application/json
modelstringrequiredA model's name from
GET /api/v1/models, such asdeepseek/deepseek-v4.1-flash. A suffix changes one request::floortries the cheapest provider first and:nitrothe fastest. On Chat Completions and Responses:onlineasks for a web search, which llm.buzz does not run today: the request is served without one andx-sgr-ignored-parametersnamesweb_search->dropped(search_unavailable), or for an organization whose requests llm.buzz keeps in the EU it answers 400web_search_unavailable_in_region. On Messages:onlinedoes nothing and is named asmodel:online.max_tokensintegerrequiredThe most tokens the answer may use.
messagesobject[]requiredThe conversation, as Anthropic's message objects.
systemstring or object[]The system prompt: a string, or a list of text blocks, which may carry
cache_control.streambooleandefault falseStream Anthropic's server-sent events.
toolsobject[]Tools in Anthropic's shape.
{"type": "tool_search_tool_bm25"}or{"type": "tool_search_tool_regex"}declares a tool search over tools markeddefer_loading: true.reasoningobjectReasoning controls, translated for each provider.
Show 4 child fields
effortstringHow hard the model thinks. An effort the model does not take becomes the nearest one it does, named in
x-sgr-ignored-parameters.max_tokensintegerA reasoning budget in tokens.
enabledbooleanTurn reasoning on or off.
excludebooleanKeep the reasoning text out of the answer while the model still reasons.
providerobjectSteers one request across the model's providers. With the OpenAI SDK, send it in
extra_body. Every field acceptsnull. A name matches a provider's display name, its tag or the tag's first part, ignoring case:llm.buzzorllm-buzznames llm.buzz's own provider, andllm-buzz/euonly its capacity in the EU.Show 7 child fields
orderstring[]Try these providers first, in this order, then the others. At most 64 names.
onlystring[]Use only these providers.
ignorestring[]Never use these providers.
allow_fallbacksbooleanfalsestops moving to other providers.sortstringThe order to try providers in. Ignored when
orderis set.pricethroughputlatencysmartzdrbooleantruekeeps the request on providers that declare 0 days of retention.data_collectionstringdenykeeps the request on providers that declare no training and 0 days of retention.allowdeny
session_idstringA name for the conversation, 1 to 256 characters, so its turns stay on the provider that holds its cache.
Response 200
Anthropic's message object. usage always carries cache_creation_input_tokens and cache_read_input_tokens, and cost in US dollars; readable reasoning arrives as a thinking block.
Errors
400A field is missing or malformed, or the model cannot do what the request asks, in Anthropic's error body as an
invalid_request_error; the message names the field.401Messages keeps Anthropic's error body: a 401 is an
authentication_error, a 402 abilling_error, a 403 apermission_errorand a 429 arate_limit_error.