Back to Docs
Authentication

API Keys

All API requests require a valid API key in the Authorization header.

Key format

API keys follow the format hg_.... The prefix indicates a secret key — never expose it in client-side code.

Authorization: Bearer hg_sk_live_abc123def456

Best practices

  • Store API keys in environment variables, never in source code.
  • Use different keys for development, staging, and production.
  • Rotate keys regularly and revoke unused keys immediately.
  • Monitor API key usage in the dashboard for anomalous activity.

Error responses

StatusCodeDescription
401invalid_api_keyThe API key is missing, malformed, or revoked.
403insufficient_permissionsThe API key does not have permission for this resource.
429rate_limit_exceededToo many requests. Wait and retry.