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(**kwargs) -> Decision { answers, model, usage }
POST/decisions

Evaluate ordered classification and scoring questions against shared input. Answers are returned in question order.

Supply input as a string or user messages containing text and inline images. Only user messages with input_text and input_image parts are supported; non-user roles, function calls, files, audio, and item references are not supported. Images require a data URL, not an external URL or file ID. At most 128 images are allowed across the request.

Each question can return a refusal instead of a scored answer. A refusal has type refusal and the corresponding question name, or null if unnamed.

ParametersExpand Collapse
input: String | Array[DecisionInputMessage { content, role, type } ]

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: String
minLength0
maxLength1048576
questions: Array[Predicate{ instructions, type, name} | Choice{ choices, instructions, type, name} | Score{ instructions, levels, type, name}]
safety_identifier: String

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, model, usage }
answers: Array[Predicate{ name, probability, type} | Choice{ choice, confidence, name, 2 more} | Score{ confidence, name, probabilities, 2 more} | Refusal{ name, type}]
model: String
minLength0
usage: Usage{ input_tokens, input_tokens_details, output_tokens, 2 more}

Create a decision

require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

decision = openai.decisions.create(
  input: "string",
  model: "model",
  questions: [{instructions: "instructions", type: :predicate}]
)

puts(decision)
{
  "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
  }
}