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

> ## Agent Instructions
> Phaseo Gateway base URL: https://api.phaseo.app/v1. Send `Authorization: Bearer $PHASEO_API_KEY` with every request.
> Model IDs look like `provider/model`, for example `openai/gpt-6-astra`. Do not guess IDs: list them with `GET /v1/models` or check https://phaseo.app/models. `phaseo/free` routes to an available free model and needs no wallet balance.
> For new text integrations prefer `POST /v1/responses`. `POST /v1/chat/completions` (OpenAI format) and `POST /v1/messages` (Anthropic format) suit existing code.
> The full API contract is https://phaseo.app/docs/openapi/v1/openapi.yaml. Official SDKs: `@phaseo/sdk` (TypeScript) and `phaseo` (Python), plus Go, C#, PHP, Ruby and Rust.
> Search these docs over MCP at https://phaseo.app/docs/mcp, and install Phaseo skills with `npx skills add https://phaseo.app/docs`. If a page is wrong or out of date, report it with the MCP `submit_feedback` tool.
> Manage Phaseo accounts with the `phaseo` CLI (`npm install -g @phaseo/cli`, then `phaseo login` or `phaseo login --device-code`), the `/v1` Management API or the MCP server at `https://mcp.phaseo.app/mcp?access=manage`. Do not send users to the dashboard for account tasks. A person is still needed for sign-up, approving a sign-in, paying the first top-up on the checkout link that `phaseo credits add` returns when no card is saved, confirming each saved-card top-up from the emailed link, and account security (password, MFA, passkeys). Create API keys with `phaseo keys create --name <name> --json`; never guess one. Credit top-ups need `phaseo login --scopes billing:write` first. Task map: https://phaseo.app/docs/v1/developers/manage-from-an-agent.md.

# Make a decision

> Evaluate typed questions against application state with supported decision models.

Use the OpenAI-compatible format for new calls: `input` contains text or user messages with inline `input_image` parts, and `questions` is an ordered array of `predicate`, `choice`, or `score` questions. Answers use the same order, with optional names. Boolean choice values remain booleans. Hosted HTTPS image URLs work only on Base Labs models (Elephant-1, Mammoth-1 and Joey-1) and must be on Amazon S3, Google Cloud Storage or Azure Blob Storage; Luna accepts up to 128 inline images, while other providers impose their own limits. Explicit image detail and `safety_identifier` require an OpenAI route. Existing `state`, named question maps, `noul`, and `criteria` remain supported and return the original answer map. Together Tev requires that legacy format because it returns labels without probabilities. The legacy examples below remain valid.

```json theme={null}
{
  "model": "openai/gpt-6-luna",
  "input": "I was charged twice for my order.",
  "questions": [{
    "type": "choice",
    "name": "department",
    "instructions": "Which department should handle this?",
    "choices": [
      { "value": "billing", "description": "Payments and refunds" },
      { "value": "other", "description": "Everything else" }
    ]
  }]
}
```

Use `POST /v1/decisions` when your application needs structured answers that code can consume directly. Supported models include TypeSafe Jev 1.13 (`typesafe/jev-1.13.0`), Together Tev1 4B Experimental (`together/tev1-4b-experimental`), and Respan Span-01 (`respan/span-01:free` and `respan/span-01`).

The request contains:

* `state`: a string, object, or array containing the information to evaluate.
* `questions`: a map of named questions. Each question sets `type` to `noul`, `choice`, or `score` and includes `instructions`; supported types depend on the selected model.
* `model`: the Phaseo model ID. Use `typesafe/jev-1.13.0` for Jev 1.13, or `typesafe/jev-latest` to follow the latest Jev release.

Liquid D1 (`liquid-ai/d1:free`, also available as `liquid-ai/d1`) and Perplexity Decider 27B (`perplexity/decider-27b`) support all three question types. D1 is free during experimental early access. Decider costs \$0.04 per million input tokens, including image tokens; output tokens are free. Add a Perplexity provider credential in Phaseo to use Decider. Its image state uses PNG, JPEG, or WebP base64 data URLs; remote image URLs are unsupported. Each choice question accepts up to 255 options, and each score question accepts up to 10 levels. Check model availability before calling either model.

