Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Create a decision

decisions.create(DecisionCreateParams**kwargs) -> Decision
POST/decisions

Use this endpoint to ask classification or scoring questions about the same input. You’ll get the answers back in the order you asked the questions.

For text, you can pass a string. You can also send user messages containing input_text and input_image parts, with up to 128 images per request. Images must be data URLs; external URLs and file IDs aren’t accepted. Other message roles, function calls, files, audio, and item references aren’t supported.

Sometimes a question returns a refusal instead of an answer. The result has type refusal and includes the question’s name, or null if you didn’t give it one.

ParametersExpand Collapse
input: Union[str, Iterable[DecisionInputMessageParam]]

The text or images to evaluate for every question. Provide a text string or user messages containing text and inline images. Images must be inline data URLs; at most 128 images are allowed across all messages in one request. External URLs, files, audio, tools, and item references are not supported.

model: str
minLength0
maxLength1048576
questions: Iterable[Question]
safety_identifier: Optional[str]

Opaque caller-provided end-user identifier, scoped by the verified org. Match Responses’ limit; this is never the authenticated user identity.

minLength0
maxLength128
ReturnsExpand Collapse
class Decision: …
answers: List[Answer]
model: str
minLength0

Create a decision

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
decision = client.decisions.create(
    input="string",
    model="model",
    questions=[{
        "instructions": "instructions",
        "type": "predicate",
    }],
)
print(decision.answers)
{
  "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
  }
}