元任务 AI 网关 exposes a REST API that follows the OpenAI API format exactly. You can use any HTTP client, the official OpenAI SDK, or any OpenAI-compatible library to talk to the gateway — just point it at the base URL below and supply your gateway API key.Documentation Index
Fetch the complete documentation index at: https://docs.metask.ai/llms.txt
Use this file to discover all available pages before exploring further.
Base URL
All API requests go to:Authentication
Every request must include your API key as a Bearer token in theAuthorization header.
You can generate and manage API keys from your dashboard API keys page. Keep your key secret — anyone who holds it can make requests charged to your account balance.
Available endpoints
POST /v1/chat/completions
Send a list of messages to a model and receive an AI completion in return. Supports streaming.
GET /v1/models
Return the list of AI models available through the gateway. Use the model IDs in chat completion requests.
Request format
Send all request bodies as JSON and include theContent-Type: application/json header.
Response format
All successful responses return JSON. Error responses also return JSON with a machine-readableerror object.
HTTP status codes
| Status | Meaning |
|---|---|
200 | Success — the request completed normally |
400 | Bad Request — one or more parameters are missing or invalid |
401 | Unauthorized — the API key is missing or invalid |
403 | Forbidden — the key lacks permission, or your account balance is insufficient |
404 | Not Found — the requested model or resource does not exist |
429 | Too Many Requests — you have exceeded the rate limit |
500 | Server Error — an internal error occurred on the gateway |
Rate limiting
The gateway enforces per-key rate limits. When you exceed the limit, the API returns a429 response. Implement exponential backoff in your client and retry the request after a short delay. The response headers include Retry-After to indicate how long to wait.