跳转到正文

开放模型

RightNow AIOpen models 更新于

本页内容

开放模型 API 通过兼容 OpenAI 的 Chat Completions API 和兼容 Anthropic 的 Messages API 提供托管的开放权重模型。 一个工作区 API 密钥即可访问全部模型,用量由额度支付。

两种协议,一个密钥
Text
图示一个工作区密钥通过两种协议访问开放模型。

两种协议,即 /v1/chat/completions 上的 chat completions 和 /v1/messages 上的 Messages,接受同一个工作区密钥。 两者都通过同一个主机访问开放模型。 用量从一个额度余额中支付,图中画成一根条。

RightNow decision model 有自己的文档。

调用托管模型

设置你所用路由的基础 URL,使用工作区 API 密钥,并传入一个模型 ID。

示例调用 glm-5-3;Open models 中任何可用的 ID 都可以替换它。用 GET /v1/models 读取当前的能力、限制和价格。

TypeScript
import OpenAI from "openai";

// Server side only: never expose this key in browser code.
const client = new OpenAI({
  baseURL: "https://api.rightnowai.co/v1",
  apiKey: process.env.RIGHTNOW_API_KEY,
});
const response = await client.chat.completions.create({
  model: "glm-5-3",
  messages: [{ role: "user", content: "Write a TypeScript retry helper." }],
  max_tokens: 16384,
  reasoning_effort: "low",
});
console.log(response.choices[0]?.message?.content);

GET /v1/models 是托管聊天模型的权威列表。它也会报告某个模型何时暂时暂停。

请求和回复中的一些名称以 runinfra 开头,来自平台以前的名称。它们保持不变。

哪个路由

路由路径客户端基础 URL阅读
Chat completionsPOST /v1/chat/completionshttps://api.rightnowai.co/v1Chat completions and Responses
ResponsesPOST /v1/responseshttps://api.rightnowai.co/v1Chat completions and Responses
MessagesPOST /v1/messageshttps://api.rightnowai.coMessages

按此顺序阅读

  1. Call an open model

    Get a workspace key, discover an available model and send a server-side chat request.

  2. Models

    Discover the model ids a workspace key can reach, and the limits the gateway enforces on them.

  3. Chat completions and Responses

    Chat and Responses request fields, tool loops, streamed events, usage, validation and output budgets.

  4. Streaming

    Stream chat completion deltas over Server-Sent Events, and ask for the usage frame.

  5. Errors

    The error envelope, every status and code, and whether retrying can help.

  6. Retries

    Retry a call, streaming or not, without starting duplicate inference work or a second charge.

  7. Limits

    What each purchase unlocks, what each 429 means, and how to back off.

  8. Sessions

    Keep a session's requests together so its prefix cache stays warm across turns and fan-out workers.

价格、访问与帮助