Every request to the TokModel API must include an API key. Keys are created in the TokModel console and passed as a bearer token in theDocumentation Index
Fetch the complete documentation index at: https://docs.tokmodel.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header. You can create multiple keys — one per environment or application — so that you can rotate or revoke them independently without disrupting other services.
Create your first API key
Open the console
Go to https://tokmodel.com/console and log in to your account.
Navigate to API keys
In the left sidebar, click API Keys. You will see a list of any keys you have already created.
Name your key
Enter a descriptive name such as
production-backend or dev-local. A clear name makes it easier to identify and revoke a specific key later.Key naming and organization
Use names that reflect where and how the key is used. Good examples:prod-api-server— the key used by your production backendstaging-worker— a background job in a staging environmentlocal-dev-alice— a personal key for local development
key1 or test. When you need to revoke a key after a credential leak, an ambiguous name makes it harder to identify the right one quickly.
Use a key in API requests
Pass your key as a bearer token in theAuthorization header of every request.
Set the key as an environment variable
Store your key in an environment variable rather than hard-coding it in source files. This keeps credentials out of version control.Rotate a key
If you suspect a key has been compromised, or you want to rotate credentials as a routine security practice:- Create a new API key in the console and give it a name that reflects its purpose.
- Deploy the new key to your application or environment.
- Verify that the new key is working correctly in production.
- Revoke the old key (see below).
Revoke a key
To delete a key, open the API Keys page in the console, find the key by name, and click Revoke. The key is immediately invalidated — any in-flight or future requests using it will receive a401 Unauthorized response.
Security best practices
- Never share API keys. Do not paste keys in chat messages, emails, GitHub issues, or support tickets.
- Use environment variables. Never hard-code a key directly in source code or commit it to a repository.
- Use one key per environment. Separate keys for development, staging, and production make it easy to rotate credentials in one environment without affecting others.
- Revoke unused keys. Delete keys that are no longer needed to minimize your attack surface.
- Audit periodically. Review the API Keys list regularly and remove any keys whose purpose you no longer recognize.