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

# Turn context into a typed decision.

> Send input, an instruction and either an inline choice list or a previously created catalogue. This free endpoint does not require an API key; a bearer key is an optional alternative in the current contract. The response contains the selected choice, confidence and probabilities keyed by the original choice strings.



## OpenAPI

````yaml /openapi.json post /v1/decisions
openapi: 3.1.0
info:
  title: Aspas Labs API
  version: 1.0.0
  description: >-
    A small, direct API for structured decisions with Goldenfish. The free
    decision and model discovery surface does not require an API key. Send
    context, an instruction, and either inline choices or a reusable catalog.
    The response returns one selected choice, confidence, probabilities, the
    model used, and input-token usage. The model is selected in the request body
    so the public contract stays stable as the model catalog grows. Catalog
    management is a separate protected surface and requires a bearer key.
  contact:
    name: Aspas Labs
    url: https://aspaslabs.com/
    email: hello@aspaslabs.com
  license:
    name: Aspas Labs API terms
    url: https://aspaslabs.com/
servers:
  - url: https://api.aspaslabs.com
    description: Production
security: []
tags:
  - name: Decisions
    description: >-
      Run a constrained inference request and receive a typed choice with
      confidence and per-choice probabilities.
  - name: Models
    description: >-
      Discover model identifiers, availability status, and public input and
      choice limits.
  - name: Catalogs
    description: Create and manage named choice catalogs for repeatable decision workflows.
  - name: Health
    description: >-
      Check process liveness and whether an inference worker is ready to serve
      requests.
paths:
  /v1/decisions:
    post:
      tags:
        - Decisions
      summary: Turn context into a typed decision.
      description: >-
        Send input, an instruction and either an inline choice list or a
        previously created catalogue. This free endpoint does not require an API
        key; a bearer key is an optional alternative in the current contract.
        The response contains the selected choice, confidence and probabilities
        keyed by the original choice strings.
      operationId: createDecision
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecisionRequest'
            examples:
              inlineChoices:
                summary: Classify a support request
                value:
                  model: goldenfish-g1
                  input: forgot my password
                  instruction: Which category applies?
                  choices:
                    - reset_password
                    - billing
                    - cancel_account
                    - technical_issue
              catalog:
                summary: Use a reusable catalogue
                value:
                  model: goldenfish-g1
                  input: billing problem
                  instruction: What is the issue?
                  catalog: support-actions
      responses:
        '200':
          description: Decision completed.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Decision'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/AuthenticationRequired'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
      security:
        - {}
        - apiKey: []
components:
  schemas:
    DecisionRequest:
      type: object
      description: >-
        The context and constraints for one structured decision. Exactly one of
        `choices` or `catalog` must be provided.
      additionalProperties: false
      required:
        - model
        - input
        - instruction
      properties:
        model:
          type: string
          minLength: 1
          description: >-
            The Goldenfish model identifier. Select the model in the body
            instead of changing the route.
          examples:
            - goldenfish-g1
            - goldenfish-g1@REVISION
        input:
          type: string
          minLength: 1
          description: The context to classify.
        instruction:
          type: string
          minLength: 1
          description: The question or decision instruction.
        choices:
          type: array
          description: >-
            Inline valid outcomes. Send 2–300 unique, non-empty strings when you
            are not using a catalog.
          minItems: 2
          maxItems: 300
          uniqueItems: true
          items:
            type: string
            minLength: 1
        catalog:
          type: string
          minLength: 1
          description: A reusable catalogue ID.
      oneOf:
        - required:
            - choices
          not:
            required:
              - catalog
        - required:
            - catalog
          not:
            required:
              - choices
    Decision:
      type: object
      description: The result of one structured decision request.
      required:
        - id
        - object
        - model
        - output
        - usage
      properties:
        id:
          type: string
          pattern: ^dec_
          description: The unique decision identifier. Values begin with `dec_`.
          example: dec_01K7Y...
        object:
          const: decision
          description: Always `decision` for this response object.
        model:
          type: string
          description: The model identifier used to produce the result.
          example: goldenfish-g1
        output:
          $ref: '#/components/schemas/DecisionOutput'
        usage:
          $ref: '#/components/schemas/Usage'
    DecisionOutput:
      type: object
      description: >-
        The selected choice and the model's probability distribution over the
        valid outcomes.
      required:
        - choice
        - confidence
        - probabilities
      properties:
        choice:
          type: string
          description: The selected value from the submitted choices or referenced catalog.
          example: reset_password
        confidence:
          type: number
          format: float
          minimum: 0
          maximum: 1
          description: The probability assigned to the selected choice, from 0 to 1.
          example: 0.9489
        probabilities:
          type: object
          description: A map from every valid choice string to a probability from 0 to 1.
          additionalProperties:
            type: number
            format: float
            minimum: 0
            maximum: 1
          example:
            reset_password: 0.9489
            billing: 0.0001
    Usage:
      type: object
      description: Usage counters for the completed decision request.
      required:
        - input_tokens
      properties:
        input_tokens:
          type: integer
          format: int32
          minimum: 0
          description: Number of input tokens processed for the request.
          example: 13
    ErrorResponse:
      type: object
      description: The common error envelope returned for failed requests.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
            - code
          properties:
            message:
              type: string
              description: >-
                A human-readable explanation intended for logs and operator
                feedback.
              example: Rate limit exceeded.
            type:
              type: string
              description: The broad error category for program logic.
              enum:
                - invalid_request_error
                - authentication_error
                - rate_limit_error
                - model_error
                - server_error
            code:
              type: string
              description: A machine-readable reason for the failure.
              example: rate_limit_exceeded
            param:
              type:
                - string
                - 'null'
              description: The request parameter associated with the error, or `null`.
              example: null
  headers:
    RequestId:
      description: >-
        Correlation ID for this request. Keep it when contacting Aspas Labs
        about a failed or unexpected response.
      schema:
        type: string
        pattern: ^req_[A-Za-z0-9_-]+$
  responses:
    InvalidRequest:
      description: >-
        The request is invalid. Check required fields, JSON types, and the rule
        that exactly one of `choices` or `catalog` must be provided.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    AuthenticationRequired:
      description: >-
        Authentication is required or the supplied bearer key is invalid. Add a
        server-side `Authorization: Bearer gf_live_...` header when the endpoint
        requires one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: >-
        The request exceeded a rate, concurrency, or quota limit. Honor
        `Retry-After` when present and retry with bounded exponential backoff
        and jitter.
      headers:
        Retry-After:
          description: The minimum number of seconds to wait before retrying.
          schema:
            type: integer
            format: int32
            minimum: 0
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unavailable:
      description: >-
        The service or model is temporarily unavailable. Retry safely with
        bounded backoff when the operation can be repeated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: gf_live_...
      description: >-
        Use a bearer key beginning with `gf_live_...` for protected catalog
        operations. Keep keys server-side. Aspas Labs does not currently expose
        a self-service dashboard or key-management page.

````

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