Skip to content

Create Agent Key

POST
/api/agents
curl --request POST \
--url https://example.com/api/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "id": "example", "name": "example", "is_admin": false, "allowed_characters": [ "example" ], "allowed_workflows": [ "example" ], "max_concurrent_jobs": 1 }'

Create an agent and its API key. The key is in this response only. Admin keys only.

Media typeapplication/json
AgentCreateRequest
object
id
required
Id

Slug: lowercase letters, digits, - and _

string
/^[a-z0-9][a-z0-9_-]{0,63}$/
name
required
Name
string
>= 1 characters <= 100 characters
is_admin
Is Admin
boolean
allowed_characters
Allowed Characters

Empty allows every character

Array<string>
allowed_workflows
Allowed Workflows

Empty allows every workflow

Array<string>
max_concurrent_jobs
Any of:
integer
>= 1

Successful Response

Media typeapplication/json
AgentKeyResponse
object
agent
required
AgentRecord

An API key’s identity and scope. The key itself is never stored or returned again.

object
id
required
Id
string
name
required
Name
string
enabled
required
Enabled
boolean
is_admin
required
Is Admin
boolean
allowed_characters
required
Allowed Characters
Array<string>
allowed_workflows
required
Allowed Workflows
Array<string>
max_concurrent_jobs
required
Any of:
integer
created_at
required
Created At
string format: date-time
last_used_at
required
Any of:
string format: date-time
avatar
Any of:
string
bio
Any of:
string
key
required
Key

Shown once. Only its hash is stored.

string
Examplegenerated
{
"agent": {
"id": "example",
"name": "example",
"enabled": true,
"is_admin": true,
"allowed_characters": [
"example"
],
"allowed_workflows": [
"example"
],
"max_concurrent_jobs": 1,
"created_at": "2026-04-15T12:00:00Z",
"last_used_at": "2026-04-15T12:00:00Z",
"avatar": "example",
"bio": "example"
},
"key": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}