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 ErrorsWebhooks
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
POSTto yoururlwith 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
| Event | Trigger | Payload |
|---|---|---|
usage.recorded | Every logged API request | endpoint, model, provider, tokens, cost, duration, status |
billing.plan_changed | Plan changed via admin | plan, status |
apikey.revoked | Admin revokes a key | keyId, 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.