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

# Execute Decision Model Completion

> Ask a decision model typed questions about a state and get calibrated probabilities back instead of generated text.



## OpenAPI

````yaml https://api.swarms.world/openapi.json post /v1/decision/completions
openapi: 3.1.0
info:
  title: Swarms API
  description: >-
    Swarms API provides scalable, secure orchestration for multi-agent systems.
    Access robust endpoints for managing agents and swarms, automating
    workflows, and monitoring execution. Requires an API key—see the [API Keys
    page](https://swarms.world/platform/api-keys). Refer to [Swarms API
    Documentation](https://docs.swarms.ai) for guides and details.
  version: 1.0.0
servers:
  - url: https://api.swarms.world
    description: Swarms Production API
security: []
paths:
  /v1/decision/completions:
    post:
      tags:
        - Decision Models
      summary: Execute Decision Model Completion
      description: >-
        Ask a decision model typed questions about a state and get calibrated
        probabilities back instead of generated text.
      operationId: run_decision_model_completions_v1_decision_completions_post
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecisionModelCompletion'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecisionModelCompletionOutput'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DecisionModelCompletion:
      properties:
        state:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - items: {}
              type: array
          title: State
          description: >-
            The content every question is asked about: text, a JSON object or a
            list.
        questions:
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/ChoiceQuestion'
              - $ref: '#/components/schemas/ScoreQuestion'
              - $ref: '#/components/schemas/NoulQuestion'
            discriminator:
              propertyName: type
              mapping:
                choice: '#/components/schemas/ChoiceQuestion'
                noul: '#/components/schemas/NoulQuestion'
                score: '#/components/schemas/ScoreQuestion'
          type: object
          minProperties: 1
          title: Questions
          description: >-
            Questions keyed by a name you choose. The answers come back under
            the same names.
        model_name:
          type: string
          title: Model Name
          description: >-
            Decision model that answers the questions; also accepted as model.
            GET /v1/decision/models lists the available models and their prices.
          default: jev-latest
      type: object
      required:
        - state
        - questions
      title: DecisionModelCompletion
    DecisionModelCompletionOutput:
      properties:
        job_id:
          type: string
          title: Job Id
          description: Unique identifier for this completion.
        status:
          type: string
          title: Status
          description: Status of the request, success when completed.
        model_name:
          type: string
          title: Model Name
          description: The decision model requested.
        model:
          type: string
          title: Model
          description: >-
            The model version that answered, which may differ from an alias such
            as jev-latest.
        answers:
          additionalProperties:
            additionalProperties: true
            type: object
          type: object
          title: Answers
          description: >-
            Answers keyed by question name. A choice answer has choice,
            probabilities and confidence; a score answer has score, legend,
            probabilities and confidence; a noul answer has noul, the
            probability from 0 to 1.
        usage:
          $ref: '#/components/schemas/DecisionModelUsage'
          description: Token usage and cost of this request.
        timestamp:
          type: string
          title: Timestamp
          description: ISO 8601 time the completion finished.
      type: object
      required:
        - job_id
        - status
        - model_name
        - model
        - answers
        - usage
        - timestamp
      title: DecisionModelCompletionOutput
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChoiceQuestion:
      properties:
        type:
          type: string
          const: choice
          title: Type
          description: Picks one of the options in criteria.
        instructions:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: 'null'
          title: Instructions
          description: What the model should decide when choosing an option.
        criteria:
          additionalProperties:
            anyOf:
              - type: string
              - additionalProperties: true
                type: object
              - items: {}
                type: array
              - type: 'null'
          type: object
          title: Criteria
          description: >-
            Option names mapped to a description of when each applies, or null
            to go by the name alone.
      type: object
      required:
        - type
        - criteria
      title: ChoiceQuestion
    ScoreQuestion:
      properties:
        type:
          type: string
          const: score
          title: Type
          description: Rates the state against the levels in criteria.
        instructions:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: 'null'
          title: Instructions
          description: What the model should rate.
        criteria:
          items:
            anyOf:
              - type: string
              - additionalProperties: true
                type: object
              - items: {}
                type: array
          type: array
          minItems: 1
          title: Criteria
          description: >-
            Level descriptions ordered from lowest to highest. Each level's
            position is its score, starting at 0.
      type: object
      required:
        - type
        - criteria
      title: ScoreQuestion
    NoulQuestion:
      properties:
        type:
          type: string
          const: noul
          title: Type
          description: Gives the probability that a yes/no question or statement is true.
        instructions:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: 'null'
          title: Instructions
          description: The yes/no question or statement to evaluate.
        criteria:
          anyOf:
            - $ref: '#/components/schemas/NoulCriteria'
            - type: 'null'
          description: What counts as a yes and as a no answer.
      type: object
      required:
        - type
      title: NoulQuestion
    DecisionModelUsage:
      properties:
        input_tokens:
          type: integer
          title: Input Tokens
          description: Input tokens reported by the provider.
        output_tokens:
          type: integer
          title: Output Tokens
          description: Output tokens reported by the provider.
        total_tokens:
          type: integer
          title: Total Tokens
          description: Input plus output tokens.
        input_cost:
          type: number
          title: Input Cost
          description: Cost of the input tokens in USD.
        output_cost:
          type: number
          title: Output Cost
          description: Cost of the output tokens in USD.
        total_cost:
          type: number
          title: Total Cost
          description: Amount charged for this request in USD.
      type: object
      required:
        - input_tokens
        - output_tokens
        - total_tokens
        - input_cost
        - output_cost
        - total_cost
      title: DecisionModelUsage
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    NoulCriteria:
      properties:
        'true':
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: 'null'
          title: 'True'
          description: What counts as a yes answer.
        'false':
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: 'null'
          title: 'False'
          description: What counts as a no answer.
      additionalProperties: false
      type: object
      title: NoulCriteria

````

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