API reference

API reference · API

The balance this key spends

GET/v1/creditsAPI key

For a client that holds only the key: whether the account has deposited, the spendable balance with holds taken off, and for an account that never deposited the free allowance left. An organization key reads the organization's shared balance. Takes the read scope, which every key minted with the defaults holds.

Answer 200

The credit standing.

Headers: x-antimatter-request-id, x-request-id

Fields of the 200 answer
FieldTypeWhat it is
object"credits"
accountstringOne of "personal", "organization".
fundedbooleanTrue once the account has deposited; until then it spends a free allowance.
balance_microsinteger or nullThe spendable balance, holds on requests in flight taken off. Null until funded.
balancenumber or nullThe same, in dollars.
held_microsintegerWhat requests in flight hold right now.
free_allowanceobject or nullAn account that never deposited: its lifetime free allowance. Null otherwise.
free_allowance.allowance_microsinteger
free_allowance.spent_microsinteger
free_allowance.remaining_microsinteger
free_allowance.remainingnumber
free_allowance.exhaustedboolean
currency"USD"

Errors

  • 401OpenAI shaped error.
  • 403OpenAI shaped error.
  • 429Rate limited, or a spent budget or spend cap. The type distinguishes rate_limit_error, policy_exceeded, and spend_cap_exceeded.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter