Create Message
Send a conversation to any Orchestrator API model using the Anthropic Messages schema. Set stream: true to receive server-sent events. Authenticate with your Perplexity API key in Authorization: Bearer or in the Anthropic SDK’s default x-api-key header.
Authorization: Bearer and the Anthropic SDK’s default x-api-key header are accepted, so the stock SDK api_key parameter works unchanged. No anthropic-version header is required.Parameter support
Parameter support
model, routing (only with model: "perplexity/auto"), max_tokens (required), messages, system, stream, temperature, top_p, top_k, stop_sequences, thinking, output_config.effort, tools, tool_choice, cache_control on content blocks and tools (ttl of 5m or 1h), and service_tier (auto or standard_only). Message content and tool_result.content accept text, image, document, and search_result blocks. Document sources can be base64 PDF, plain text, URLs, or text content blocks; all but base64 PDF require an anthropic/ model, as do title, context, and enabled citations. context_management requires the anthropic-beta: context-management-2025-06-27 header and is applied on anthropic/ models only.Accepted but not forwarded to the model: metadata.Rejected with a 400: service_tier values other than auto or standard_only, container, inference_geo, mcp_servers, fallbacks, a thinking type the model does not support, plus any unrecognized top-level field.Notes: thinking accepts {"type": "disabled"}, {"type": "enabled", "budget_tokens": N}, and {"type": "adaptive"}. Support for enabled and adaptive varies by model. For example, anthropic/claude-sonnet-5-5 requires adaptive with output_config.effort, and anthropic/claude-haiku-4-5 accepts enabled but not adaptive. Cache writes with a 1h TTL are billed at 2x the base input rate. A tool’s description is optional.Streaming
Streaming
stream: true to receive typed server-sent events: message_start, then content_block_start, content_block_delta, and content_block_stop for each content block, interleaved with ping events, then message_delta with the stop reason and final usage, then message_stop. The stream ends after message_stop, with no [DONE] trailer.Errors detected before streaming begins, such as an unavailable model, return a normal JSON error response with the matching HTTP status.Errors
Errors
429 with type overloaded_error and a Retry-After header. An unavailable model returns 404 with type not_found_error, and a missing or invalid API key returns 401. Requests that fail before producing output are not billed.Body
Request body for POST /orchestrator/v1/messages.
Inline routing for model: "perplexity/auto" only. Omit this field or set it to null to use the default policy. The serialized routing object must be at most 16384 bytes. Models must be available in the Orchestrator catalog. Routes incompatible with the request are excluded; if the default model is incompatible, the first compatible route model becomes the default. The request fails if no model is compatible.
- Option 1
- Option 2
Response
Successful response. JSON for non-streaming requests; a text/event-stream of typed events (message_start through message_stop) when stream is true.
Non-streaming response body and the message_start payload.