reasoning_content, separate from the final content.
Supported models
Models not listed here don’t support reasoning.
Enable thinking
For models marked opt-in in the table above, enable thinking by passingchat_template_args.
- Python
- JavaScript
- cURL
Pass
chat_template_args through extra_body since it extends the standard OpenAI API:enable_thinking.py
Control reasoning depth
Set the top-levelreasoning_effort parameter to control how much reasoning a supported model performs. Only the models in this table apply the parameter.
Lower values reduce reasoning-token usage and latency. Higher values use more output tokens for reasoning. Set
reasoning_effort to none to request a direct answer.
Thinking is always on for the GLM 5.3 family, so none does not turn it off. GLM 5.3 and GLM 5.3 Flash accept none and map it to low reasoning, which still returns reasoning_content for many prompts. GLM 5.3 Fast returns a 400 error instead. The enable_thinking and thinking controls follow the same split: a 400 on GLM 5.3 and GLM 5.3 Fast, silently ignored by GLM 5.3 Flash.
- Python
- JavaScript
- cURL
Pass
reasoning_effort through extra_body since it extends the standard OpenAI API:reasoning_effort.py
thinking: {"type": "enabled"} when you set reasoning_effort.
Use reasoning for mathematical calculations, multi-step logic, code generation with complex requirements, and analysis that requires several intermediate steps.
For simple questions or text generation, reasoning adds latency and output tokens. Use a model without reasoning support or set reasoning_effort to low.
Parse the response
The message object returns reasoning inreasoning_content and the final answer in content.
- Python
- JavaScript
- cURL
Read
reasoning_content and content directly off the message object:parse_reasoning.py
Response
completion_tokens and counts them toward your total usage and billing.
Set a reasoning token budget
max_tokens caps the whole completion, reasoning tokens included. reasoning.max_tokens caps reasoning tokens alone: once the model has generated that many reasoning tokens, it stops thinking and spends the rest of max_tokens on its final answer. Set max_tokens above the reasoning budget so the model has room to answer.
DeepSeek V4 Flash 0731 enforces reasoning.max_tokens; other reasoning models ignore it. On DeepSeek V4 Flash 0731, reasoning stops at 4,096 tokens by default, including at reasoning_effort: max. Raise the budget when a hard problem needs more thinking room:
- Python
- JavaScript
- cURL
Pass
reasoning through extra_body since it extends the standard OpenAI API:reasoning_budget.py
Next steps
Model APIs overview
Review supported models, pricing, and features.
Structured outputs
Constrain reasoning model output to a JSON schema.