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

# Create a response

> Generate an OpenAI-compatible Responses API object from text or structured input items, with optional tools and streaming events.



## OpenAPI

````yaml /openapi/naga-api.json post /v1/responses
openapi: 3.1.0
info:
  title: NagaAI API
  summary: Unified AI API with OpenAI and Anthropic compatibility layers.
  version: '2026-03-31'
  contact:
    name: NagaAI
    url: https://naga.ac
  termsOfService: https://naga.ac/legal/terms
servers:
  - url: https://api.naga.ac
    description: Production
  - url: http://localhost:8500
    description: Local development
security: []
tags:
  - name: Chat Completions
    description: >-
      OpenAI-compatible chat completion requests, including streaming, tools,
      and multimodal input.
  - name: Messages
    description: >-
      Anthropic-compatible Messages API requests used by Claude-style clients
      and agents.
  - name: Responses
    description: >-
      OpenAI-compatible Responses API requests for structured input, tools, and
      streaming output items.
  - name: Embeddings
    description: >-
      Create vector embeddings for search, retrieval, clustering, and ranking
      use cases.
  - name: Images
    description: >-
      Generate or edit images with multimodal models and OpenAI-compatible
      payloads.
  - name: Audio
    description: >-
      Generate speech or convert uploaded audio into transcriptions and
      translations.
  - name: Moderations
    description: Classify text and image inputs for safety policy categories.
  - name: Models
    description: List available models, capabilities, and pricing metadata.
  - name: Startups
    description: >-
      Public metadata about AI startups and model providers surfaced by the
      gateway.
  - name: Account
    description: Provisioning-key protected account balance and usage endpoints.
  - name: API Keys
    description: Provisioning-key protected API key management endpoints.
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Create a response
      description: >-
        Generate an OpenAI-compatible Responses API object from text or
        structured input items, with optional tools and streaming events.
      operationId: createResponse
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              basic:
                summary: Basic text request
                value:
                  model: gpt-4.1-mini
                  input: Summarize why caching matters for API performance.
                  instructions: Respond in 2 concise bullet points.
              tool_calling:
                summary: Structured tool calling request
                value:
                  model: gpt-4.1
                  input:
                    - type: message
                      role: user
                      content:
                        - type: input_text
                          text: >-
                            Check the weather in Paris and tell me if I need a
                            coat.
                  tools:
                    - type: function
                      name: get_weather
                      description: Fetch the current weather for a city.
                      parameters:
                        type: object
                        properties:
                          city:
                            type: string
                        required:
                          - city
                      strict: true
                  tool_choice:
                    type: function
                    name: get_weather
        required: true
      responses:
        '200':
          description: >-
            JSON response when stream=false, or Responses API Server-Sent Events
            when stream=true.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesApiResponse'
            text/event-stream:
              schema:
                type: string
                description: >-
                  Responses API event stream. Each data frame contains a JSON
                  event object followed by a final [DONE] marker.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '410':
          description: Model deprecated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationErrorResponse'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '503':
          description: Upstream service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - bearerAuth: []
        - xApiKeyAuth: []
