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

# Create an agent

`POST /api/v1/agents`

## Request

- Base URL: `https://your-deployment.example.com`
- URL: `https://your-deployment.example.com/api/v1/agents`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Creates an agent owned by the caller. The number of agents a user may own depends on their plan. Unknown body fields are rejected.

## Request body

- CreateAgentRequest
  - `name` string, required
  - `description` string
  - `system_prompt` string
  - `preferred_model` string: A chat model id. An unknown model is rejected with a 422.
  - `temperature` number
  - `max_tokens` integer
  - `allowed_tools` string[]: Tools the agent may call. An empty list (or `null`) means the default tool policy applies.
  - `denied_tools` string[]: Tools the agent may never call. An empty list (or `null`) means the default tool policy applies.
  - `trigger_words` string[]: Mentions (for example `@research`) that invoke the agent in chat.

## Response `201`

The created agent.

- CreateAgentResponse201
  - `id` string, required
  - `name` string, required
  - `description` string, required
  - `system_prompt` string, nullable, required: The agent's system prompt. `null` unless the caller owns the agent.
  - `preferred_model` string, nullable, required: Model id the agent answers with; `null` uses the default.
  - `temperature` number, nullable, required
  - `max_tokens` integer, nullable, required
  - `allowed_tools` string[], nullable, required: Tools the agent may call. An empty list (or `null`) means the default tool policy applies.
  - `denied_tools` string[], nullable, required: Tools the agent may never call. An empty list (or `null`) means the default tool policy applies.
  - `trigger_words` string[], required: Mentions (for example `@research`) that invoke the agent in chat.
  - `is_owner` boolean, required: Whether the caller owns the agent, rather than having it shared with them.
  - `created_at` string, nullable, required: ISO 8601 timestamp.
  - `updated_at` string, nullable, required: ISO 8601 timestamp.

## Other responses

- `400`: The caller already owns as many agents as their plan allows (`errorCode: agent_limit_reached`), or the body is not valid JSON. Nothing is created.
- `401`: Missing or invalid credentials.
- `403`: The API key lacks `agents:write`.
- `405`: The path does not serve this HTTP method.
- `422`: Request body failed validation: an unknown field, an out-of-range value, an unknown `preferred_model`, or a malformed `trigger_words`/tool list.
- `429`: Per-user rate limit exceeded.

---

[API](https://skmtc.dev/bike4mind/apis/bike4mind-api.md) · [All operations](https://skmtc.dev/bike4mind/apis/bike4mind-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bike4mind/apis/bike4mind-api/revisions/db47495b892f?raw)
