Skip to content

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

  1. Log in to the ANC Relay Console
  2. Click "Tokens" in the left menu
  3. View all created tokens in the token list

Token List Fields

FieldDescription
NameCustom name for the token, for easy identification
StatusEnabled/Disabled status
Used QuotaQuota consumed by this token
Remaining QuotaRemaining available quota (shows "Unlimited" if no limit)
Created TimeWhen the token was created
Expiration TimeToken validity period (shows "Never Expires" if permanent)

Create New Token

Steps

  1. Click the "Add Token" button on the token page
  2. Fill in the token information:
ConfigurationDescriptionRecommendation
NameToken name for identificationUse meaningful names like "Claude-Code-Work-PC"
ExpirationToken validity periodSet as needed, choose "Never Expires" for long-term use
QuotaMaximum quota for the tokenSet a reasonable limit to prevent accidental consumption
Model RestrictionLimit available modelsOptional, leave empty to use all models
IP RestrictionLimit accessible IPsOptional, enhances security
  1. Click "Submit" to generate the token
  2. Important: Copy the displayed token value immediately!

Token Format

The generated token format looks like:

sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Manage Tokens

Edit Token

  1. Find the target token in the token list
  2. Click the "Edit" button
  3. You can modify:
    • Name
    • Expiration time
    • Quota limit
    • Model restriction
    • IP restriction
  4. 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

  1. Find the target token in the token list
  2. Click the "Delete" button
  3. 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 applications

2. 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.