跳转到主要内容

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.

元任务 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.

Base URL

All API requests go to:
https://napi.origintask.cn/v1

Authentication

Every request must include your API key as a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY
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 the Content-Type: application/json header.
Content-Type: application/json

Response format

All successful responses return JSON. Error responses also return JSON with a machine-readable error object.

HTTP status codes

StatusMeaning
200Success — the request completed normally
400Bad Request — one or more parameters are missing or invalid
401Unauthorized — the API key is missing or invalid
403Forbidden — the key lacks permission, or your account balance is insufficient
404Not Found — the requested model or resource does not exist
429Too Many Requests — you have exceeded the rate limit
500Server 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 a 429 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.
Sustained request bursts that exceed your plan’s rate limit will result in dropped requests. If you regularly hit rate limits, consider upgrading your plan from the dashboard.