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

client.decisions.create(DecisionCreateParams { input, model, questions, safety_identifier } body, RequestOptionsoptions?): 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
body: DecisionCreateParams { input, model, questions, safety_identifier }
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<QuestionParamPredicate { instructions, type, name } | QuestionParamChoice { choices, instructions, type, name } | QuestionParamScore { instructions, levels, type, name } >
safety_identifier?: string | null

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
Decision { answers, model, usage }
answers: Array<AnswerResourcePredicate { name, probability, type } | AnswerResourceChoice { choice, confidence, name, 2 more } | AnswerResourceScore { confidence, name, probabilities, 2 more } | AnswerResourceRefusal { name, type } >
model: string
minLength0
usage: Usage { input_tokens, input_tokens_details, output_tokens, 2 more }

Create a decision

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const decision = await client.decisions.create({
  input: 'string',
  model: 'model',
  questions: [{ instructions: 'instructions', type: 'predicate' }],
});

console.log(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
  }
}