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

# Create Response (OpenAI Responses API)

> Creates a response using the new OpenAI Responses API format. Often used by agentic tools (like OpenAI Codex or O-series models) for multi-step reasoning and structured outputs. Passes through all native parameters.



## OpenAPI

````yaml /api-reference/openapi.json post /responses
openapi: 3.1.0
info:
  title: LLM Router API
  description: >-
    Intelligent AI Gateway with smart routing, Skills, Zero Data Retention, and
    cost optimization. Fully compatible with the OpenAI API.
  version: 1.0.0
  contact:
    name: LLM Router Support
    url: https://docs.llmrouter.app
servers:
  - url: https://api.llmrouter.app/v1
    description: Production Server
security:
  - bearerAuth: []
paths:
  /responses:
    post:
      tags:
        - Responses
      summary: Create Response (OpenAI Responses API)
      description: >-
        Creates a response using the new OpenAI Responses API format. Often used
        by agentic tools (like OpenAI Codex or O-series models) for multi-step
        reasoning and structured outputs. Passes through all native parameters.
      requestBody:
        description: Responses API request parameters
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponseAPIRequest'
      responses:
        '200':
          description: Successful Response generation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAPIResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ResponseAPIRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: ID of the model to use (e.g., openai/o3)
        input:
          type: array
          description: The input conversation sequence.
          items:
            $ref: '#/components/schemas/Message'
        gateway:
          $ref: '#/components/schemas/GatewayConfig'
      additionalProperties: true
      description: >-
        Accepts any additional properties supported by the upstream Responses
        API (e.g., reasoning_effort, tools, instructions).
    ResponseAPIResult:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the response
          example: gen_8f90f62a-b4c1-4482-94b8-0132c42a6afb
        object:
          type: string
          example: response
        created_at:
          type: integer
          description: Unix timestamp when the response was created
        status:
          type: string
          enum:
            - completed
            - in_progress
            - failed
            - incomplete
          example: completed
        completed_at:
          type:
            - integer
            - 'null'
          nullable: true
        incomplete_details:
          type:
            - object
            - 'null'
          nullable: true
        error:
          type:
            - object
            - 'null'
          nullable: true
        output:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                example: message
              id:
                type: string
              status:
                type: string
              role:
                type: string
                example: assistant
              content:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      example: output_text
                    text:
                      type: string
                    annotations:
                      type: array
                      items:
                        type: object
                    logprobs:
                      type: array
                      items:
                        type: object
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            total_tokens:
              type: integer
            planning_usage_details:
              allOf:
                - $ref: '#/components/schemas/Usage'
              nullable: true
              description: >-
                The cost breakdown for the planning/reasoning phase of the
                request (if applicable). Can be null.
        model:
          type: string
        temperature:
          type: number
        top_p:
          type: number
        max_output_tokens:
          type:
            - integer
            - 'null'
          nullable: true
        presence_penalty:
          type: number
        frequency_penalty:
          type: number
        tools:
          type: array
          items:
            type: object
        tool_choice:
          type: string
          example: auto
        text:
          type: object
          properties:
            format:
              type: object
              properties:
                type:
                  type: string
                  example: text
        output_text:
          type: string
          description: Concatenated output text for convenience
      required:
        - id
        - object
        - created_at
        - status
        - model
        - output
        - usage
      additionalProperties: true
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
              nullable: true
              enum:
                - UNAUTHORIZED
                - FORBIDDEN
                - INTERNAL_SERVER_ERROR
                - BAD_REQUEST
                - USER_NOT_FOUND
                - MODEL_NOT_FOUND
                - EXCEEDS_MONTHLY_LIMIT
                - INVALID_GATEWAY_SETTINGS
                - TOO_MANY_REQUESTS
              description: Error code (can be null or undefined)
          additionalProperties: true
      additionalProperties: true
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
            - function
        content:
          type:
            - string
            - array
          description: >-
            The contents of the message. Can be a string or an array of
            multimodal content parts.
        name:
          type: string
      additionalProperties: true
    GatewayConfig:
      type: object
      description: Custom LLM Router configurations injected into the request.
      properties:
        zdr:
          type: boolean
          description: >-
            If true, enforces Zero Data Retention by only routing to non-logging
            providers.
        order:
          type: array
          items:
            type: string
          description: Priority list of provider slugs for fallbacks.
        only:
          type: array
          items:
            type: string
          description: Strict whitelist of allowed provider slugs.
        planningTriggerScore:
          type: number
          minimum: 0
          maximum: 1
          description: Threshold to trigger the Chain-of-Thought planning model.
        imageGenerationModel:
          type: string
          description: Fallback model used if the request requires an image output.
        tags:
          type: array
          description: Intent-based routing rules.
          items:
            type: object
            required:
              - name
              - description
              - models
            properties:
              name:
                type: string
              description:
                type: string
              models:
                type: array
                items:
                  type: string
        skills:
          type: object
          required:
            - skillIds
          properties:
            skillIds:
              type: array
              items:
                type: string
            enableAutoSearch:
              type: boolean
              default: false
        chatHistoryCompression:
          type: object
          properties:
            enabled:
              type: boolean
              default: false
            score:
              type: number
              minimum: 0
              maximum: 1
              default: 0.6
        mediaOptimization:
          type: boolean
          default: false
        toolOptimization:
          type: object
          properties:
            enabled:
              type: boolean
              default: false
            acceptScore:
              type: number
              minimum: 0
              maximum: 1
              default: 0.5
            alwaysInclude:
              type: array
              items:
                type: string
        redact:
          type: object
          description: PII redaction configuration
          properties:
            email:
              type: boolean
            phone:
              type: boolean
            ip:
              type: boolean
            uuid:
              type: boolean
            token:
              type: boolean
            credit_card:
              type: boolean
            iban:
              type: boolean
            ssn:
              type: boolean
            mac:
              type: boolean
            custom:
              type: array
              items:
                type: string
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
        cost:
          type: integer
          description: Total model usage cost (excluding routing fees)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: LLM Router API Key (e.g., sk-llmr-...)

````