Base URL
Send your API key on every request:
List Models
id,object,created,owned_byare the stable OpenAI fields — SDKs that only read these keep working.max_model_lenis the hard context-window cap; requests past it returncontext_length_exceeded.zdr_supported: truemeans the model acceptsWafer-ZDR: required. Models without ZDR support omit the field or set itfalse.wafer.capabilities.{vision, tools, reasoning}are the legacy summary flags. Newer model cards also include per-surface flags underchat_completions,messages,responses, andzdr; branch on those when using structured outputs, grammar, regex, tools, or ZDR-specific behavior.wafer.pricingis in cents per million tokens and is what we’ll bill at; check it whenever pricing changes matter to your code path.
Compatibility Notes
pass.wafer.ai validates and normalizes a few model-specific features before a request is sent upstream:
- Safe local JSON Schema references (
#/$defs/...and#/definitions/...) are automatically inlined for tool schemas and structured outputs. Remote, unresolved, and recursive refs are rejected. response_format.type = "grammar"is supported only on models whosewafer.capabilities.chat_completions.grammarflag istrue.- Top-level
regexis rejected when the selected model or ZDR partition would ignore it. For example,Kimi-K2.6supports regex on the ZDR self-hosted partition but not on the non-ZDR Moonshot partition. - When
toolsandresponse_formatare both present, tools keep OpenAI-style precedence so a tool-selected request can still return tool calls. n > 1is passed through only on models whosewafer.capabilities.chat_completions.nflag istrue. Unsupported models fail fast withunsupported_featureandparam: "n"instead of silently returning one choice.- OpenAI-compatible
role: "tool"messages may sendcontent: null; Wafer normalizes that to an empty tool result before dispatch so common SDK histories keep working. /v1/responseswithtext.format.type = "json_schema"returns raw JSON text instead of wrapping JSON in Markdown fences.
Chat Completions
UsePOST /v1/chat/completions for ordinary text prompts and OpenAI-compatible clients:
Wafer-ZDR: required when the request must only route to ZDR-capable infrastructure:
Reasoning Controls
Reasoning-capable models can return a separatereasoning_content field alongside the final answer. Discover support from GET /v1/models by checking wafer.capabilities.reasoning.
Wafer accepts three equivalent control shapes:
Default behavior is reasoning off unless you explicitly enable it — for every reasoning-capable model.
The same on/off curl shape works across reasoning-capable models. For example,
swap the
model value to GLM-5.2 to run the 1M-context GLM route with the
same toggle. You can also use reasoning_effort (none, low, medium,
high, or max) when you want an explicit effort level.
Where the reasoning text appears. Most reasoning-capable models (
GLM-5.1,
GLM-5.2, glm5.2-fast, Kimi-K2.6, Kimi-K2.7-Code,
Qwen3.6-35B-A3B, and qwen3.7-max)
return reasoning in a separate reasoning_content field on the assistant
message.MiniMax-M3 is an exception: it currently returns reasoning inline in
content as <think>…</think> text rather than in a separate field. If you’re
parsing reasoning programmatically, branch on the model — or strip the
<think> block from content before displaying.Kimi-K2.6
With reasoning off:Kimi-K2.7-Code
Kimi-K2.7-Code is a coding-focused model with reasoning always on — there
is no reasoning-off mode. You don’t need to send thinking/reasoning_effort;
any attempt to disable thinking is treated as enabled. Give it room for the
reasoning pass with a generous max_tokens.
Tool use must be model-decided. Because thinking is always on,
Kimi-K2.7-Code rejects forced tool calls — tool_choice: "required" and a
specific {"type": "function", ...} choice both return 400 with
code: "unsupported_feature" and param: "tool_choice". Pass your tools
with tool_choice: "auto" (or "none") and let the model decide.GLM-5.1
With reasoning off:Qwen3.5-397B-A17B
With reasoning off:GLM-5.2
With reasoning off:Streaming
Setstream to true and add -N to receive server-sent events as they arrive:
Usage chunks are always included on streaming requests. Wafer automatically
sets
stream_options: {"include_usage": true, "continuous_usage_stats": true}
on every streaming chat completion so the final SSE chunk carries
usage.{prompt_tokens, completion_tokens, total_tokens}. You don’t need to send
stream_options yourself — and if you do, the auto-injected values still win.
This means you can reliably bill / track token spend from streaming responses
the same way you would from non-streaming.tool_calls array arrives in a single chunk rather than streamed argument-
by-argument. Buffer the chunk before processing — partial tool-call deltas
will not occur on Wafer.
Chat Request Body
Unsupported or model-specific parameters return a request error instead of being silently ignored — except where noted in Model-specific behavior.
Model-specific Behavior
A handful of routes intentionally diverge from the generic OpenAI/Anthropic contract. Know these before you ship.Kimi-K2.6 sampling params are stripped
Kimi-K2.6 forwards to Moonshot’s hostedkimi-k2.6, which enforces fixed sampling values (temperature=1.0, top_p=0.95, n=1, presence_penalty=0, frequency_penalty=0) and rejects anything else. Wafer strips temperature, top_p, n, presence_penalty, and frequency_penalty from Kimi-K2.6 requests before forwarding.
If you send temperature: 0 to Kimi-K2.6, expect Moonshot-default sampling (temperature=1.0) at the model. Either pick a model where those controls take effect (GLM-5.1, Qwen3.5-397B-A17B, etc.), or compensate with prompt engineering / reasoning_effort.
MiniMax-M3 returns inline <think> reasoning
See the caveat in Reasoning Controls above. MiniMax-M3 does not populate reasoning_content; it inlines <think>…</think> in content instead.
Multi-turn preserved thinking
Kimi-K2.6, Kimi-K2.7-Code, and GLM-5.1 accept either preserve_thinking: true (Wafer shape) or thinking: {"type": "enabled", "keep": "all"} (Moonshot shape) to carry prior turns’ reasoning back into the next turn’s context. The previous turn’s reasoning_content is inlined as <think>…</think> inside the assistant message before the chat template runs, so the model can build on its own earlier chain of thought.
JSON Schema references in tools and structured outputs
Wafer Serverless accepts common MCP, Zod, and Pydantic JSON Schemas that use safe local references such as#/$defs/... or #/definitions/.... For
compatible models, Wafer inlines those local definitions before dispatching the
request upstream.
Remote references and recursive schemas are not supported. Inline those schemas
client-side or simplify them before retrying.
Text Completions
UsePOST /v1/completions only when you need token-ID prompts or constrained decoding on a supported route:
/v1/completions request shape, streaming example, parameter table, and response shape, see Tokenized Completions and Constrained Decoding.
Anthropic Messages
Wafer also exposes an Anthropic-compatible Messages endpoint athttps://pass.wafer.ai/v1/messages. Most users reach it through Claude Code or Conductor; see Agent Setup for the required environment variables.