Account
Create API Token
Create a new API token via API
POST
Documentation Index
Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
Use this file to discover all available pages before exploring further.
- Create a new API token via API
- Customize token name and expiration time
- Configure quota limits and model restrictions
- Token key is only returned once upon creation
Authorizations
All endpoints require Bearer Token authenticationGet your API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:
Body
Token name, maximum 50 charactersExample:
"My New Token"Token expiration time (Unix timestamp in seconds)
- Set to
-1for never expires - Set to a specific timestamp to expire at that time
1738483200 (2025-02-02 00:00:00 UTC)Token remaining quota (internal units)Conversion:
500000 = $1 USDExample: 500000 (equivalent to $1)Token remaining credits. If provided, it overrides
remain_quotaConversion: 200 credits = $1 USD = 500000 internal quotaExample: 200 (equivalent to $1)Daily token limit in credits. If provided, it is converted to
daily_quotaExample: 100 (equivalent to $0.5 daily limit)Monthly token limit in credits. If provided, it is converted to
monthly_quotaExample: 1000 (equivalent to $5 monthly limit)Whether the token has unlimited quota
true: Unlimited quota, no restrictionsfalse: Limited quota, usesremain_quotavalue
falseWhether to enable model restrictions
true: Enable model restrictions, only models inmodel_limitscan be usedfalse: No model restrictions
falseList of allowed models (comma-separated)Only effective when
model_limits_enabled is trueExample: "gpt-4o,gpt-4o-mini,claude-3-5-sonnet"Token group nameUsed to specify the channel group for this tokenExample:
"default"Response
Whether the request was successful
Error message (only returned on failure)
Created token information (returned on success)
Use Cases
- Automate creation of multiple API tokens
- Create separate tokens for different applications or services
- Batch manage token lifecycle through scripts
Token Key FormatThe
key field returned upon success is a 48-character random string. When using, add the sk- prefix for the complete format: sk-xxxxxxxx...Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| 令牌名称过长 | Name exceeds 50 characters | Use a shorter token name |
| 生成令牌失败 | Internal system error | Retry later or contact support |
| Authentication failed | API Key is invalid or expired | Check if the API Key is correct |