Skip to main content
Anthropic Messages format. Accepts every model in the catalog except OpenAI ones. Claude goes to Anthropic directly and other models are routed through OpenRouter; see endpoint compatibility.

Request

string
required
Bearer $SERV_API_KEY.
string
required
Model ID from the catalog, for example claude-haiku-4.5. Append -serv-kronos or -serv-multipath to enable Kronos or Multipath.
integer
required
Maximum number of tokens to generate. Required by the Messages format. SERV may lower it when your balance is low; see low balance.
string
required
The system prompt. SERV requires one.
array
required
The conversation so far. Each entry has a role (user or assistant) and content.
object
Extended thinking controls, for example { "type": "enabled", "budget_tokens": 1024 }.
array
Tool definitions, in Anthropic format: { name, input_schema }.
object
{ "type": "auto" }, { "type": "any" }, or { "type": "tool", "name": "..." } to force a named tool.
array
Sequences that stop generation.
boolean
default:"false"
Stream the response as server-sent events.
Other Anthropic Messages parameters are forwarded to the model, with these exceptions:
  • service_tier and speed are removed, since requests are billed at the standard rate.
  • metadata is not forwarded.
  • web_search_options, plugins, models, route and mcp_servers are rejected with a 400.
  • Claude models accept custom tools plus the Anthropic web search (web_search_20250305, web_search_20260209 or web_search_20260318), web fetch, bash, text editor, computer use and memory tools, with at most one web search tool and one web fetch tool. Other models accept custom tools only. Any other tool type, such as code execution, returns a 400.

Response

string
Unique identifier for the message.
string
Always "message".
string
Always "assistant".
string
The model used.
array
Output blocks. Find the block with type: "text" for the generated text.
string
Why generation ended. Common values: end_turn, max_tokens, stop_sequence, tool_use.
object
Token counts: input_tokens, output_tokens.