Skip to main content
The Reasoning Agent Completions endpoint (/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.
Premium tier required. This endpoint is restricted to Pro, Ultra, and Premium subscribers. Free-tier keys receive a 403 with upgrade instructions. See Premium Endpoints.

Endpoint

Architecture

The exact internals depend on swarm_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 single ReasoningAgentSpec 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

Response

Response Schema

outputs is deliberately untyped in the schema: a self-consistency run and a reasoning-duo run return different structures, and output_type changes it again. Do not assume a fixed shape — branch on agent_type, or pin output_type to final when you only need the answer string.

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.

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