跳转到主要内容

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 single OpenAI-compatible endpoint that routes your requests to any supported model. You only need an account and an API key — no per-provider setup, no separate credentials. This guide walks you through everything from registration to your first successful API call.
1

Create an account

Go to napi.origintask.cn and register for a free account. You can sign up with an email address. If you have a promo code, you can enter it during or after registration to add credit to your balance.
2

Generate an API key

Once you are logged in, navigate to Settings → API Keys in your dashboard. Click Create API key, give it a name so you can identify it later, and copy the key immediately — it is only shown once.
Store your API key somewhere safe as soon as you create it. The dashboard will not show the full key again after you close the dialog.
3

Make your first API call

Send a request to the chat completions endpoint. Replace YOUR_API_KEY with the key you just copied.
curl https://napi.origintask.cn/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": "Say hello in one sentence."
      }
    ]
  }'
A successful response looks like this:
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1714000000,
  "model": "gpt-4o-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm here and ready to help you today."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 13,
    "completion_tokens": 12,
    "total_tokens": 25
  }
}
4

View your usage

Return to your dashboard to see token usage and spending for the request you just made. The Usage section updates in real time and breaks down consumption by model and by API key.
The Python and Node.js examples use the official OpenAI SDK pointed at the gateway’s base URL. Any library or tool that lets you set a custom base_url works the same way — no gateway-specific SDK required.

Next steps

Available models

Browse all AI models you can access through the gateway and learn how to reference them in your requests.

OpenAI SDK integration

Configure the official OpenAI Python and Node.js SDKs to route all requests through the gateway.