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

# Create Agent

`POST /v1/agents`

## Request body

- V1AgentCreateRequest — Body for ``POST /v1/agents``.
  - `name` string, required
  - `description` string, nullable
  - `instructions` string, nullable
  - `execution_mode` string, nullable
  - `models` object, nullable
  - `knowledge_bases` string[]
  - `skills` string[]
  - `tool_categories` string[]
  - `suggested_prompts` string[]
  - `generate_runtime_key` boolean

## Response `200`

Successful Response

- V1AgentCreateResponse
  - `agent` V1AgentResponse, required
    - `id` integer, required
    - `user_id` integer, required
    - `name` string, required
    - `description` string, nullable
    - `instructions` string, nullable
    - `execution_mode` string, required
    - `models` object, nullable
    - `knowledge_bases` string[], required
    - `skills` string[], required
    - `tool_categories` string[], required
    - `suggested_prompts` string[], required
    - `logo_url` string, nullable
    - `status` string, required
    - `published_at` string, nullable
    - `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
  - `api_key` RuntimeKeyResponse — Runtime API key returned once after creation or rotation.
    - `full_key` string, required
    - `key_prefix` string, required
    - `created_at` string, date-time, 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/revisions/33e4ba4936ad/schema)
