aimldocs
ReferenceApi

Byok

bring your own provider keys: upload, validate, rotate, delete

GET
/v1/byok
AuthorizationBearer <token>

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/byok"
{  "object": "list",  "data": [    {      "id": "byok_01J8ZK",      "provider_id": "anthropic",      "label": "prod",      "hint": "…9f2a",      "status": "active",      "fee_bps": 500,      "fallback_to_pool": false,      "created_at": "2026-09-10T08:00:00Z",      "updated_at": "2026-09-10T08:00:00Z",      "last_used_at": "2026-09-10T09:12:00Z"    }  ],  "providers": [    {      "id": "anthropic",      "name": "Anthropic",      "byok_capable": true,      "byok_required": false    }  ],  "fee_bps": 500}
POST
/v1/byok
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/byok" \  -H "Content-Type: application/json" \  -d '{    "provider_id": "anthropic",    "secret": "sk-ant-api03-…",    "label": "prod",    "fallback_to_pool": false  }'
{  "key": {    "id": "byok_01J8ZK",    "provider_id": "anthropic",    "label": "prod",    "hint": "…9f2a",    "status": "active",    "fee_bps": 500,    "fallback_to_pool": false,    "created_at": "2026-09-10T08:00:00Z",    "updated_at": "2026-09-10T08:00:00Z",    "validated_at": "2026-09-10T08:00:00Z"  }}
PATCH
/v1/byok/{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/byok/string" \  -H "Content-Type: application/json" \  -d '{    "fallback_to_pool": true  }'
{  "key": {    "id": "byok_01J8ZK",    "provider_id": "anthropic",    "label": "prod",    "hint": "…9f2a",    "status": "active",    "fee_bps": 500,    "fallback_to_pool": false,    "created_at": "2026-09-10T08:00:00Z",    "updated_at": "2026-09-10T08:00:00Z",    "validated_at": "2026-09-10T08:00:00Z"  }}
DELETE
/v1/byok/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

curl -X DELETE "https://example.com/v1/byok/string"
Empty
POST
/v1/byok/{id}/validate
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/byok/string/validate"
{  "validation": {    "ok": true,    "models": 14,    "status": 200,    "provider_id": "anthropic"  },  "key": {    "id": "byok_01J8ZK",    "provider_id": "anthropic",    "status": "active",    "hint": "…9f2a",    "fee_bps": 500,    "fallback_to_pool": false,    "created_at": "2026-09-10T08:00:00Z",    "updated_at": "2026-09-10T09:20:00Z",    "validated_at": "2026-09-10T09:20:00Z"  }}