API Keys
CheapestInference uses two categories of API keys:
- Consumption keys (
sk-...) — used for inference requests. Created from a pool (Unlimited) subscription. - Management keys (
mk_xxx) — used for programmatic account management (create keys, check billing, etc.).
All key management endpoints accept either an auth token or a management key in the Authorization header:
Authorization: Bearer YOUR_AUTH_TOKEN# orAuthorization: Bearer mk_xxxxxxxxxxxxxxxxConsumption keys
Section titled “Consumption keys”Consumption keys are the keys you use with the Chat Completions and Anthropic Messages endpoints.
Subscription keys
Section titled “Subscription keys”Minted from a pool (Unlimited) subscription. After you reserve one or more time blocks via POST /api/pools/:id/subscribe, create a key with POST /api/keys/subscription.
- Unlimited usage during your reserved time blocks, no token caps; a capped number of simultaneous requests per key
- Independent expiration per key, tied to the subscription’s billing period
- When a key expires, only that key is revoked
See Unlimited Subscriptions API for the pool subscribe flow.
Holding several subscriptions? A combined key spans two or more of them under one credential — coverage windows add up, and during overlapping hours their parallel capacity stacks.
List consumption keys
Section titled “List consumption keys”GET /api/keysReturns all consumption keys for the authenticated user.
Example
Section titled “Example”curl https://api.cheapestinference.com/api/keys \ -H "Authorization: Bearer YOUR_AUTH_TOKEN"Response
Section titled “Response”{ "success": true, "data": [ { "id": "clx1abc...", "name": "prod-key", "keyPlan": "pool", "keyType": "subscription", "apiKey": "sk-...", "isActive": true, "subscriptionId": "sub-uuid", "subscriptionStatus": "active", "subscriptionExpiresAt": "2026-02-15T10:00:00.000Z", "createdAt": "2026-01-15T10:00:00.000Z", "lastUsedAt": "2026-01-20T08:00:00.000Z" } ]}The full key (
apiKey) is included in list responses for the show/copy feature in the dashboard. Treat list responses as sensitive.
Create subscription key (Unlimited / pool)
Section titled “Create subscription key (Unlimited / pool)”POST /api/keys/subscriptionCreates a new API key for your active Unlimited (pool) subscription.
Request body
Section titled “Request body”| Parameter | Type | Required | Description |
|---|---|---|---|
subscriptionId | string | No | Target a specific subscription. If omitted, uses the most recent active subscription. |
Example — create key for most recent subscription
Section titled “Example — create key for most recent subscription”curl -X POST https://api.cheapestinference.com/api/keys/subscription \ -H "Authorization: Bearer mk_your_key"Example — create key for a specific subscription
Section titled “Example — create key for a specific subscription”curl -X POST https://api.cheapestinference.com/api/keys/subscription \ -H "Authorization: Bearer mk_your_key" \ -H "Content-Type: application/json" \ -d '{"subscriptionId": "subscription_uuid"}'Response
Section titled “Response”{ "success": true, "data": { "id": "key-uuid", "apiKey": "sk_pool_xxxxxxxxxxxxxxxx", "isActive": true }}Note: The
apiKeyis shown here on creation and stays retrievable later viaGET /api/keys. Treat it as a secret.
This endpoint is for Unlimited/pool subscriptions — the current subscription product. Reserve time blocks via
POST /api/pools/:id/subscribefirst, then create the key here.
Update key
Section titled “Update key”PUT /api/keys/:idUpdate a key’s name or active status. Deactivating a key immediately revokes it.
Request body
Section titled “Request body”| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | New name for the key |
isActive | boolean | No | false to deactivate, true to reactivate |
Example
Section titled “Example”curl -X PUT https://api.cheapestinference.com/api/keys/clx1abc... \ -H "Authorization: Bearer YOUR_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{"isActive": false}'Delete key
Section titled “Delete key”DELETE /api/keys/:idPermanently deletes a consumption key and revokes it.
Example
Section titled “Example”curl -X DELETE https://api.cheapestinference.com/api/keys/clx1abc... \ -H "Authorization: Bearer YOUR_AUTH_TOKEN"Response
Section titled “Response”{ "success": true, "data": { "deleted": true }}Management keys
Section titled “Management keys”Management keys (mk_xxx) let you manage your account programmatically without a session token. Use them in CI/CD pipelines, scripts, or automated workflows.
List management keys
Section titled “List management keys”GET /api/keys/managementExample
Section titled “Example”curl https://api.cheapestinference.com/api/keys/management \ -H "Authorization: Bearer YOUR_AUTH_TOKEN"Response
Section titled “Response”{ "success": true, "data": [ { "id": "uuid-here", "name": "mgmt_key_01", "keyPrefix": "mk_a1b2c3d4", "isActive": true, "lastUsedAt": "2026-02-01T08:00:00.000Z", "createdAt": "2026-01-25T12:00:00.000Z" } ]}Create management key
Section titled “Create management key”POST /api/keys/management| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | A label for the key (e.g. “mgmt_key_01”) |
Example
Section titled “Example”curl -X POST https://api.cheapestinference.com/api/keys/management \ -H "Authorization: Bearer YOUR_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "mgmt_key_01"}'Response
Section titled “Response”{ "success": true, "data": { "id": "uuid-here", "name": "mgmt_key_01", "keyPrefix": "mk_a1b2c3d4", "apiKey": "mk_a1b2c3d4e5f6g7h8i9j0..." }}Important: The full management key is only returned once. Store it securely.
Delete management key
Section titled “Delete management key”DELETE /api/keys/management/:idcurl -X DELETE https://api.cheapestinference.com/api/keys/management/uuid-here \ -H "Authorization: Bearer YOUR_AUTH_TOKEN"Using management keys
Section titled “Using management keys”Once created, use a management key as a Bearer token to authenticate any /api/* endpoint:
# List your consumption keys using a management keycurl https://api.cheapestinference.com/api/keys \ -H "Authorization: Bearer mk_a1b2c3d4e5f6g7h8i9j0..."
# Check billing statuscurl https://api.cheapestinference.com/api/billing/status \ -H "Authorization: Bearer mk_a1b2c3d4e5f6g7h8i9j0..."
# Create a subscription key programmaticallycurl -X POST https://api.cheapestinference.com/api/keys/subscription \ -H "Authorization: Bearer mk_a1b2c3d4e5f6g7h8i9j0..." \ -H "Content-Type: application/json" \ -d '{"name": "auto-created"}'Management keys cannot be used for inference. Use consumption keys (
sk-...) for that.
Key lifecycle
Section titled “Key lifecycle”Subscription keys
Section titled “Subscription keys”Subscribe to a pool (reserve time blocks) → Create key (POST /api/keys/subscription) → Use during reserved hours → Key expires at period end → Renew- Reserve one or more time blocks on a pool via
POST /api/pools/:id/subscribe. - Create one or more keys for that subscription with
POST /api/keys/subscription. - Each key gives unlimited usage during your reserved blocks (no token caps).
- When a subscription key expires at the end of the billing period, only that specific key is revoked.
- You can hold multiple pool subscriptions to cover more time blocks, each with its own keys.
Throughput
Section titled “Throughput”| Type | Throughput | Concurrency |
|---|---|---|
| Pool (Unlimited) subscription | Unlimited during reserved blocks, no token caps | Capped simultaneous requests per key |
Combined keys
Section titled “Combined keys”A combined key spans two or more of your subscriptions under one sk-ci-meta-… credential. Every endpoint below works with either auth method (Firebase session or mk_ management key).
Member role values on the wire: "lane" = Parallel (adds a simultaneous request slot), "boost" = Boost (no slot — feeds sustained speed to the lanes).
List combined keys
Section titled “List combined keys”curl https://api.cheapestinference.com/api/meta-keys \ -H "Authorization: Bearer mk_your_management_key"{ "success": true, "data": [ { "id": "mk_uuid", "token": "sk-ci-meta-...", "label": "Production", "isActive": true, "createdAt": "2026-07-01T00:00:00.000Z", "rolesSelectable": true, "members": [ { "pledgeId": "sub_uuid", "role": "lane", "poolSlug": "core", "pledgeLabel": "Main agent", "pledgeStatus": "active", "keyActive": true, "hours": [0, 1, 2], "currentPeriodEnd": "2026-08-20T00:00:00.000Z", "windowOpenNow": true, "maxParallel": 1 } ] } ]}rolesSelectable is true when the key has 2+ members in a single pool — the precondition for assigning boost roles.
Create a combined key
Section titled “Create a combined key”Subscriptions must be active and keyless (delete a subscription’s standalone key first). roles is optional — omitted members join as "lane".
curl -X POST https://api.cheapestinference.com/api/meta-keys \ -H "Authorization: Bearer mk_your_management_key" \ -H "Content-Type: application/json" \ -d '{ "pledgeIds": ["sub_uuid_1", "sub_uuid_2", "sub_uuid_3"], "label": "Production", "roles": { "sub_uuid_3": "boost" } }'{ "success": true, "data": { "id": "mk_uuid", "token": "sk-ci-meta-...", "label": "Production", "createdAt": "..." } }Validation (each failure is a 400 with the reason in error):
- At least 2 subscriptions, no duplicates, all active and keyless.
- At least one member must be a
lane. boostroles require all members in the same pool.- A
boost’s covered hours must be fully covered by thelanemembers — otherwise the key would be off during part of the boost’s window.
Change member roles
Section titled “Change member roles”Same validation as creation. Members not listed keep their current role.
curl -X PATCH https://api.cheapestinference.com/api/meta-keys/mk_uuid/member-roles \ -H "Authorization: Bearer mk_your_management_key" \ -H "Content-Type: application/json" \ -d '{"roles": {"sub_uuid_2": "boost"}}'Returns the updated combined key (same shape as the list rows).
Update members
Section titled “Update members”Replaces the member set. Removed subscriptions are left keyless (create a fresh standalone key for them any time); added ones must be keyless and join as "lane"; retained members keep their roles.
curl -X PUT https://api.cheapestinference.com/api/meta-keys/mk_uuid/members \ -H "Authorization: Bearer mk_your_management_key" \ -H "Content-Type: application/json" \ -d '{"pledgeIds": ["sub_uuid_1", "sub_uuid_2"]}'Rename
Section titled “Rename”curl -X PATCH https://api.cheapestinference.com/api/meta-keys/mk_uuid \ -H "Authorization: Bearer mk_your_management_key" \ -H "Content-Type: application/json" \ -d '{"label": "Staging"}'Delete
Section titled “Delete”Never cancels the underlying subscriptions — they stay active and keyless.
curl -X DELETE https://api.cheapestinference.com/api/meta-keys/mk_uuid \ -H "Authorization: Bearer mk_your_management_key"{ "success": true, "data": { "deleted": true } }