API keysCreate an API key

Create an API key

Create an API key — the plaintext key is returned once; store it immediately. Keys support three scopes: admin, read, evaluate.

curl -X POST "https://api.autopil.ai/v1/keys" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "name": "agent-runtime",
  "scope": "evaluate",
  "expires_days": 90
}'
{
  "key_id": "key_abc123",
  "name": "agent-runtime",
  "key": "apl_...",
  "scope": "evaluate",
  "expires_at": "2026-07-05T00:00:00",
  "created_at": "2026-04-06T00:00:00"
}
POST
/v1/keys
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.

API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.
Content-Typestring
Required

The media type of the request body

Options: application/json
scopestring
Options: admin, read, evaluate
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.

Body

application/json
scopestring
Allowed values:adminreadevaluate

Responses