Decisions API is in public beta
Decisions API is in public beta
The Decisions API evaluates text, images, or both and returns typed answers about 10x faster than the Responses API. Get the probability that a condition is true, a choice from a fixed set, or a score against a rubric. Use those answers to classify content, route requests, and prioritize work in your application.
Decisions API 目前处于公开测试阶段。该 API 可评估文本、图像或两者,其返回类型化答案的速度比 Responses API 快约 10 倍。您可以获取条件为真的概率、从固定集合中进行选择,或根据评分标准获取分数。利用这些答案来对内容进行分类、路由请求并确定应用程序中的工作优先级。
Try the Decisions API in the Playground to experiment with questions and inputs before writing code.
在编写代码之前,请在 Playground 中尝试使用 Decisions API,以便对问题和输入进行实验。
The Decisions API is in public beta, and we expect to GA in the coming weeks. gpt-6-luna is the only model currently available. Use the dedicated POST /v1/decisions endpoint.
Decisions API 目前处于公开测试阶段,我们预计在未来几周内正式发布(GA)。目前唯一可用的模型是 gpt-6-luna。请使用专用的 POST /v1/decisions 端点。
To run the SDK examples below, use these OpenAI SDK versions or later: Python 3.26.0, JavaScript 7.30.0, Go 3.73.0, Ruby 0.101.0, and Java 4.78.0. See OpenAI SDK for installation instructions.
要运行下方的 SDK 示例,请使用以下或更高版本的 OpenAI SDK:Python 3.26.0、JavaScript 7.30.0、Go 3.73.0、Ruby 0.101.0 和 Java 4.78.0。有关安装说明,请参阅 OpenAI SDK 文档。
A request has three parts:
请求包含三个部分:
The response contains an answers array. Give each question a unique name to identify its answer; the API echoes that name in the response.
响应包含一个答案数组。请为每个问题指定一个唯一名称以标识其答案;API 会在响应中回显该名称。
Both choice and score return probabilities over discrete options. Use choice for categories without an order, such as departments. Use score for ordered levels, such as severity; it takes the probability-weighted average of their numeric indices to produce a score that can fall between levels.
choice 和 score 都会返回离散选项的概率。对于没有顺序的类别(如部门),请使用 choice。对于有序级别(如严重程度),请使用 score;它会获取其数字索引的概率加权平均值,从而产生一个可能落在级别之间的分数。
Use Decisions when your application needs one of these answer types. Use Structured Outputs with the Responses API when you need to generate an object that follows your own JSON schema, such as extracted fields or a written explanation, or function calling when you need a model to request a tool call with arguments.
当您的应用程序需要这些答案类型之一时,请使用 Decisions。当您需要生成符合您自定义 JSON 模式的对象(例如提取的字段或书面解释)时,请使用 Responses API 的结构化输出(Structured Outputs);当您需要模型请求带有参数的工具调用时,请使用函数调用(function calling)。
Use a predicate question to check a product photo for visible damage. This request combines the image with instructions to look for a crack, tear, or dent.
使用谓词问题来检查产品照片是否有可见损坏。此请求将图像与查找裂缝、撕裂或凹痕的指令相结合。
Can I return an item after 30 days?
我可以在 30 天后退货吗?
An illustrative response excerpt:
说明性响应摘录:
The probability is the model’s estimate that the condition is true. Use it to flag photos for review based on a threshold you choose.
概率是模型对条件为真的估计。您可以根据自己选择的阈值使用它来标记需要审核的照片。
Images must be inline base64 data URLs. Hosted HTTP or HTTPS image URLs and file_id inputs aren’t supported by this endpoint. Combine input_text and input_image parts in a user message to evaluate images together with instructions or other context.
图像必须是内联 base64 数据 URL。此端点不支持托管的 HTTP 或 HTTPS 图像 URL 以及 file_id 输入。在用户消息中组合 input_text 和 input_image 部分,以便将图像与指令或其他上下文一起评估。
A choice question selects one value from the options you provide. Use distinct values and descriptions that explain when each option applies.
choice 问题会从您提供的选项中选择一个值。请使用不同的值和描述来解释每个选项的适用情况。
Billed to Cedar & Co.
Payment due October 21
Thank you for your purchase.
Visa ending in 4242 · Approved
Between Northline Studio and Cedar & Co.
The provider agrees to deliver design services for a term of twelve months.
账单寄往 Cedar & Co.
付款截止日期为 10 月 21 日
感谢您的购买。
尾号 4242 的 Visa 卡 · 已批准
Northline Studio 与 Cedar & Co. 之间
提供商同意提供为期十二个月的设计服务。
This request routes a customer complaint:
此请求用于路由客户投诉:
An illustrative response excerpt:
说明性响应摘录:
The answer’s choice field contains a supplied value, here “billing”. It also includes a probabilities array for the options and a confidence field. See Interpret the answers for guidance on setting thresholds.
答案的 choice 字段包含一个提供的值,此处为“billing”(账单)。它还包括选项的概率数组和一个置信度字段。有关设置阈值的指导,请参阅“解释答案”(Interpret the answers)。
Include a fallback option such as “other” when your categories don’t cover every possible input. Your application can send that result to a general review queue.
当您的类别无法涵盖所有可能的输入时,请包含一个后备选项,例如“other”(其他)。您的应用程序可以将该结果发送到通用审核队列。
A score question evaluates an input against ordered levels. Define the criteria for each level and arrange them from lowest to highest.
score 问题根据有序级别评估输入。请定义每个级别的标准,并按从低到高的顺序排列。
An illustrative response excerpt:
说明性响应摘录:
Level indices start at 0. Here, 0 means cosmetic, 1 means a workaround is available, and 2 means fully blocked. The returned score is a probability-weighted average, so it can fall between levels. In this example, probabilities of 0.1, 0.7, and 0.2 produce a score of 1.1.
级别索引从 0 开始。此处,0 表示外观问题,1 表示有变通方法,2 表示完全受阻。返回的分数是概率加权平均值,因此它可能落在级别之间。在此示例中,0.1、0.7 和 0.2 的概率产生 1.1 的分数。
The answer also includes confidence and the per-level probabilities. The score summarizes the distribution across levels. Use choice to select a single category.
答案还包括置信度和各级别的概率。分数总结了跨级别的分布情况。请使用 choice 来选择单个类别。
Put independent questions in the same questions array to evaluate shared input. For a product photo, you could check for damage and classify the product category in one request. Each question can use a different type.
将独立的问题放在同一个 questions 数组中以评估共享输入。对于产品照片,您可以在一个请求中检查损坏情况并对产品类别进行分类。每个问题可以使用不同的类型。
For decisions that depend on an earlier answer, send separate requests. For example, check for damage first, then use the result to decide whether to request a repair category.
对于依赖于先前答案的决策,请发送单独的请求。例如,先检查损坏情况,然后使用结果来决定是否请求维修类别。
Write questions around observable criteria. Separate different concerns into different questions, give choices distinct meanings, and define score levels so that adjacent levels have distinct criteria.
围绕可观察的标准编写问题。将不同的关注点分开到不同的问题中,赋予选项明确的含义,并定义评分级别,以便相邻级别具有不同的标准。
Predicates return the estimated probability that a condition is true. Choice and score answers return a probability distribution and a separate confidence field.
谓词返回条件为真的估计概率。Choice 和 score 答案返回概率分布和一个单独的置信度字段。
Use labeled examples from your application to set thresholds for routing, filtering, or review. Choose thresholds based on the cost of false positives and false negatives.
使用应用程序中的标记示例来设置路由、过滤或审核的阈值。根据误报和漏报的成本来选择阈值。
With gpt-6-luna, input costs $0.10 per 1M tokens. You pay only for input tokens: there are no cache-read, cache-write, or output-token charges.
使用 gpt-6-luna,输入成本为每 100 万 token 0.10 美元。您只需为输入 token 付费:没有缓存读取、缓存写入或输出 token 的费用。
Regional processing premiums and long-context input pricing multipliers apply. These rates apply to /v1/decisions; other requests using gpt-6-luna follow the applicable model and processing-tier pricing.
区域处理溢价和长上下文输入定价乘数适用。这些费率适用于 /v1/decisions;使用 gpt-6-luna 的其他请求遵循适用的模型和处理层定价。
The Decisions API supports Zero Data Retention (ZDR) and HIPAA use for eligible customers. Data residency and regional processing are supported in the United States and Europe (EEA + Switzerland). See data controls for eligibility requirements, required agreements, and limitations.
Decisions API 为符合条件的客户提供零数据保留 (ZDR) 和 HIPAA 合规支持。美国和欧洲(欧洲经济区 + 瑞士)支持数据驻留和区域处理。有关资格要求、所需协议和限制,请参阅数据控制。
Use client delegation with the Live API to choose actions from voice requests and report their results to the user.
使用 Live API 的客户端委托功能,从语音请求中选择操作并将结果报告给用户。
Loading docs agent…
正在加载文档代理…