API reference

API reference · Webhooks

Register a webhook

POST/api/webhooksSigned in session

Deliveries carry x-antimatter-signature, a hex HMAC SHA-256 of the exact body under the whsec_ secret returned here once. Ten per account. Events: budget.threshold, key.created, key.revoked, price.change, alert.triggered, alert.resolved, credits.low_balance, plan.renewed, plan.ended, model.degraded, model.recovered, shadow.candidate_ready, shadow.auto_switched, shadow.savings_report, distill.completed, distill.proof_ready, studio.shot_finished, project.budget_threshold, spend.forecast_over_cap. credits.low_balance carries scope, thresholdMicros, balanceMicros, shortfallMicros and topUpUrl, once per fall below the account's line; plan.renewed and plan.ended (with reason cancelled, lapsed, withdrawn or frozen) carry the subscription's terms; model.degraded and model.recovered carry model, state, reason, since, the last hour's evidence and the thresholds, once per change of a model the account watches (PUT /api/account/model-watch).

Request body

application/json, required

Request body fields
FieldTypeWhat it is
urlrequiredstring
eventsrequiredarray of string

Example

{
  "url": "https://example.com",
  "events": [
    "string"
  ]
}

Answer 201

The endpoint and its signing secret.

Fields of the 201 answer
FieldTypeWhat it is
idinteger
urlstring
eventsarray of string
secretstringShown exactly once.

Errors

  • 400OpenAI 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