Skip to content

Endpoints

Key

Read the calling key's limit and spend, and the account's available credit and free credit.

GET/v1/key

Returns details about the key in the request. Use it to check credit from a script or a statusline. Send the key as Authorization: Bearer sk-df-... or x-api-key.

Example

curl https://deference.si/v1/key \
  -H "Authorization: Bearer $DEFERENCE_API_KEY"

Response

{
  "data": {
    "name": "claude-code",
    "label": "sk-df-Ab3x…Qz9k",
    "limit": 50,
    "usage": 12.4,
    "limit_remaining": 37.6,
    "credit_available": 112.8,
    "free_credit_available": 1.25,
    "free_credit_expires_at": "2026-11-07T00:00:00.000Z",
    "expires_at": null
  }
}

Fields

namestring
The key's name.
labelstring
The masked key.
limitnumber | null
The key's credit limit in dollars, or null for no limit.
usagenumber
Dollars the key has spent.
limit_remainingnumber | null
The limit minus usage and minus the credit the key's running requests hold, never below 0, or null for no limit. This is what a new request on the key can use.
credit_availablenumber
The account's credit balance minus held credit, in dollars, and 0 when that is negative. This does not include free credit.
free_credit_availablenumber
The account's free credit that can still be spent, in dollars: grants that have not expired, less what running requests hold. 0 when there is none. See Free credit.
free_credit_expires_atstring | null
An ISO 8601 time: when the next free credit expires. null when there is no free credit, or none of it expires.
expires_atstring | null
An ISO 8601 time, or null if the key does not expire.

Errors

A bad key returns the key errors in Authentication, in the OpenAI envelope.