API reference/Balance & usage
Balance, Requests & Usage
Query the account balance, request records, usage summary, and key details with the current API key.
These endpoints query the current API key, using either Bearer or x-api-key. Production API keys are isolated by key id: requests made with key A do not appear when querying with key B, even when both keys belong to the same account. Request records come 20 per page, fixed by the server; contentType narrows them to one kind of request.
Want a daily spend summary, or a reminder before your balance runs out? Set up notifications and alerts →
On this pageexpand_more
Account Balancelink
/v1/dashboard/balanceReturns the account-level balance for the account that owns the current API key. Multiple keys in the same account share this balance; it is not a separate per-key balance. A procurement-order key returns that order's prepaid available, reserved, and settled amounts, with source: "market_order".
curl 'https://api.wokey.ai/v1/dashboard/balance' \
-H "Authorization: Bearer YOUR_API_KEY"{
"userId": "1234",
"availableUsd": 12.345678,
"reservedUsd": 0.1
}Response fields
availableUsd- Available balance in USD.
reservedUsd- Amount held for requests in progress; each is settled at its actual cost when it finishes.
source / marketOrderId / settledUsd- Procurement-order keys only: source is always market_order, marketOrderId is the order ID, and settledUsd is the amount already settled on that order.
Request Recordslink
/v1/requests?page=1Returns paginated request records from the last 90 days for the current API key. The server fixes page size at 20 records, so clients cannot change it with limit. Public fields include request ID, model, status, timestamps, tokens, cost, API key name, and masked key.
curl 'https://api.wokey.ai/v1/requests?page=1' \
-H "Authorization: Bearer YOUR_API_KEY"{
"data": [
{
"id": "20261107012345abc",
"modelId": "claude-sonnet-5-5",
"contentType": "text",
"status": "succeeded",
"errorCode": null,
"errorMessage": null,
"createdAt": "2026-11-07T01:23:45.000Z",
"completedAt": "2026-11-07T01:23:48.000Z",
"firstTokenMs": 1350,
"uploadMs": null,
"inputTokens": 1200,
"outputTokens": 300,
"cacheWriteTokens": 0,
"cacheReadTokens": 8000,
"usageSource": "upstream",
"estimatedInputTokens": null,
"actualAmount": "0.012345",
"apiKeyName": "prod-key",
"apiKeyPrefix": "sk-abcd...1234"
}
],
"pagination": { "page": 1, "limit": 20, "total": 42 }
}Some fields are left out of the sample.
Response fields
page- Query parameter. Page number, starting at 1; defaults to 1.
contentType- Optional query parameter. text, image, or video returns only that kind of request.
id- Request ID; include it when you contact support.
modelId- The model that served the request.
status- Request status, such as succeeded or failed.
errorCode / errorMessage- Error code and message for a failed request; null on success.
firstTokenMs / uploadMs- firstTokenMs: milliseconds from the request reaching Wokey to the first token the model returns (text, reasoning, or a tool call); streaming requests only, otherwise null. uploadMs: how much of that went to uploading the request to Wokey, returned only when it took 2 seconds or more, otherwise null. Both count from arrival, like createdAt.
inputTokens / outputTokens / cacheReadTokens / cacheWriteTokens- Token usage of the request. inputTokens is null when the upstream did not report input usage.
usageSource- upstream means input usage came from the upstream; estimate_fallback means the upstream did not report it and the request was settled on a local estimate, given in estimatedInputTokens.
actualAmount- Amount charged in USD, as a string.
apiKeyName / apiKeyPrefix- The key's name and masked display value.
pagination- page is the current page, limit the page size (always 20), and total the number of records.
Usage Summarylink
/v1/usageAggregates request count, success and failure count, total cost, input tokens, and output tokens for the current API key. The scope matches /v1/requests.
curl 'https://api.wokey.ai/v1/usage' \
-H "Authorization: Bearer YOUR_API_KEY"{
"requestCount": 42,
"succeededCount": 40,
"failedCount": 2,
"totalUsd": 1.234567,
"totalUsageUsd": 1.234567,
"total_usage": 123,
"inputTokens": 123456,
"outputTokens": 45678,
"apiKeyUsageLimit": {
"apiKeyId": "123",
"usageLimitUsd": "5.000000",
"usageSpentUsd": "1.234567",
"usageReservedUsd": "0.100000",
"usageRemainingUsd": "3.665433",
"usageLimitExceeded": false
}
}Response fields
requestCount / succeededCount / failedCount- Total, successful, and failed requests.
totalUsd- Total cost in USD. totalUsageUsd is the same value and total_usage is it in whole cents; both are kept for older clients.
inputTokens / outputTokens- Token totals. Only upstream-reported usage counts; locally estimated input is left out.
apiKeyUsageLimit- This key's cap: usageLimitUsd is the cap, usageSpentUsd what is settled, usageReservedUsd what is held for requests in progress, usageRemainingUsd what is left, and usageLimitExceeded whether it is used up. usageLimitUsd and usageRemainingUsd are null for an uncapped key.
API Key Infolink
/v1/keyReturns cumulative and rolling daily, weekly, and monthly usage plus the current key limit and remaining amount.
curl 'https://api.wokey.ai/v1/key' \
-H "Authorization: Bearer YOUR_API_KEY"{
"label": "sk-abcd...1234",
"usage": 1.234567,
"usage_daily": 0.123456,
"usage_weekly": 0.765432,
"usage_monthly": 1.234567,
"limit": 5,
"limit_remaining": 3.665433,
"limit_reset": null
}Response fields
label- The key's masked display value.
usage- Cumulative spend in USD.
usage_daily / usage_weekly / usage_monthly- Spend over the last 24 hours, 7 days, and 30 days.
limit- The key's cumulative spending cap; null for an uncapped key.
limit_remaining- The cap minus settled spend and amounts held for requests in progress, never below 0; null for an uncapped key.
limit_reset- The cap is cumulative and never resets on a schedule, so this is always null.