开放模型
更新于
开放模型 API 通过兼容 OpenAI 的 Chat Completions API 和兼容 Anthropic 的 Messages API 提供托管的开放权重模型。 一个工作区 API 密钥即可访问全部模型,用量由额度支付。
两种协议,即 /v1/chat/completions 上的 chat completions 和 /v1/messages 上的 Messages,接受同一个工作区密钥。 两者都通过同一个主机访问开放模型。 用量从一个额度余额中支付,图中画成一根条。
RightNow decision model 有自己的文档。
调用托管模型
设置你所用路由的基础 URL,使用工作区 API 密钥,并传入一个模型 ID。
示例调用 glm-5-3;Open models 中任何可用的 ID 都可以替换它。用 GET /v1/models 读取当前的能力、限制和价格。
GET /v1/models 是托管聊天模型的权威列表。它也会报告某个模型何时暂时暂停。
请求和回复中的一些名称以 runinfra 开头,来自平台以前的名称。它们保持不变。
哪个路由
| 路由 | 路径 | 客户端基础 URL | 阅读 |
|---|---|---|---|
| Chat completions | POST /v1/chat/completions | https:// | Chat completions and Responses |
| Responses | POST /v1/responses | https:// | Chat completions and Responses |
| Messages | POST /v1/messages | https://api.rightnowai.co | Messages |
按此顺序阅读
Get a workspace key, discover an available model and send a server-side chat request.
Discover the model ids a workspace key can reach, and the limits the gateway enforces on them.
Chat completions and Responses
Chat and Responses request fields, tool loops, streamed events, usage, validation and output budgets.
Stream chat completion deltas over Server-Sent Events, and ask for the usage frame.
The error envelope, every status and code, and whether retrying can help.
Retry a call, streaming or not, without starting duplicate inference work or a second charge.
What each purchase unlocks, what each 429 means, and how to back off.
Keep a session's requests together so its prefix cache stays warm across turns and fan-out workers.