Skip to content

Credits & Top-ups

Credits let you use the API without a monthly subscription. Top up your balance, and usage is deducted automatically until your credits run out.

All endpoints require authentication.

POST /api/billing/topup
ParameterTypeRequiredDescription
amountnumberYesTop-up amount in USD (minimum $10)
methodstringYesstripe or usdc
Terminal window
curl -X POST https://api.cheapestinference.com/api/billing/topup \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"amount": 50, "method": "stripe"}'
{
"sessionUrl": "https://checkout.stripe.com/c/pay/cs_live_...",
"sessionId": "cs_live_..."
}
Terminal window
curl -X POST https://api.cheapestinference.com/api/billing/topup \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"amount": 50, "method": "usdc"}'
{
"address": "0x...",
"chain": "base",
"amount": 25
}

POST /api/billing/verify-topup

After sending USDC on-chain, verify the transaction to credit your account.

ParameterTypeRequiredDescription
txHashstringYesBase L2 transaction hash
amountnumberYesAmount sent (must match)
Terminal window
curl -X POST https://api.cheapestinference.com/api/billing/verify-topup \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"txHash": "0xabc123...", "amount": 25}'
{
"credited": 25,
"balance": "75.00"
}

GET /api/billing/credits

Returns your current credit balance and usage.

Terminal window
curl https://api.cheapestinference.com/api/billing/credits \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
{
"totalTopUp": "100.00",
"remaining": "74.50",
"hasCreditKey": true,
"creditKeyId": "clx3ghi..."
}
FieldDescription
totalTopUpTotal amount you’ve ever topped up
remainingCurrent available balance (real-time tracking)
hasCreditKeyWhether you have a credit key
creditKeyIdID of your credit key (if exists)

When you make your first top-up, a credit key is automatically created. This is a special API key with plan credits that uses budget-based tracking instead of subscription-based rate limits.

  • The credit key has a 60 RPM rate limit
  • There is no token-per-minute limit — spend is tracked in USD
  • The system tracks max_budget and spend for the key
  • When spend >= max_budget, further requests fail with a budget error

All credit usage for your account goes through your single credit key. The balance is shared — if you use it from multiple applications, they all draw from the same pool.

Each top-up adds to your existing budget:

Current max_budget: $50, spent: $20 (remaining: $30)
Top up $25
New max_budget: $75, spent: $20 (remaining: $55)
SubscriptionCredits
Payment$20 or $60/month (one-time, 30 days)$10+ per top-up
Rate limitsRPM + TPM per key60 RPM only
BillingFlat rate, unlimited usage within limitsPay per token used
Expiration30 days, then keys revokedNever expires, consumed until depleted
Key creationManual, choose name and planAutomatic on first top-up

You can have both an active subscription and credits simultaneously. Subscription keys use rate-limited access; credit keys use budget-based access.