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.
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
}
}