API reference

API reference · Credits

The price lock offer, and this account's locks

GET/api/account/price-locksSigned in session

A price lock freezes one model's billed input and output rates for a number of days, with prepaid credit that only that model spends. A keyed request on the personal balance whose every model (fallbacks included) is the locked one is paid from the lock and billed, per rate, at the lower of the locked and today's rate, never more than without the lock. When the lock cannot hold the request's worst case, the balance pays at today's rates. At expiry the remainder returns to the balance; the premium is not refunded. Reading closes any lock that has run out.

Parameters

Path and query parameters
FieldTypeWhat it is
model (query)stringA model id, to quote a lock on it.

Answer 200

The offer and the account's locks.

Fields of the 200 answer
FieldTypeWhat it is
enabledrequiredbooleanFalse unless the operator set ANTIMATTER_PRICE_LOCK_PREMIUM_BPS, ANTIMATTER_PRICE_LOCK_MAX_DAYS and both exposure caps; a cap left unset is zero and sells no lock.
premiumBpsintegerThe premium, in basis points of the credit locked.
maxDaysintegerThe longest lock, at most 365 days.
minMicrosintegerThe smallest lock, 10000 micro dollars; amounts are whole cents.
modelobject or nullWith ?model=, what a lock on that model would freeze today.
model.idstring
model.cardobject or null
model.card.promptPer1MnumberUSD per 1M input tokens.
model.card.completionPer1MnumberUSD per 1M output tokens.
model.card.cacheReadPer1Mnumber or nullNull when none was published; cached input then bills at the input rate.
model.card.cacheWritePer1Mnumber or null
model.refusalstring or nullWhy it cannot be locked.
locksrequiredarray of object
locks[].idinteger
locks[].modelIdstring
locks[].cardobjectThe billed rates frozen on the day the lock was bought.
locks[].card.promptPer1MnumberUSD per 1M input tokens.
locks[].card.completionPer1MnumberUSD per 1M output tokens.
locks[].card.cacheReadPer1Mnumber or nullNull when none was published; cached input then bills at the input rate.
locks[].card.cacheWritePer1Mnumber or null
locks[].creditMicrosintegerThe prepaid credit moved into the lock.
locks[].premiumBpsinteger
locks[].premiumMicrosintegerCharged once at purchase as its own ledger line; never refunded.
locks[].daysinteger
locks[].statusstringOne of "open", "expired".
locks[].createdAtinteger
locks[].expiresAtinteger
locks[].closedAtinteger or null
locks[].returnedMicrosinteger or nullWhat went back to the balance at expiry.
locks[].balanceMicrosintegerWhat the lock can still spend, open holds taken off.
locks[].heldMicrosintegerHeld for requests in flight.
locks[].spentMicrosintegerSpent by requests the lock paid for.
locks[].marketobject or nullThe model's billed card today, for an open lock; null when it is not priced now.
locks[].market.promptPer1MnumberUSD per 1M input tokens.
locks[].market.completionPer1MnumberUSD per 1M output tokens.
locks[].market.cacheReadPer1Mnumber or nullNull when none was published; cached input then bills at the input rate.
locks[].market.cacheWritePer1Mnumber or null

Errors

  • 401OpenAI shaped error.

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