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_KEYOAuth 2.0 Authentication
Supports OAuth 2.0 protocol for third-party application authorization.
API Key Types
| Type | Purpose | Permission |
|---|---|---|
| Test Key | Development & Testing | Limited models and quota |
| Production Key | Production Environment | All models and features |
Security Best Practices
- Key Security: Do not hardcode keys in client code
- Regular Rotation: Rotate API Keys regularly
- Least Privilege: Assign permissions as needed
- Monitor Logs: Check API call logs regularly
- IP Restrictions: Enable IP whitelist