---
title: "Create AI agent"
method: POST
path: "/v3/ai-agents"
tags: ["v3", "ai-agents"]
---

# Create AI agent

`POST /v3/ai-agents`

## Request

- Base URL: `https://api.mentium.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mentium.io/v3/ai-agents`
- Auth: HTTP bearer

Create a new AI agent in the current workspace.

## Headers

- `mentium-workspace-id` string, nullable

## Request body

- AIAgentCreateRequest: Request schema for creating a new AI agent.
  - `name` string, required: Agent name
  - `description` string, nullable: Agent description
  - `agent_type` string: Agent type identifier
  - `type_config` object, nullable: Type-specific configuration. Required fields are defined by the agent type registry.
  - `workspace_phone_number_id` string, nullable: Assigned workspace phone number ID (phone agents only).
  - `model` string, required: LLM model identifier (e.g. gpt-5.5, claude-sonnet-4-6)
  - `system_prompt_template` string, required: System prompt template with {{variables}}
  - `user_prompt_template` string, nullable: User prompt template with {{variables}}
  - `temperature` number, nullable: LLM temperature (0-2)
  - `max_tokens` integer, nullable: Maximum output tokens
  - `reasoning_effort` string, nullable: Reasoning effort level for reasoning models (dynamic, depends on model)
  - `tools` string[]: List of tool identifiers the agent can use
  - `tool_inputs` object, nullable: Agent-side default inputs per tool identifier (tool_identifier -> {param_key -> value}). Soft defaults that travel with the agent; runtime precedence is agent < node < LLM args.
  - `mcp_bindings` AgentMcpBindingInput[]: MCP servers the agent may use; part of its first revision
    - `integration_connection_id` string, required
    - `allowed_tool_names` string[]
  - `is_active` boolean: Whether the agent is active

## Response `201`

Successful Response

- AIAgentResponse: Response schema for a single AI agent.
  - `id` string, required
  - `name` string, required
  - `description` string, nullable, required
  - `agent_type` string, required
  - `type_config` object, nullable, required
  - `workspace_phone_number_id` string, nullable
  - `model` string, required
  - `system_prompt_template` string, required
  - `user_prompt_template` string, nullable, required
  - `temperature` number, nullable, required
  - `max_tokens` integer, nullable, required
  - `reasoning_effort` string, nullable, required
  - `tools` string[], required
  - `tool_inputs` object, nullable: Agent-side default inputs per tool identifier (tool_identifier -> {param_key -> value}). Soft defaults that travel with the agent; runtime precedence is agent < node < LLM args.
  - `automation_tools_count` integer: Number of shared HTTP automation tools bound to this agent.
  - `is_active` boolean, required
  - `is_draft` boolean
  - `draft_of_id` string, nullable
  - `yaml_content` string, nullable
  - `chat_history` object[], nullable
  - `yaml_history` object[], nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `prompt_variables` string[]: {{variable}} placeholder names found in the agent's prompts (system_prompt_template, user_prompt_template, type_config.first_message). Excludes ElevenLabs system variables (system__*) injected automatically at runtime.
  - `has_draft` boolean: True when the agent has unpublished draft changes.
  - `live_revision_id` string, nullable: The revision the agent runs
  - `draft` object, nullable: Staged draft changes that have not been published yet.

## Other responses

- `422`: Validation Error

---

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