CrossModel

Usage

Read your spend, token, and request counts across the current day, week, and month. Read-only and suitable for polling.

Endpoint

GET https://api.crossmodel.ai/v1/usage
Authorization: Bearer cm-YOUR_KEY
# Or: x-api-key: cm-YOUR_KEY

Accepts either OpenAI-style Authorization: Bearer or Anthropic-style x-api-key authentication.

Get usage

GET /v1/usage

curl https://api.crossmodel.ai/v1/usage \
  -H "Authorization: Bearer cm-YOUR_KEY"

Anthropic-style authentication works on the same URL:

curl https://api.crossmodel.ai/v1/usage \
  -H "x-api-key: cm-YOUR_KEY"
{
  "currency": "USD",
  "daily": {
    "cost_micro": 152340,
    "prompt_tokens": 18230,
    "completion_tokens": 4120,
    "total_tokens": 22350,
    "request_count": 12,
    "success_count": 12
  },
  "weekly": {
    "cost_micro": 982110,
    "prompt_tokens": 120400,
    "completion_tokens": 28900,
    "total_tokens": 149300,
    "request_count": 86,
    "success_count": 84
  },
  "monthly": {
    "cost_micro": 3450980,
    "prompt_tokens": 410200,
    "completion_tokens": 96500,
    "total_tokens": 506700,
    "request_count": 312,
    "success_count": 305
  }
}

The usage object

FieldTypeNotes
currencystringCurrency of all cost_micro fields, e.g. USD.
dailyobjectUsage window for the current UTC day (since 00:00 UTC).
weeklyobjectUsage window for the current ISO week (since Monday 00:00 UTC).
monthlyobjectUsage window for the current calendar month (since the 1st, 00:00 UTC).

Each window object has the same shape. cost_micro is in micro units of currency (1 USD = 1,000,000 micro); divide by 1,000,000 for the decimal amount.

FieldTypeNotes
cost_microintegerTotal spend in the window, in micro units.
prompt_tokensintegerSum of input tokens.
completion_tokensintegerSum of output tokens.
total_tokensintegerSum of total tokens.
request_countintegerTotal requests (all statuses).
success_countintegerRequests that completed successfully.

Windows use UTC calendar boundaries. Values are cached briefly (about 60 seconds), so very recent requests may take up to a minute to appear.

Errors

Bearer-authenticated requests use the OpenAI-compatible error format; requests carrying a non-empty x-api-key use the Anthropic-compatible error format (see Models for both shapes).

HTTP statustypeCommon codeNotes
401authentication_errormissing_api_key, invalid_api_keyAPI key missing or invalid.
500api_errordb_errorA CrossModel internal error.