本指南带您从零开始完成一次 API 调用。完成后您将拥有:Documentation Index
Fetch the complete documentation index at: https://docs.routerlink.ai/llms.txt
Use this file to discover all available pages before exploring further.
- 一个 RouterLink 账号和 API Key
- 对任意支持模型的一次成功聊天补全请求
- 为您的 Key 设置预算以防止超支
1. 创建 API Key
登录
访问 routerlink.ai,使用邮箱或 Google 账号登录。
生成 Key
前往 API Keys → 创建 Key。复制该 Key(以
sk- 开头,仅显示一次)。2. 发起第一个请求(OpenAI 兼容)
将
<ROUTERLINK_API_KEY> 替换为您的 RouterLink Key。model 选项,请查看 模型库。直接复制模型名称即可使用。
- Curl
- Python
- Node.js
curl https://router-link.world3.ai/api/v1/chat/completions \
-H "Authorization: Bearer <ROUTERLINK_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "world3-router-north-america/openai/gpt-5.3-codex",
"messages": [
{"role": "user", "content": "Say hello in one short sentence."}
]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://router-link.world3.ai/api/v1",
api_key="<ROUTERLINK_API_KEY>",
)
resp = client.chat.completions.create(
model="world3-router-north-america/openai/gpt-5.3-codex",
messages=[{"role": "user", "content": "Say hello in one short sentence."}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://router-link.world3.ai/api/v1",
apiKey: process.env.ROUTERLINK_API_KEY,
});
const resp = await client.chat.completions.create({
model: "world3-router-north-america/openai/gpt-5.3-codex",
messages: [{ role: "user", content: "Say hello in one short sentence." }],
});
console.log(resp.choices[0].message.content);
3. 使用原生 Anthropic SDK
RouterLink 提供 Anthropic 兼容的 Messages 端点,任何官方 Anthropic 客户端 SDK 只需覆盖base_url(并将 api_key 指向您的 RouterLink Key)即可使用。
Base URL:
https://router-link.world3.ai/api — SDK 会自动追加 /v1/messages。将 <ROUTERLINK_API_KEY> 替换为您的 RouterLink API Key。- Curl
- Python
- Node.js
curl https://router-link.world3.ai/api/v1/messages \
-H "x-api-key: <ROUTERLINK_API_KEY>" \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "anthropic/claude-opus-4-6",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Say hello in one short sentence."}
]
}'
pip install anthropic
import anthropic
client = anthropic.Anthropic(
base_url="https://router-link.world3.ai/api",
api_key="<ROUTERLINK_API_KEY>",
)
message = client.messages.create(
model="anthropic/claude-opus-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Say hello in one short sentence."}],
)
print(message.content[0].text)
npm install @anthropic-ai/sdk
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://router-link.world3.ai/api",
apiKey: process.env.ROUTERLINK_API_KEY,
});
const message = await client.messages.create({
model: "anthropic/claude-opus-4-6",
max_tokens: 1024,
messages: [{ role: "user", content: "Say hello in one short sentence." }],
});
console.log(message.content);
https://router-link.world3.ai/api,并传入您的 RouterLink Key。

