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



## OpenAPI

````yaml /openapi.json post /v1/responses
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/responses:
    post:
      tags:
        - inference
      summary: Create Response
      operationId: createResponse
      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/CreateResponseRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResponseResult'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ResponseStreamEvent'
        '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:
    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
    CreateResponseResult:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          title: Object
        created_at:
          type: number
          title: Created At
        status:
          type: string
          title: Status
        model:
          type: string
          title: Model
        output:
          items:
            anyOf:
              - $ref: '#/components/schemas/ResponseOutputMessage'
              - $ref: '#/components/schemas/ResponseFunctionToolCall'
              - $ref: '#/components/schemas/ResponseReasoningItem'
          type: array
          title: Output
        usage:
          anyOf:
            - $ref: '#/components/schemas/ResponseUsage'
            - type: 'null'
        incomplete_details:
          anyOf:
            - $ref: '#/components/schemas/ResponseIncompleteDetails'
            - type: 'null'
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
        metadata:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Metadata
        parallel_tool_calls:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Parallel Tool Calls
        previous_response_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Response Id
        tool_choice:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Choice
        tools:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResponseFunctionTool'
              type: array
            - type: 'null'
          title: Tools
      additionalProperties: true
      type: object
      required:
        - id
        - object
        - created_at
        - status
        - model
        - output
      title: CreateResponseResult
    ResponseStreamEvent:
      additionalProperties: true
      properties:
        type:
          type: string
          title: Type
        sequence_number:
          title: Sequence Number
          type: integer
        response:
          anyOf:
            - $ref: '#/components/schemas/CreateResponseResult'
            - type: 'null'
        item:
          anyOf:
            - $ref: '#/components/schemas/ResponseOutputMessage'
            - $ref: '#/components/schemas/ResponseFunctionToolCall'
            - $ref: '#/components/schemas/ResponseReasoningItem'
            - type: 'null'
          title: Item
        output_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Output Index
        content_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Content Index
        item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Item Id
        delta:
          anyOf:
            - type: string
            - type: 'null'
          title: Delta
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
      required:
        - type
        - sequence_number
      title: ResponseStreamEvent
      type: object
    InferenceErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/InferenceErrorDetail'
      type: object
      required:
        - error
      title: InferenceErrorEnvelope
    ResponseOutputMessage:
      properties:
        id:
          type: string
          title: Id
        content:
          items:
            anyOf:
              - $ref: '#/components/schemas/ResponseOutputText'
              - $ref: '#/components/schemas/ResponseOutputRefusal'
          type: array
          title: Content
        role:
          type: string
          const: assistant
          title: Role
        status:
          type: string
          enum:
            - in_progress
            - completed
            - incomplete
          title: Status
        type:
          type: string
          const: message
          title: Type
        phase:
          anyOf:
            - type: string
              enum:
                - commentary
                - final_answer
            - type: 'null'
          title: Phase
      additionalProperties: true
      type: object
      required:
        - id
        - content
        - role
        - status
        - type
      title: ResponseOutputMessage
    ResponseFunctionToolCall:
      properties:
        arguments:
          type: string
          title: Arguments
        call_id:
          type: string
          title: Call Id
        name:
          type: string
          title: Name
        type:
          type: string
          const: function_call
          title: Type
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        status:
          anyOf:
            - type: string
              enum:
                - in_progress
                - completed
                - incomplete
            - type: 'null'
          title: Status
      additionalProperties: true
      type: object
      required:
        - arguments
        - call_id
        - name
        - type
      title: ResponseFunctionToolCall
    ResponseReasoningItem:
      properties:
        id:
          type: string
          title: Id
        summary:
          items:
            $ref: '#/components/schemas/ResponseReasoningSummary'
          type: array
          title: Summary
        type:
          type: string
          const: reasoning
          title: Type
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResponseReasoningText'
              type: array
            - type: 'null'
          title: Content
        encrypted_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Encrypted Content
        status:
          anyOf:
            - type: string
              enum:
                - in_progress
                - completed
                - incomplete
            - type: 'null'
          title: Status
      additionalProperties: true
      type: object
      required:
        - id
        - summary
        - type
      title: ResponseReasoningItem
    ResponseUsage:
      properties:
        input_tokens:
          type: integer
          title: Input Tokens
        input_tokens_details:
          $ref: '#/components/schemas/ResponseInputTokensDetails'
        output_tokens:
          type: integer
          title: Output Tokens
        output_tokens_details:
          $ref: '#/components/schemas/ResponseOutputTokensDetails'
        total_tokens:
          type: integer
          title: Total Tokens
      additionalProperties: true
      type: object
      required:
        - input_tokens
        - input_tokens_details
        - output_tokens
        - output_tokens_details
        - total_tokens
      title: ResponseUsage
    ResponseIncompleteDetails:
      properties:
        reason:
          anyOf:
            - type: string
              enum:
                - max_output_tokens
                - content_filter
            - type: 'null'
          title: Reason
      additionalProperties: true
      type: object
      title: ResponseIncompleteDetails
    ResponseFunctionTool:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          const: function
          title: Type
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      additionalProperties: true
      type: object
      required:
        - name
        - type
      title: ResponseFunctionTool
    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
    ResponseOutputText:
      properties:
        annotations:
          items:
            anyOf:
              - $ref: '#/components/schemas/ResponseFileCitation'
              - $ref: '#/components/schemas/ResponseUrlCitation'
              - $ref: '#/components/schemas/ResponseContainerFileCitation'
              - $ref: '#/components/schemas/ResponseFilePath'
          type: array
          title: Annotations
        text:
          type: string
          title: Text
        type:
          type: string
          const: output_text
          title: Type
        logprobs:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResponseOutputLogprob'
              type: array
            - type: 'null'
          title: Logprobs
      additionalProperties: true
      type: object
      required:
        - annotations
        - text
        - type
      title: ResponseOutputText
    ResponseOutputRefusal:
      properties:
        refusal:
          type: string
          title: Refusal
        type:
          type: string
          const: refusal
          title: Type
      additionalProperties: true
      type: object
      required:
        - refusal
        - type
      title: ResponseOutputRefusal
    ResponseReasoningSummary:
      properties:
        text:
          type: string
          title: Text
        type:
          type: string
          const: summary_text
          title: Type
      additionalProperties: true
      type: object
      required:
        - text
        - type
      title: ResponseReasoningSummary
    ResponseReasoningText:
      properties:
        text:
          type: string
          title: Text
        type:
          type: string
          const: reasoning_text
          title: Type
      additionalProperties: true
      type: object
      required:
        - text
        - type
      title: ResponseReasoningText
    ResponseInputTokensDetails:
      properties:
        cached_tokens:
          type: integer
          title: Cached Tokens
      additionalProperties: true
      type: object
      required:
        - cached_tokens
      title: ResponseInputTokensDetails
    ResponseOutputTokensDetails:
      properties:
        reasoning_tokens:
          type: integer
          title: Reasoning Tokens
      additionalProperties: true
      type: object
      required:
        - reasoning_tokens
      title: ResponseOutputTokensDetails
    ResponseFileCitation:
      properties:
        file_id:
          type: string
          title: File Id
        filename:
          type: string
          title: Filename
        index:
          type: integer
          title: Index
        type:
          type: string
          const: file_citation
          title: Type
      additionalProperties: true
      type: object
      required:
        - file_id
        - filename
        - index
        - type
      title: ResponseFileCitation
    ResponseUrlCitation:
      properties:
        end_index:
          type: integer
          title: End Index
        start_index:
          type: integer
          title: Start Index
        title:
          type: string
          title: Title
        type:
          type: string
          const: url_citation
          title: Type
        url:
          type: string
          title: Url
      additionalProperties: true
      type: object
      required:
        - end_index
        - start_index
        - title
        - type
        - url
      title: ResponseUrlCitation
    ResponseContainerFileCitation:
      properties:
        container_id:
          type: string
          title: Container Id
        end_index:
          type: integer
          title: End Index
        file_id:
          type: string
          title: File Id
        filename:
          type: string
          title: Filename
        start_index:
          type: integer
          title: Start Index
        type:
          type: string
          const: container_file_citation
          title: Type
      additionalProperties: true
      type: object
      required:
        - container_id
        - end_index
        - file_id
        - filename
        - start_index
        - type
      title: ResponseContainerFileCitation
    ResponseFilePath:
      properties:
        file_id:
          type: string
          title: File Id
        index:
          type: integer
          title: Index
        type:
          type: string
          const: file_path
          title: Type
      additionalProperties: true
      type: object
      required:
        - file_id
        - index
        - type
      title: ResponseFilePath
    ResponseOutputLogprob:
      properties:
        token:
          type: string
          title: Token
        bytes:
          items:
            type: integer
          type: array
          title: Bytes
        logprob:
          type: number
          title: Logprob
        top_logprobs:
          items:
            $ref: '#/components/schemas/ResponseOutputLogprobTopLogprob'
          type: array
          title: Top Logprobs
      additionalProperties: true
      type: object
      required:
        - token
        - bytes
        - logprob
        - top_logprobs
      title: ResponseOutputLogprob
    ResponseOutputLogprobTopLogprob:
      properties:
        token:
          type: string
          title: Token
        bytes:
          items:
            type: integer
          type: array
          title: Bytes
        logprob:
          type: number
          title: Logprob
      additionalProperties: true
      type: object
      required:
        - token
        - bytes
        - logprob
      title: ResponseOutputLogprobTopLogprob
  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.