Create a message
Anthropic Messages-compatible endpoint for any Anthropic SDK client.
Models that list POST /v1/messages in supported_endpoints accept
the Messages request shape, and tool_use / tool_result blocks
round-trip. Count the input tokens of a request first with
POST /v1/messages/count_tokens.
max_tokens is optional; without it the model’s default output limit
applies. thinking turns reasoning on (enabled with
budget_tokens, or adaptive) or off, output_config.effort sets
the reasoning effort, and output_config.format takes a JSON schema
for the output. A web_search tool turns on web search on models
that offer it; any other server tool, such as web fetch, code
execution, or an MCP toolset, returns 400 naming the tool. A
content block the model cannot take returns 400 naming its
position, for example messages.0.content.2.
With stream: true the response is Anthropic’s event stream, from
message_start to message_stop. A stream that fails after it
starts ends with one error event in the Anthropic error shape, and
no event follows it.
Errors use the Anthropic error shape,
{"type": "error", "error": {"type": "...", "message": "..."}}. Every
response carries the request ID in the request-id and
x-request-id headers.
Authentication
Pass your EmpirioLabs API key as a bearer token. The Anthropic-style
x-api-key header is also accepted on every endpoint.
Request
The conversation. Content blocks of type text, image (base64 or url source), document (text, content, base64 or url source), tool_use, tool_result, and thinking are accepted where Anthropic accepts them.
The most tokens the model may generate, thinking included. Optional; without it the model’s default output limit applies.
Stream the message as Anthropic server-sent events.
Text that ends generation. A matched sequence is reported as stop_reason stop_sequence.
Tools the model may call: client tools with name, description and input_schema, Anthropic’s client tool types such as bash_20250124, and web_search, which turns on web search on models that offer it. Any other server tool returns 400.
{"type": "auto"}, {"type": "any"}, {"type": "none"}, or {"type": "tool", "name": "..."}. Set disable_parallel_tool_use to true for at most one tool call.
Anthropic-style thinking control. enabled turns reasoning on and budget_tokens maps to thinking_budget for supported models; adaptive turns it on without a budget; disabled turns it off.
Response
The message, or an event stream when stream is true.
Message ID, msg_ followed by 24 hex characters.
Content blocks: thinking (with a signature to send back unchanged in later turns), text, and tool_use.
The stop sequence that ended generation, when stop_reason is stop_sequence.
