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

# Create Agent

`POST /v1/agents`

## Request

- Base URL: `https://api.usekeel.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.usekeel.io/v1/agents`
- Auth: none declared

Create an agent + credential. Token is returned ONCE.

## Headers

- `Authorization` string, nullable
- `X-Org-Id` string, nullable

## Request body

- CreateAgentRequest: Request body for POST /v1/agents.
  - `name` string, required
  - `scopes` string[], nullable
  - `expires_in_days` integer

## Response `201`

Successful Response

- CreateAgentResponse
  - `id` string, required
  - `name` string, required
  - `token` string, required
  - `credential_id` string, required
  - `created_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

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