## Create a decision

`decisions.create(DecisionCreateParams**kwargs)  -> Decision`

**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: Union[str, Iterable[DecisionInputMessageParam]]`

  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.

  - `str`

  - `Iterable[DecisionInputMessageParam]`

    - `content: Union[str, List[DecisionInputPart]]`

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

      - `str`

      - `List[DecisionInputPart]`

        - `class DecisionInputText: …`

          - `text: str`

          - `type: Literal["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.

          - `image_url: str`

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

          - `type: Literal["input_image"]`

            - `"input_image"`

          - `detail: Optional[Literal["low", "high", "auto", "original"]]`

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

            - `"low"`

            - `"high"`

            - `"auto"`

            - `"original"`

    - `role: Literal["user"]`

      - `"user"`

    - `type: Optional[Literal["message"]]`

      - `"message"`

- `model: str`

- `questions: Iterable[Question]`

  - `class QuestionQuestionParamPredicate: …`

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

    - `instructions: str`

    - `type: Literal["predicate"]`

      The type of the object. Always `predicate`.

      - `"predicate"`

    - `name: Optional[str]`

  - `class QuestionQuestionParamChoice: …`

    Choose from the supplied options based on the input.

    - `choices: Iterable[QuestionQuestionParamChoiceChoice]`

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

      - `value: Union[str, bool]`

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

        - `str`

        - `bool`

      - `description: Optional[str]`

    - `instructions: str`

    - `type: Literal["choice"]`

      The type of the object. Always `choice`.

      - `"choice"`

    - `name: Optional[str]`

  - `class QuestionQuestionParamScore: …`

    Rate the input against the supplied ordered levels.

    - `instructions: str`

    - `levels: Iterable[QuestionQuestionParamScoreLevel]`

      - `label: str`

      - `description: Optional[str]`

    - `type: Literal["score"]`

      The type of the object. Always `score`.

      - `"score"`

    - `name: Optional[str]`

- `safety_identifier: Optional[str]`

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

### Returns

- `class Decision: …`

  - `answers: List[Answer]`

    - `class AnswerAnswerResourcePredicate: …`

      - `name: Optional[str]`

      - `probability: float`

      - `type: Literal["predicate"]`

        The type of the object. Always `predicate`.

        - `"predicate"`

    - `class AnswerAnswerResourceChoice: …`

      - `choice: Union[str, bool]`

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

        - `str`

        - `bool`

      - `confidence: float`

      - `name: Optional[str]`

      - `probabilities: List[AnswerAnswerResourceChoiceProbability]`

        - `probability: float`

        - `value: Union[str, bool]`

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

          - `str`

          - `bool`

      - `type: Literal["choice"]`

        The type of the object. Always `choice`.

        - `"choice"`

    - `class AnswerAnswerResourceScore: …`

      - `confidence: float`

      - `name: Optional[str]`

      - `probabilities: List[AnswerAnswerResourceScoreProbability]`

        - `label: str`

        - `probability: float`

        - `value: int`

      - `score: float`

      - `type: Literal["score"]`

        The type of the object. Always `score`.

        - `"score"`

    - `class AnswerAnswerResourceRefusal: …`

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

      - `name: Optional[str]`

      - `type: Literal["refusal"]`

        The type of the object. Always `refusal`.

        - `"refusal"`

  - `model: str`

  - `usage: Usage`

    - `input_tokens: int`

    - `input_tokens_details: UsageInputTokensDetails`

      - `cache_write_tokens: int`

      - `cached_tokens: int`

    - `output_tokens: int`

    - `output_tokens_details: UsageOutputTokensDetails`

      - `reasoning_tokens: int`

    - `total_tokens: int`

### Example

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
decision = client.decisions.create(
    input="string",
    model="model",
    questions=[{
        "instructions": "instructions",
        "type": "predicate",
    }],
)
print(decision.answers)
```

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