入门

本页内容

本指南通过三个步骤,帮助设施从零开始完成第一个可用的请求,然后介绍如何确认其已成功运行。

开始之前

  • 您必须是 Organisation Administrator。Model Router 仅供 Technology Stack 设施的 Organisation Administrator 使用。
  • 使用 Performance Hub 主工具栏中的设施选择器选择要配置的设施。
  • 为该设施保存一张账单卡,或准备好添加一张。充值会从您保存的账单卡扣款;如果没有已存档的卡,Balance & Top-up 页面会显示 "No card on file." 以及 Add payment details 链接。

第 1 步:启用 Model Router

从主菜单(AI Modules & Agents 分组中)打开 Model Router。如果尚未为此设施启用该模块,您会看到 Welcome to Model Router 页面:

"Give your business prepaid access to a catalog of leading AI models through a single, OpenAI-compatible endpoint. Your Performance Hub AI Agents connect automatically, and you can create API keys to plug the same models into your own software — with spend limits and full usage visibility."(通过一个兼容 OpenAI 的单一端点,为您的企业提供预付费访问一系列领先 AI 模型的能力。您的 Performance Hub AI Agents 会自动连接,您还可以创建 API 密钥,将相同的模型接入您自己的软件,并可设置支出限额、全面了解使用情况。)

Welcome to Model Router 页面Welcome to Model Router 页面

图 1:启用模块之前设施看到的 Welcome to Model Router 页面

该页面有三个按钮:Enable Model Router、Read the documentation(打开本文档)和 Explore first without enabling。按钮下方列出了三个设置步骤:

步骤说明内容按钮
1. Enable & add a billing card"Turn on prepaid AI inference for this facility and store a billing card if you have not already — nothing is charged until you top up."(为此设施开启预付费 AI 推理,如果尚未保存账单卡,请保存一张;在您充值之前不会产生任何费用。)Enable module
2. Top up your balance"Add prepaid credit with your stored billing card (minimum $10). Turn on auto top-up so inference never stops because the balance ran out."(使用已保存的账单卡添加预付额度(最低 $10)。开启自动充值,使推理永远不会因余额耗尽而停止。)Top up
3. Connect an agent or create an API key"Paired AI Agent devices connect automatically. For your own software, create an API key and point any OpenAI-compatible SDK at our endpoint."(已配对的人工智能代理设备会自动连接。对于您自己的软件,请创建 API 密钥,并将任何兼容 OpenAI 的 SDK 指向我们的端点。)Create an API key

每个步骤还提供 Learn more 链接。

点击 Enable Model Router(或 Enable module)以开启该模块。

设置清单

启用模块后,Model Router 顶部会显示设置清单横幅,直到设置完成为止。横幅标题为 Finish setting up Model Router,并显示预计时间(例如 ~3 min left)、已完成的步骤数(例如 2 of 3 complete),以及可展开完整清单的 Resume 按钮。每个步骤都有 Review(或 Review again)和 Learn more;点击 Collapse 可再次将其折叠。只剩一个步骤时,展开后的副标题显示为 "Just one step to go before AI requests start flowing. Steps can be done in any order."(只差一步即可开始处理 AI 请求。各步骤可以按任意顺序完成。)

设置清单横幅设置清单横幅

图 2:设置完成前显示的设置清单横幅

必需步骤为 Add a billing card、Top up your balance 和 Connect an agent or create an API key。可选步骤(Set spend limits、Turn on auto top-up 和 Verify your first request)可以通过 Skip for now 跳过。

第 2 步:完成首次充值

前往 Budgets & Limits → Balance & Top-up。

Top up balance 和 Auto top-up 卡片Top up balance 和 Auto top-up 卡片

图 3:Top up balance 卡片(预设金额、金额、已保存的卡)和 Auto top-up 卡片

  1. 在 Top up balance 卡片中,选择一个预设金额($25、$50、$100、$250、$500、$1000)或输入金额。"Minimum top-up is $10."(最低充值金额为 $10。)
  2. 检查金额下方显示的已保存卡片(例如 "Amex ending 0005 · exp 06/29")。如需更新,请使用 Edit payment details。
  3. 点击 Top up $–.––。成功后您会看到 "Top-up successful. Your balance has been credited."(充值成功。您的余额已入账。)充值会立即反映在余额中。

**推荐:**在 Auto top-up 卡片中打开 Enable auto top-up,设置 When balance is below 和 Top up by(最低同样为 $10),然后点击 保存更改。此后,每当余额低于阈值时,系统都会自动从您的卡扣款,因此推理永远不会意外停止。详情请参阅预算与充值。

第 3 步:发送您的第一个请求

选择适用于您的方式:

如果您有 AI Agents 或 Workflows

无需任何配置:与此设施配对的人工智能代理设备会自动连接,Workflows 也可以连接。打开 Settings(齿轮)→ Service Access & API Keys,确认您的代理显示在 Connected Services 下且状态为 在线的。请参阅 Connected Services。

如果您要连接自己的软件

  1. 打开 Settings(齿轮)→ Service Access & API Keys,然后点击 Create key。从 "Copy your API key" 对话框中复制密钥:"This is the only time the full key is shown. Store it somewhere safe."(这是唯一一次显示完整密钥。请将其妥善保存。)
  2. 使用同一页面 Connecting to the API 卡片中显示的 Base URL 和示例请求。最简测试如下:
curl https://app.performancehub.co/ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "auto", "messages": [{"role": "user", "content": "Hello"}]}'

有关 Python 和 TypeScript 示例,请参阅连接您的应用程序。

第 4 步:验证

打开 Logs 选项卡。您的测试请求应在片刻之内显示出来,包括其模型、令牌计数、成本、速度以及 success 状态。如果没有显示,请参阅故障排除。

  • 设置支出限额:Budgets & Limits → Spend Limits。每月上限是一个明智的安全保障;请参阅预算与充值。
  • 查看模型目录:Settings → Models。所有模型默认启用;如果您对提供商或预算有偏好,可使用快速预设缩小范围。请参阅 Models。
  • 考虑使用防护规则:在 Settings → Guardrails 中设置 PII 遮蔽、机密信息隐去和提示注入防护。默认情况下均未启用。请参阅 Guardrails。