Mercury Decide (`inception/mercury-decide`) supports predicate, choice, and score questions with text or JSON evidence. Choice questions accept up to 255 options; score questions accept up to 10 levels. Images, streaming, and tool calling are unsupported. Input is currently \$0.02 per million tokens under Inception's 50% promotion; output tokens are reported but free. Inception has not published a promotion end date. Check model availability and [current upstream pricing](https://docs.inceptionlabs.ai/get-started/models) before use.

```json theme={null}
{
  "model": "inception/mercury-decide",
  "input": "Please refund the duplicate charge on my account.",
  "questions": [{
    "type": "predicate",
    "name": "billing",
    "instructions": "Is this request about billing?"
  }]
}
```

Microsoft Decision (`microsoft/microsoft-decision-1`) uses an Azure Foundry deployment and supports predicate, choice, and score questions with text or JSON evidence. Its input limit is 32,768 tokens. Published pricing is \$0.042 per million input tokens, with free output. Media, streaming, tools, `safety_identifier`, and `service_tier` are unsupported. Check model availability before calling it. See [Microsoft's guide](https://learn.microsoft.com/azure/foundry/foundry-models/how-to/use-foundry-models-microsoft-decision).

```json theme={null}
{
  "model": "microsoft/microsoft-decision-1",
  "input": "The API returns 500 on every call.",
  "questions": [{
    "type": "choice",
    "name": "team",
    "instructions": "Which team should handle this ticket?",
    "choices": [
      { "value": "engineering", "description": "Bugs, errors, and outages" },
      { "value": "support", "description": "How-to and account questions" }
    ]
  }]
}
```

For Respan Span-01, `state` must be a conversation span with an `input` array of preceding messages and an `output` assistant message. Span-01 supports `noul` questions only. The `noul` answer is the probability that the behavior is present; `probabilities` also includes absent and not-observable probabilities.

```json theme={null}
{
  "model": "respan/span-01:free",
  "state": {
    "input": [{ "role": "user", "content": "Please connect me to a person." }],
    "output": { "role": "assistant", "content": "I will connect you to support." }
  },
  "questions": {
    "escalation": {
      "type": "noul",
      "instructions": "Does the assistant offer a human handoff?"
    }
  }
}
```

`respan/span-01:free` is the free Lite model with a daily limit; Phaseo maps it to Respan's `span-01-free` API model ID. `respan/span-01` maps to Respan's `span-01-pro` API model ID and is billed by Respan at \$0.02 per million input tokens; output tokens are free. Span-01 is in early access, so Respan must enable access for your organization. Add your Respan API key as a Respan provider credential in Phaseo before calling these models.

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.

For the Respan example, a response looks like this:

```json theme={null}
{
  "answers": {
    "escalation": {
      "type": "noul",
      "noul": 0.73,
      "probabilities": {
        "true": 0.73,
        "false": 0.25,
        "not_observable": 0.02
      }
    }
  }
}
```

Jev supports mixing all three question types in one request; Span-01 supports `noul` questions only. See the [Quickstart](https://phaseo.app/docs/v1/quickstart.md) 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).

### Images, Box, and long context with Jev

On supporting TypeSafe routes, Jev 1.13 and 1.14 accept inline PNG or JPEG images through `input_image` or legacy `images`. Phaseo builds TypeSafe's image assets and enables image support automatically. Images must meet TypeSafe's [image limits](https://docs.typesafe.ai/images): at most 16 MiB each, dimensions from 256 to 1568 pixels, and at least 78,400 total pixels. TypeSafe validates dimensions and encoding; it does not resize rejected images. The mapped upstream JSON body is limited to 32 MiB. Image tokens use the normal input price.

`box` is a separate question type for supporting routes such as Jev 1.14. It requires an image, takes no criteria, and returns one bounding box plus confidence. Its `top`, `bottom`, `left`, and `right` edges range from 0 to 1, measured from the top-left corner. Box always returns a rectangle; pair it with a `predicate` presence question when the target may be absent. With legacy images, refer to `images[0]`; with ordered input, refer to the first image or `[Image 0]`. See the [Box contract](https://docs.typesafe.ai/primitives/box).

Set `provider_options.typesafe.long_context` to `true` to raise both the per-request and per-question context limits to 262k tokens. The defaults are 64k per request and 32k per question. Long context is opt-in and has the same token price. Images, Box, and long context are experimental upstream capabilities; check model availability before use.

```json theme={null}
{
  "model": "typesafe/jev-1.14.0",
  "input": [{
    "role": "user",
    "content": [{ "type": "input_image", "image_url": "data:image/png;base64,<base64 image bytes>" }]
  }],
  "questions": [
    { "type": "predicate", "name": "visible", "instructions": "Is there a mug in the first image?" },
    { "type": "box", "name": "mug", "instructions": "The mug in the first image" }
  ],
  "provider_options": { "typesafe": { "long_context": true } }
}
```

### Image decisions with Clef

`cloudflare/clef` and `cloudflare/clef-flash` support all three question types and embedded images through Cloudflare Workers AI. Clef has a 65,536-token context window; Clef Flash has 24,576 tokens. Input costs $0.24 per million tokens for Clef and $0.038 for Clef Flash.

```json theme={null}
{
  "model": "cloudflare/clef-flash",
  "state": "Inspect the attached product photo.",
  "images": [{ "content_type": "image/png", "base64": "<base64 image bytes>" }],
  "questions": {
    "damaged": { "type": "noul", "instructions": "Is the product visibly damaged?" }
  }
}
```

You can also supply a `data:image/png;base64,...` string in `images`. Clef accepts up to four PNG, JPEG, or WebP images, each at most 4 MiB and 16 megapixels, with at most 8 MiB of decoded image data and a 13 MiB request body. Remote URLs are unsupported. Cloudflare validates image formats and dimensions. Models without image support reject image requests.

Clef accepts at most 64 questions, with IDs of up to 100 letters, digits, underscores, dots, or hyphens. Choice questions require 2–255 options; score questions require 2–10 levels. See Cloudflare's [Clef documentation](https://developers.cloudflare.com/workers-ai/models/clef/).

### Audio and video decisions with Clef Omni

`cloudflare/clef-omni` accepts text, images, audio, and video with the same ordered `questions` and answers as other Decisions models. Audio and video are Phaseo extensions to the OpenAI-style input contract; OpenAI Decisions routes currently support text and images only. Check model availability before use.

This example requires an available Omni route and a Phaseo API key. Replace the placeholder audio bytes and video URL with your own media before sending it.

```json theme={null}
{
  "model": "cloudflare/clef-omni",
  "input": [{
    "role": "user",
    "content": [
      { "type": "input_text", "text": "Review the recording and clip." },
      { "type": "input_audio", "input_audio": { "data": "<base64 WAV bytes>", "format": "wav" } },
      { "type": "input_video", "video_url": { "url": "https://media.example.com/clip.mp4" } }
    ]
  }],
  "questions": [{ "type": "predicate", "name": "safe", "instructions": "Is the equipment operating safely?" }]
}
```

Use `input_audio.data` with `format: "wav"` or `"mp3"`, or `input_audio.url` with a public HTTPS URL or an inline audio data URL. `input_video.video_url` accepts a string or `{ "url": "..." }` containing a public HTTPS URL or an inline MP4/WebM data URL. Remote servers must return the matching media Content-Type. Phaseo fetches URLs with size limits and private-address/redirect checks, then embeds the media for Cloudflare; provider credentials are never sent to the media server.

Omni accepts up to four audio clips (8 MiB and 300 seconds each) and two videos (16 MiB and 60 seconds each). Audio and video together cannot exceed 16 MiB decoded. Omni retains the per-image and combined-image limits above; its request-body limit replaces the 13 MiB Clef/Flash limit. Phaseo caps the complete Omni request body at 37 MiB. Cloudflare validates media encoding, image dimensions, and clip duration, and samples video at two frames per second. A video's soundtrack is used when every video in the request has one.

Omni has a documented 64,000-token context and costs \$0.15 per million aggregate input tokens. Media tokens count toward context and billing; output is free. Phaseo settles against Cloudflare's reported input usage without adding separate audio or video charges. See [Cloudflare's Omni contract](https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/workers-ai-models/clef-omni.json).


## OpenAPI

````yaml openapi/v1/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 ordered predicate, choice, and score questions against text or
        inline images using the OpenAI-compatible Decisions format. Legacy state
        and named question maps remain supported.
      operationId: makeDecision
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecisionCreateRequest'
      responses:
        '200':
          description: Structured decisions response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecisionCreateResponse'
components:
  schemas:
    DecisionCreateRequest:
      description: >-
        OpenAI-compatible input and ordered questions are the preferred format.
        Legacy state and named question maps remain supported. The response
        format follows the request format; do not mix the two.
      oneOf:
        - $ref: '#/components/schemas/OpenAIDecisionsRequest'
        - $ref: '#/components/schemas/LegacyDecisionsRequest'
    DecisionCreateResponse:
      description: >-
        Ordered answers for input/array requests, or a named map for legacy
        state/map requests.
      oneOf:
        - $ref: '#/components/schemas/OpenAIDecisionsResponse'
        - $ref: '#/components/schemas/LegacyDecisionsResponse'
    OpenAIDecisionsRequest:
      type: object
      required:
        - model
        - input
        - questions
      properties:
        model:
          type: string
          minLength: 1
          description: Canonical Phaseo model id or provider model alias.
        models:
          $ref: '#/components/schemas/ModelFallbacks'
        input:
          description: >-
            Text evidence or user messages containing text and inline images.
            Audio and video are Phaseo extensions for supporting models; OpenAI
            Decisions routes do not support these extensions.
          oneOf:
            - type: string
              maxLength: 10485760
            - type: array
              items:
                $ref: '#/components/schemas/DecisionInputMessage'
        questions:
          type: array
          minItems: 1
          items:
            oneOf:
              - $ref: '#/components/schemas/DecisionPredicateQuestion'
              - $ref: '#/components/schemas/OpenAIDecisionChoiceQuestion'
              - $ref: '#/components/schemas/OpenAIDecisionScoreQuestion'
              - $ref: '#/components/schemas/DecisionBoxQuestion'
        provider_options:
          $ref: '#/components/schemas/DecisionProviderOptions'
        safety_identifier:
          type: string
          nullable: true
          maxLength: 128
          description: Opaque end-user identifier. Supported on OpenAI routes only.
        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
    LegacyDecisionsRequest:
      description: >-
        Compatibility format using state, named question maps, and noul
        questions.
      type: object
      required:
        - model
        - state
        - questions
      properties:
        model:
          type: string
          description: Canonical Phaseo model id or provider model alias.
          default: typesafe/jev-1.13.0
        models:
          $ref: '#/components/schemas/ModelFallbacks'
        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/DecisionNoulQuestion'
              - $ref: '#/components/schemas/DecisionChoiceQuestion'
              - $ref: '#/components/schemas/DecisionScoreQuestion'
              - $ref: '#/components/schemas/LegacyDecisionBoxQuestion'
        provider_options:
          $ref: '#/components/schemas/DecisionProviderOptions'
        images:
          type: array
          maxItems: 4
          description: >-
            Embedded images for vision-capable decision models. Clef accepts
            PNG, JPEG, or WebP; remote URLs are unsupported. Maximum 4 MiB and
            16 megapixels per image, 8 MiB decoded total, and 13 MiB per request
            body.
          items:
            oneOf:
              - type: string
                pattern: >-
                  ^[Dd][Aa][Tt][Aa]:image/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$
              - $ref: '#/components/schemas/DecisionImage'
        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
    OpenAIDecisionsResponse:
      type: object
      required:
        - model
        - answers
        - usage
      properties:
        model:
          type: string
        answers:
          type: array
          description: >-
            One answer per question in request order, including unnamed or
            repeated-name questions.
          items:
            oneOf:
              - $ref: '#/components/schemas/DecisionPredicateAnswer'
              - $ref: '#/components/schemas/DecisionChoiceAnswer'
              - $ref: '#/components/schemas/DecisionScoreAnswer'
              - $ref: '#/components/schemas/DecisionRefusalAnswer'
              - $ref: '#/components/schemas/DecisionBoxAnswer'
        usage:
          $ref: '#/components/schemas/DecisionsUsage'
        request_id:
          type: string
          nullable: true
        meta:
          type: object
          additionalProperties: true
    LegacyDecisionsResponse:
      type: object
      properties:
        model:
          type: string
        answers:
          type: object
          additionalProperties: true
        usage:
          $ref: '#/components/schemas/DecisionsUsage'
        request_id:
          type: string
          nullable: true
        meta:
          type: object
          additionalProperties: true
    ModelFallbacks:
      type: array
      minItems: 1
      maxItems: 25
      items:
        type: string
        minLength: 1
      description: >-
        Optional ordered fallback models tried after `model`. `model` is
        required and is always the primary model. When an attempt fails with
        `429`, `500`, `502`, `503`, or `504`, the next entry is tried; other
        errors are returned unchanged. Accepts up to 25 model IDs or presets;
        duplicates and entries equal to `model` are ignored. Each attempt is
        validated, logged, and billed as its own request, and the response
        `model` field and routing trace show the model that served the request.
        Streaming requests fall back only before the first byte, and video and
        music jobs fall back only at submission. Batch, realtime, and council
        requests reject `models`. Fallbacks set on a dynamic route take
        precedence, and `phaseo/auto` cannot be combined with `models`.
      example:
        - anthropic/claude-sonnet-5-5
        - google/gemini-2.5-flash
    DecisionInputMessage:
      type: object
      required:
        - role
        - content
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - message
        role:
          type: string
          enum:
            - user
        content:
          oneOf:
            - type: string
              maxLength: 10485760
            - type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/DecisionInputText'
                  - $ref: '#/components/schemas/DecisionInputImage'
                  - $ref: '#/components/schemas/DecisionInputAudio'
                  - $ref: '#/components/schemas/DecisionInputVideo'
    DecisionPredicateQuestion:
      type: object
      required:
        - type
        - instructions
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - predicate
        name:
          type: string
          maxLength: 1048576
        instructions:
          type: string
          maxLength: 1048576
    OpenAIDecisionChoiceQuestion:
      type: object
      required:
        - type
        - instructions
        - choices
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - choice
        name:
          type: string
          maxLength: 1048576
        instructions:
          type: string
          maxLength: 1048576
        choices:
          type: array
          minItems: 1
          description: >-
            Values must be distinct; a boolean and a string with the same text
            are different values.
          items:
            type: object
            required:
              - value
            additionalProperties: false
            properties:
              value:
                oneOf:
                  - type: string
                  - type: boolean
              description:
                type: string
                maxLength: 1048576
    OpenAIDecisionScoreQuestion:
      type: object
      required:
        - type
        - instructions
        - levels
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - score
        name:
          type: string
          maxLength: 1048576
        instructions:
          type: string
          maxLength: 1048576
        levels:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - label
            additionalProperties: false
            properties:
              label:
                type: string
                maxLength: 1048576
              description:
                type: string
                maxLength: 1048576
    DecisionBoxQuestion:
      type: object
      required:
        - type
        - instructions
      additionalProperties: false
      description: >-
        Phaseo extension for a single bounding box. Requires image input and a
        supporting route, such as Jev 1.14. No criteria or not-found result.
      properties:
        type:
          type: string
          enum:
            - box
        name:
          type: string
          maxLength: 1048576
        instructions:
          type: string
          maxLength: 1048576
    DecisionProviderOptions:
      type: object
      properties:
        typesafe:
          type: object
          additionalProperties: false
          properties:
            long_context:
              type: boolean
              description: >-
                Opt in to experimental Jev long context: 262k tokens per request
                and per question, instead of 64k per request and 32k per
                question. Default false. Requires a supporting TypeSafe route.
    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
          description: >-
            `allow` (the default) filters nothing. `deny` is not supported yet
            and returns 400 unsupported_routing_filter.
          enum:
            - allow
            - deny
        zdr:
          type: boolean
          nullable: true
        enforce_distillable_text:
          type: boolean
          nullable: true
          description: >-
            `false` (the default) filters nothing. `true` is not supported yet
            and returns 400 unsupported_routing_filter.
        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
    DecisionNoulQuestion:
      type: object
      required:
        - type
        - instructions
      properties:
        type:
          type: string
          enum:
            - noul
        instructions:
          $ref: '#/components/schemas/DecisionInstructions'
        criteria:
          type: object
          properties:
            'true':
              type: string
            'false':
              type: string
          additionalProperties: true
    DecisionChoiceQuestion:
      type: object
      required:
        - type
        - instructions
        - criteria
      properties:
        type:
          type: string
          enum:
            - choice
        instructions:
          $ref: '#/components/schemas/DecisionInstructions'
        criteria:
          type: object
          minProperties: 1
          additionalProperties:
            type: string
            nullable: true
    DecisionScoreQuestion:
      type: object
      required:
        - type
        - instructions
        - criteria
      properties:
        type:
          type: string
          enum:
            - score
        instructions:
          $ref: '#/components/schemas/DecisionInstructions'
        criteria:
          type: array
          minItems: 2
          items:
            type: string
    LegacyDecisionBoxQuestion:
      type: object
      required:
        - type
        - instructions
      additionalProperties: false
      description: Single bounding-box question for image-capable Box routes. No criteria.
      properties:
        type:
          type: string
          enum:
            - box
        instructions:
          $ref: '#/components/schemas/DecisionInstructions'
    DecisionImage:
      type: object
      required:
        - content_type
        - base64
      properties:
        content_type:
          type: string
          enum:
            - image/png
            - image/jpeg
            - image/webp
        base64:
          type: string
          pattern: ^[A-Za-z0-9+/]+={0,2}$
    DecisionPredicateAnswer:
      type: object
      required:
        - type
        - name
        - probability
      properties:
        type:
          type: string
          enum:
            - predicate
        name:
          type: string
          nullable: true
        probability:
          type: number
          minimum: 0
          maximum: 1
    DecisionChoiceAnswer:
      type: object
      required:
        - type
        - name
        - choice
        - probabilities
        - confidence
      properties:
        type:
          type: string
          enum:
            - choice
        name:
          type: string
          nullable: true
        choice:
          oneOf:
            - type: string
            - type: boolean
        confidence:
          type: number
          minimum: 0
          maximum: 1
        probabilities:
          type: array
          items:
            type: object
            required:
              - value
              - probability
            properties:
              value:
                oneOf:
                  - type: string
                  - type: boolean
              probability:
                type: number
                minimum: 0
                maximum: 1
    DecisionScoreAnswer:
      type: object
      required:
        - type
        - name
        - score
        - probabilities
        - confidence
      properties:
        type:
          type: string
          enum:
            - score
        name:
          type: string
          nullable: true
        score:
          type: number
          minimum: 0
        confidence:
          type: number
          minimum: 0
          maximum: 1
        probabilities:
          type: array
          items:
            type: object
            required:
              - value
              - label
              - probability
            properties:
              value:
                type: integer
                minimum: 0
              label:
                type: string
              probability:
                type: number
                minimum: 0
                maximum: 1
    DecisionRefusalAnswer:
      type: object
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - refusal
        name:
          type: string
          nullable: true
    DecisionBoxAnswer:
      type: object
      required:
        - type
        - name
        - box
        - confidence
      properties:
        type:
          type: string
          enum:
            - box
        name:
          type: string
          nullable: true
        box:
          $ref: '#/components/schemas/DecisionBox'
        confidence:
          type: number
          minimum: 0
          maximum: 1
          nullable: true
          description: >-
            Confidence in the box, from 0 to 1, or null when the model gives
            none.
    DecisionsUsage:
      type: object
      properties:
        input_tokens:
          type: integer
          minimum: 0
        output_tokens:
          type: integer
          minimum: 0
        total_tokens:
          type: integer
          minimum: 0
        input_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              minimum: 0
            cache_write_tokens:
              type: integer
              minimum: 0
        output_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              minimum: 0
    DecisionInputText:
      type: object
      required:
        - type
        - text
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - input_text
        text:
          type: string
          maxLength: 10485760
    DecisionInputImage:
      type: object
      required:
        - type
        - image_url
      additionalProperties: false
      description: >-
        Inline base64 image, or an HTTPS image URL on Amazon S3, Google Cloud
        Storage or Azure Blob Storage (Base Labs models only). File IDs are
        unsupported. A request supports at most 128 images across all messages;
        individual providers can impose lower limits.
      properties:
        type:
          type: string
          enum:
            - input_image
        image_url:
          type: string
          maxLength: 1073741824
          pattern: >-
            ^(data:image/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/]+={0,2}|https://\S+)$
        detail:
          type: string
          nullable: true
          enum:
            - low
            - high
            - auto
            - original
          description: Explicit image detail is supported on OpenAI routes only.
    DecisionInputAudio:
      type: object
      required:
        - type
        - input_audio
      additionalProperties: false
      description: >-
        Phaseo extension for audio-capable decision models such as Clef Omni.
        Supply exactly one of base64 data (with format) or a public HTTPS/inline
        audio data URL. OpenAI decision models do not support this extension.
      properties:
        type:
          type: string
          enum:
            - input_audio
        input_audio:
          $ref: '#/components/schemas/DecisionAudioSource'
    DecisionInputVideo:
      type: object
      required:
        - type
        - video_url
      additionalProperties: false
      description: >-
        Phaseo extension for video-capable decision models such as Clef Omni.
        Supply a public HTTPS URL or an inline video data URL. OpenAI decision
        models do not support this extension.
      properties:
        type:
          type: string
          enum:
            - input_video
        video_url:
          oneOf:
            - type: string
              maxLength: 25165824
              pattern: >-
                ^(https://|data:video/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/]+={0,2}$)
            - type: object
              required:
                - url
              additionalProperties: false
              properties:
                url:
                  type: string
                  maxLength: 25165824
                  pattern: >-
                    ^(https://|data:video/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/]+={0,2}$)
    DecisionInstructions:
      oneOf:
        - type: string
        - type: object
          additionalProperties: true
        - type: array
          items: {}
    DecisionBox:
      type: object
      required:
        - top
        - bottom
        - left
        - right
      description: >-
        Edges as fractions of image dimensions from the top-left corner. top
        must be less than bottom; left must be less than right.
      properties:
        top:
          type: number
          minimum: 0
          maximum: 1
        bottom:
          type: number
          minimum: 0
          maximum: 1
        left:
          type: number
          minimum: 0
          maximum: 1
        right:
          type: number
          minimum: 0
          maximum: 1
    DecisionAudioSource:
      type: object
      additionalProperties: false
      anyOf:
        - required:
            - data
            - format
        - required:
            - url
      not:
        required:
          - data
          - url
      properties:
        data:
          type: string
          maxLength: 12582912
          pattern: ^[A-Za-z0-9+/]+={0,2}$
        format:
          type: string
          enum:
            - wav
            - mp3
        url:
          type: string
          maxLength: 25165824
          pattern: ^(https://|data:audio/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/]+={0,2}$)
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication

````

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