跳转到主要内容

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.

本指南带您从零开始完成一次 API 调用。完成后您将拥有:
  • 一个 RouterLink 账号和 API Key
  • 对任意支持模型的一次成功聊天补全请求
  • 为您的 Key 设置预算以防止超支

1. 创建 API Key

1

登录

访问 routerlink.ai,使用邮箱或 Google 账号登录。
2

充值 Credits

打开 设置 → 账单,添加 Credits。
3

生成 Key

前往 API Keys → 创建 Key。复制该 Key(以 sk- 开头,仅显示一次)。

2. 发起第一个请求(OpenAI 兼容)

<ROUTERLINK_API_KEY> 替换为您的 RouterLink Key
关于可用的 model 选项,请查看 模型库。直接复制模型名称即可使用。
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."}
    ]                                                                                                                                                                  
  }'                                                        

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 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."}
    ]
  }'                                                                                                                                                                   
其他官方 SDK(Java、Go、Ruby、C#、PHP)的使用方式相同 — 将 SDK 的 base URL 设置为 https://router-link.world3.ai/api,并传入您的 RouterLink Key。

4. 查看消费情况

打开 设置 → 日志设置 → 用量,按模型和 Key 查看请求量、延迟及费用明细。

通过第三方客户端发起请求

在使用 Claude Code、Codex 或其他支持 Anthropic 或 OpenAI API 的工具?将其指向 RouterLink 并使用您自己的 Key — 请参阅 集成指南 了解端到端配置。