Skip to main content
Reasoning Models are designed for more complex task scenarios, such as math problem solving, code generation, logical analysis, and multi-step reasoning. They provide OpenAI-compatible interfaces and support streaming output, making them easy to integrate into existing applications. Representative models include:
  • Qwen/Qwen3-32B
  • Qwen/Qwen3.6-27B
  • Qwen/Qwen3.5-397B-A17B
  • kimi-k2.6
These models return their chain-of-thought in a separate reasoning field. For the full model list and pricing, refer to Models.

Core Capabilities

  • Structured thinking: Break complex problems into smaller and clearer steps through chain-of-thought (CoT).
  • Knowledge fusion: Combine general knowledge with domain-specific context to improve coverage and accuracy.
  • Self-correction: Add validation and reflection during generation to improve result reliability.
  • Multimodal processing: Some models support mixed inputs, such as text, code, and formulas. For details, refer to the corresponding model details.

Usage Notes

  • Before moving to production, check each model’s context limits, whether it supports thinking_budget, pricing, and concurrency limits.
  • Not every model emits a reasoning field. General-purpose chat models, such as DeepSeek-V4-Flash, answer directly without exposing a separate chain-of-thought.

Key Parameters

Parameter Description

  • Request parameters
    • thinking_budget: Token budget for internal reasoning. It can be used to balance reasoning depth and response latency.
    • max_completion_tokens: Token limit for user-visible output, used to avoid overly long responses.
  • Context context_length is not a request parameter. The maximum context length supported by each model can be viewed in Models.
  • Response fields
    • reasoning: Chain-of-thought content, at the same level as content in the response object.
    • content: The final answer content shown to end users.

Recommendations

  • thinking_budget is a hint, not a hard limit. Some models use it to adjust the amount of reasoning, while others may only partially apply it or even ignore it. Do not treat it as an exact limit.
  • The reasoning process and final answer share the max_completion_tokens budget. If max_completion_tokens is set too low, reasoning content may consume the budget, causing content to be empty with finish_reason: length. We recommend increasing max_completion_tokens appropriately or controlling reasoning length through thinking_budget to leave enough room for the final answer.
  • If the output exceeds max_completion_tokens, or the total input exceeds context_length, the response will be truncated and finish_reason will be set to length.
For tailored parameter recommendations, for example for math reasoning, code workflows, or evaluation baselines, share your goals and constraints, and we can suggest best-practice configurations.

Notes

  • Streaming vs. non-streaming: Use streaming when you need long output or real-time feedback; use non-streaming when you need to receive the complete result at once.
  • Latency and stability: Tune thinking_budget, max_completion_tokens, and client timeout settings to reduce the risk of 504 errors and request timeouts.
  • Quota and concurrency: Configure rate limiting strategies with pricing in mind, based on Models. Implement exponential backoff on the client side when necessary.

Billing

  • Formula: Total cost = (input tokens x input unit price) + (output tokens x output unit price).
  • Pricing: Check the model detail page in Models for each model’s pricing.

Examples

The examples read the API key from an environment variable to avoid writing secrets into code.

Streaming Request

Non-Streaming Request

FAQ

  • How should I handle very long text? Adjust max_completion_tokens and enable stream=True to reduce timeout risk. Context limits vary by model; refer to Models for details.
  • What if the chain-of-thought is too long and gets truncated? Lower thinking_budget or increase the client timeout, and make sure max_completion_tokens is set to a reasonable value.
  • Why can’t I see reasoning? Only some reasoning models return this field. Refer to each model’s documentation.