1
Create a Valar API key
Sign in at the Valar dashboard and create a key. Store it as
VALAR_API_KEY so the OpenAI SDK and other clients pick it up.2
Point your client at Valar
Keep your existing OpenAI client. Change the base URL to
https://api.valarhq.ai/v1 and pass your Valar key - Valar authenticates with Authorization: Bearer <key>.3
Switch to a Valar model
Valar serves open-weight models, so update the
model field - OpenAI names like gpt-4o won’t resolve. Pick one from the Models page, such as moonshotai/Kimi-K2.7 or zai-org/GLM-5.2-FP8, and confirm availability at runtime with GET /v1/models.4
Tune cost and latency (optional)
For work that doesn’t need an instant answer, set
background=True and choose a completion window - standard or flex - to trade a little latency for a lower rate. See Inference modes.What changes
A few behaviors differ from OpenAI - worth checking before you ship:
- Streaming is available on Chat Completions and Messages. The Responses API rejects
stream: true; for long jobs usebackground: trueand poll or wait on webhooks. Inference modes covers the realtime / async / batch split. - Completion windows replace latency tuning. Use
metadata.completion_window(asap,standard, orflex) instead ofservice_tier. See Pricing. - Structured outputs work the same way -
text.formaton Responses, orresponse_formaton Chat Completions, with a JSON schema. See Structured outputs. - Some OpenAI-only parameters are ignored or rejected (server-side tools, conversation chaining, sampling penalties, and others). The API support matrix lists exactly what each surface accepts.
Coming from Anthropic? The OpenAI SDK works against Valar’s Responses and Chat Completions APIs, and the Anthropic SDK works against Valar’s Messages API — see Anthropic SDK & Claude Agent SDK.
Let your coding agent do it
Valar’s docs are built to be read by agents: every page has a Markdown view, the full index lives at/llms.txt, and there’s an MCP server at https://docs.valarhq.ai/mcp. Point your coding agent (Cursor, Claude Code, and the like) at the docs and hand it a prompt such as:
Next steps
Quickstart
Make your first Valar request.
Models
Pick a model and copy its id.
Inference modes
Realtime, async, batch, and completion windows.
Structured outputs
Get schema-constrained JSON back.