When to use them
Control reasoning effort
Some OpenAI-compatible reasoning models supportreasoning_effort:
Supported values depend on the selected model.
Reasoning content
Some providers expose a separate reasoning field, such asreasoning_content, while others return only the final answer. If the model exposes reasoning content, your application can display it, store it for debugging, or ignore it.
Example response shape:
Python example
Replace the entiresk-your-api-key value in API_KEY with your actual key. To use another reasoning model, change MODEL. Not every model returns reasoning_content, so the example reads it safely with getattr.
Node.js example
Replace the entiresk-your-api-key value in API_KEY with your actual key. To use another reasoning model, change MODEL. reasoning_content is an optional extension field, so the example checks whether it exists.
Streaming reasoning output
In streaming mode, a provider may send reasoning deltas before final answer deltas. If you choose to display them, keep them visually separate from the final answer and make sure your parser handles missing fields.Cost and latency
Reasoning tokens usually count toward output usage. A higher reasoning budget may improve quality on hard tasks, but it also increases latency and cost. Monitor usage in dashboard and usage.Practical guidance
- Start with a standard model for simple tasks.
- Use reasoning models for hard tasks with measurable accuracy needs.
- Keep prompts focused and provide the necessary facts up front.
- Set reasoning controls only when the selected model supports them.
- Validate final answers when they affect money, permissions, or user data.
