API reference

API reference · Account

Replace the set of spend alerts

PUT/api/account/alertsSigned in session

Crossing a threshold fires the existing budget.threshold webhook event, once per window, on the edge. What you send is exactly what is armed.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
orgIdinteger or null
alertsrequiredarray of object
alerts[].periodrequiredstringOne of "day", "month".
alerts[].thresholdMicrosrequiredintegerMicro USD.

Example

{
  "orgId": 0,
  "alerts": [
    {
      "period": "day",
      "thresholdMicros": 0
    }
  ]
}

Answer 200

The alerts now armed.

The answer's fields are not named in the document.

Errors

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