# Decisions

## Create a decision

`$ openai decisions create`

**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 can be base64 data URLs or publicly accessible HTTP(S) URLs. 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.

### Parameters

- `--input: string or array of DecisionInputMessage`

  The text or images to evaluate for every question. Provide a text string or user messages containing text and images. Images can be base64 data URLs or publicly accessible HTTP(S) URLs; at most 128 images are allowed across all messages in one request. Files, audio, tools, and item references are not supported.

- `--model: string`

- `--question: array of object { instructions, type, name }  or object { choices, instructions, type, name }  or object { instructions, levels, type, name }`

- `--safety-identifier: optional string`

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

### Returns

- `decision: object { answers, model, usage }`

  - `answers: array of object { name, probability, type }  or object { choice, confidence, name, 2 more }  or object { confidence, name, probabilities, 2 more }  or object { name, type }`

    - `predicate: object { name, probability, type }`

      - `name: string`

      - `probability: number`

      - `type: "predicate"`

        The type of the object. Always `predicate`.

    - `choice: object { choice, confidence, name, 2 more }`

      - `choice: string or boolean`

        Choice values are typed: a string and a boolean with the same text are distinct.

        - `union_member_0: string`

        - `union_member_1: boolean`

      - `confidence: number`

      - `name: string`

      - `probabilities: array of object { probability, value }`

        - `probability: number`

        - `value: string or boolean`

          Choice values are typed: a string and a boolean with the same text are distinct.

          - `union_member_0: string`

          - `union_member_1: boolean`

      - `type: "choice"`

        The type of the object. Always `choice`.

    - `score: object { confidence, name, probabilities, 2 more }`

      - `confidence: number`

      - `name: string`

      - `probabilities: array of object { label, probability, value }`

        - `label: string`

        - `probability: number`

        - `value: number`

      - `score: number`

      - `type: "score"`

        The type of the object. Always `score`.

    - `refusal: object { name, type }`

      The model declined to answer this question. Other questions in the same request can still receive answers.

      - `name: string`

      - `type: "refusal"`

        The type of the object. Always `refusal`.

  - `model: string`

  - `usage: object { input_tokens, input_tokens_details, output_tokens, 2 more }`

    - `input_tokens: number`

    - `input_tokens_details: object { cache_write_tokens, cached_tokens }`

      - `cache_write_tokens: number`

      - `cached_tokens: number`

    - `output_tokens: number`

    - `output_tokens_details: object { reasoning_tokens }`

      - `reasoning_tokens: number`

    - `total_tokens: number`

### Example

```cli
openai decisions create \
  --api-key 'My API Key' \
  --input string \
  --model model \
  --question '{instructions: instructions, type: predicate}'
```

#### Response

```json
{
  "answers": [
    {
      "name": "name",
      "probability": 0,
      "type": "predicate"
    }
  ],
  "model": "model",
  "usage": {
    "input_tokens": -2147483648,
    "input_tokens_details": {
      "cache_write_tokens": -2147483648,
      "cached_tokens": -2147483648
    },
    "output_tokens": -2147483648,
    "output_tokens_details": {
      "reasoning_tokens": -2147483648
    },
    "total_tokens": -2147483648
  }
}
```

## Domain Types

### Decision

- `decision: object { answers, model, usage }`

  - `answers: array of object { name, probability, type }  or object { choice, confidence, name, 2 more }  or object { confidence, name, probabilities, 2 more }  or object { name, type }`

    - `predicate: object { name, probability, type }`

      - `name: string`

      - `probability: number`

      - `type: "predicate"`

        The type of the object. Always `predicate`.

    - `choice: object { choice, confidence, name, 2 more }`

      - `choice: string or boolean`

        Choice values are typed: a string and a boolean with the same text are distinct.

        - `union_member_0: string`

        - `union_member_1: boolean`

      - `confidence: number`

      - `name: string`

      - `probabilities: array of object { probability, value }`

        - `probability: number`

        - `value: string or boolean`

          Choice values are typed: a string and a boolean with the same text are distinct.

          - `union_member_0: string`

          - `union_member_1: boolean`

      - `type: "choice"`

        The type of the object. Always `choice`.

    - `score: object { confidence, name, probabilities, 2 more }`

      - `confidence: number`

      - `name: string`

      - `probabilities: array of object { label, probability, value }`

        - `label: string`

        - `probability: number`

        - `value: number`

      - `score: number`

      - `type: "score"`

        The type of the object. Always `score`.

    - `refusal: object { name, type }`

      The model declined to answer this question. Other questions in the same request can still receive answers.

      - `name: string`

      - `type: "refusal"`

        The type of the object. Always `refusal`.

  - `model: string`

  - `usage: object { input_tokens, input_tokens_details, output_tokens, 2 more }`

    - `input_tokens: number`

    - `input_tokens_details: object { cache_write_tokens, cached_tokens }`

      - `cache_write_tokens: number`

      - `cached_tokens: number`

    - `output_tokens: number`

    - `output_tokens_details: object { reasoning_tokens }`

      - `reasoning_tokens: number`

    - `total_tokens: number`

### Decision Input Image

- `decision_input_image: object { image_url, type, detail }`

  An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.

  - `image_url: string`

    A base64-encoded image in a data URL or a publicly accessible HTTP(S) image URL.

  - `type: "input_image"`

  - `detail: optional "low" or "high" or "auto" or "original"`

    The image detail level, using the selected model's image profile. Defaults to auto.

    - `"low"`

    - `"high"`

    - `"auto"`

    - `"original"`

### Decision Input Message

- `decision_input_message: object { content, role, type }`

  A user message containing text or images.

  - `content: string or array of DecisionInputPart`

    Text evidence or an ordered list of text and image parts.

    - `union_member_0: string`

    - `Parts: array of DecisionInputPart`

      - `decision_input_text: object { text, type }`

        - `text: string`

        - `type: "input_text"`

      - `decision_input_image: object { image_url, type, detail }`

        An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.

        - `image_url: string`

          A base64-encoded image in a data URL or a publicly accessible HTTP(S) image URL.

        - `type: "input_image"`

        - `detail: optional "low" or "high" or "auto" or "original"`

          The image detail level, using the selected model's image profile. Defaults to auto.

          - `"low"`

          - `"high"`

          - `"auto"`

          - `"original"`

  - `role: "user"`

  - `type: optional "message"`

    - `"message"`

### Decision Input Part

- `decision_input_part: DecisionInputText or DecisionInputImage`

  An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.

  - `decision_input_text: object { text, type }`

    - `text: string`

    - `type: "input_text"`

  - `decision_input_image: object { image_url, type, detail }`

    An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.

    - `image_url: string`

      A base64-encoded image in a data URL or a publicly accessible HTTP(S) image URL.

    - `type: "input_image"`

    - `detail: optional "low" or "high" or "auto" or "original"`

      The image detail level, using the selected model's image profile. Defaults to auto.

      - `"low"`

      - `"high"`

      - `"auto"`

      - `"original"`

### Decision Input Text

- `decision_input_text: object { text, type }`

  - `text: string`

  - `type: "input_text"`
