API Reference
Key status
GET
https://console.aimodelhub.ai/v1/key
Returns the calling key's label, its optional spend cap, its usage over the last day and 30 days, and the current wallet balance, so that an app can check status and remaining budget programmatically.
Example response
JSON
{
"data": {
"label": "Production · web app",
"limit": null,
"limit_remaining": null,
"usage": 0.0000823,
"usage_daily": 0.0000823,
"usage_monthly": 0.0000823,
"wallet_balance": 25.00
}
}All amounts are in USD. limit and limit_remaining are null when the key has no monthly cap (as above). Set one when creating the key to see them populated, e.g. {"limit": 50, "limit_remaining": 47.5}. Once usage_monthly reaches limit, the key returns 402 insufficient_quota with the message This key reached its spend cap. The cap is checked before each call, so the request that crosses it still completes and usage can finish slightly above limit.