Get API-key usage
Returns daily usage for the authenticating API key only. Usage events are persisted asynchronously and may take a short time to appear.
/account/usageReturns daily usage for the authenticating API key only. Usage events are persisted asynchronously and may take a short time to appear.
Authorization
BearerAuth Tenant key supplied as the Authorization Bearer token.
In: header
Query Parameters
Inclusive RFC 3339 start time. Defaults to 30 days before to.
date-timeInclusive RFC 3339 end time. Defaults to the current time. The range may not exceed 90 days.
date-time1 <= length <= 2001 <= length <= 200Value in
- "tts"
- "stt"
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
const response = await fetch("https://api.allmodels.io/account/usage?capability=tts", { headers: { Authorization: `Bearer ${process.env.ALLMODELS_API_KEY}` }});if (!response.ok) throw new Error(`AllModels request failed: ${response.status}`);console.log(await response.json());import osimport requestsresponse = requests.get( "https://api.allmodels.io/account/usage?capability=tts", headers={"Authorization": f"Bearer {os.environ['ALLMODELS_API_KEY']}"}, timeout=30,)response.raise_for_status()print(response.json())curl https://api.allmodels.io/account/usage?capability=tts \ -H "Authorization: Bearer $ALLMODELS_API_KEY"{ "from": "2019-08-24T14:15:22Z", "to": "2019-08-24T14:15:22Z", "totals": { "request_count": 0, "credits": 1250000, "cost_usd": 1.25, "usage": [ { "unit": "characters", "amount": 0 } ] }, "points": [ { "date": "2019-08-24", "provider": "string", "model": "string", "capability": "tts", "usage_unit": "characters", "usage_amount": 0, "request_count": 0, "credits": 1250000, "cost_usd": 1.25 } ]}{ "error": "invalid_request"}{ "error": "invalid_request"}{ "error": "invalid_request"}{ "error": "invalid_request"}{ "error": "invalid_request"}Check account balance GET
Use this endpoint to check the paid and promotional credits associated with your API key. Authenticate with `Authorization: Bearer <apiKey>`. Use `spendable_paid_credits` to see the paid balance available for any request. Promotional credits can be limited to the provider and model combinations in `promotion_grants.targets`, so check each grant's `eligible` and `expires_at` values before relying on it. A `state` of `exhausted` means no balance is currently available for requests. One credit equals $0.000001. You can call this endpoint even when the balance is zero.
List API-key activity GET
Lists individual requests made with the authenticating API key, newest first. Activity is asynchronously persisted. Treat pagination cursors as opaque.
