TokenHub authenticates every request using an API key passed as a Bearer token in theDocumentation Index
Fetch the complete documentation index at: https://docs.inferoute.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header. You generate API keys in the TokenHub dashboard and can create multiple keys for different environments, teams, or applications.
Generate an API key
- Sign in to your TokenHub dashboard at tokenhub.ai.
- Go to Settings → API Keys.
- Click New API key.
- Enter a descriptive name for the key (for example,
production-appordev-local). - Optionally set an expiry date to limit how long the key remains valid.
- Click Create and copy the key immediately — it will not be shown again.
Pass the API key in requests
Include your API key in theAuthorization header of every request using the Bearer scheme.
Use environment variables
Store your API key in an environment variable rather than hardcoding it in your application. The recommended variable name isTOKENHUB_API_KEY.
.env file loaded by your framework, or through your cloud provider’s secrets manager).
Invalid and expired keys
If you provide a missing, malformed, or expired API key, TokenHub returns a401 Unauthorized response:
401 error:
- The
Authorizationheader is present and uses theBearerprefix. - The key was copied correctly with no leading or trailing whitespace.
- The key has not expired (check Settings → API Keys in the dashboard).
- The key has not been revoked.
Security best practices
- Use environment variables — never hardcode an API key in source code or configuration files.
- Never commit keys to version control — add
.envand any secrets files to your.gitignore. - Create separate keys per environment — use distinct keys for development, staging, and production so you can revoke one without affecting the others.
- Set expiry dates — use short-lived keys for CI pipelines and temporary integrations.
- Rotate keys regularly — revoke and replace keys periodically, especially after a team member leaves or a potential exposure.
- Limit key scope — if your use case allows, create keys with restricted permissions rather than full-access keys.