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
| Field | Type | What it is |
|---|---|---|
| thresholdMicrosrequired | integer or null | Micro USD, or null to clear the line. From 1 to 1000000000000. |
Example
{
"thresholdMicros": 1
}Answer 200
The line as it now stands.
| Field | Type | What it is |
|---|---|---|
| thresholdMicros | integer or null | The line, or null when none is set. |
| funded | boolean | False for an account on the house allowance, which has no balance to fall. |
| balanceMicros | integer or null | The settled balance, holds excluded; null when not funded. |
| low | boolean | The balance is under the line right now. |
| armed | boolean | The next fall below the line will send credits.low_balance. |
| firedAt | integer or null | |
| shortfallMicros | integer | What brings the balance back to the line, rounded up to the cent. |
| topUpPath | string | /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.