API 文档

Base URL: https://lumitokenhub.nat200.top

快速开始

1

获取 API Key

Sign up for an account and generate an API key from the dashboard.

2

设置 API Key

Set your API key as an environment variable or pass it in the Authorization header.

3

发起请求

Send a POST request to the chat completions endpoint with your model and messages.

代码示例

cURL

curl https://lumitokenhub.nat200.top/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <你的API Key>" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Python

import requests

api_key = "lum-xxxx...(控制台获取)"
url = "https://lumitokenhub.nat200.top/v1/chat/completions"

resp = requests.post(
    url,
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    json={
        "model": "auto",
        "messages": [
            {"role": "user",
             "content": "Hello!"}
        ],
    },
)
print(resp.json())

JavaScript

const apiKey = "lum-xxxx...(控制台获取)";

const resp = await fetch(
  "https://lumitokenhub.nat200.top/v1/chat/completions",
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${apiKey}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "auto",
      messages: [
        { role: "user",
          content: "Hello!" }
      ],
    }),
  }
);
const data = await resp.json();

可用模型

Model ID文档ContextPricing
deepseekDeepSeek$0.0733/1K
local本地模型64K$0.0081/1K
xiaomi小米 MiMo$0.0098/1K
chaosuan超算中心$0.0059/1K

错误代码

代码消息说明
400Bad RequestInvalid request parameters
401UnauthorizedInvalid or expired API key
402Insufficient BalanceAccount balance too low
429Rate LimitedToo many requests per minute
500Server ErrorInternal server error, try again
503Model UnavailableModel temporarily unavailable