aiml docs
ReferenceAPI reference

Keys

API keys

GET/v1/limits
AuthorizationBearer <token>

In: header

Query Parameters

key_id?string
project_id?string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/limits"
{  "plan": {    "rpm": 600,    "tpm": 2000000,    "concurrency": 32,    "keys": 50,    "projects": 10  },  "keys": [    {      "key_id": "key_01J9ZK2K4Q7Q3M3QX1V0F1KEY1",      "name": "production",      "project_id": "prj_01J9ZK2K4Q7Q3M3QX1V0F1PRJ1",      "status": "active",      "configured": {        "rpm": 600,        "tpm": 2000000,        "concurrency": 32      },      "budget": {        "daily_micro": 50000000,        "hard": true      },      "live": {        "rpm_remaining": 598,        "tpm_remaining": 1999000,        "concurrency_in_use": 2      },      "spend_today_micro": 12500000,      "spend_month_micro": 61000000    }  ],  "rejected_24h": {    "rpm": 3,    "concurrency": 1  },  "upstream_capacity_24h": 7,  "live": true,  "analytics": true}
GET/v1/keys
AuthorizationBearer <token>

In: header

Query Parameters

cursor?string
limit?integer
Rangevalue <= 200
status?string

only keys whose status is this; expired is an active or rotating key past its expires_at

Value in

  • "active"
  • "rotating"
  • "revoked"
  • "expired"

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/keys"
{  "object": "list",  "data": [    {      "id": "key_01J9ZK2K4Q7Q3M3QX1V0F1KEY1",      "project_id": "prj_01J9ZK2K4Q7Q3M3QX1V0F1PRJ1",      "name": "production",      "hint": "8ASglIDp",      "environment": "live",      "scopes": [        "inference",        "read:usage"      ],      "status": "active",      "limits": {        "rpm": 600,        "tpm": 2000000,        "concurrency": 32      },      "budget": {        "daily_micro": 50000000,        "hard": true      },      "created_at": "2026-09-01T10:05:00Z",      "last_used_at": "2026-09-10T11:59:00Z"    }  ]}
POST/v1/keys
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/keys" \  -H "Content-Type: application/json" \  -d '{    "project_id": "prj_01J9ZK2K4Q7Q3M3QX1V0F1PRJ1",    "name": "ci",    "scopes": [      "inference",      "read:usage"    ],    "limits": {      "rpm": 60    },    "budget": {      "daily_micro": 5000000,      "hard": true    },    "expires_in": "720h"  }'
{  "id": "key_01J9ZK2K4Q7Q3M3QX1V0F1KEY2",  "project_id": "prj_01J9ZK2K4Q7Q3M3QX1V0F1PRJ1",  "name": "ci",  "hint": "Ab12Cd34",  "environment": "live",  "scopes": [    "inference",    "read:usage"  ],  "status": "active",  "limits": {    "rpm": 600,    "tpm": 2000000,    "concurrency": 32  },  "budget": {    "daily_micro": 50000000,    "hard": true  },  "created_at": "2026-09-01T10:05:00Z",  "secret": "aiml-live-Ab12Cd34EfGhIjKlMnOpQrStUvWxYz0123456789ab"}
GET/v1/keys/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/keys/string"
{  "id": "key_01J9ZK2K4Q7Q3M3QX1V0F1KEY1",  "project_id": "prj_01J9ZK2K4Q7Q3M3QX1V0F1PRJ1",  "name": "production",  "hint": "8ASglIDp",  "environment": "live",  "scopes": [    "inference",    "read:usage"  ],  "status": "active",  "limits": {    "rpm": 600,    "tpm": 2000000,    "concurrency": 32  },  "budget": {    "daily_micro": 50000000,    "hard": true  },  "created_at": "2026-09-01T10:05:00Z",  "last_used_at": "2026-09-10T11:59:00Z"}
PATCH/v1/keys/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/v1/keys/string" \  -H "Content-Type: application/json" \  -d '{    "limits": {      "rpm": 300    }  }'
{  "id": "key_01J9ZK2K4Q7Q3M3QX1V0F1KEY1",  "project_id": "prj_01J9ZK2K4Q7Q3M3QX1V0F1PRJ1",  "name": "production",  "hint": "8ASglIDp",  "environment": "live",  "scopes": [    "inference",    "read:usage"  ],  "status": "active",  "limits": {    "rpm": 300,    "tpm": 2000000,    "concurrency": 32  },  "budget": {    "daily_micro": 50000000,    "hard": true  },  "created_at": "2026-09-01T10:05:00Z",  "last_used_at": "2026-09-10T11:59:00Z"}
DELETE/v1/keys/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X DELETE "https://example.com/v1/keys/string"
{  "id": "key_01J9ZK2K4Q7Q3M3QX1V0F1KEY1",  "project_id": "prj_01J9ZK2K4Q7Q3M3QX1V0F1PRJ1",  "name": "production",  "hint": "8ASglIDp",  "environment": "live",  "scopes": [    "inference",    "read:usage"  ],  "status": "revoked",  "limits": {    "rpm": 600,    "tpm": 2000000,    "concurrency": 32  },  "budget": {    "daily_micro": 50000000,    "hard": true  },  "created_at": "2026-09-01T10:05:00Z",  "last_used_at": "2026-09-10T11:59:00Z",  "revoked_at": "2026-09-11T09:00:00Z"}
POST/v1/keys/{id}/rotate
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/keys/string/rotate" \  -H "Content-Type: application/json" \  -d '{    "grace_seconds": 3600  }'
{  "id": "key_01J9ZK2K4Q7Q3M3QX1V0F1KEY3",  "project_id": "prj_01J9ZK2K4Q7Q3M3QX1V0F1PRJ1",  "name": "production",  "hint": "Zz11qqWw",  "environment": "live",  "scopes": [    "inference",    "read:usage"  ],  "status": "active",  "limits": {    "rpm": 600,    "tpm": 2000000,    "concurrency": 32  },  "budget": {    "daily_micro": 50000000,    "hard": true  },  "created_at": "2026-09-01T10:05:00Z",  "last_used_at": "2026-09-10T11:59:00Z",  "secret": "aiml-live-Zz11qqWwEfGhIjKlMnOpQrStUvWxYz0123456789ab",  "rotated_from": "key_01J9ZK2K4Q7Q3M3QX1V0F1KEY1"}