Skip to content
Request
Response

Auth

Authentication and authorization documentation.

Authentication Methods

API Key Authentication

API Key is the primary credential for accessing ai.TokenHub API.

Header Format:

Authorization: Bearer YOUR_API_KEY

OAuth 2.0 Authentication

Supports OAuth 2.0 protocol for third-party application authorization.

API Key Types

TypePurposePermission
Test KeyDevelopment & TestingLimited models and quota
Production KeyProduction EnvironmentAll models and features

Security Best Practices

  1. Key Security: Do not hardcode keys in client code
  2. Regular Rotation: Rotate API Keys regularly
  3. Least Privilege: Assign permissions as needed
  4. Monitor Logs: Check API call logs regularly
  5. IP Restrictions: Enable IP whitelist