Credits
Read your wallet balance. This is a lightweight, read-only endpoint suitable for polling from dashboards and menu-bar tools.
Endpoint
GET https://api.crossmodel.ai/v1/credits
Authorization: Bearer cm-YOUR_KEY
# Or: x-api-key: cm-YOUR_KEYAccepts either OpenAI-style Authorization: Bearer or Anthropic-style
x-api-key authentication.
Get balance
GET /v1/credits
curl https://api.crossmodel.ai/v1/credits \
-H "Authorization: Bearer cm-YOUR_KEY"Anthropic-style authentication works on the same URL:
curl https://api.crossmodel.ai/v1/credits \
-H "x-api-key: cm-YOUR_KEY"{
"currency": "USD",
"balance_micro": 12340000,
"uncollected_micro": 0
}The credits object
All amounts are integers in micro units of currency (1 USD = 1,000,000
micro). Divide by 1,000,000 to get the decimal amount.
| Field | Type | Notes |
|---|---|---|
currency | string | Wallet currency, e.g. USD. |
balance_micro | integer | Spendable balance, in micro units. Divide by 1,000,000 for the dollar amount. |
uncollected_micro | integer | Funds currently held by in-flight requests (settlement pending), in micro units. Usually 0. |
A user with no wallet yet returns zeros.
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 status | type | Common code | Notes |
|---|---|---|---|
401 | authentication_error | missing_api_key, invalid_api_key | API key missing or invalid. |
500 | api_error | db_error | A CrossModel internal error. |