The same models and completion windows work across all three inference surfaces. The Batch API layers on top: it wraps a large set of Responses API calls into one asynchronous job.
Behavior shared across every API
Before the per-API detail, a few rules hold no matter which surface you call:- Streaming is available on Responses, Chat Completions, and Messages. Pass
stream: truefor Server-Sent Events:response.*events on Responses,chat.completion.chunkon Chat Completions, and Anthropic-style events on Messages. Addstream_options.include_usageon Chat Completions for a closing usage chunk. Streaming cannot be combined withbackground: trueor the Flex window. For background requests, poll or wait on webhooks. - Completion windows steer scheduling and price. Set
metadata.completion_window(or theX-Valar-Completion-Windowheader) to"asap"(the Now tier),"priority","standard", or"flex"(background only). See Completion windows and Pricing. - Webhooks fire on completion. Set
metadata.completion_webhookto receive a POST when processing finishes. See Webhooks. storeis not a retention control. See OpenAI API compatibility for how it affects reasoning across turns, and the Data Processing Addendum for retention commitments.
Inference APIs
Each accordion below lists what the API accepts and what it rejects. Open the one that matches the SDK you’re using.Responses API - POST /v1/responses
Responses API - POST /v1/responses
This is the surface we recommend reaching for first.Supported
Not yet supported
Chat Completions API - POST /v1/chat/completions
Chat Completions API - POST /v1/chat/completions
This surface streams
chat.completion.chunk events.SupportedNot yet supported
What comes back
- A response always carries exactly one choice (
n=1). finish_reasonis either"stop"or"tool_calls"- values such as"length"and"content_filter"are never returned.- Neither
system_fingerprintnorservice_tierappears in responses. logprobsis alwaysnull.
Messages API - POST /v1/messages
Messages API - POST /v1/messages
Valar’s Anthropic-compatible surface. The Anthropic Python SDK and the Claude Agent SDK work against it with a base URL and key change.SupportedThe
Not yet supported
What comes back
stop_reasonisend_turn,tool_use, ormax_tokens. (A run halted on astop_sequencesmatch comes back asend_turn, notstop_sequence.)- The response content is one or more blocks:
text,thinking, andtool_use. usageincludesinput_tokens,output_tokens,cache_read_input_tokens, andcache_creation_input_tokens.
Authorization: Bearer <key> (the OpenAI convention) and the Anthropic x-api-key: <key> header. With the Anthropic SDK, either auth_token or api_key works:anthropic-version header is neither required nor inspected, and errors come back in the OpenAI-style error envelope format. See Anthropic SDK & Claude Agent SDK for end-to-end examples.Batch API
The Batch API runs large volumes of requests asynchronously, following the OpenAI Batch API: upload a JSONL request file, create a batch that points at it, poll for status, and download the results file. Batches target/v1/chat/completions or /v1/responses - you can’t batch /v1/messages today. One batch takes up to 10,000 requests; single results are also fetchable early by custom_id, a Valar extension.
For the end-to-end workflow, see Sending Requests at Scale; for the request and response schemas, see the Batch API reference.