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

# Make a decision

> Evaluate typed questions against application state with a decision model such as Jev 1.13.

Use `POST /v1/decisions` when your application needs structured answers that code can consume directly. Phaseo exposes TypeSafe's Jev 1.13 as `typesafe/jev`.

The request contains:

* `state`: a string, object, or array containing the information to evaluate.
* `questions`: a map of named questions. Each question is `noul`, `choice`, or `score` and must include `instructions`.
* `model`: the Phaseo model ID. Use `typesafe/jev` for Jev 1.13.

Answers use the same keys as `questions`. `choice` answers include the selected option, probabilities, and confidence; `noul` answers include a 0–1 probability; and `score` answers include a probability-weighted score, legend, probabilities, and confidence.

You can mix all three question types in one request. See the [Quickstart](../../quickstart) for copy-pasteable cURL, JavaScript, TypeScript SDK, and Python SDK examples. Jev 1.13 is billed at \$0.042 per 1M input tokens; output tokens are free.

For the upstream question semantics, see TypeSafe's [API reference](https://docs.typesafe.ai/api).


## OpenAPI

````yaml POST /decisions
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    A gateway API for accessing various AI models with OpenAI-compatible
    endpoints.
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: Global routing
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /decisions:
    post:
      tags:
        - Gateway
      summary: Make structured decisions
      description: >-
        Evaluates typed Noul, Choice, and Score questions against structured
        state using a decision model such as TypeSafe Jev.
      operationId: makeDecision
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SystemOneRequest'
      responses:
        '200':
          description: Structured decisions response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneResponse'
components:
  schemas:
    SystemOneRequest:
      type: object
      required:
        - model
        - state
        - questions
      properties:
        model:
          type: string
          description: Canonical Phaseo model id or provider model alias.
          default: typesafe/jev
        state:
          description: Structured state evaluated by the model.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        questions:
          type: object
          minProperties: 1
          maxProperties: 128
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/SystemOneNoulQuestion'
              - $ref: '#/components/schemas/SystemOneChoiceQuestion'
              - $ref: '#/components/schemas/SystemOneScoreQuestion'
        meta:
          type: boolean
          default: false
        echo_upstream_request:
          type: boolean
        debug:
          $ref: '#/components/schemas/DebugOptions'
        provider:
          $ref: '#/components/schemas/ProviderRoutingOptions'
        routing:
          $ref: '#/components/schemas/ProviderRoutingOptions'
        metadata:
          type: object
          additionalProperties: true
    SystemOneResponse:
      type: object
      properties:
        model:
          type: string
        answers:
          type: object
          additionalProperties: true
        usage:
          $ref: '#/components/schemas/SystemOneUsage'
        request_id:
          type: string
          nullable: true
        meta:
          type: object
          additionalProperties: true
    SystemOneNoulQuestion:
      type: object
      required:
        - type
        - instructions
      properties:
        type:
          type: string
          enum:
            - noul
        instructions:
          $ref: '#/components/schemas/SystemOneInstructions'
        criteria:
          type: object
          properties:
            'true':
              type: string
            'false':
              type: string
          additionalProperties: true
    SystemOneChoiceQuestion:
      type: object
      required:
        - type
        - instructions
        - criteria
      properties:
        type:
          type: string
          enum:
            - choice
        instructions:
          $ref: '#/components/schemas/SystemOneInstructions'
        criteria:
          type: object
          minProperties: 1
          additionalProperties:
            type: string
            nullable: true
    SystemOneScoreQuestion:
      type: object
      required:
        - type
        - instructions
        - criteria
      properties:
        type:
          type: string
          enum:
            - score
        instructions:
          $ref: '#/components/schemas/SystemOneInstructions'
        criteria:
          type: array
          minItems: 2
          items:
            type: string
    DebugOptions:
      type: object
      description: Gateway debug controls. These flags are never forwarded upstream.
      properties:
        enabled:
          type: boolean
        return_upstream_request:
          type: boolean
        return_upstream_response:
          type: boolean
        trace:
          type: boolean
        trace_level:
          type: string
          enum:
            - summary
            - full
    ProviderRoutingOptions:
      type: object
      description: Provider routing preferences for gateway selection.
      properties:
        order:
          type: array
          items:
            type: string
        only:
          type: array
          items:
            type: string
        ignore:
          type: array
          items:
            type: string
        include_alpha:
          type: boolean
          description: Include alpha providers in routing (off by default).
        allow_fallbacks:
          type: boolean
          nullable: true
          description: Allow fallback to another eligible provider after failure.
        require_parameters:
          type: boolean
          nullable: true
          description: Require provider support for requested parameters before routing.
        required_execution_region:
          type: string
          nullable: true
          description: Restrict routing to providers with the requested execution region.
        required_data_region:
          type: string
          nullable: true
          description: Restrict routing to providers with the requested data region.
        require_zero_data_retention:
          type: boolean
          nullable: true
          description: Restrict routing to providers that support zero data retention.
        data_collection:
          type: string
          nullable: true
          enum:
            - allow
            - deny
        zdr:
          type: boolean
          nullable: true
        enforce_distillable_text:
          type: boolean
          nullable: true
        quantizations:
          type: array
          nullable: true
          items:
            type: string
        sort:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: >-
            Rank providers for this request, for example by price, latency, or
            throughput.
        max_price:
          type: object
          properties:
            prompt:
              oneOf:
                - type: number
                - type: string
            completion:
              oneOf:
                - type: number
                - type: string
            image:
              oneOf:
                - type: number
                - type: string
            audio:
              oneOf:
                - type: number
                - type: string
            request:
              oneOf:
                - type: number
                - type: string
        preferred_min_throughput:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
        preferred_max_latency:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
    SystemOneUsage:
      type: object
      properties:
        input_tokens:
          type: integer
          minimum: 0
        output_tokens:
          type: integer
          minimum: 0
        total_tokens:
          type: integer
          minimum: 0
    SystemOneInstructions:
      oneOf:
        - type: string
        - type: object
          additionalProperties: true
        - type: array
          items: {}
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication

````