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

# Generate a response

> Create a response using the specified model and instructions.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/responses
openapi: 3.1.0
info:
  title: Neosantara AI API
  description: OpenAI-compatible LLM Gateway
  version: 1.0.0
servers:
  - url: https://api.neosantara.xyz
    description: Neosantara Production Gateway
security:
  - bearerAuth: []
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Generate a response
      description: Create a response using the specified model and instructions.
      operationId: postV1Responses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type:
                    - string
                    - 'null'
                input:
                  anyOf:
                    - type: string
                    - type: array
                      items:
                        anyOf:
                          - type: object
                            properties:
                              type:
                                type: string
                                const: item_reference
                              id:
                                type: string
                            required:
                              - type
                              - id
                          - type: object
                            properties:
                              type:
                                type: string
                                const: message
                                default: message
                              role:
                                type: string
                                const: user
                                default: user
                              id:
                                type:
                                  - string
                                  - 'null'
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      oneOf:
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: input_text
                                            text:
                                              type: string
                                          required:
                                            - type
                                            - text
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: input_image
                                            image_url:
                                              type: string
                                            file_id:
                                              type: string
                                            detail:
                                              type: string
                                              enum:
                                                - auto
                                                - low
                                                - high
                                              default: auto
                                            fidelity:
                                              type: string
                                              enum:
                                                - auto
                                                - low
                                                - high
                                              default: auto
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: input_file
                                            file_id:
                                              type: string
                                            file_data:
                                              type: string
                                            file_url:
                                              type: string
                                            filename:
                                              type: string
                                            detail:
                                              type: string
                                              enum:
                                                - low
                                                - high
                                          required:
                                            - type
                              status:
                                type:
                                  - string
                                  - 'null'
                            required:
                              - content
                          - type: object
                            properties:
                              type:
                                type: string
                                const: message
                                default: message
                              role:
                                type: string
                                const: assistant
                                default: assistant
                              id:
                                type:
                                  - string
                                  - 'null'
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          const: output_text
                                        text:
                                          type: string
                                        annotations:
                                          type: array
                                          items:
                                            type: string
                                      required:
                                        - type
                                        - text
                              status:
                                type:
                                  - string
                                  - 'null'
                                enum:
                                  - in_progress
                                  - completed
                                  - failed
                                  - null
                            required:
                              - content
                          - type: object
                            properties:
                              type:
                                type: string
                                const: message
                                default: message
                              role:
                                type: string
                                const: system
                                default: system
                              id:
                                type:
                                  - string
                                  - 'null'
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      oneOf:
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: input_text
                                            text:
                                              type: string
                                          required:
                                            - type
                                            - text
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: input_image
                                            image_url:
                                              type: string
                                            file_id:
                                              type: string
                                            detail:
                                              type: string
                                              enum:
                                                - auto
                                                - low
                                                - high
                                              default: auto
                                            fidelity:
                                              type: string
                                              enum:
                                                - auto
                                                - low
                                                - high
                                              default: auto
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: input_file
                                            file_id:
                                              type: string
                                            file_data:
                                              type: string
                                            file_url:
                                              type: string
                                            filename:
                                              type: string
                                            detail:
                                              type: string
                                              enum:
                                                - low
                                                - high
                                          required:
                                            - type
                            required:
                              - content
                          - type: object
                            properties:
                              type:
                                type: string
                                const: message
                                default: message
                              role:
                                type: string
                                const: developer
                                default: developer
                              id:
                                type:
                                  - string
                                  - 'null'
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      oneOf:
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: input_text
                                            text:
                                              type: string
                                          required:
                                            - type
                                            - text
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: input_image
                                            image_url:
                                              type: string
                                            file_id:
                                              type: string
                                            detail:
                                              type: string
                                              enum:
                                                - auto
                                                - low
                                                - high
                                              default: auto
                                            fidelity:
                                              type: string
                                              enum:
                                                - auto
                                                - low
                                                - high
                                              default: auto
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: input_file
                                            file_id:
                                              type: string
                                            file_data:
                                              type: string
                                            file_url:
                                              type: string
                                            filename:
                                              type: string
                                            detail:
                                              type: string
                                              enum:
                                                - low
                                                - high
                                          required:
                                            - type
                            required:
                              - content
                          - type: object
                            properties:
                              type:
                                type: string
                                const: reasoning
                              id:
                                type:
                                  - string
                                  - 'null'
                              summary:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      const: summary_text
                                    text:
                                      type: string
                                  required:
                                    - type
                                    - text
                              content:
                                type: array
                                items:
                                  type: string
                              encrypted_content:
                                type: string
                            required:
                              - type
                              - summary
                          - type: object
                            properties:
                              type:
                                type: string
                                const: compaction
                              id:
                                type:
                                  - string
                                  - 'null'
                              encrypted_content:
                                type: string
                            required:
                              - type
                              - encrypted_content
                          - type: object
                            properties:
                              type:
                                type: string
                                const: mcp_approval_request
                              id:
                                type:
                                  - string
                                  - 'null'
                              server_label:
                                type: string
                              name:
                                type: string
                              arguments:
                                type: string
                            required:
                              - type
                              - server_label
                              - name
                              - arguments
                          - type: object
                            properties:
                              type:
                                type: string
                                const: mcp_approval_response
                              id:
                                type:
                                  - string
                                  - 'null'
                              approval_request_id:
                                type: string
                              approve:
                                type: boolean
                              reason:
                                type: string
                            required:
                              - type
                              - approval_request_id
                              - approve
                          - type: object
                            properties:
                              type:
                                type: string
                                const: function_call
                              id:
                                type:
                                  - string
                                  - 'null'
                              call_id:
                                type: string
                              name:
                                type: string
                              arguments:
                                type: string
                              status:
                                type: string
                                enum:
                                  - in_progress
                                  - completed
                                  - failed
                            required:
                              - type
                              - call_id
                              - name
                              - arguments
                          - type: object
                            properties:
                              type:
                                type: string
                                const: function_call_output
                              id:
                                type:
                                  - string
                                  - 'null'
                              call_id:
                                type: string
                              output:
                                anyOf:
                                  - type: string
                                  - type: object
                                    additionalProperties: {}
                            required:
                              - type
                              - call_id
                          - type: object
                            properties:
                              type:
                                type: string
                            required:
                              - type
                            additionalProperties: true
                    - type: 'null'
                previous_response_id:
                  type:
                    - string
                    - 'null'
                include:
                  type: array
                  items:
                    type: string
                tools:
                  type:
                    - array
                    - 'null'
                  items:
                    anyOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            const: function
                          name:
                            type: string
                          description:
                            type: string
                          parameters:
                            type: object
                            additionalProperties: {}
                          strict:
                            type: boolean
                            default: true
                        required:
                          - type
                          - name
                          - parameters
                      - type: object
                        properties:
                          type:
                            type: string
                            const: computer-preview
                          display_width:
                            type: integer
                            exclusiveMinimum: 0
                          display_height:
                            type: integer
                            exclusiveMinimum: 0
                          environment: {}
                        required:
                          - type
                          - display_width
                          - display_height
                      - type: object
                        properties:
                          type:
                            type: string
                            const: apply_patch
                        required:
                          - type
                      - type: object
                        properties:
                          type:
                            type: string
                            const: mcp
                          server_label:
                            type: string
                          server_url:
                            type: string
                          server_description:
                            type: string
                          authorization:
                            type: string
                          authorization_token:
                            type: string
                          headers:
                            type: object
                            additionalProperties:
                              type: string
                          allowed_tools:
                            anyOf:
                              - type: array
                                items:
                                  type: string
                              - {}
                          require_approval: {}
                        required:
                          - type
                          - server_label
                      - type: object
                        properties:
                          type:
                            type: string
                            const: image_generation
                          model: {}
                          quality:
                            type: string
                            enum:
                              - low
                              - medium
                              - high
                              - auto
                          size:
                            type: string
                            enum:
                              - 1024x1024
                              - 1024x1536
                              - 1536x1024
                              - auto
                          output_format:
                            type: string
                            enum:
                              - png
                              - webp
                              - jpeg
                          output_compression:
                            type: integer
                            minimum: 0
                            maximum: 100
                          moderation:
                            type: string
                            enum:
                              - auto
                              - low
                          background:
                            type: string
                            enum:
                              - transparent
                              - opaque
                              - auto
                          input_fidelity:
                            type:
                              - string
                              - 'null'
                            enum:
                              - high
                              - low
                              - null
                          input_image_mask:
                            type: object
                            properties:
                              image_url:
                                type: string
                              file_id:
                                type: string
                          partial_images:
                            type: integer
                            minimum: 0
                            maximum: 3
                          action:
                            type: string
                            enum:
                              - auto
                              - generate
                              - edit
                        required:
                          - type
                      - type: object
                        properties:
                          type:
                            type: string
                            const: web_search
                        required:
                          - type
                        additionalProperties: true
                      - type: object
                        properties:
                          type:
                            type: string
                            const: file_search
                        required:
                          - type
                        additionalProperties: true
                      - type: object
                        properties:
                          type:
                            type: string
                            const: code_interpreter
                          env_vars:
                            type: object
                            additionalProperties:
                              type: string
                          timeout_ms:
                            type: number
                            default: 60000
                          sandbox_id:
                            type: string
                        required:
                          - type
                      - type: object
                        properties:
                          type:
                            type: string
                        required:
                          - type
                        additionalProperties: true
                tool_choice:
                  type: 'null'
                mcp_servers:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        const: url
                      url:
                        type: string
                        format: uri
                      name:
                        type: string
                        minLength: 1
                      authorization_token:
                        type: string
                      allowed_tools:
                        type: array
                        items:
                          type: string
                    required:
                      - url
                      - name
                    additionalProperties: true
                metadata:
                  type:
                    - object
                    - 'null'
                  additionalProperties: {}
                text:
                  type:
                    - object
                    - 'null'
                  properties:
                    format:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - text
                            - json_object
                            - json_schema
                      required:
                        - type
                temperature:
                  type:
                    - number
                    - 'null'
                top_p:
                  type:
                    - number
                    - 'null'
                presence_penalty:
                  type:
                    - number
                    - 'null'
                frequency_penalty:
                  type:
                    - number
                    - 'null'
                parallel_tool_calls:
                  type:
                    - boolean
                    - 'null'
                stream:
                  type: boolean
                stream_options:
                  type: 'null'
                background:
                  type: boolean
                max_output_tokens:
                  type:
                    - integer
                    - 'null'
                  exclusiveMinimum: 0
                max_tool_calls:
                  type:
                    - integer
                    - 'null'
                  exclusiveMinimum: 0
                reasoning:
                  type:
                    - object
                    - 'null'
                  properties:
                    effort:
                      type:
                        - string
                        - 'null'
                      enum:
                        - none
                        - minimal
                        - low
                        - medium
                        - high
                        - xhigh
                        - max
                        - null
                    summary:
                      type:
                        - string
                        - 'null'
                      enum:
                        - auto
                        - concise
                        - detailed
                        - null
                    encrypted_content:
                      type:
                        - boolean
                        - 'null'
                  additionalProperties: true
                user:
                  type:
                    - string
                    - 'null'
                safety_identifier:
                  type:
                    - string
                    - 'null'
                prompt_cache_key:
                  type:
                    - string
                    - 'null'
                prompt_cache_retention:
                  type: 'null'
                truncation:
                  type: string
                  enum:
                    - auto
                    - disabled
                instructions:
                  type:
                    - string
                    - 'null'
                store:
                  type: boolean
                service_tier: {}
                top_logprobs:
                  type:
                    - integer
                    - 'null'
                conversation:
                  type: 'null'
              additionalProperties: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  object:
                    type: string
                    const: response
                  created_at:
                    type: number
                  status:
                    type: string
                    enum:
                      - queued
                      - in_progress
                      - completed
                      - failed
                  model:
                    type: string
                  output:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              const: redacted_thinking
                            id:
                              type: string
                            data:
                              type: string
                          required:
                            - type
                            - id
                            - data
                        - type: object
                          properties:
                            type:
                              type: string
                              const: reasoning
                            id:
                              type: string
                            summary:
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    const: summary_text
                                  text:
                                    type: string
                                required:
                                  - type
                                  - text
                            content:
                              type: array
                              items:
                                type: string
                            encrypted_content:
                              type: string
                          required:
                            - type
                            - id
                        - type: object
                          properties:
                            type:
                              type: string
                              const: message
                            id:
                              type: string
                            status:
                              type: string
                              enum:
                                - in_progress
                                - completed
                                - failed
                            role:
                              type: string
                            content:
                              type: array
                              items:
                                oneOf:
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: output_text
                                      text:
                                        type: string
                                      annotations:
                                        type: array
                                        items:
                                          type: string
                                    required:
                                      - type
                                      - text
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: input_text
                                      text:
                                        type: string
                                    required:
                                      - type
                                      - text
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: input_image
                                      image_url:
                                        type: string
                                      file_id:
                                        type: string
                                      detail:
                                        type: string
                                        enum:
                                          - auto
                                          - low
                                          - high
                                        default: auto
                                      fidelity:
                                        type: string
                                        enum:
                                          - auto
                                          - low
                                          - high
                                        default: auto
                                    required:
                                      - type
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: input_file
                                      file_id:
                                        type: string
                                      file_data:
                                        type: string
                                      file_url:
                                        type: string
                                      filename:
                                        type: string
                                      detail:
                                        type: string
                                        enum:
                                          - low
                                          - high
                                    required:
                                      - type
                          required:
                            - type
                            - id
                            - role
                            - content
                        - type: object
                          properties:
                            type:
                              type: string
                              const: function_call
                            id:
                              type: string
                            call_id:
                              type: string
                            name:
                              type: string
                            arguments:
                              type: string
                            status:
                              type: string
                              enum:
                                - in_progress
                                - completed
                                - incomplete
                          required:
                            - type
                            - id
                            - call_id
                            - name
                            - arguments
                        - type: object
                          properties:
                            type:
                              type: string
                              const: function_call_output
                            id:
                              type: string
                            call_id:
                              type: string
                            output:
                              anyOf:
                                - type: string
                                - type: object
                                  additionalProperties: {}
                            status:
                              type: string
                              enum:
                                - in_progress
                                - completed
                                - incomplete
                          required:
                            - type
                            - id
                            - call_id
                        - type: object
                          properties:
                            type:
                              type: string
                              const: compaction
                            id:
                              type:
                                - string
                                - 'null'
                            encrypted_content:
                              type: string
                            created_by:
                              type: string
                          required:
                            - type
                            - encrypted_content
                        - type: object
                          properties:
                            type:
                              type: string
                              const: mcp_list_tools
                            id:
                              type: string
                            server_label:
                              type: string
                            tools:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  description:
                                    type: string
                                  input_schema:
                                    type: object
                                    additionalProperties: {}
                                required:
                                  - name
                                  - input_schema
                          required:
                            - type
                            - id
                            - server_label
                            - tools
                        - type: object
                          properties:
                            type:
                              type: string
                              const: mcp_approval_request
                            id:
                              type: string
                            server_label:
                              type: string
                            name:
                              type: string
                            arguments:
                              type: string
                          required:
                            - type
                            - id
                            - server_label
                            - name
                            - arguments
                        - type: object
                          properties:
                            type:
                              type: string
                              const: mcp_approval_response
                            id:
                              type: string
                            approval_request_id:
                              type: string
                            approve:
                              type: boolean
                            reason:
                              type: string
                          required:
                            - type
                            - id
                            - approval_request_id
                            - approve
                        - type: object
                          properties:
                            type:
                              type: string
                              const: code_interpreter
                            id:
                              type: string
                            code_interpreter:
                              type: object
                              properties:
                                input:
                                  type: string
                                sandbox_id:
                                  type: string
                                outputs:
                                  type: array
                                  items:
                                    oneOf:
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            const: logs
                                          logs:
                                            type: string
                                        required:
                                          - type
                                          - logs
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            const: image
                                          image:
                                            type: object
                                            properties:
                                              file_id:
                                                type: string
                                              base64:
                                                type: string
                                        required:
                                          - type
                                          - image
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            const: result
                                          result: {}
                                        required:
                                          - type
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            const: error
                                          name:
                                            type: string
                                          value:
                                            type: string
                                          traceback:
                                            type: string
                                        required:
                                          - type
                                          - name
                                          - value
                              required:
                                - input
                                - outputs
                          required:
                            - type
                            - id
                            - code_interpreter
                        - type: object
                          properties:
                            type:
                              type: string
                              const: image_generation_call
                            id:
                              type: string
                            status:
                              type: string
                            result:
                              type:
                                - string
                                - 'null'
                            revised_prompt:
                              type:
                                - string
                                - 'null'
                          required:
                            - type
                            - id
                  usage:
                    type: 'null'
                required:
                  - id
                  - object
                  - created_at
                  - status
                  - model
                  - output
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      type:
                        type: string
                      param:
                        type:
                          - string
                          - 'null'
                      code:
                        type:
                          - string
                          - 'null'
                      details:
                        type:
                          - string
                          - 'null'
                    required:
                      - message
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      type:
                        type: string
                      param:
                        type:
                          - string
                          - 'null'
                      code:
                        type:
                          - string
                          - 'null'
                      details:
                        type:
                          - string
                          - 'null'
                    required:
                      - message
                required:
                  - error
        '429':
          description: Rate Limit Exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      type:
                        type: string
                      param:
                        type:
                          - string
                          - 'null'
                      code:
                        type:
                          - string
                          - 'null'
                      details:
                        type:
                          - string
                          - 'null'
                    required:
                      - message
                required:
                  - error
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |-
            from openai import OpenAI

            client = OpenAI(
                api_key='YOUR_NEOSANTARA_API_KEY',
                base_url='https://api.neosantara.xyz/v1'
            )

            response = client.responses.create(
                model='deepseek-v4.1-flash',
                input='Halo, apa kabar?',
                instructions='Jawab dengan gaya santai.',
                store=True
            )
            print(response.output_text)
        - lang: javascript
          label: Node.js SDK
          source: |-
            import OpenAI from 'openai';

            const client = new OpenAI({
              apiKey: 'YOUR_NEOSANTARA_API_KEY',
              baseURL: 'https://api.neosantara.xyz/v1'
            });

            const response = await client.responses.create({
              model: 'deepseek-v4.1-flash',
              input: 'Halo, apa kabar?',
              instructions: 'Jawab dengan gaya santai.',
              store: true
            });
            console.log(response.output_text);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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