---
title: "Create a new agent"
method: POST
path: "/api/agents"
tags: ["agents"]
---

# Create a new agent

`POST /api/agents`

## Request

- Base URL: `http://localhost:3000`
- URL: `http://localhost:3000/api/agents`
- Auth: none declared

Creates a new agent from character configuration

## Request body

- object
  - `characterPath` string: Path to a character file
  - `characterJson` object: Character configuration in JSON format

## Response `201`

Agent created successfully

- object
  - `success` boolean
  - `data` object
    - `character` Character
      - `id` string, uuid: Unique identifier for the character
      - `name` string, required: Name of the character
      - `bio` string: Short biography of the character
      - `settings` object: Character-specific settings
      - `system` string: System prompt for the character
      - `style` object: Character's communication style
      - `lore` string[]: Extended lore and background information
      - `messageExamples` string[]: Example messages for character training
      - `topics` string[]: Topics the character is knowledgeable about
      - `plugins` string[]: Plugins used by the character

## Other responses

- `400`: Error creating agent

---

[API](https://skmtc.dev/elizaos/apis/eliza-os-api.md) - [All operations](https://skmtc.dev/elizaos/apis/eliza-os-api/llms.txt) - [OpenAPI document](https://skmtc.dev/elizaos/apis/eliza-os-api/revisions/d606a12682bb?raw)
