Webhooks — OneHub

Subscribe an endpoint to receive real-time events when usage is recorded, billing changes, or API keys are created or revoked.

Docs Docs Quick Start Authentication SDK Setup Available Models Rate Limits Chat Completions Streaming List Models Embeddings Image Generation Text to Speech Speech to Text Billing & Wallet Webhooks Errors

Webhooks

Subscribe

Webhook subscriptions are created and managed from your dashboard (there is no public HTTP API). Each subscription is stored in the webhooks Convex table; deliveries are signed with the subscription secret (auto-generated or custom) via api.webhooks.create internally.

Delivery

  • POST to your url with a JSON body: { event, data, timestamp }.
  • Signature header: x-onehub-signature: sha256=<hmac> — HMAC-SHA256 of the raw request body using the subscription secret.
  • Event header: x-onehub-event (e.g. usage.recorded, billing.plan_changed, apikey.revoked).
  • If a delivery fails or returns non-2xx, it is not retried automatically. Inspect your endpoint logs.

Events

EventTriggerPayload
usage.recordedEvery logged API requestendpoint, model, provider, tokens, cost, duration, status
billing.plan_changedPlan changed via adminplan, status
apikey.revokedAdmin revokes a keykeyId, name

Manage subscriptions

Remove a subscription from the dashboard Webhooks section, or call api.webhooks.remove (which deletes the row). Deliveries to removed/disabled subscriptions stop immediately.