messages

Anthropic Messages API-compatible endpoint.

Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and hybrid mode. Hybrid-mode requests resolve credentials via the platform service and get multi-attempt fallback across the resolved route, tool-loop requests included (fallback applies up to the pre-lock-in point, same as chat).

post/api/v1/messages

Request

  • The document declares no server URL.
  • Auth: one of:
    • API key in header Otari-Key
    • API key in header x-api-key

Headers

Idempotency-Keystring nullable

A unique value, such as a UUID, that makes a non-streaming request safe to retry. A retry with the same key and body returns the original response, request ID and cost without calling the provider or billing again. A retry while the original is still running is answered 409 with Retry-After. Reusing a key for a different body is refused with 422. Ignored for streaming requests, in hybrid mode, and on a deployment without OTARI_SECRET_KEY, which encrypts the stored response.

Request body

betasstring[] nullable
cache_controlobject nullable
context_managementobject nullable
max_tokensinteger required
max_tool_iterationsinteger nullable
mcp_server_idsstring[] nullable
messagesobject[] required
metadataobject nullable

Tags for cost attribution, recorded on the request's usage rows and filterable in the usage API: up to 16 string pairs, keys up to 64 characters and values up to 512. A null value is ignored. LiteLLM's nested spend_logs_metadata object is also read, and wins over a flat key of the same name; it is never forwarded to the provider. user_id names the billed user and is not a tag.

modelstring required
output_formatobject nullable
prompt_cache_keystring nullable
service_tierstring nullable
session_labelstring nullable

Optional caller-supplied label for cost attribution (per run, experiment, or conversation). In hybrid mode it is forwarded onto the platform usage report so spend can be sliced by session without standing up OpenTelemetry. Stripped before the request is forwarded upstream to the provider. Has no effect in standalone mode, where there is no platform to report it to.

stop_sequencesstring[] nullable
streamboolean
temperaturenumber nullable
thinkingobject nullable
tool_choiceobject nullable
toolsobject[] nullable
tools_headerstring nullable
top_kinteger nullable
top_pnumber nullable

Response

Successful Response

unknown required

Changes