allmodels.ioDocs
API ReferenceAccount

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.

GET/account/usage

Returns daily usage for the authenticating API key only. Usage events are persisted asynchronously and may take a short time to appear.

Authorization

BearerAuth
AuthorizationBearer <token>

Tenant key supplied as the Authorization Bearer token.

In: header

Query Parameters

from?string

Inclusive RFC 3339 start time. Defaults to 30 days before to.

Formatdate-time
to?string

Inclusive RFC 3339 end time. Defaults to the current time. The range may not exceed 90 days.

Formatdate-time
provider?string
Length1 <= length <= 200
model?string
Length1 <= length <= 200
capability?string

Value in

  • "tts"
  • "stt"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

Client
Language
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());
{  "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"}