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

# Create Decision



## OpenAPI

````yaml /openapi.json post /v1/decisions
openapi: 3.1.0
info:
  title: Trajectory API
  version: 0.1.0
  x-trajectory-api-version: '2026-10-14'
  description: >-
    This contract is API version 2026-10-14. The optional Trajectory-API-Version
    header pins it, and tmp-contract is accepted as an alias. Requests without
    the header get this version. Version 2026-10-07 and the pre-launch legacy
    response formats are retired.
servers:
  - url: https://api.trajectory.ai
security: []
tags:
  - name: agents
    x-group: Agents
  - name: benchmarks
    x-group: Specs (benchmarks)
  - name: diagnostics
    x-group: Diagnostics
  - name: benchmark-ingestion
    x-group: Spec (benchmark) submissions
  - name: eval
    x-group: Evaluations
  - name: training
    x-group: Training
  - name: deployments
    x-group: Deployments
  - name: model-endpoints
    x-group: Model endpoints
  - name: inference
    x-group: Inference
  - name: trajectories
    x-group: Trajectories
  - name: artifacts
    x-group: Artifacts
  - name: telemetry
    x-group: Telemetry
  - name: supported-models
    x-group: Supported models
  - name: organizations
    x-group: Organizations
  - name: secrets
    x-group: Secrets
paths:
  /v1/decisions:
    post:
      tags:
        - inference
      summary: Create Decision
      operationId: createDecision
      parameters:
        - name: X-Trajectory-Id
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            title: X-Trajectory-Id
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDecisionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDecisionResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Conflict
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Bad Gateway
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Service Unavailable
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Gateway Timeout
      security:
        - InferenceAuthorization: []
        - ApiKeyAuth: []
components:
  schemas:
    CreateDecisionRequest:
      properties:
        model:
          type: string
          minLength: 1
          title: Model
        input:
          anyOf:
            - type: string
              minLength: 1
            - items:
                anyOf:
                  - $ref: '#/components/schemas/TextPart'
                  - $ref: '#/components/schemas/ImagePart'
              type: array
              minItems: 1
          title: Input
        questions:
          items:
            $ref: '#/components/schemas/DecisionQuestionInput'
          type: array
          maxItems: 1
          minItems: 1
          title: Questions
      additionalProperties: false
      type: object
      required:
        - model
        - input
        - questions
      title: CreateDecisionRequest
    CreateDecisionResponse:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: decision
          title: Object
          default: decision
        created:
          type: integer
          title: Created
        model:
          type: string
          title: Model
        result:
          anyOf:
            - $ref: '#/components/schemas/DecisionAnswerResponse'
            - type: 'null'
      type: object
      required:
        - id
        - created
        - model
        - result
      title: CreateDecisionResponse
    InferenceErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/InferenceErrorDetail'
      type: object
      required:
        - error
      title: InferenceErrorEnvelope
    TextPart:
      properties:
        text:
          type: string
          title: Text
          description: Text at this position in the message content.
        type:
          type: string
          const: text
          title: Type
          description: Identifies a text content part.
          default: text
      type: object
      required:
        - text
      title: TextPart
    ImagePart:
      properties:
        artifact_id:
          type: string
          minLength: 1
          title: Artifact Id
          description: >-
            Image artifact attached to this trajectory. Use its artifact read
            endpoint to request a download URL.
        type:
          type: string
          const: image
          title: Type
          description: Identifies an image content part.
          default: image
      type: object
      required:
        - artifact_id
      title: ImagePart
    DecisionQuestionInput:
      properties:
        type:
          type: string
          const: choice
          title: Type
        name:
          type: string
          minLength: 1
          title: Name
        instructions:
          type: string
          minLength: 1
          title: Instructions
        choices:
          items:
            $ref: '#/components/schemas/DecisionChoiceInput'
          type: array
          maxItems: 26
          minItems: 2
          title: Choices
      additionalProperties: false
      type: object
      required:
        - type
        - name
        - instructions
        - choices
      title: DecisionQuestionInput
    DecisionAnswerResponse:
      properties:
        name:
          type: string
          title: Name
        choice:
          type: string
          title: Choice
        probabilities:
          items:
            $ref: '#/components/schemas/ChoiceProbabilityResponse'
          type: array
          title: Probabilities
        confidence:
          type: number
          title: Confidence
        usage:
          anyOf:
            - $ref: '#/components/schemas/DecisionUsageResponse'
            - type: 'null'
      type: object
      required:
        - name
        - choice
        - probabilities
        - confidence
      title: DecisionAnswerResponse
    InferenceErrorDetail:
      properties:
        message:
          type: string
          title: Message
        type:
          type: string
          title: Type
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
      type: object
      required:
        - message
        - type
      title: InferenceErrorDetail
    DecisionChoiceInput:
      properties:
        value:
          type: string
          minLength: 1
          title: Value
        description:
          type: string
          title: Description
          default: ''
      additionalProperties: false
      type: object
      required:
        - value
      title: DecisionChoiceInput
    ChoiceProbabilityResponse:
      properties:
        value:
          type: string
          title: Value
        probability:
          type: number
          title: Probability
      type: object
      required:
        - value
        - probability
      title: ChoiceProbabilityResponse
    DecisionUsageResponse:
      properties:
        prompt_tokens:
          type: integer
          title: Prompt Tokens
        completion_tokens:
          type: integer
          title: Completion Tokens
        total_tokens:
          type: integer
          title: Total Tokens
      type: object
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      title: DecisionUsageResponse
  securitySchemes:
    InferenceAuthorization:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key

````

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