Token
What is a Token?
A token is a key used for authentication when calling the API, similar to your "pass." Each time you call the API, you need to include your token in the request header.
Obtaining an API Key
- Log in to the Fast-API platform
- Go to the Token page in the dashboard
- Click Add Token in the upper right corner
- Fill in the name, keep other options as default
- Click Confirm to obtain the generated Key
The Key format is usually: sk-xxxx......
Token Configuration Options
| Option | Description |
|---|---|
| Name | The identifier name for the token, for easy management |
| Quota | The maximum quota the token can use, 0 means unlimited |
| Expiry Time | The token’s validity period, can be set to never expire |
| Model Scope | Restricts which models the token can access, leave empty for all |
| IP Whitelist | Restricts which IP addresses can use the token, leave empty for no restriction |
Security Recommendations
Security Notice
- Do not share your API Key with others or expose it in code repositories
- It is recommended to create different tokens for different projects
- If your token is leaked, delete it immediately and create a new one
Usage
Add the Authorization field to the request header:
Authorization: Bearer sk-yourAPIKey