Skip to content

Management API

Everything you can do in the dashboard, you can do via API. Create a management key and use it to subscribe to plans, create API keys, top up credits, and manage your account — all programmatically. Perfect for CI/CD pipelines, SaaS platforms, and AI agents.

From the dashboard, switch to the Management Keys tab and create one. You’ll get a key starting with mk_. Save it — you won’t see it again.

All Management API requests use this key as a Bearer token:

Terminal window
curl https://api.cheapestinference.com/api/billing/status \
-H "Authorization: Bearer mk_your_management_key"

If you already have a card on file, subscribe instantly — no browser redirect needed:

Terminal window
curl -X POST https://api.cheapestinference.com/api/billing/subscribe \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"planSlug": "pro", "createKey": true, "keyName": "prod-api"}'
{
"success": true,
"data": {
"subscriptionId": "sub_uuid",
"planSlug": "pro",
"status": "active",
"currentPeriodEnd": "2026-04-24T00:00:00.000Z",
"key": {
"id": "key_uuid",
"name": "prod-api",
"apiKey": "sk_live_abc123..."
}
}
}

Set createKey: false (or omit it) to create a subscription without a key — you can create keys later with POST /api/keys/subscription.

If you haven’t saved a card yet, use checkout to add one:

Terminal window
curl -X POST https://api.cheapestinference.com/api/billing/checkout \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"planSlug": "pro"}'

Returns a sessionUrl — open it in a browser to complete payment. After that, your card is saved and you can use /subscribe for future subscriptions.

PlanBillingPriceRPMBudget per 8h
standardmonthly$30/mo200$0.22
promonthly$60/mo400$0.67
standard-annualannual~$270/yr200$0.22
pro-annualannual~$540/yr400$0.67

Annual plans charge upfront at a reduced effective monthly rate. Call GET /api/plans for the current authoritative prices. Rate limits are identical between monthly and annual.

You can hold multiple subscriptions — each one is an independent budget pool with its own keys.

Unlimited plans give you dedicated model access with no $ budget cap, unlimited throughput, and 1 concurrent request. You subscribe to 8-hour time blocks (Asia, Europe, Americas) and are charged monthly or annually with a discount for annual billing.

See the full reference at Unlimited Subscriptions API.

Use the -annual slug. Same flow, Stripe switches to a yearly interval and charges upfront:

Terminal window
curl -X POST https://api.cheapestinference.com/api/billing/subscribe \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"planSlug": "pro-annual", "createKey": true, "keyName": "prod-api"}'

For the first-time no-card flow, /api/billing/checkout accepts the same -annual slugs and opens a Stripe Checkout session with yearly billing.

Terminal window
curl https://api.cheapestinference.com/api/billing/status \
-H "Authorization: Bearer mk_your_management_key"
{
"success": true,
"data": {
"subscriptions": [
{
"id": "sub_uuid",
"planSlug": "pro",
"status": "active",
"currentPeriodEnd": "2026-03-05T10:00:00.000Z",
"cancelAtPeriodEnd": false,
"keyCount": 2,
"keys": [
{ "id": "key_uuid", "name": "prod-api", "isActive": true, "createdAt": "2026-02-03T10:00:00.000Z" },
{ "id": "key_uuid", "name": "staging", "isActive": true, "createdAt": "2026-02-03T10:00:00.000Z" }
]
}
],
"plan": "pro",
"status": "active",
"creditBalance": 25.00,
"stripeCustomerId": "cus_xxx",
"subscriptionExpiresAt": null,
"legacySubscriptionKeys": []
}
}

Each subscription supports unlimited keys. Create keys and assign them to a subscription:

Terminal window
curl -X POST https://api.cheapestinference.com/api/keys/subscription \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"name": "prod-api", "subscriptionId": "sub_uuid"}'
{
"success": true,
"data": {
"id": "key_uuid",
"name": "prod-api",
"apiKey": "sk_live_abc123..."
}
}

Save the apiKey — it’s shown only once. Use it to make inference requests:

Terminal window
curl https://api.cheapestinference.com/v1/chat/completions \
-H "Authorization: Bearer sk_live_abc123..." \
-H "Content-Type: application/json" \
-d '{"model": "deepseek/deepseek-chat-v3-0324", "messages": [{"role": "user", "content": "Hello"}]}'
Terminal window
curl -X POST https://api.cheapestinference.com/api/billing/topup \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"amount": 50, "method": "stripe"}'

