Your API key is the credential that authenticates every request you send to 元任务 AI 网关. The gateway accepts keys in the standardDocumentation Index
Fetch the complete documentation index at: https://docs.metask.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer header, making it compatible with any OpenAI-compatible library or tool. You can create multiple keys to isolate access by project, environment, or team member, and revoke any key instantly from the dashboard.
Create an API key
Open the dashboard
Log in at napi.origintask.cn and go to your dashboard.
Create a new key
Click Create Key (or New Token). Enter a descriptive name — for example,
production-app or dev-laptop — so you can identify the key later.Use the API key in requests
Pass your key as a Bearer token in theAuthorization header of every request.
Manage multiple keys
You can create as many keys as you need. A common pattern is to create separate keys for each environment or application so that you can rotate or revoke one key without affecting others.Per-environment keys
Create one key for development and a separate key for production. Rotate them independently without disrupting the other environment.
Per-project keys
Give each project or integration its own key. If a project is decommissioned, delete only that key to immediately cut off access.
Rotate a key
Key rotation replaces an existing key with a new one to limit the impact of a potential leak.Create a replacement key
Follow the steps above to create a new key with a clear name indicating it is the replacement.
Update your applications
Replace the old key value with the new one in every application, service, or environment variable that uses it.
Delete a key
To revoke a key, open the API Keys section in the dashboard, locate the key in the list, and click Delete (or the trash icon). Deletion takes effect immediately — any request using that key will be rejected with a401 Unauthorized error.
Security best practices
Protecting your API keys prevents unauthorized usage and unexpected charges against your balance.- Use environment variables — Store keys in environment variables or a secrets manager instead of hardcoding them in source files.
- Never commit keys to source control — Add
.envfiles to.gitignoreand audit your repository history if a key was accidentally committed. - Create separate keys per environment — Use different keys for development, staging, and production so a leaked dev key cannot affect production.
- Rotate keys periodically — Replace keys on a regular schedule or immediately after any suspected exposure.
- Delete unused keys — Remove keys for deprecated projects or former team members right away to minimize the attack surface.
If you suspect a key has been compromised, delete it from the dashboard immediately. The revocation is instantaneous, stopping any further unauthorized use.