Skip to main content
Valar gives you four endpoints. Three are inference surfaces shaped after APIs you already know, and one batches work asynchronously: 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: true for Server-Sent Events: response.* events on Responses, chat.completion.chunk on Chat Completions, and Anthropic-style events on Messages. Add stream_options.include_usage on Chat Completions for a closing usage chunk. Streaming cannot be combined with background: true or the Flex window. For background requests, poll or wait on webhooks.
  • Completion windows steer scheduling and price. Set metadata.completion_window (or the X-Valar-Completion-Window header) to "asap" (the Now tier), "priority", "standard", or "flex" (background only). See Completion windows and Pricing.
  • Webhooks fire on completion. Set metadata.completion_webhook to receive a POST when processing finishes. See Webhooks.
  • store is 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

RecommendedOpenAI Responses formatOpenAI SDK compatibleAPI reference
This is the surface we recommend reaching for first.SupportedNot yet supported
OpenAI Chat Completions formatOpenAI SDK compatibleAPI reference
This surface streams chat.completion.chunk events.SupportedNot yet supportedWhat comes back
  • A response always carries exactly one choice (n=1).
  • finish_reason is either "stop" or "tool_calls" - values such as "length" and "content_filter" are never returned.
  • Neither system_fingerprint nor service_tier appears in responses.
  • logprobs is always null.
Anthropic Messages formatAnthropic SDK compatibleAPI reference
Valar’s Anthropic-compatible surface. The Anthropic Python SDK and the Claude Agent SDK work against it with a base URL and key change.SupportedNot yet supportedWhat comes back
  • stop_reason is end_turn, tool_use, or max_tokens. (A run halted on a stop_sequences match comes back as end_turn, not stop_sequence.)
  • The response content is one or more blocks: text, thinking, and tool_use.
  • usage includes input_tokens, output_tokens, cache_read_input_tokens, and cache_creation_input_tokens.
Authenticating with the Anthropic SDKValar accepts both 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:
The 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.