Routescope APIRoutescope API
快速开始第一次调用

第一次 curl 调用

用 curl 完成模型列表验证和一次聊天补全请求

下面示例只用于入门验证,不展开所有模型参数。请先把 sk-your-token 替换为你的完整 API Key,并把 your-model-id 替换为模型广场或模型列表接口返回的可用模型 ID。

1. 验证模型列表

curl https://api.routescope.ai/v1/models \
  -H "Authorization: Bearer sk-your-token"

如果这里能正常返回模型列表,说明 Base URL 和 API Key 已经可用。

2. 发起聊天补全请求

curl https://api.routescope.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-your-token" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-id",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "请用一句话介绍 Routescope API。"
      }
    ]
  }'

3. 调用后回到控制台确认

  • 在使用日志中查看请求是否成功、实际使用的模型和扣费明细。
  • 图像、视频等异步任务可在任务日志中查看状态、结果内容和失败原因。
  • 在钱包中确认余额和消费变化。

最后更新于