[DOCS]
Chat completions
POST /v1/chat/completions accepts the standard OpenAI request and response shapes, streaming included. Unknown parameters are silently ignored.
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
| PARAM | TYPE | NOTES |
|---|---|---|
model | string | Required. An available model id; see Models. |
messages | array | Required. OpenAI message objects (system/user/assistant/tool/developer). |
stream | boolean | SSE streaming. Terminates with data: [DONE]. |
max_tokens | integer | Output tokens only. Capped at 2,000,000. |
max_completion_tokens | integer | Alias for max_tokens; same cap. |
temperature | number | Passed through. |
top_p | number | Passed through. |
stop | string | string[] | Passed through. |
seed | integer | Passed through. |
frequency_penalty / presence_penalty | number | Passed through. |
n | integer | Must be 1. |
tools / tool_choice | array / any | Function calling, passed through. |
response_format | object | e.g. JSON mode, passed through. |
logprobs / top_logprobs | boolean / integer | Passed through. |
user | string | End-user identifier, passed through. |
stream_options | object | e.g. {"include_usage": true} for usage in streams. |
chat_template_kwargs | object | Advanced, 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.
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.
{
"model": "deepseek-ai/deepseek-v4-pro",
"messages": [{ "role": "user", "content": "Prove it step by step." }],
"chat_template_kwargs": { "thinking": true }
}Limits
| LIMIT | VALUE |
|---|---|
| Free requests / day | 100; only successful (200) responses count |
| Request body | 5 MB |
| max_tokens ceiling | 2,000,000 (output tokens) |
| n | 1 |