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

# Submit Inference Operation



## OpenAPI

````yaml /openapi.json post /api/v1/inference/operations
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:
  /api/v1/inference/operations:
    post:
      tags:
        - inference
      summary: Submit Inference Operation
      operationId: submitInferenceOperation
      parameters:
        - name: X-Trajectory-Id
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            title: X-Trajectory-Id
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/ChatInferenceOperationInput'
                - $ref: '#/components/schemas/ResponsesInferenceOperationInput'
              discriminator:
                propertyName: api
                mapping:
                  chat: '#/components/schemas/ChatInferenceOperationInput'
                  responses: '#/components/schemas/ResponsesInferenceOperationInput'
              title: Body
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceOperationResponse'
        '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
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceErrorEnvelope'
          description: Service Unavailable
      security:
        - InferenceAuthorization: []
        - ApiKeyAuth: []
components:
  schemas:
    ChatInferenceOperationInput:
      properties:
        api:
          type: string
          const: chat
          title: Api
        input:
          $ref: '#/components/schemas/ChatCompletionRequest'
      type: object
      required:
        - api
        - input
      title: ChatInferenceOperationInput
    ResponsesInferenceOperationInput:
      properties:
        api:
          type: string
          const: responses
          title: Api
        input:
          $ref: '#/components/schemas/CreateResponseRequest'
      type: object
      required:
        - api
        - input
      title: ResponsesInferenceOperationInput
    InferenceOperationResponse:
      properties:
        id:
          type: string
          title: Id
        status:
          $ref: '#/components/schemas/InferenceOperationState'
        status_url:
          type: string
          title: Status Url
        deadline_at:
          type: string
          format: date-time
          title: Deadline At
        failure_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Code
        failure:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Failure
        result:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Result
      type: object
      required:
        - id
        - status
        - status_url
        - deadline_at
      title: InferenceOperationResponse
    InferenceErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/InferenceErrorDetail'
      type: object
      required:
        - error
      title: InferenceErrorEnvelope
    ChatCompletionRequest:
      properties:
        model:
          type: string
          title: Model
        messages:
          items:
            $ref: '#/components/schemas/ChatMessage'
          type: array
          title: Messages
        stream:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Stream
          default: false
        disable_thinking:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Disable Thinking
        temperature:
          anyOf:
            - type: number
            - type: 'null'
          title: Temperature
        max_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Tokens
          description: Maximum generated tokens, including reasoning tokens when emitted.
        top_p:
          anyOf:
            - type: number
            - type: 'null'
          title: Top P
      additionalProperties: true
      type: object
      required:
        - model
        - messages
      title: ChatCompletionRequest
    CreateResponseRequest:
      properties:
        model:
          type: string
          title: Model
        input:
          anyOf:
            - type: string
            - items:
                additionalProperties: true
                type: object
              type: array
          title: Input
        stream:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Stream
          default: false
        disable_thinking:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Disable Thinking
      additionalProperties: true
      type: object
      required:
        - model
        - input
      title: CreateResponseRequest
    InferenceOperationState:
      type: string
      enum:
        - PENDING
        - IN_PROGRESS
        - COMPLETED
        - FAILED
      title: InferenceOperationState
    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
    ChatMessage:
      properties:
        role:
          type: string
          title: Role
        content:
          anyOf:
            - type: string
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Content
      additionalProperties: true
      type: object
      required:
        - role
      title: ChatMessage
  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.