Create a decision
Use this endpoint to quickly answer classification or scoring questions about some input. You can ask multiple questions in one request.
Body ParametersJSON
input: string or array of DecisionInputMessage { content, role, phase, type } or FunctionCall { arguments, call_id, name, 4 more } or FunctionCallOutput { call_id, output, type, 2 more } or 2 moreThe input to evaluate for every question. Provide a text string or an ordered array of messages, function calls and outputs, or custom tool calls and outputs. Each tool output must identify a matching call by call ID. User messages and tool outputs can contain text and images; developer and system messages can contain only input text, and assistant messages can contain output text or refusals. Images can be base64 data URLs or publicly accessible HTTP(S) URLs; at most 128 images are allowed per request. Files, audio, and item references are not supported.
The input to evaluate for every question. Provide a text string or an ordered array of messages, function calls and outputs, or custom tool calls and outputs. Each tool output must identify a matching call by call ID. User messages and tool outputs can contain text and images; developer and system messages can contain only input text, and assistant messages can contain output text or refusals. Images can be base64 data URLs or publicly accessible HTTP(S) URLs; at most 128 images are allowed per request. Files, audio, and item references are not supported.
array of DecisionInputMessage { content, role, phase, type } or FunctionCall { arguments, call_id, name, 4 more } or FunctionCallOutput { call_id, output, type, 2 more } or 2 more
DecisionInputMessage object { content, role, phase, type } A user message containing input text or images, a developer or system message containing input text, or an assistant message containing output text or refusals. System messages are rendered as developer messages.
A user message containing input text or images, a developer or system message containing input text, or an assistant message containing output text or refusals. System messages are rendered as developer messages.
Text evidence or an ordered list of text and image parts.
Text evidence or an ordered list of text and image parts.
DecisionInputImage object { image_url, type, detail, prompt_cache_breakpoint } An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.
An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.
FunctionCallOutput object { call_id, output, type, 2 more }
output: string or array of DecisionInputText { text, type, prompt_cache_breakpoint } or DecisionInputImage { image_url, type, detail, prompt_cache_breakpoint } Text evidence or an ordered list of text and image parts.
Text evidence or an ordered list of text and image parts.
Parts = array of DecisionInputText { text, type, prompt_cache_breakpoint } or DecisionInputImage { image_url, type, detail, prompt_cache_breakpoint }
DecisionInputImage object { image_url, type, detail, prompt_cache_breakpoint } An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.
An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.
CustomToolCallOutput object { call_id, output, type, 2 more }
output: string or array of DecisionInputText { text, type, prompt_cache_breakpoint } or DecisionInputImage { image_url, type, detail, prompt_cache_breakpoint } Text evidence or an ordered list of text and image parts.
Text evidence or an ordered list of text and image parts.
Parts = array of DecisionInputText { text, type, prompt_cache_breakpoint } or DecisionInputImage { image_url, type, detail, prompt_cache_breakpoint }
DecisionInputImage object { image_url, type, detail, prompt_cache_breakpoint } An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.
An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.
questions: array of Predicate { instructions, type, name } or Choice { choices, instructions, type, name } or Score { instructions, levels, type, name } Ask 1–400 questions about the input. Each question can be a predicate, choice, or score. Answers come back in the same order.
Ask 1–400 questions about the input. Each question can be a predicate, choice, or score. Answers come back in the same order.
Predicate object { instructions, type, name } Estimate how likely it is that a statement about the input is true.
Estimate how likely it is that a statement about the input is true.
Choice object { choices, instructions, type, name } Choose from the supplied options based on the input.
Choose from the supplied options based on the input.
Partition prompt cache reuse by caller-provided key.
prompt_cache_options: optional object { mode, ttl } or nullOptions for prompt caching. Supported for gpt-5.6 and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with prompt_cache_breakpoint. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set mode to explicit to disable the implicit breakpoint. The ttl defaults to 30m, which is currently the only supported value. See the prompt caching guide for current details.
Options for prompt caching. Supported for gpt-5.6 and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with prompt_cache_breakpoint. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set mode to explicit to disable the implicit breakpoint. The ttl defaults to 30m, which is currently the only supported value. See the prompt caching guide for current details.
mode: optional "implicit" or "explicit" or nullControls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With explicit, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching.
Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With explicit, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching.
Returns
Decision object { answers, model, usage }
answers: array of Predicate { name, probability, type } or Choice { choice, confidence, name, 2 more } or Score { confidence, name, probabilities, 2 more } or Refusal { name, type } Answers in question order. Any question can return a refusal instead of an answer; other questions can still receive answers. A refusal has type: "refusal" and the question’s name, or null if it was unnamed.
Answers in question order. Any question can return a refusal instead of an answer; other questions can still receive answers. A refusal has type: "refusal" and the question’s name, or null if it was unnamed.
Choice object { choice, confidence, name, 2 more }
Create a decision
curl https://api.tpg-oai.studydeckedu.com/v1/decisions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-6-luna",
"input": "The package arrived with a broken screen.",
"questions": [
{
"type": "predicate",
"name": "damaged",
"instructions": "Does the customer report a damaged item?"
}
]
}'
{
"model": "gpt-6-luna",
"answers": [
{"type": "predicate", "name": "damaged", "probability": 0.95}
],
"usage": {
"input_tokens": 42,
"input_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0},
"output_tokens": 0,
"output_tokens_details": {"reasoning_tokens": 0},
"total_tokens": 42
}
}
Returns Examples
{
"model": "gpt-6-luna",
"answers": [
{"type": "predicate", "name": "damaged", "probability": 0.95}
],
"usage": {
"input_tokens": 42,
"input_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0},
"output_tokens": 0,
"output_tokens_details": {"reasoning_tokens": 0},
"total_tokens": 42
}
}