[DOCS]

Chat completions

POST /v1/chat/completions accepts the standard OpenAI request and response shapes, streaming included. Unknown parameters are silently ignored.

REQUEST
POST https://blazeinference.com/v1/chat/completions

{
  "model": "deepseek-ai/deepseek-v4-pro",
  "messages": [
    { "role": "system", "content": "You are terse." },
    { "role": "user", "content": "Summarize SSE in one line." }
  ],
  "temperature": 0.7,
  "max_tokens": 400
}

Parameters

PARAMTYPENOTES
modelstringRequired. An available model id; see Models.
messagesarrayRequired. OpenAI message objects (system/user/assistant/tool/developer).
streambooleanSSE streaming. Terminates with data: [DONE].
max_tokensintegerOutput tokens only. Capped at 2,000,000.
max_completion_tokensintegerAlias for max_tokens; same cap.
temperaturenumberPassed through.
top_pnumberPassed through.
stopstring | string[]Passed through.
seedintegerPassed through.
frequency_penalty / presence_penaltynumberPassed through.
nintegerMust be 1.
tools / tool_choicearray / anyFunction calling, passed through.
response_formatobjecte.g. JSON mode, passed through.
logprobs / top_logprobsboolean / integerPassed through.
userstringEnd-user identifier, passed through.
stream_optionsobjecte.g. {"include_usage": true} for usage in streams.
chat_template_kwargsobjectAdvanced, optional; see below.

Streaming

Set stream: true to receive server-sent events: data: chunks terminated by data: [DONE], exactly like OpenAI. If generation fails mid-stream, you receive one final event carrying our standard error envelope, then [DONE]; a request that fails this way is not counted against your quota.

STREAMING · openai sdk
const stream = await blaze.chat.completions.create({
  model: "z-ai/glm-5.2",
  messages: [{ role: "user", content: "Write a haiku about GPUs." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content || "");
}

Reasoning (DeepSeek)

deepseek-ai/deepseek-v4-pro and deepseek-ai/deepseek-v4-flash support on-demand reasoning. By default we run them with reasoning off for predictable latency; opt in per request with chat_template_kwargs, and your value always overrides the default. Flash additionally accepts "reasoning_effort": "low" | "medium" | "high". When reasoning is on, the assistant message may carry a reasoning_content field alongside content.

REASONING ON
{
  "model": "deepseek-ai/deepseek-v4-pro",
  "messages": [{ "role": "user", "content": "Prove it step by step." }],
  "chat_template_kwargs": { "thinking": true }
}

Limits

LIMITVALUE
Free requests / day100; only successful (200) responses count
Request body5 MB
max_tokens ceiling2,000,000 (output tokens)
n1