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.
1. Create a management key
Section titled “1. Create a management key”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:
curl https://api.cheapestinference.com/api/billing/status \ -H "Authorization: Bearer mk_your_management_key"2. Subscribe to a plan
Section titled “2. Subscribe to a plan”Start a recurring Stripe subscription:
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"}'{ "sessionUrl": "https://checkout.stripe.com/c/pay/cs_live_..."}Open sessionUrl in a browser to complete payment. After Stripe processes the payment, the subscription activates automatically via webhook.
Available plans
Section titled “Available plans”| Plan | Price | RPM | Budget per 5h |
|---|---|---|---|
standard | $20/mo | 60 | $0.14 |
pro | $60/mo | 200 | $0.42 |
You can hold multiple subscriptions — each one is an independent budget pool with its own keys.
3. Check subscription status
Section titled “3. Check subscription status”curl https://api.cheapestinference.com/api/billing/status \ -H "Authorization: Bearer mk_your_management_key"{ "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" }, { "id": "key_uuid", "name": "staging" } ] } ], "creditBalance": "25.00"}4. Create API keys from a subscription
Section titled “4. Create API keys from a subscription”Each subscription supports unlimited keys. Create keys and assign them to a subscription:
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"}'{ "id": "key_uuid", "name": "prod-api", "apiKey": "sk_live_abc123..."}Save the apiKey — it’s shown only once. Use it to make inference requests:
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"}]}'5. Top up credits
Section titled “5. Top up credits”Via Stripe (card)
Section titled “Via Stripe (card)”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.
Via USDC on Base
Section titled “Via USDC on Base”# 1. Get payment addresscurl -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"}'{ "address": "0x...", "chain": "base", "amount": "50"}# 2. Send USDC on Base, then verifycurl -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}'6. Create credit keys
Section titled “6. Create credit keys”Credit keys deduct from your prepaid balance. Optionally set a per-key budget and rate limits:
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}'| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Key name |
maxBudget | number | No | Per-key budget in USD (omit for shared pool) |
rpm | number | No | Requests per minute limit |
tpm | number | No | Tokens per minute limit |
7. Cancel a subscription
Section titled “7. Cancel a 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"}'The subscription stays active until the end of the billing period, then keys are revoked automatically.
8. List and delete keys
Section titled “8. List and delete keys”# List all consumption keyscurl https://api.cheapestinference.com/api/keys \ -H "Authorization: Bearer mk_your_management_key"
# Delete a keycurl -X DELETE https://api.cheapestinference.com/api/keys/KEY_ID \ -H "Authorization: Bearer mk_your_management_key"Full flow example
Section titled “Full flow example”MK="mk_your_management_key"API="https://api.cheapestinference.com/api"
# 1. Subscribe to ProSESSION=$(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 statusSTATUS=$(curl -s $API/billing/status -H "Authorization: Bearer $MK")SUB_ID=$(echo $STATUS | jq -r '.data.subscriptions[0].id')
# 3. Create a keyKEY=$(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 itcurl 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!"}]}'