# Decisions

## Create a decision

`Decision decisions().create(DecisionCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**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

- `DecisionCreateParams params`

  - `Input input`

    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.

    - `String`

    - `List<DecisionInputMessage>`

      - `Content content`

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

        - `String`

        - `List<DecisionInputPart>`

          - `class DecisionInputText:`

            - `String text`

            - `JsonValue; type "input_text"constant`

              - `INPUT_TEXT("input_text")`

          - `class DecisionInputImage:`

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

            - `String imageUrl`

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

            - `JsonValue; type "input_image"constant`

              - `INPUT_IMAGE("input_image")`

            - `Optional<Detail> detail`

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

              - `LOW("low")`

              - `HIGH("high")`

              - `AUTO("auto")`

              - `ORIGINAL("original")`

      - `JsonValue; role "user"constant`

        - `USER("user")`

      - `Optional<Type> type`

        - `MESSAGE("message")`

  - `String model`

  - `List<Question> questions`

    - `class Predicate:`

      Estimate how likely it is that a statement about the input is true.

      - `String instructions`

      - `JsonValue; type "predicate"constant`

        The type of the object. Always `predicate`.

        - `PREDICATE("predicate")`

      - `Optional<String> name`

    - `class Choice:`

      Choose from the supplied options based on the input.

      - `List<DecisionChoiceOption> choices`

        Provide between 2 and 255 choices. Each choice must be unique.

        - `Value value`

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

          - `String`

          - `boolean`

        - `Optional<String> description`

      - `String instructions`

      - `JsonValue; type "choice"constant`

        The type of the object. Always `choice`.

        - `CHOICE("choice")`

      - `Optional<String> name`

    - `class Score:`

      Rate the input against the supplied ordered levels.

      - `String instructions`

      - `List<Level> levels`

        - `String label`

        - `Optional<String> description`

      - `JsonValue; type "score"constant`

        The type of the object. Always `score`.

        - `SCORE("score")`

      - `Optional<String> name`

  - `Optional<String> safetyIdentifier`

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

### Returns

- `class Decision:`

  - `List<Answer> answers`

    - `class Predicate:`

      - `Optional<String> name`

      - `double probability`

      - `JsonValue; type "predicate"constant`

        The type of the object. Always `predicate`.

        - `PREDICATE("predicate")`

    - `class Choice:`

      - `DecisionChoiceValue choice`

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

        - `String`

        - `boolean`

      - `double confidence`

      - `Optional<String> name`

      - `List<Probability> probabilities`

        - `double probability`

        - `DecisionChoiceValue value`

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

      - `JsonValue; type "choice"constant`

        The type of the object. Always `choice`.

        - `CHOICE("choice")`

    - `class Score:`

      - `double confidence`

      - `Optional<String> name`

      - `List<Probability> probabilities`

        - `String label`

        - `double probability`

        - `long value`

      - `double score`

      - `JsonValue; type "score"constant`

        The type of the object. Always `score`.

        - `SCORE("score")`

    - `class Refusal:`

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

      - `Optional<String> name`

      - `JsonValue; type "refusal"constant`

        The type of the object. Always `refusal`.

        - `REFUSAL("refusal")`

  - `String model`

  - `Usage usage`

    - `long inputTokens`

    - `InputTokensDetails inputTokensDetails`

      - `long cacheWriteTokens`

      - `long cachedTokens`

    - `long outputTokens`

    - `OutputTokensDetails outputTokensDetails`

      - `long reasoningTokens`

    - `long totalTokens`

### Example

```java
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.decisions.Decision;
import com.openai.models.decisions.DecisionCreateParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        DecisionCreateParams params = DecisionCreateParams.builder()
            .input("string")
            .model("model")
            .addPredicateQuestion("instructions")
            .build();
        Decision decision = client.decisions().create(params);
    }
}
```

#### 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

- `class Decision:`

  - `List<Answer> answers`

    - `class Predicate:`

      - `Optional<String> name`

      - `double probability`

      - `JsonValue; type "predicate"constant`

        The type of the object. Always `predicate`.

        - `PREDICATE("predicate")`

    - `class Choice:`

      - `DecisionChoiceValue choice`

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

        - `String`

        - `boolean`

      - `double confidence`

      - `Optional<String> name`

      - `List<Probability> probabilities`

        - `double probability`

        - `DecisionChoiceValue value`

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

      - `JsonValue; type "choice"constant`

        The type of the object. Always `choice`.

        - `CHOICE("choice")`

    - `class Score:`

      - `double confidence`

      - `Optional<String> name`

      - `List<Probability> probabilities`

        - `String label`

        - `double probability`

        - `long value`

      - `double score`

      - `JsonValue; type "score"constant`

        The type of the object. Always `score`.

        - `SCORE("score")`

    - `class Refusal:`

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

      - `Optional<String> name`

      - `JsonValue; type "refusal"constant`

        The type of the object. Always `refusal`.

        - `REFUSAL("refusal")`

  - `String model`

  - `Usage usage`

    - `long inputTokens`

    - `InputTokensDetails inputTokensDetails`

      - `long cacheWriteTokens`

      - `long cachedTokens`

    - `long outputTokens`

    - `OutputTokensDetails outputTokensDetails`

      - `long reasoningTokens`

    - `long totalTokens`

### Decision Choice Option

- `class DecisionChoiceOption:`

  - `Value value`

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

    - `String`

    - `boolean`

  - `Optional<String> description`

### Decision Choice Value

- `class DecisionChoiceValue: A class that can be one of several variants.union`

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

  - `String`

  - `boolean`

### Decision Input Image

- `class DecisionInputImage:`

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

  - `String imageUrl`

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

  - `JsonValue; type "input_image"constant`

    - `INPUT_IMAGE("input_image")`

  - `Optional<Detail> detail`

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

    - `LOW("low")`

    - `HIGH("high")`

    - `AUTO("auto")`

    - `ORIGINAL("original")`

### Decision Input Message

- `class DecisionInputMessage:`

  A user message containing text or images.

  - `Content content`

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

    - `String`

    - `List<DecisionInputPart>`

      - `class DecisionInputText:`

        - `String text`

        - `JsonValue; type "input_text"constant`

          - `INPUT_TEXT("input_text")`

      - `class DecisionInputImage:`

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

        - `String imageUrl`

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

        - `JsonValue; type "input_image"constant`

          - `INPUT_IMAGE("input_image")`

        - `Optional<Detail> detail`

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

          - `LOW("low")`

          - `HIGH("high")`

          - `AUTO("auto")`

          - `ORIGINAL("original")`

  - `JsonValue; role "user"constant`

    - `USER("user")`

  - `Optional<Type> type`

    - `MESSAGE("message")`

### Decision Input Part

- `class DecisionInputPart: A class that can be one of several variants.union`

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

  - `class DecisionInputText:`

    - `String text`

    - `JsonValue; type "input_text"constant`

      - `INPUT_TEXT("input_text")`

  - `class DecisionInputImage:`

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

    - `String imageUrl`

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

    - `JsonValue; type "input_image"constant`

      - `INPUT_IMAGE("input_image")`

    - `Optional<Detail> detail`

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

      - `LOW("low")`

      - `HIGH("high")`

      - `AUTO("auto")`

      - `ORIGINAL("original")`

### Decision Input Text

- `class DecisionInputText:`

  - `String text`

  - `JsonValue; type "input_text"constant`

    - `INPUT_TEXT("input_text")`
