Token Management
This document explains how to create and manage API tokens on the ANC Relay platform.
What is a Token?
A token is your credential for calling the API, equivalent to an API Key. Each token is independent, and you can:
- Create different tokens for different applications
- Set independent quota limits for each token
- Disable or delete tokens at any time
- Track the usage of each token
View Tokens
- Log in to the ANC Relay Console
- Click "Tokens" in the left menu
- View all created tokens in the token list
Token List Fields
| Field | Description |
|---|---|
| Name | Custom name for the token, for easy identification |
| Status | Enabled/Disabled status |
| Used Quota | Quota consumed by this token |
| Remaining Quota | Remaining available quota (shows "Unlimited" if no limit) |
| Created Time | When the token was created |
| Expiration Time | Token validity period (shows "Never Expires" if permanent) |
Create New Token
Steps
- Click the "Add Token" button on the token page
- Fill in the token information:
| Configuration | Description | Recommendation |
|---|---|---|
| Name | Token name for identification | Use meaningful names like "Claude-Code-Work-PC" |
| Expiration | Token validity period | Set as needed, choose "Never Expires" for long-term use |
| Quota | Maximum quota for the token | Set a reasonable limit to prevent accidental consumption |
| Model Restriction | Limit available models | Optional, leave empty to use all models |
| IP Restriction | Limit accessible IPs | Optional, enhances security |
- Click "Submit" to generate the token
- Important: Copy the displayed token value immediately!
Token Format
The generated token format looks like:
sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxManage Tokens
Edit Token
- Find the target token in the token list
- Click the "Edit" button
- You can modify:
- Name
- Expiration time
- Quota limit
- Model restriction
- IP restriction
- Click "Submit" to save changes
Disable/Enable Token
- Click the token status toggle to quickly switch between enabled/disabled states
- Disabled tokens cannot be used for API calls
- Re-enabling restores functionality
Delete Token
- Find the target token in the token list
- Click the "Delete" button
- Confirm the deletion
⚠️ Warning: Deletion is irreversible, please proceed with caution.
Token Best Practices
1. Categorized Management
Create separate tokens for different purposes:
✅ Recommended:
- Claude-Code-Work-PC
- Claude-Code-Personal-Laptop
- ChatGPT-Web-App
❌ Not Recommended:
- Using one token for all applications2. Set Quota Limits
Set reasonable quota limits for each token:
- Development/Testing: Set lower quota (e.g., $10)
- Production: Set based on estimated usage
- Personal Use: Set monthly budget limit
3. Regular Checks
- Regularly review token usage
- Delete unused tokens
- Check for abnormal consumption
4. Security Recommendations
- Never hardcode tokens in public code
- Use environment variables to store tokens
- Rotate important tokens regularly
- Enable IP restrictions for enhanced security
FAQ
Q: What if I lose my token?
A: Tokens cannot be recovered. You must delete the original token and create a new one.
Q: What if my token quota is exhausted?
A: You can edit the token to increase the quota, or top up your account balance and the quota will automatically recover.
Q: How many tokens can I create?
A: Regular users have a limit on the number of tokens they can create. Please check your account tier for details.
Q: What if my token is compromised?
A: Immediately disable or delete the token, create a new one, and review your account security settings.
