---
title: "Create Agent"
method: POST
path: "/api/agents"
tags: ["agents"]
---

# Create Agent

`POST /api/agents`

Create a new custom agent.

## Request body

- AgentCreateRequest — Request model for creating a new agent.
  - `name` string, required — Agent name
  - `description` string, nullable — Agent description
  - `instructions` string, nullable — System instructions/prompt
  - `execution_mode` string, nullable — Execution mode: flash, balanced, think, or auto
  - `models` object, nullable — Model config: {general, small_fast, visual, compact}
  - `knowledge_bases` string[] — Knowledge base names
  - `skills` string[] — Skill names
  - `tool_categories` string[] — Tool category names
  - `suggested_prompts` string[] — Suggested prompt examples for users
  - `logo_base64` string, nullable — Logo image as base64 data URL

## Response `200`

Successful Response

- AgentResponse — Response model for agent data.
  - `id` integer, required
  - `user_id` integer, required
  - `name` string, required
  - `description` string, nullable, required
  - `instructions` string, nullable, required
  - `execution_mode` string, required
  - `models` object, nullable, required
  - `knowledge_bases` string[], required
  - `skills` string[], required
  - `tool_categories` string[], required
  - `suggested_prompts` string[], required
  - `logo_url` string, nullable, required
  - `status` string, required
  - `published_at` string, nullable, required
  - `created_at` string, required
  - `updated_at` string, required
  - `widget_enabled` boolean, required
  - `allowed_domains` string[], required
  - `share_enabled` boolean, required
  - `share_updated_at` string, nullable, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.net/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xorbitsai/xagent/versions/33e4ba4936ad/schema)
