---
title: "Decisions"
method: POST
path: "/v1/decisions"
---

# Decisions

`POST /v1/decisions`

## Request

- Base URL: `https://api.llmgateway.io`
- URL: `https://api.llmgateway.io/v1/decisions`
- Auth: HTTP bearer

Evaluate text or images against typed questions and get calibrated predicate, choice and score answers back. OpenAI-compatible API.

## Request body

- object
  - `model` string, required: ID of the decision model to use, optionally prefixed with a provider (`openai/gpt-6-luna-decisions`, `azure/microsoft-decision-1`, `typesafe/jev-1.14.0`).
  - `input` union, required: The text or images to evaluate for every question: a string, or user messages with `input_text` and `input_image` parts. Image input depends on the model.
    - string
    - object[]
      - `type` 'message'
      - `role` 'user', required
      - `content` union, required
        - string
        - union[]
          - union
            - object
              - …
            - object
              - …
  - `questions` union[], required: Questions to evaluate against the input. Answers come back in the same order, echoing each question's `name`.
    - union: A typed question: `predicate` (probability a condition is true), `choice` (one option from a set) or `score` (rating across ordered levels).
      - object
        - `type` 'predicate', required
        - `name` string
        - `instructions` string, required
      - object
        - `type` 'choice', required
        - `name` string
        - `instructions` string, required
        - `choices` object[], required: Between 2 and 255 unique options. Values are typed: a string and a boolean with the same text are distinct.
          - `value` union, required
            - string
            - boolean
          - `description` string
      - object
        - `type` 'score', required
        - `name` string
        - `instructions` string, required
        - `levels` object[], required: Ordered levels, lowest first.
          - `label` string, required
          - `description` string
  - `safety_identifier` string, nullable: Opaque end-user identifier stored in log params.safety_identifier. Credits requests use LLM Gateway's fixed API-key identifier upstream; BYOK requests omit it.

## Response `200`

Typed answers for the submitted questions.

- object: One typed answer per question, in question order.
  - `model` string, required
  - `answers` object[], required
    - `type` 'predicate' | 'choice' | 'score' | 'refusal', required
    - `name` string, nullable
    - `probability` number: Probability from 0 to 1 that the condition is true, on a predicate answer.
    - `choice` union: Highest-probability option, on a choice answer.
      - string
      - boolean
    - `score` number: Probability-weighted average of the level indices, on a score answer.
    - `probabilities` object[]
      - `value` union, required
        - string
        - boolean
        - number
      - `label` string
      - `probability` number, required
    - `confidence` number
  - `usage` object
    - `input_tokens` integer, required
    - `output_tokens` integer, required
    - `total_tokens` integer, required

## Other responses

- `400`: Invalid request body or parameters.
- `401`: Missing or invalid API key.
- `402`: Insufficient credits or plan limits reached.
- `403`: Forbidden request or upstream response.
- `404`: Unknown model or upstream not-found response.
- `408`: Request timeout.
- `410`: Archived or unavailable project.
- `413`: Request too large.
- `415`: Unsupported media type.
- `429`: Rate limited. Response headers describe only LLMGateway-enforced limits; upstream provider headers are not forwarded. Honor Retry-After when present.
- `500`: Internal server error.
- `502`: Failed to connect to the upstream provider.
- `503`: Service unavailable upstream response.
- `504`: Upstream provider timeout.
- `529`: Gateway overloaded.

## Changes

- **2026-10-31** `2902b7e0a589`: 1 info
  - added the new `undefined` enum value to the request property `input/anyOf[subschema #2]/items/content/anyOf[subschema #2]/items/oneOf[subschema #2]/detail`
- **2026-10-13** `d48a43dc3f88`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/llmgateway/apis/llmgateway-api/changes/v1/decisions/post.md)

---

[API](https://skmtc.dev/llmgateway/apis/llmgateway-api.md) - [All operations](https://skmtc.dev/llmgateway/apis/llmgateway-api/llms.txt) - [OpenAPI document](https://skmtc.dev/llmgateway/apis/llmgateway-api/revisions/ded707bdf4a1?raw)
