API reference

API reference · Credits

Set or clear the low balance line

PUT/api/account/low-balanceSigned in session

A line set above the current balance sends nothing and arms once the balance reaches it. Same origin only; ten changes a minute.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
thresholdMicrosrequiredinteger or nullMicro USD, or null to clear the line. From 1 to 1000000000000.

Example

{
  "thresholdMicros": 1
}

Answer 200

The line as it now stands.

Fields of the 200 answer
FieldTypeWhat it is
thresholdMicrosinteger or nullThe line, or null when none is set.
fundedbooleanFalse for an account on the house allowance, which has no balance to fall.
balanceMicrosinteger or nullThe settled balance, holds excluded; null when not funded.
lowbooleanThe balance is under the line right now.
armedbooleanThe next fall below the line will send credits.low_balance.
firedAtinteger or null
shortfallMicrosintegerWhat brings the balance back to the line, rounded up to the cent.
topUpPathstring/billing/top-up, with ?amount= set to the shortfall when there is one.

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 403OpenAI shaped error.
  • 429OpenAI 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