Every request to the 元任务 AI 网关 API must be authenticated. The gateway uses Bearer token authentication: you pass your API key in theDocumentation 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 header of each request. There are no cookies, sessions, or other authentication mechanisms — just your key in the header.
How to authenticate
Set theAuthorization header to Bearer YOUR_API_KEY on every request:
To get an API key, log in to your dashboard and open the Settings → API Keys section. You can create multiple keys and revoke them individually.
Examples
Authentication failures
When a request fails authentication, the API returns a401 Unauthorized response. This happens when:
- The
Authorizationheader is missing entirely. - The token format is incorrect (for example, missing the
Bearerprefix). - The API key has been revoked or does not exist.
Security best practices
- Store your API key in an environment variable, not hardcoded in source code.
- Do not expose your key in client-side JavaScript or public repositories.
- Rotate keys periodically from the Settings → API Keys section in your dashboard.
- Create separate keys for different applications so you can revoke one without affecting others.