OpenAI Decisions API: strukturierte Ja-oder-Nein-Antworten fuer Entwickler
Die neue Decisions API von OpenAI soll das Problem loesen, dass Modelle auf einfache Entscheidungsfragen ganze Absaetze liefern, aus denen Entwickler per Regular Expression die Antwort herausfiltern muessen. Stattdessen kommen saubere, maschinenlesbare Labels zurueck.

Posted on Oct 15 • Originally published at logicstack.org
If your app asks a large language model a yes-or-no question, you have probably lived through this: you request a clean label, the model replies with a paragraph, and somewhere in your codebase a regular expression tries to drag the word "refund" out of "I believe this does constitute a refund request." It works on Monday. By Friday the model is feeling chatty, the regex misses, and a support ticket goes to the wrong queue.
On 6 October, OpenAI put a public beta of a different answer in front of developers: the Decisions API, a new endpoint — POST /v1/decisions — that returns typed verdicts instead of prose. No paragraphs to parse, no JSON mode to coax, just a probability, a choice, or a score. This is a practical guide: what the endpoint does, what it costs, where it genuinely helps, and the calibration work it quietly leaves to you.
The idea is deliberately narrow. You send evidence (input) plus one or more questions, and the API answers each question in a fixed shape. Three question types exist:
Predicate — a yes-or-no condition, answered with a probability between 0 and 1. "Does this photo show visible product damage?"
Choice — a fixed set of candidate answers you define, answered with the winning choice, the option probabilities and a confidence value. "Which department owns this ticket?"
Score — an ordered rubric you define, answered with a probability-weighted average across the levels, plus a confidence. "How severe is this incident?"
A refusal is a separate answer type — not a low score and not your fallback category. As of mid-October the API is in public beta, with gpt-6-luna as the only supported model, and OpenAI says it expects general availability "in the coming weeks". That is an expectation, not a date.
The quickest way to feel the shape of the API is a support-routing call. With curl:
curl https://api.openai.com/v1/decisions \ -H "Authorization: Bearer $OPENAI_API_KEY " \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-6-luna", "input": "I was charged twice for my order.", "questions": [{ "type": "choice", "name": "department", "instructions": "Which department should handle this complaint?", "choices": [ {"value": "billing", "description": "Payments, invoices and refunds."}, {"value": "technical", "description": "Problems using the product."}, {"value": "shipping", "description": "Delivery and tracking."}, {"value": "other", "description": "Requests outside these categories."} ] }] }' Enter fullscreen mode Exit fullscreen mode In Python the call mirrors OpenAI's published guide (the SDK surface is still beta and may change):
from openai import OpenAI client = OpenAI () decision = client. decisions. create ( model = " gpt-6-luna ", input = " I was charged twice for my order #48210. ", questions = [ { " type ": " choice ", " name ": " department ", " instructions ": " Which department should handle this complaint? ", " choices ": [ { " value ": " billing ", " description ": " Payments, invoices and refunds.
" }, { " value ": " technical ", " description ": " Problems using the product. " }, { " value ": " shipping ", " description ": " Delivery and tracking. " }, { " value ": " other ", " description ": " Requests outside these categories.
" }, ], } ], ) answer = decision. answers [ 0 ] print ( answer. name, " -> ", answer. choice, f " (confidence { answer. confidence:. 2 f } ) " ) Enter fullscreen mode Exit fullscreen mode The response carries each answer under the name you gave its question, so a single request can ask several independent questions about the same input — say, a queue and a severity — and get back a tidy list instead of a paragraph to dissect.
The part most tutorials skip is the one that breaks production: the model can refuse a question. A refusal arrives as its own answer type, and your code must branch on it before touching probability, choice or score. A small routing helper makes the policy explicit:
Expand lucy-reeves lucy-reeves lucy-reeves Follow uhhh lol Joined Oct 12, 2026 • Oct 15 Dropdown menu Copy link Hide have you tried using the function calling feature to get a strict boolean instead of regex‑parsing the model's free‑form reply?