> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omniall.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI Decisions

> OpenAI Decisions-compatible endpoint. Question types map to TypeSafe as:

- `predicate` ↔ `noul`
- `choice` ↔ `choice`
- `score` ↔ `score`

Use OpenAI SDK `client.decisions.create` with `base_url=https://api.omniall.ai/v1`
(requires openai Python ≥ 3.26.0 or JS ≥ 7.30.0).


## Question types

| `type` | Extra fields | Answer fields |
| - | - | - |
| `predicate` | — | `probability` |
| `choice` | `choices` (2–255) | `choice`, `probabilities[]`, `confidence` |
| `score` | `levels` (2–10) | `score`, `probabilities[]`, `confidence` |

Request body only accepts `model`, `input`, and `questions` (other fields are rejected). Any single question may return `type: refusal`; others still answer.

How-to: [TypeSafe Jev API](https://docs.omniall.ai/typesafe-jev-api.md).


## OpenAPI

````yaml openapi/typesafe-jev.yaml POST /v1/decisions
openapi: 3.1.0
info:
  title: Omniall AI — TypeSafe Jev (System One)
  version: 1.14.0
  description: >
    TypeSafe Jev System One decision APIs on Omniall AI.


    Jev does **not** generate text. You send content (`state` / `input`) and
    typed questions;

    it returns answers with probabilities (and confidence where applicable).


    **Two call styles:**


    - TypeSafe official: `POST /typesafe/v1/systemone`

    - OpenAI Decisions: `POST /v1/decisions`


    **Models:** `jev-1.14.0`, `jev-preview` (alias of current preview),
    `jev-latest`.


    **Host:** `https://api.omniall.ai` · Auth `Authorization: Bearer sk-...`


    Preview headers (optional):


    - `TypeSafe-Danger-Zone-Images: true` — allow images in TypeSafe official
    requests

    - `TypeSafe-Danger-Zone-Long-Context: true` — raise context limit to 262k
    tokens
servers:
  - url: https://api.omniall.ai
security: []
tags:
  - name: TypeSafe System One
    description: TypeSafe official System One format
  - name: OpenAI Decisions
    description: OpenAI Decisions-compatible format
paths:
  /v1/decisions:
    post:
      tags:
        - OpenAI Decisions
      summary: OpenAI Decisions
      description: >
        OpenAI Decisions-compatible endpoint. Question types map to TypeSafe as:


        - `predicate` ↔ `noul`

        - `choice` ↔ `choice`

        - `score` ↔ `score`


        Use OpenAI SDK `client.decisions.create` with
        `base_url=https://api.omniall.ai/v1`

        (requires openai Python ≥ 3.26.0 or JS ≥ 7.30.0).
      operationId: createDecision
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - name: TypeSafe-Danger-Zone-Long-Context
          in: header
          required: false
          schema:
            type: string
            enum:
              - 'true'
          description: Preview — raise context limits to 262k tokens.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenAIDecisionsRequest'
            examples:
              complaint:
                summary: Complaint routing
                value:
                  model: jev-1.14.0
                  input: I was charged twice for my order.
                  questions:
                    - type: choice
                      name: department
                      instructions: Which department should handle this complaint?
                      choices:
                        - value: billing
                          description: Payments, invoices, and refunds.
                        - value: technical
                          description: Problems using the product.
                        - value: other
                          description: Requests outside these categories.
                    - type: predicate
                      name: refund_requested
                      instructions: Is the customer asking for money back?
                    - type: score
                      name: severity
                      instructions: How severe is this issue?
                      levels:
                        - label: Cosmetic
                          description: Appearance only; no lost functionality.
                        - label: Workaround available
                          description: A task fails, but another way works.
                        - label: Fully blocked
                          description: A task fails with no workaround.
      responses:
        '200':
          description: Answers in request order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIDecisionsResponse'
              examples:
                complaint:
                  value:
                    model: jev-1.14.0
                    answers:
                      - type: choice
                        name: department
                        choice: billing
                        probabilities:
                          - value: billing
                            probability: 0.95
                          - value: technical
                            probability: 0.03
                          - value: other
                            probability: 0.02
                        confidence: 0.93
                      - type: predicate
                        name: refund_requested
                        probability: 0.91
                      - type: score
                        name: severity
                        score: 1.1
                        probabilities:
                          - value: 0
                            label: Cosmetic
                            probability: 0.1
                          - value: 1
                            label: Workaround available
                            probability: 0.7
                          - value: 2
                            label: Fully blocked
                            probability: 0.2
                        confidence: 0.55
                    usage:
                      input_tokens: 142
                      output_tokens: 0
                      total_tokens: 142
        '400':
          $ref: '#/components/responses/OpenAIError'
        '401':
          $ref: '#/components/responses/OpenAIError'
        '404':
          $ref: '#/components/responses/OpenAIError'
        '429':
          $ref: '#/components/responses/OpenAIError'
components:
  parameters:
    Authorization:
      name: Authorization
      in: header
      required: true
      schema:
        type: string
        example: Bearer sk-...
      description: Bearer API key, e.g. `Bearer sk-...`.
  schemas:
    OpenAIDecisionsRequest:
      type: object
      required:
        - model
        - input
        - questions
      additionalProperties: false
      properties:
        model:
          type: string
          example: jev-1.14.0
        input:
          description: Shared input — plain string or user-message array.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                required:
                  - role
                  - content
                properties:
                  role:
                    type: string
                    enum:
                      - user
                  content:
                    oneOf:
                      - type: string
                      - type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - input_text
                                - input_image
                            text:
                              type: string
                            image_url:
                              type: string
                              description: HTTPS URL or base64 data URL (PNG/JPEG).
        questions:
          type: array
          minItems: 1
          maxItems: 200
          items:
            $ref: '#/components/schemas/OpenAIDecisionsQuestion'
    OpenAIDecisionsResponse:
      type: object
      properties:
        model:
          type: string
        answers:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/OpenAIPredicateAnswer'
              - $ref: '#/components/schemas/OpenAIChoiceAnswer'
              - $ref: '#/components/schemas/OpenAIScoreAnswer'
              - $ref: '#/components/schemas/OpenAIRefusalAnswer'
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            total_tokens:
              type: integer
    OpenAIDecisionsQuestion:
      type: object
      required:
        - type
        - instructions
      properties:
        type:
          type: string
          enum:
            - predicate
            - choice
            - score
        name:
          type: string
          nullable: true
          description: Optional id echoed in the answer. Must be unique within the request.
        instructions:
          type: string
        choices:
          type: array
          description: Required for `choice` (2–255 options).
          minItems: 2
          maxItems: 255
          items:
            type: object
            required:
              - value
            properties:
              value:
                oneOf:
                  - type: string
                  - type: boolean
              description:
                type: string
        levels:
          type: array
          description: Required for `score` (2–10 ordered levels; score index from 0).
          minItems: 2
          maxItems: 10
          items:
            type: object
            required:
              - label
            properties:
              label:
                type: string
              description:
                type: string
    OpenAIPredicateAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - predicate
        name:
          type: string
          nullable: true
        probability:
          type: number
          minimum: 0
          maximum: 1
    OpenAIChoiceAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - choice
        name:
          type: string
          nullable: true
        choice:
          oneOf:
            - type: string
            - type: boolean
        probabilities:
          type: array
          items:
            type: object
            properties:
              value:
                oneOf:
                  - type: string
                  - type: boolean
              probability:
                type: number
        confidence:
          type: number
    OpenAIScoreAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - score
        name:
          type: string
          nullable: true
        score:
          type: number
        probabilities:
          type: array
          items:
            type: object
            properties:
              value:
                type: integer
              label:
                type: string
              probability:
                type: number
        confidence:
          type: number
    OpenAIRefusalAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - refusal
        name:
          type: string
          nullable: true
  responses:
    OpenAIError:
      description: OpenAI-style error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                  type:
                    type: string
                  code:
                    type: string
                    nullable: true

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.