---
title: "Run Reasoning Agent Completions"
method: POST
path: "/v1/reasoning-agent/completions"
---

# Run Reasoning Agent Completions

`POST /v1/reasoning-agent/completions`

Run a reasoning agent with the specified task.

## Headers

- `x-api-key` string, required

## Request body

- ReasoningAgentSpec
  - `agent_name` string, nullable — The unique name assigned to the reasoning agent.
  - `description` string, nullable — A detailed explanation of the reasoning agent's purpose and capabilities.
  - `model_name` string, nullable — The name of the AI model that the reasoning agent will utilize.
  - `system_prompt` string, nullable — The initial instruction or context provided to the reasoning agent.
  - `max_loops` integer, nullable — The maximum number of times the reasoning agent is allowed to repeat its task.
  - `swarm_type` 'reasoning-duo' | 'self-consistency' | 'ire' | 'reasoning-agent' | 'consistency-agent' | 'ire-agent' | 'ReflexionAgent' | 'GKPAgent' | 'AgentJudge', nullable — The type of reasoning swarm to use (e.g., reasoning duo, self-consistency, IRE).
  - `num_samples` integer, nullable — The number of samples to generate for the reasoning agent.
  - `output_type` 'list' | 'dict' | 'dictionary' | 'string' | 'str' | 'final' | 'last' | 'json' | 'all' | 'yaml' | 'xml' | 'dict-all-except-first' | 'str-all-except-first' | 'basemodel' | 'dict-final' | 'list-final', nullable — The type of output format for the reasoning agent.
  - `num_knowledge_items` integer, nullable — The number of knowledge items to use for the reasoning agent.
  - `memory_capacity` integer, nullable — The memory capacity for the reasoning agent.
  - `task` string, nullable — The task to be completed by the reasoning agent.

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/the-swarm-corporation/apis/swarms-api.md) · [All operations](https://skmtc.net/the-swarm-corporation/apis/swarms-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/the-swarm-corporation/swarms-api/revisions/7618ad18b40e/schema)