Returns a sessionUrl to complete the payment. Minimum $10.

Terminal window
# 1. Get payment address
curl -X POST https://api.cheapestinference.com/api/billing/topup \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"amount": 50, "method": "usdc"}'
{
"success": true,
"data": {
"address": "0x...",
"chain": "base",
"amount": "50"
}
}
Terminal window
# 2. Send USDC on Base, then verify
curl -X POST https://api.cheapestinference.com/api/billing/verify-topup \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"txHash": "0xabc123...", "amount": 50}'

Credit keys deduct from your prepaid balance. Optionally set a per-key budget and rate limits:

Terminal window
curl -X POST https://api.cheapestinference.com/api/keys/credit \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"name": "client-acme", "maxBudget": 25, "rpm": 100, "tpm": 50000}'
ParameterTypeRequiredDescription
namestringYesKey name
maxBudgetnumberNoPer-key budget in USD (omit for shared pool)
rpmnumberNoRequests per minute limit
tpmnumberNoTokens per minute limit

7. Subscribe to an Unlimited (dedicated model) plan

Section titled “7. Subscribe to an Unlimited (dedicated model) plan”

Unlimited plans give you a specific model with no $ budget cap, by reserving 8-hour time blocks. Each pool exposes its own annualDiscount field on the list response. You can hold multiple subscriptions on the same pool to cover more time blocks. Full endpoint reference: Unlimited Subscriptions API.

Terminal window
# List available pools
curl https://api.cheapestinference.com/api/pools \
-H "Authorization: Bearer mk_your_management_key"
# Subscribe to the Europe block, billed annually
curl -X POST https://api.cheapestinference.com/api/pools/POOL_SLUG/subscribe \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"blocks": ["europe"], "quantity": 1, "billingCycle": "year"}'

Omit billingCycle (or pass "month") for monthly billing.

No API key is created automatically. Create it yourself:

Terminal window
# Create key for the most recent subscription
curl -X POST https://api.cheapestinference.com/api/keys/subscription \
-H "Authorization: Bearer mk_your_management_key"
# Or target a specific subscription
curl -X POST https://api.cheapestinference.com/api/keys/subscription \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"subscriptionId": "subscription_uuid"}'
# List all your subscriptions and their keys
curl https://api.cheapestinference.com/api/pools/POOL_SLUG/my-subscriptions \
-H "Authorization: Bearer mk_your_management_key"
Terminal window
# All-Models subscription
curl -X POST https://api.cheapestinference.com/api/billing/cancel \
-H "Authorization: Bearer mk_your_management_key" \
-H "Content-Type: application/json" \
-d '{"subscriptionId": "sub_uuid"}'
# Unlimited pool subscription
curl -X DELETE https://api.cheapestinference.com/api/pools/POOL_ID/pledge \
-H "Authorization: Bearer mk_your_management_key"

Both paths flip cancelAtPeriodEnd: true on Stripe’s side — the subscription stays active until the end of the billing period, then the key is revoked automatically. No refund is issued for unused time on annual subscriptions.

Terminal window
# List all consumption keys
curl https://api.cheapestinference.com/api/keys \
-H "Authorization: Bearer mk_your_management_key"
# Delete a key
curl -X DELETE https://api.cheapestinference.com/api/keys/KEY_ID \
-H "Authorization: Bearer mk_your_management_key"
Terminal window
MK="mk_your_management_key"
API="https://api.cheapestinference.com/api"
# 1. Subscribe to Pro
SESSION=$(curl -s -X POST $API/billing/checkout \
-H "Authorization: Bearer $MK" \
-H "Content-Type: application/json" \
-d '{"planSlug": "pro"}' | jq -r '.data.sessionUrl')
echo "Pay at: $SESSION"
# 2. After payment, check status
STATUS=$(curl -s $API/billing/status -H "Authorization: Bearer $MK")
SUB_ID=$(echo $STATUS | jq -r '.data.subscriptions[0].id')
# 3. Create a key
KEY=$(curl -s -X POST $API/keys/subscription \
-H "Authorization: Bearer $MK" \
-H "Content-Type: application/json" \
-d "{\"name\": \"my-app\", \"subscriptionId\": \"$SUB_ID\"}" | jq -r '.data.apiKey')
# 4. Use it
curl https://api.cheapestinference.com/v1/chat/completions \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek/deepseek-chat-v3-0324", "messages": [{"role": "user", "content": "Hello!"}]}'