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 Chat Completions and Messages. Pass stream: true and you get Server-Sent Events (chat.completion.chunk on Chat Completions, Anthropic-style events on Messages); add stream_options.include_usage on Chat Completions for a closing usage chunk. The Responses API rejects stream: true. For long jobs, use background: true on the Responses API and 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.
  • Responses are always stored. store: false is unsupported.

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 Responses API requests asynchronously. Every entry targets /v1/responses - you can’t batch /v1/chat/completions or /v1/messages today. One POST /v1/batches call takes up to 100,000 requests; you then poll GET /v1/batches/{id} for status and fetch each result by its custom_id. For the end-to-end workflow, see Sending Requests at Scale; for the request and response schemas, see the Batch API reference.