---
title: "Create an agent"
method: POST
path: "/agents"
tags: ["Agents"]
---

# Create an agent

`POST /agents`

## Request

- Base URL: `https://workflow.loopfour.ai/api/v1`
- URL: `https://workflow.loopfour.ai/api/v1/agents`
- Auth: API key in header `x-api-key`

Creates a new custom agent.

## Request body

- object
  - `name` string, required: Agent display name.
  - `type` 'extraction' | 'content' | 'transform' | 'decision' | 'code' | 'classification' | 'custom', required
  - `systemPrompt` string, required: System prompt defining agent behavior.
  - `provider` 'openai' | 'anthropic': AI provider (default: openai).
  - `model` string: Model ID (defaults to gpt-5.6-sol).
  - `outputSchema` object: JSON Schema for structured output.
  - `temperature` number: Temperature (0.0-2.0), defaults to 0.7.
  - `maxTokens` integer: Max tokens in response, defaults to 4096.

## Response `201`

Agent created

- object
  - `success` unknown
  - `data` Agent
    - `id` string
    - `name` string
    - `type` 'extraction' | 'content' | 'transform' | 'decision' | 'code' | 'classification' | 'custom'
    - `provider` 'openai' | 'anthropic'
    - `model` string
    - `version` number
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400`: Bad request — invalid parameters or request body.
- `401`: Missing or invalid API key.
- `403`: Forbidden — insufficient permissions for this resource.

---

[API](https://skmtc.dev/loopfour/apis/loopfour-workflows-api.md) - [All operations](https://skmtc.dev/loopfour/apis/loopfour-workflows-api/llms.txt) - [OpenAPI document](https://skmtc.dev/loopfour/apis/loopfour-workflows-api/revisions/872822a3af00?raw)
