Skip to content

Usage

Usage endpoints return spend data tracked by the platform.

GET /v1/usage

Returns budget, rate limits, plan info, credit balance, and key metadata for the authenticated key. Authenticate with your consumption key (sk_xxx) — no dashboard session required.

Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx
Terminal window
curl https://api.cheapestinference.com/v1/usage \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx"
{
"budget": {
"spent": 1.23,
"limit": 10.0,
"duration": "30d",
"resets_at": "2026-02-15T10:00:00.000Z"
},
"rate_limits": {
"rpm": 60,
"tpm": 3333
},
"plan": {
"slug": "standard",
"status": "active",
"expires_at": "2026-02-15T10:00:00.000Z"
},
"credits": {
"balance": 5.0
},
"key": {
"name": "prod-key",
"type": "subscription",
"created_at": "2026-01-15T10:00:00.000Z"
}
}
FieldDescription
budget.spentTotal spend in USD for the current budget period
budget.limitBudget cap (null if unlimited)
budget.durationBudget reset interval (e.g. "30d")
budget.resets_atNext budget reset timestamp
rate_limits.rpmRequests per minute limit
rate_limits.tpmTokens per minute limit
plan.slugPlan tier ("standard", "pro", or null for credit keys)
plan.statusSubscription status ("active", "expired")
plan.expires_atSubscription expiration timestamp
credits.balanceAccount credit balance in USD
key.nameKey label
key.type"subscription" or "credit"
key.created_atKey creation timestamp
StatusReason
401Missing, invalid, or unrecognized API key
403Key is deactivated
404Key not found in the system
429Rate limit exceeded
502Usage data temporarily unavailable

The following endpoints use dashboard authentication (session token or management key mk_).

GET /api/usage

Returns all your keys with usage stats across 4 time periods and subscription info. Rate limited to 12 requests per 12 hours.

Terminal window
curl https://api.cheapestinference.com/api/usage \
-H "Authorization: Bearer mk_your_management_key"
{
"success": true,
"data": [
{
"id": "key-uuid",
"name": "user-alice",
"type": "subscription",
"plan": "pro",
"isActive": true,
"usage": {
"last1h": { "requests": 3, "tokens": 8200, "promptTokens": 7800, "completionTokens": 400 },
"last24h": { "requests": 45, "tokens": 128000, "promptTokens": 120000, "completionTokens": 8000 },
"last7d": { "requests": 312, "tokens": 890000, "promptTokens": 840000, "completionTokens": 50000 },
"last30d": { "requests": 1287, "tokens": 35895828, "promptTokens": 35634452, "completionTokens": 261376 }
},
"subscription": {
"status": "active",
"expiresAt": "2026-04-23T15:12:31.565Z"
},
"createdAt": "2026-03-05T13:29:01.800Z"
}
]
}
FieldDescription
idKey UUID
nameKey label
type"subscription" or "credit"
planPlan tier ("standard", "pro", or "credits")
isActiveWhether the key is currently active
usageRequest and token counts across 4 periods: last1h, last24h, last7d, last30d
subscriptionPresent for subscription keys — status and expiry
createdAtKey creation timestamp

This endpoint is rate limited to 12 requests per 12 hours. Cache the response client-side.


GET /api/usage/:keyId

Returns info for a specific key (by UUID).

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

Returns the same shape as a single item from the list above.


GET /api/plans

Returns all available plans with rate limits and pricing. No authentication required.

Terminal window
curl https://api.cheapestinference.com/api/plans
[
{
"slug": "standard",
"name": "Standard",
"priceUsdc": "20",
"rateLimits": {
"tpm_limit": 3333,
"rpm_limit": 60
}
},
{
"slug": "pro",
"name": "Pro",
"priceUsdc": "60",
"rateLimits": {
"tpm_limit": 13333,
"rpm_limit": 200
}
}
]