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

# System One Decisions

> Answer structured questions about your application state. Returns one typed answer per question, with probabilities. Gloo AI chooses the model, and any `model` you send is ignored.

> [card] [Guide: System One Decisions](https://docs.gloo.com/api-guides/system-one.md)
>
> Quickstart, question types, writing questions, pricing, and errors.


## OpenAPI

````yaml post /xds/v2/sys1
openapi: 3.1.0
info:
  title: AI API
  description: |-
    Optimized for high-speed inference and scalability by Gloo AI

    [Swagger UI](./docs) | [ReDoc UI](./redoc)
  version: 1.0.0
servers:
  - url: https://platform.ai.gloo.com
security:
  - bearerAuth: []
tags:
  - name: Content Controls
  - name: Data Engine
  - name: Ingestion & Enrichment
  - name: answers
  - name: chat
  - name: completions
  - name: content
  - name: core
  - name: data
  - name: get-models
  - name: ingestion
  - name: sotc
  - name: v1
  - name: v2
  - name: decisions
paths:
  /xds/v2/sys1:
    post:
      tags:
        - decisions
      summary: Post System One decision
      description: >-
        Answer structured questions about your application state. Returns one
        typed answer per question, with probabilities. Gloo AI chooses the
        model, and any `model` you send is ignored.
      operationId: post-sys1-v2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SystemOneRequestBody'
            examples:
              ticket_triage:
                summary: Ticket triage
                value:
                  state:
                    ticket: I was charged twice for my subscription this month.
                    customer_tier: pro
                  questions:
                    category:
                      type: choice
                      instructions: Which team should handle this ticket?
                      criteria:
                        billing: Payments, invoices, refunds, or charges.
                        technical: Bugs, errors, or how the product works.
                        account: Login, profile, or account settings.
                    wants_refund:
                      type: noul
                      instructions: The customer is asking for their money back.
      responses:
        '200':
          description: Successful decision response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneResponse'
              example:
                id: gen-dec-1793981370-uOwFt34AIeyibLNhYu26
                model: typesafe/jev-1.13-20260917
                provider: TypeSafe
                answers:
                  category:
                    type: choice
                    choice: billing
                    confidence: 1
                    probabilities:
                      account: 0
                      billing: 1
                      technical: 0
                  wants_refund:
                    type: noul
                    noul: 0.66
                usage:
                  input_tokens: 386
                  output_tokens: 58
        '400':
          description: >-
            The body is not a single JSON object, `state` is missing,
            `questions` is not an object, or the provider rejected a question.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneError'
        '401':
          description: The API key is missing or not valid.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/SystemOneAuthError'
                  - $ref: '#/components/schemas/SystemOneError'
        '402':
          description: Your organization is out of credit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneError'
        '403':
          description: >-
            The provider refused the content of the request, or your
            organization has no active billing account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneError'
        '413':
          description: The request body is larger than 32 MB.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneError'
        '429':
          description: >-
            Your organization reached its spending limit, or the provider is
            rate limiting the model. A spending limit has `error.type` set to
            `billing_error`: do not retry until it is resolved. Anything else is
            a rate limit: retry after the `Retry-After` delay if present,
            otherwise with backoff.
          headers:
            Retry-After:
              description: How long to wait before retrying, when the response includes it.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneError'
        '503':
          description: >-
            The service or the provider is temporarily unavailable. Retry after
            the `Retry-After` delay if present, otherwise with backoff.
          headers:
            Retry-After:
              description: How long to wait before retrying, when the response includes it.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneError'
components:
  schemas:
    SystemOneRequestBody:
      type: object
      title: SystemOneRequestBody
      required:
        - state
        - questions
      properties:
        state:
          description: >-
            The content System One reads to answer the questions: a string, or a
            JSON object or array of related context.
          oneOf:
            - type: string
            - type: object
            - type: array
              items: {}
        questions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SystemOneQuestion'
        session_id:
          type: string
          maxLength: 256
        user:
          type: string
        trace:
          type: object
    SystemOneResponse:
      type: object
      title: SystemOneResponse
      properties:
        id:
          type: string
        model:
          type: string
        provider:
          type: string
        answers:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SystemOneAnswer'
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
    SystemOneError:
      type: object
      title: SystemOneError
      description: >-
        Returned when Gloo refuses a request. Errors passed through from the
        provider can use another shape, so only `error.message` is guaranteed
        here.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            message:
              type: string
              description: A human-readable description of the error.
            type:
              type: string
              description: >-
                The error category. `billing_error` means your organization's
                credit or spending limit, not a provider rate limit.
            code:
              type: integer
              description: A numeric error code, such as `1001`.
            fault:
              type: string
              description: Which side caused the error, such as `client` or `provider`.
            retryable:
              type: boolean
              description: Whether the same request can succeed if retried.
    SystemOneAuthError:
      type: object
      title: SystemOneAuthError
      description: Returned when the API key is missing or not valid.
      required:
        - error
        - code
      properties:
        error:
          type: string
          description: A human-readable description of the error.
        code:
          type: string
          description: >-
            A machine-readable error code, such as
            `unauthorized_missing_authorization`.
    SystemOneQuestion:
      type: object
      title: SystemOneQuestion
      required:
        - type
        - instructions
      properties:
        type:
          type: string
          enum:
            - choice
            - noul
        instructions:
          type: string
          description: The question or statement to evaluate.
        criteria:
          type: object
          additionalProperties:
            type: string
          description: >-
            Required for `choice`. Map of option key to a description of when to
            pick it.
      if:
        properties:
          type:
            const: choice
      then:
        required:
          - criteria
    SystemOneAnswer:
      type: object
      title: SystemOneAnswer
      properties:
        type:
          type: string
        choice:
          type: string
          description: '`choice` only. The option key the model picked.'
        confidence:
          type: number
          description: '`choice` only. The model''s confidence in its choice.'
        probabilities:
          type: object
          additionalProperties:
            type: number
          description: '`choice` only. Option key to probability.'
        noul:
          type: number
          description: '`noul` only. The probability that the statement is true.'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: api-key
      x-default: Bearer <api-key>
      description: >-
        Bearer authentication header of the form Bearer `<api-key>`, where
        `<api-key>` is your [API key](/studio/manage-api-credentials).

````

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