Endpoint
Basic Example
- Python
- JavaScript
- cURL
Request Parameters
Required
Sampling
Output
Penalties
Log Probabilities
Tool Calling
Structured Output
Reasoning
Some models (like Kimi K2.6 and GLM 5.2) include chain-of-thought reasoning by default. When reasoning is active, the model’s chain-of-thought is returned in a separate
reasoning field on the response message. Reasoning tokens are included in completion_tokens and count toward your usage — including all reasoning controls below.
These are model-specific chat-template controls, not universal OpenAI parameters. The exact key and accepted values depend on each model’s chat template.
Per-model reasoning controls
Notes:
- GLM 5.2 supports
reasoning_effortwith two levels —high(default) andmax.maxis the opt-in highest-quality mode for long-horizon agentic and complex problem-solving tasks, at the cost of higher latency and token usage. You can sendreasoning_efforteither as a top-level field (OpenAI-style) or insidechat_template_kwargs. Disable thinking entirely withchat_template_kwargs.enable_thinking: false; when thinking is disabled,reasoning_efforthas no effect. - MiniMax M3 does not use a boolean toggle. It accepts
thinking_modewith three values:adaptive(default — the model decides),enabled(always think), anddisabled(never think). - Defaults differ per model: Kimi K2.6 and GLM 5.2 have reasoning on by default; Gemma 4 has reasoning off by default; MiniMax M3 is adaptive by default. See the Models page for per-model details.
Thinking toggle keys
The key that toggles reasoning is defined by each model’s chat template, not by the API, so it differs per model family:
Unknown keys inside
chat_template_kwargs are silently ignored by chat templates, so the safe, forward-compatible approach is to send both keys. This works across all current Lilac models and any future model whose template uses either convention:
- Python
- JavaScript
- cURL
Streaming
Enable streaming to receive tokens as they’re generated:- Python
- JavaScript
Vision
Pass images as URLs or base64 data URIs in thecontent array:
- Python
- JavaScript
- cURL
Tool Calling
Structured Output
Force the model to return valid JSON matching a schema:Response Format
The
reasoning field is present when the model uses chain-of-thought reasoning. It is not counted separately in the response — reasoning tokens are included in completion_tokens.
