/v1/reasoning-agent/completions) runs a single task through a specialized reasoning architecture rather than a plain agent loop. Instead of one model call producing one answer, a reasoning agent decomposes, samples, critiques, or debates its way to a result — trading cost and latency for reliability on problems where a single pass is often wrong.
Endpoint
Architecture
The exact internals depend onswarm_type — some architectures sample independently and reconcile, others critique and revise in sequence. What they share is that one request produces multiple internal reasoning passes before returning.
ReasoningAgentSpec
The request body is a singleReasoningAgentSpec object.
Reasoning Types
swarm_type accepts the following values:
The default is
reasoning_duo (underscore), while the enum lists reasoning-duo (hyphen). Pass one of the enumerated values explicitly rather than relying on the default. Call GET /v1/reasoning-agent/types for the live list.Output Types
output_type controls the shape of outputs: list, dict, dictionary, string, str, final, last, json, all, yaml, xml, dict-all-except-first, str-all-except-first, basemodel, dict-final, list-final.
Use final or last when you want only the answer. Use the default dict-all-except-first when you want the reasoning trace alongside it.
Quick Start
- Python
- JavaScript
- Shell (curl)
Response
Response Schema
Status Codes
When to Use a Reasoning Agent
Reasoning agents cost more than a plain agent call — multiple internal passes means multiple sets of billed tokens. They earn that cost on problems where a single pass is unreliable:
Raise
num_samples to increase consensus strength on self-consistency; raise max_loops to give reflective architectures more revision rounds. Both multiply cost roughly linearly.
Related Resources
Reasoning Agent Types
Fetch the live list of reasoning architectures
Reasoning Agents Tutorial
Worked example on a hard analytical problem
Agent Completions
The standard single-agent endpoint
Premium Endpoints
Tier requirements and the 403 error shape