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