components:
  schemas:
    ResponsesRequest:
      properties:
        model:
          type: string
          title: Model
          description: Model identifier to route the request to.
          examples:
            - gpt-4.1-mini
        input:
          anyOf:
            - type: string
            - items:
                oneOf:
                  - $ref: '#/components/schemas/InputMessage'
                  - $ref: '#/components/schemas/InputFunctionCall'
                  - $ref: '#/components/schemas/InputFunctionCallOutput'
                  - $ref: '#/components/schemas/InputReasoningItem'
                  - $ref: '#/components/schemas/ItemReference'
                discriminator:
                  propertyName: type
                  mapping:
                    function_call:
                      $ref: '#/components/schemas/InputFunctionCall'
                    function_call_output:
                      $ref: '#/components/schemas/InputFunctionCallOutput'
                    item_reference:
                      $ref: '#/components/schemas/ItemReference'
                    message:
                      $ref: '#/components/schemas/InputMessage'
                    reasoning:
                      $ref: '#/components/schemas/InputReasoningItem'
              type: array
          title: Input
          description: Text or structured input items to the model.
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: A system (or developer) message inserted into the model's context.
        max_output_tokens:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Output Tokens
        temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Temperature
        top_p:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Top P
        presence_penalty:
          anyOf:
            - type: number
            - type: 'null'
          title: Presence Penalty
        frequency_penalty:
          anyOf:
            - type: number
            - type: 'null'
          title: Frequency Penalty
        tools:
          anyOf:
            - items:
                oneOf:
                  - $ref: '#/components/schemas/FunctionTool'
                  - $ref: '#/components/schemas/WebSearchTool'
                  - $ref: '#/components/schemas/WebSearchPreviewTool'
                  - $ref: '#/components/schemas/FileSearchTool'
                  - $ref: '#/components/schemas/ComputerUseTool'
                  - $ref: '#/components/schemas/CodeInterpreterTool'
                  - $ref: '#/components/schemas/McpTool'
                  - $ref: '#/components/schemas/ImageGenerationTool'
                  - $ref: '#/components/schemas/LocalShellTool'
                  - $ref: '#/components/schemas/ShellTool'
                  - $ref: '#/components/schemas/ApplyPatchTool'
                  - $ref: '#/components/schemas/CustomTool'
                discriminator:
                  propertyName: type
                  mapping:
                    apply_patch:
                      $ref: '#/components/schemas/ApplyPatchTool'
                    code_interpreter:
                      $ref: '#/components/schemas/CodeInterpreterTool'
                    computer_use_preview:
                      $ref: '#/components/schemas/ComputerUseTool'
                    custom:
                      $ref: '#/components/schemas/CustomTool'
                    file_search:
                      $ref: '#/components/schemas/FileSearchTool'
                    function:
                      $ref: '#/components/schemas/FunctionTool'
                    image_generation:
                      $ref: '#/components/schemas/ImageGenerationTool'
                    local_shell:
                      $ref: '#/components/schemas/LocalShellTool'
                    mcp:
                      $ref: '#/components/schemas/McpTool'
                    shell:
                      $ref: '#/components/schemas/ShellTool'
                    web_search:
                      $ref: '#/components/schemas/WebSearchTool'
                    web_search_2025_08_26:
                      $ref: '#/components/schemas/WebSearchTool'
                    web_search_preview:
                      $ref: '#/components/schemas/WebSearchPreviewTool'
                    web_search_preview_2025_03_11:
                      $ref: '#/components/schemas/WebSearchPreviewTool'
              type: array
            - type: 'null'
          title: Tools
        tool_choice:
          anyOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - $ref: '#/components/schemas/ToolChoiceFunction'
            - $ref: '#/components/schemas/ToolChoiceFunctionLegacy'
            - $ref: '#/components/schemas/ToolChoiceAllowedTools'
            - type: 'null'
          title: Tool Choice
        parallel_tool_calls:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Parallel Tool Calls
        truncation:
          anyOf:
            - type: string
              enum:
                - auto
                - disabled
            - type: 'null'
          title: Truncation
        reasoning:
          anyOf:
            - $ref: '#/components/schemas/ReasoningConfig'
            - type: 'null'
        text:
          anyOf:
            - $ref: '#/components/schemas/ResponseTextConfig'
            - type: 'null'
        stream:
          type: boolean
          title: Stream
          description: >-
            Return a Responses API SSE event stream instead of a single JSON
            response.
          default: false
      type: object
      required:
        - model
        - input
      title: ResponsesRequest
      description: >-
        Stateless gateway schema for OpenAI Responses API request body.

        Strict request surface: only parameters that map to the gateway's
        unified model.
      examples:
        - input: Explain the tradeoff between throughput and latency.
          instructions: Respond in 2 bullet points.
          model: gpt-4.1-mini
    ResponsesApiResponse:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: response
          title: Object
          default: response
        created_at:
          type: integer
          title: Created At
        completed_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Completed At
        status:
          type: string
          title: Status
        incomplete_details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Incomplete Details
        model:
          type: string
          title: Model
        previous_response_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Response Id
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
        output:
          items:
            oneOf:
              - $ref: '#/components/schemas/ResponseMessageItem'
              - $ref: '#/components/schemas/ResponseFunctionCallItem'
              - $ref: '#/components/schemas/ResponseReasoningItem'
              - $ref: '#/components/schemas/ResponseImageGenerationCallItem'
            discriminator:
              propertyName: type
              mapping:
                function_call:
                  $ref: '#/components/schemas/ResponseFunctionCallItem'
                image_generation_call:
                  $ref: '#/components/schemas/ResponseImageGenerationCallItem'
                message:
                  $ref: '#/components/schemas/ResponseMessageItem'
                reasoning:
                  $ref: '#/components/schemas/ResponseReasoningItem'
          type: array
          title: Output
        error:
          anyOf:
            - $ref: '#/components/schemas/ResponseErrorOutput'
            - type: 'null'
        tools:
          items:
            oneOf:
              - $ref: '#/components/schemas/ResponseFunctionTool'
              - $ref: '#/components/schemas/ResponseWebSearchTool'
              - $ref: '#/components/schemas/ResponseWebSearchPreviewTool'
              - $ref: '#/components/schemas/ResponseFileSearchTool'
              - $ref: '#/components/schemas/ResponseComputerUseTool'
              - $ref: '#/components/schemas/ResponseCodeInterpreterTool'
              - $ref: '#/components/schemas/ResponseMcpTool'
              - $ref: '#/components/schemas/ResponseImageGenerationTool'
              - $ref: '#/components/schemas/ResponseLocalShellTool'
              - $ref: '#/components/schemas/ResponseShellTool'
              - $ref: '#/components/schemas/ResponseApplyPatchTool'
              - $ref: '#/components/schemas/ResponseCustomTool'
            discriminator:
              propertyName: type
              mapping:
                apply_patch:
                  $ref: '#/components/schemas/ResponseApplyPatchTool'
                code_interpreter:
                  $ref: '#/components/schemas/ResponseCodeInterpreterTool'
                computer_use_preview:
                  $ref: '#/components/schemas/ResponseComputerUseTool'
                custom:
                  $ref: '#/components/schemas/ResponseCustomTool'
                file_search:
                  $ref: '#/components/schemas/ResponseFileSearchTool'
                function:
                  $ref: '#/components/schemas/ResponseFunctionTool'
                image_generation:
                  $ref: '#/components/schemas/ResponseImageGenerationTool'
                local_shell:
                  $ref: '#/components/schemas/ResponseLocalShellTool'
                mcp:
                  $ref: '#/components/schemas/ResponseMcpTool'
                shell:
                  $ref: '#/components/schemas/ResponseShellTool'
                web_search:
                  $ref: '#/components/schemas/ResponseWebSearchTool'
                web_search_2025_08_26:
                  $ref: '#/components/schemas/ResponseWebSearchTool'
                web_search_preview:
                  $ref: '#/components/schemas/ResponseWebSearchPreviewTool'
                web_search_preview_2025_03_11:
                  $ref: '#/components/schemas/ResponseWebSearchPreviewTool'
          type: array
          title: Tools
        tool_choice:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ResponseFunctionToolChoice'
            - $ref: '#/components/schemas/ResponseAllowedToolsChoice'
            - type: 'null'
          title: Tool Choice
        truncation:
          anyOf:
            - type: string
              enum:
                - auto
                - disabled
            - type: 'null'
          title: Truncation
        parallel_tool_calls:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Parallel Tool Calls
        text:
          anyOf:
            - $ref: '#/components/schemas/ResponseTextConfigOutput'
            - type: 'null'
        top_p:
          anyOf:
            - type: number
            - type: 'null'
          title: Top P
        presence_penalty:
          anyOf:
            - type: number
            - type: 'null'
          title: Presence Penalty
        frequency_penalty:
          anyOf:
            - type: number
            - type: 'null'
          title: Frequency Penalty
        top_logprobs:
          anyOf:
            - type: integer
            - type: 'null'
          title: Top Logprobs
        temperature:
          anyOf:
            - type: number
            - type: 'null'
          title: Temperature
        reasoning:
          anyOf:
            - $ref: '#/components/schemas/ResponseReasoningConfigOutput'
            - type: 'null'
        usage:
          anyOf:
            - $ref: '#/components/schemas/ResponseUsageOutput'
            - type: 'null'
        max_output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Output Tokens
        max_tool_calls:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Tool Calls
        store:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Store
        background:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Background
        service_tier:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Tier
        metadata:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - additionalProperties: true
              type: object
          title: Metadata
        safety_identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Safety Identifier
        prompt_cache_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt Cache Key
      additionalProperties: true
      type: object
      required:
        - id
        - created_at
        - status
        - model
        - output
      title: ResponsesApiResponse
      examples:
        - completed_at: 1743393601
          created_at: 1743393600
          id: resp_123
          metadata: {}
          model: gpt-4.1-mini
          object: response
          output:
            - content:
                - annotations: []
                  logprobs: []
                  text: >-
                    - Caching avoids repeated upstream work for identical or
                    similar requests.

                    - It reduces latency spikes and helps keep infrastructure
                    costs predictable.
                  type: output_text
              id: msg_123
              role: assistant
              status: completed
              type: message
          status: completed
          tools: []
          usage:
            input_tokens: 18
            input_tokens_details:
              cached_tokens: 0
            output_tokens: 31
            output_tokens_details:
              reasoning_tokens: 0
            total_tokens: 49
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      additionalProperties: true
      type: object
      required:
        - error
      title: ErrorEnvelope
      examples:
        - error:
            message: The request body is invalid.
            type: invalid_request_error
    HTTPValidationErrorResponse:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
          type: array
          title: Detail
      additionalProperties: true
      type: object
      required:
        - detail
      title: HTTPValidationErrorResponse
    InputMessage:
      properties:
        type:
          type: string
          const: message
          title: Type
          default: message
        role:
          type: string
          enum:
            - user
            - assistant
            - system
            - developer
          title: Role
        content:
          anyOf:
            - type: string
            - items:
                oneOf:
                  - $ref: '#/components/schemas/InputTextPart'
                  - $ref: '#/components/schemas/OutputTextPart'
                  - $ref: '#/components/schemas/InputImagePart'
                  - $ref: '#/components/schemas/InputAudioPart'
                  - $ref: '#/components/schemas/InputFilePart'
                discriminator:
                  propertyName: type
                  mapping:
                    input_audio:
                      $ref: '#/components/schemas/InputAudioPart'
                    input_file:
                      $ref: '#/components/schemas/InputFilePart'
                    input_image:
                      $ref: '#/components/schemas/InputImagePart'
                    input_text:
                      $ref: '#/components/schemas/InputTextPart'
                    output_text:
                      $ref: '#/components/schemas/OutputTextPart'
              type: array
            - type: 'null'
          title: Content
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - role
      title: InputMessage
      description: Corresponds to `InputMessage`.
    InputFunctionCall:
      properties:
        type:
          type: string
          const: function_call
          title: Type
        call_id:
          type: string
          title: Call Id
        name:
          type: string
          title: Name
        arguments:
          type: string
          title: Arguments
          default: ''
      type: object
      required:
        - type
        - call_id
        - name
      title: InputFunctionCall
      description: Corresponds to `RealtimeConversationItemFunctionCall` / `InputItem`.
    InputFunctionCallOutput:
      properties:
        type:
          type: string
          const: function_call_output
          title: Type
        call_id:
          type: string
          title: Call Id
        output:
          anyOf:
            - type: string
            - items:
                oneOf:
                  - $ref: '#/components/schemas/InputTextPart'
                  - $ref: '#/components/schemas/InputImagePart'
                  - $ref: '#/components/schemas/InputFilePart'
                discriminator:
                  propertyName: type
                  mapping:
                    input_file:
                      $ref: '#/components/schemas/InputFilePart'
                    input_image:
                      $ref: '#/components/schemas/InputImagePart'
                    input_text:
                      $ref: '#/components/schemas/InputTextPart'
              type: array
          title: Output
          default: ''
      type: object
      required:
        - type
        - call_id
      title: InputFunctionCallOutput
      description: >-
        Corresponds to `RealtimeConversationItemFunctionCallOutput` /
        `InputItem`.
    InputReasoningItem:
      properties:
        type:
          type: string
          const: reasoning
          title: Type
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        content:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Content
        summary:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Summary
        encrypted_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Encrypted Content
        status:
          anyOf:
            - type: string
              enum:
                - in_progress
                - completed
                - incomplete
            - type: 'null'
          title: Status
      type: object
      required:
        - type
      title: InputReasoningItem
      description: Corresponds to `ReasoningItem`.
    ItemReference:
      properties:
        type:
          type: string
          const: item_reference
          title: Type
          default: item_reference
        id:
          type: string
          title: Id
      type: object
      required:
        - id
      title: ItemReference
      description: OpenAI Responses API `item_reference` input item.
    FunctionTool:
      properties:
        type:
          type: string
          const: function
          title: Type
          default: function
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Function name exposed to the model.
          examples:
            - get_weather
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
          default: true
        function:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Function
      type: object
      title: FunctionTool
      description: Corresponds to `FunctionTool`.
    WebSearchTool:
      properties:
        type:
          type: string
          enum:
            - web_search
            - web_search_2025_08_26
          title: Type
        filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Filters
        search_context_size:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
            - type: 'null'
          title: Search Context Size
        user_location:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: User Location
      type: object
      required:
        - type
      title: WebSearchTool
      description: |-
        OpenAI Responses API web search tool (gateway subset).

        We only accept the identifying `type`. Presence enables internal
        `web_search_options` in the unified request config.
    WebSearchPreviewTool:
      properties:
        type:
          type: string
          enum:
            - web_search_preview
            - web_search_preview_2025_03_11
          title: Type
        search_context_size:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
            - type: 'null'
          title: Search Context Size
        user_location:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: User Location
      type: object
      required:
        - type
      title: WebSearchPreviewTool
    FileSearchTool:
      properties:
        type:
          type: string
          const: file_search
          title: Type
        vector_store_ids:
          items:
            type: string
          type: array
          title: Vector Store Ids
        filters:
          anyOf:
            - {}
            - type: 'null'
          title: Filters
        max_num_results:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Num Results
        ranking_options:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Ranking Options
      type: object
      required:
        - type
        - vector_store_ids
      title: FileSearchTool
    ComputerUseTool:
      properties:
        type:
          type: string
          const: computer_use_preview
          title: Type
        display_height:
          anyOf:
            - type: integer
            - type: number
          title: Display Height
        display_width:
          anyOf:
            - type: integer
            - type: number
          title: Display Width
        environment:
          type: string
          enum:
            - windows
            - mac
            - linux
            - ubuntu
            - browser
          title: Environment
      type: object
      required:
        - type
        - display_height
        - display_width
        - environment
      title: ComputerUseTool
    CodeInterpreterTool:
      properties:
        type:
          type: string
          const: code_interpreter
          title: Type
        container:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
          title: Container
      type: object
      required:
        - type
        - container
      title: CodeInterpreterTool
    McpTool:
      properties:
        type:
          type: string
          const: mcp
          title: Type
        server_label:
          type: string
          title: Server Label
        allowed_tools:
          anyOf:
            - {}
            - type: 'null'
          title: Allowed Tools
        authorization:
          anyOf:
            - type: string
            - type: 'null'
          title: Authorization
        connector_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Connector Id
        headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Headers
        require_approval:
          anyOf:
            - {}
            - type: 'null'
          title: Require Approval
        server_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Server Description
        server_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Server Url
      type: object
      required:
        - type
        - server_label
      title: McpTool
    ImageGenerationTool:
      properties:
        type:
          type: string
          const: image_generation
          title: Type
        background:
          anyOf:
            - type: string
              enum:
                - transparent
                - opaque
                - auto
            - type: 'null'
          title: Background
        input_fidelity:
          anyOf:
            - type: string
              enum:
                - high
                - low
            - type: 'null'
          title: Input Fidelity
        input_image_mask:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Image Mask
        model:
          anyOf:
            - type: string
              enum:
                - gpt-image-1
                - gpt-image-1-mini
            - type: 'null'
          title: Model
        moderation:
          anyOf:
            - type: string
              enum:
                - auto
                - low
            - type: 'null'
          title: Moderation
        output_compression:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Output Compression
        output_format:
          anyOf:
            - type: string
              enum:
                - png
                - webp
                - jpeg
            - type: 'null'
          title: Output Format
        partial_images:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Partial Images
        quality:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
                - auto
            - type: 'null'
          title: Quality
        size:
          anyOf:
            - type: string
              enum:
                - 1024x1024
                - 1024x1536
                - 1536x1024
                - auto
            - type: 'null'
          title: Size
      type: object
      required:
        - type
      title: ImageGenerationTool
    LocalShellTool:
      properties:
        type:
          type: string
          const: local_shell
          title: Type
      type: object
      required:
        - type
      title: LocalShellTool
    ShellTool:
      properties:
        type:
          type: string
          const: shell
          title: Type
      type: object
      required:
        - type
      title: ShellTool
    ApplyPatchTool:
      properties:
        type:
          type: string
          const: apply_patch
          title: Type
      type: object
      required:
        - type
      title: ApplyPatchTool
    CustomTool:
      properties:
        type:
          type: string
          const: custom
          title: Type
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        format:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Format
      type: object
      required:
        - type
        - name
      title: CustomTool
    ToolChoiceFunction:
      properties:
        type:
          type: string
          const: function
          title: Type
        name:
          type: string
          title: Name
      type: object
      required:
        - type
        - name
      title: ToolChoiceFunction
      description: |-
        Official Responses API tool_choice for forcing a function call:
          {"type":"function","name":"get_weather"}
    ToolChoiceFunctionLegacy:
      properties:
        type:
          type: string
          const: function
          title: Type
        function:
          additionalProperties:
            type: string
          type: object
          title: Function
      type: object
      required:
        - type
        - function
      title: ToolChoiceFunctionLegacy
      description: |-
        Backwards-compatible chat-style tool_choice:
          {"type":"function","function":{"name":"get_weather"}}
    ToolChoiceAllowedTools:
      properties:
        type:
          type: string
          const: allowed_tools
          title: Type
        mode:
          anyOf:
            - type: string
              enum:
                - auto
                - required
            - type: 'null'
          title: Mode
        tools:
          items:
            $ref: '#/components/schemas/ToolChoiceFunction'
          type: array
          title: Tools
      type: object
      required:
        - type
        - tools
      title: ToolChoiceAllowedTools
      description: |-
        Official Responses API allowed_tools:
          {"type":"allowed_tools","mode":"auto|required","tools":[{...}]}
    ReasoningConfig:
      properties:
        effort:
          anyOf:
            - type: string
              enum:
                - none
                - minimal
                - low
                - medium
                - high
                - xhigh
            - type: 'null'
          title: Effort
      type: object
      title: ReasoningConfig
      description: |-
        Corresponds to `Reasoning` schema.

        We keep this as the subset that maps to the gateway's unified
        `reasoning_effort` control.
    ResponseTextConfig:
      properties:
        format:
          anyOf:
            - $ref: '#/components/schemas/ResponseTextFormat'
            - type: 'null'
      type: object
      title: ResponseTextConfig
      description: Corresponds to CreateResponse `text` parameter.
    ResponseMessageItem:
      properties:
        type:
          type: string
          const: message
          title: Type
          default: message
        id:
          type: string
          title: Id
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        role:
          type: string
          title: Role
        content:
          items:
            $ref: '#/components/schemas/ResponseOutputTextPart'
          type: array
          title: Content
      additionalProperties: true
      type: object
      required:
        - id
        - role
        - content
      title: ResponseMessageItem
    ResponseFunctionCallItem:
      properties:
        type:
          type: string
          const: function_call
          title: Type
          default: function_call
        id:
          type: string
          title: Id
        call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Call Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        arguments:
          type: string
          title: Arguments
          default: ''
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      additionalProperties: true
      type: object
      required:
        - id
      title: ResponseFunctionCallItem
    ResponseReasoningItem:
      properties:
        type:
          type: string
          const: reasoning
          title: Type
          default: reasoning
        id:
          type: string
          title: Id
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        summary:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResponseSummaryTextPart'
              type: array
            - type: 'null'
          title: Summary
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResponseReasoningTextPart'
              type: array
            - type: 'null'
          title: Content
        encrypted_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Encrypted Content
      additionalProperties: true
      type: object
      required:
        - id
      title: ResponseReasoningItem
    ResponseImageGenerationCallItem:
      properties:
        type:
          type: string
          const: image_generation_call
          title: Type
          default: image_generation_call
        id:
          type: string
          title: Id
        result:
          type: string
          title: Result
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      additionalProperties: true
      type: object
      required:
        - id
        - result
      title: ResponseImageGenerationCallItem
    ResponseErrorOutput:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        message:
          type: string
          title: Message
      additionalProperties: true
      type: object
      required:
        - message
      title: ResponseErrorOutput
    ResponseFunctionTool:
      properties:
        type:
          type: string
          const: function
          title: Type
          default: function
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
      additionalProperties: true
      type: object
      title: ResponseFunctionTool
    ResponseWebSearchTool:
      properties:
        type:
          type: string
          enum:
            - web_search
            - web_search_2025_08_26
          title: Type
        filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Filters
        search_context_size:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
            - type: 'null'
          title: Search Context Size
        user_location:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: User Location
      additionalProperties: true
      type: object
      required:
        - type
      title: ResponseWebSearchTool
    ResponseWebSearchPreviewTool:
      properties:
        type:
          type: string
          enum:
            - web_search_preview
            - web_search_preview_2025_03_11
          title: Type
        search_context_size:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
            - type: 'null'
          title: Search Context Size
        user_location:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: User Location
      additionalProperties: true
      type: object
      required:
        - type
      title: ResponseWebSearchPreviewTool
    ResponseFileSearchTool:
      properties:
        type:
          type: string
          const: file_search
          title: Type
        vector_store_ids:
          items:
            type: string
          type: array
          title: Vector Store Ids
        filters:
          anyOf:
            - {}
            - type: 'null'
          title: Filters
        max_num_results:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Num Results
        ranking_options:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Ranking Options
      additionalProperties: true
      type: object
      required:
        - type
        - vector_store_ids
      title: ResponseFileSearchTool
    ResponseComputerUseTool:
      properties:
        type:
          type: string
          const: computer_use_preview
          title: Type
        display_height:
          anyOf:
            - type: integer
            - type: number
          title: Display Height
        display_width:
          anyOf:
            - type: integer
            - type: number
          title: Display Width
        environment:
          type: string
          enum:
            - windows
            - mac
            - linux
            - ubuntu
            - browser
          title: Environment
      additionalProperties: true
      type: object
      required:
        - type
        - display_height
        - display_width
        - environment
      title: ResponseComputerUseTool
    ResponseCodeInterpreterTool:
      properties:
        type:
          type: string
          const: code_interpreter
          title: Type
        container:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
          title: Container
      additionalProperties: true
      type: object
      required:
        - type
        - container
      title: ResponseCodeInterpreterTool
    ResponseMcpTool:
      properties:
        type:
          type: string
          const: mcp
          title: Type
        server_label:
          type: string
          title: Server Label
        allowed_tools:
          anyOf:
            - {}
            - type: 'null'
          title: Allowed Tools
        authorization:
          anyOf:
            - type: string
            - type: 'null'
          title: Authorization
        connector_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Connector Id
        headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Headers
        require_approval:
          anyOf:
            - {}
            - type: 'null'
          title: Require Approval
        server_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Server Description
        server_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Server Url
      additionalProperties: true
      type: object
      required:
        - type
        - server_label
      title: ResponseMcpTool
    ResponseImageGenerationTool:
      properties:
        type:
          type: string
          const: image_generation
          title: Type
        background:
          anyOf:
            - type: string
              enum:
                - transparent
                - opaque
                - auto
            - type: 'null'
          title: Background
        input_fidelity:
          anyOf:
            - type: string
              enum:
                - high
                - low
            - type: 'null'
          title: Input Fidelity
        input_image_mask:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Image Mask
        model:
          anyOf:
            - type: string
              enum:
                - gpt-image-1
                - gpt-image-1-mini
            - type: 'null'
          title: Model
        moderation:
          anyOf:
            - type: string
              enum:
                - auto
                - low
            - type: 'null'
          title: Moderation
        output_compression:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Output Compression
        output_format:
          anyOf:
            - type: string
              enum:
                - png
                - webp
                - jpeg
            - type: 'null'
          title: Output Format
        partial_images:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Partial Images
        quality:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
                - auto
            - type: 'null'
          title: Quality
        size:
          anyOf:
            - type: string
              enum:
                - 1024x1024
                - 1024x1536
                - 1536x1024
                - auto
            - type: 'null'
          title: Size
      additionalProperties: true
      type: object
      required:
        - type
      title: ResponseImageGenerationTool
    ResponseLocalShellTool:
      properties:
        type:
          type: string
          const: local_shell
          title: Type
      additionalProperties: true
      type: object
      required:
        - type
      title: ResponseLocalShellTool
    ResponseShellTool:
      properties:
        type:
          type: string
          const: shell
          title: Type
      additionalProperties: true
      type: object
      required:
        - type
      title: ResponseShellTool
    ResponseApplyPatchTool:
      properties:
        type:
          type: string
          const: apply_patch
          title: Type
      additionalProperties: true
      type: object
      required:
        - type
      title: ResponseApplyPatchTool
    ResponseCustomTool:
      properties:
        type:
          type: string
          const: custom
          title: Type
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        format:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Format
      additionalProperties: true
      type: object
      required:
        - type
        - name
      title: ResponseCustomTool
    ResponseFunctionToolChoice:
      properties:
        type:
          type: string
          const: function
          title: Type
          default: function
        name:
          type: string
          title: Name
      additionalProperties: true
      type: object
      required:
        - name
      title: ResponseFunctionToolChoice
    ResponseAllowedToolsChoice:
      properties:
        type:
          type: string
          const: allowed_tools
          title: Type
          default: allowed_tools
        mode:
          type: string
          enum:
            - auto
            - required
          title: Mode
          default: auto
        tools:
          items:
            $ref: '#/components/schemas/ResponseFunctionToolChoice'
          type: array
          title: Tools
      additionalProperties: true
      type: object
      required:
        - tools
      title: ResponseAllowedToolsChoice
    ResponseTextConfigOutput:
      properties:
        format:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/ResponseTextFormatText'
                - $ref: '#/components/schemas/ResponseTextFormatJsonObject'
                - $ref: '#/components/schemas/ResponseTextFormatJsonSchema'
              discriminator:
                propertyName: type
                mapping:
                  json_object:
                    $ref: '#/components/schemas/ResponseTextFormatJsonObject'
                  json_schema:
                    $ref: '#/components/schemas/ResponseTextFormatJsonSchema'
                  text:
                    $ref: '#/components/schemas/ResponseTextFormatText'
            - type: 'null'
          title: Format
        verbosity:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
            - type: 'null'
          title: Verbosity
      additionalProperties: true
      type: object
      title: ResponseTextConfigOutput
    ResponseReasoningConfigOutput:
      properties:
        effort:
          anyOf:
            - type: string
              enum:
                - none
                - minimal
                - low
                - medium
                - high
                - xhigh
            - type: 'null'
          title: Effort
        summary:
          anyOf:
            - type: string
              enum:
                - auto
                - concise
                - detailed
            - type: 'null'
          title: Summary
      additionalProperties: true
      type: object
      title: ResponseReasoningConfigOutput
    ResponseUsageOutput:
      properties:
        input_tokens:
          type: integer
          title: Input Tokens
        input_tokens_details:
          $ref: '#/components/schemas/ResponseUsageInputTokensDetails'
        output_tokens:
          type: integer
          title: Output Tokens
        output_tokens_details:
          $ref: '#/components/schemas/ResponseUsageOutputTokensDetails'
        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: ResponseUsageOutput
    ErrorBody:
      properties:
        type:
          type: string
          title: Type
          description: Stable machine-readable error type.
        message:
          type: string
          title: Message
          description: Human-readable error message.
        code:
          anyOf:
            - type: string
            - type: integer
            - type: 'null'
          title: Code
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
      additionalProperties: true
      type: object
      required:
        - type
        - message
      title: ErrorBody
    ValidationErrorItem:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Loc
        msg:
          type: string
          title: Msg
        type:
          type: string
          title: Type
      additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationErrorItem
    InputTextPart:
      properties:
        type:
          type: string
          const: input_text
          title: Type
        text:
          type: string
          title: Text
          description: Plain text input content.
          examples:
            - Summarize the importance of cache invalidation.
      type: object
      required:
        - type
        - text
      title: InputTextPart
    OutputTextPart:
      properties:
        type:
          type: string
          const: output_text
          title: Type
        text:
          type: string
          title: Text
        annotations:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Annotations
        logprobs:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Logprobs
      type: object
      required:
        - type
        - text
      title: OutputTextPart
    InputImagePart:
      properties:
        type:
          type: string
          const: input_image
          title: Type
        image_url:
          type: string
          minLength: 1
          format: uri
          title: Image Url
        detail:
          anyOf:
            - type: string
              enum:
                - auto
                - low
                - high
            - type: 'null'
          title: Detail
      type: object
      required:
        - type
        - image_url
      title: InputImagePart
    InputAudioPart:
      properties:
        type:
          type: string
          const: input_audio
          title: Type
        input_audio:
          additionalProperties: true
          type: object
          title: Input Audio
      type: object
      required:
        - type
        - input_audio
      title: InputAudioPart
    InputFilePart:
      properties:
        type:
          type: string
          const: input_file
          title: Type
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        file_data:
          anyOf:
            - type: string
              minLength: 1
              format: uri
            - type: 'null'
          title: File Data
        file_url:
          anyOf:
            - type: string
              minLength: 1
              format: uri
            - type: 'null'
          title: File Url
        input_file:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input File
      type: object
      required:
        - type
      title: InputFilePart
      description: >-
        File input supported by this gateway (subset of official Responses API):


        We only support *inline* file payloads that can be forwarded through our

        `/v1/chat/completions` message format:

          {"type":"input_file","filename":"x.pdf","file_data":"data:application/pdf;base64,..."}
          {"type":"input_file","input_file":{"filename":"x.pdf","file_data":"https://..."}}  (nested variant)

        We intentionally do NOT support file references like `file_id` because
        our

        underlying `/v1/chat/completions` pipeline cannot forward them.
    ResponseTextFormat:
      properties:
        type:
          type: string
          enum:
            - text
            - json_object
            - json_schema
          title: Type
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Schema
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
      type: object
      required:
        - type
      title: ResponseTextFormat
      description: Corresponds to `ResponseFormatJsonSchema` or `ResponseFormatText`.
    ResponseOutputTextPart:
      properties:
        type:
          type: string
          const: output_text
          title: Type
          default: output_text
        text:
          type: string
          title: Text
        annotations:
          items:
            $ref: '#/components/schemas/ResponseOutputTextAnnotation'
          type: array
          title: Annotations
        logprobs:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Logprobs
      additionalProperties: true
      type: object
      required:
        - text
      title: ResponseOutputTextPart
    ResponseSummaryTextPart:
      properties:
        type:
          type: string
          const: summary_text
          title: Type
          default: summary_text
        text:
          type: string
          title: Text
      additionalProperties: true
      type: object
      required:
        - text
      title: ResponseSummaryTextPart
    ResponseReasoningTextPart:
      properties:
        type:
          type: string
          const: reasoning_text
          title: Type
          default: reasoning_text
        text:
          type: string
          title: Text
      additionalProperties: true
      type: object
      required:
        - text
      title: ResponseReasoningTextPart
    ResponseTextFormatText:
      properties:
        type:
          type: string
          const: text
          title: Type
          default: text
      additionalProperties: true
      type: object
      title: ResponseTextFormatText
    ResponseTextFormatJsonObject:
      properties:
        type:
          type: string
          const: json_object
          title: Type
          default: json_object
      additionalProperties: true
      type: object
      title: ResponseTextFormatJsonObject
    ResponseTextFormatJsonSchema:
      properties:
        type:
          type: string
          const: json_schema
          title: Type
          default: json_schema
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Schema
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
      additionalProperties: true
      type: object
      title: ResponseTextFormatJsonSchema
    ResponseUsageInputTokensDetails:
      properties:
        cached_tokens:
          type: integer
          title: Cached Tokens
      additionalProperties: true
      type: object
      required:
        - cached_tokens
      title: ResponseUsageInputTokensDetails
    ResponseUsageOutputTokensDetails:
      properties:
        reasoning_tokens:
          type: integer
          title: Reasoning Tokens
      additionalProperties: true
      type: object
      required:
        - reasoning_tokens
      title: ResponseUsageOutputTokensDetails
    ResponseOutputTextAnnotation:
      properties:
        type:
          type: string
          title: Type
        start_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Start Index
        end_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: End Index
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
      additionalProperties: true
      type: object
      required:
        - type
      title: ResponseOutputTextAnnotation
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Primary authentication for inference endpoints. Send your Naga API key
        as `Authorization: Bearer <api-key>`.
      scheme: bearer
    xApiKeyAuth:
      type: apiKey
      description: >-
        Alternate authentication for inference endpoints. Useful for clients
        that send `x-api-key: <api-key>`.
      in: header
      name: x-api-key

````