Authentication — OneHub

Every OneHub API request requires a key in the Authorization header.

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

Authentication

All endpoints require a OneHub API key in the Authorization header as a Bearer token:

Authorization: Bearer sk-onehub-xxxxxxxxxxxxxxxx

Key scopes

  • Keys are scoped to your account and plan.
  • Model access is checked against your plan at request time — paid models return 403 if not unlocked.
  • Rate limits are enforced per key.

Storage & rotation

  • Keys are SHA-256 hashed in storage — the full key is only shown once when created.
  • Create a new key and delete the old one to rotate. Revoked keys stop working immediately.
  • You can subscribe to apikey.revoked events via Webhooks.

Errors

A missing or invalid key returns 401 Unauthorized with the OpenAI error format. See Errors.