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

# Create a response

> Generate a response from the specified model and text or input items. Results are returned in the `output` array. SSE streaming is supported.

Before making a request, confirm that the model supports this protocol and the parameters you need.



## OpenAPI

````yaml /model-inference/api/model-inference-api.json post /responses
openapi: 3.1.0
info:
  title: ScitiX Model Inference API
  version: 1.0.0
  description: >-
    List models and generate output using the Chat Completions, Messages, or
    Responses protocol.


    Authenticate with `Authorization: Bearer <API_KEY>`. Supported protocols,
    parameters, and response fields vary by model. Check the model documentation
    before making a request.
servers:
  - url: https://api.scitix.ai/model-api
    description: >-
      Base URL for the ScitiX Model Inference API. This reference uses the URL
      without `/v1` and appends each endpoint path.
security:
  - BearerAuth: []
tags:
  - name: Models
    description: List models and their attributes.
  - name: Chat Completions
    description: Generate chat replies using the Chat Completions protocol.
  - name: Messages
    description: Generate messages using the Anthropic Messages protocol.
  - name: Responses
    description: Generate model responses using the Responses protocol.
paths:
  /responses:
    post:
      tags:
        - Responses
      summary: Create a response
      description: >-
        Generate a response from the specified model and text or input items.
        Results are returned in the `output` array. SSE streaming is supported.


        Before making a request, confirm that the model supports this protocol
        and the parameters you need.
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponseCreateRequest'
            examples:
              Basic request:
                summary: Basic request
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  input: Reply with only the result of 1+1.
                  max_output_tokens: 64
              Message array:
                summary: Message array
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  input:
                    - role: user
                      content:
                        - type: input_text
                          text: Say hello
                  instructions: Reply with only one character
                  max_output_tokens: 128
              Structured output:
                summary: Structured output
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  input: Return a JSON object with the answer field set to YES.
                  max_output_tokens: 256
                  text:
                    format:
                      type: json_schema
                      name: check_result
                      strict: true
                      schema:
                        type: object
                        properties:
                          answer:
                            type: string
                            enum:
                              - 'YES'
                        required:
                          - answer
                        additionalProperties: false
              Streaming request:
                summary: Streaming request
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  input: Reply with only 2
                  max_output_tokens: 128
                  stream: true
              Tool call:
                summary: Tool call
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  input: Call add to calculate 7 plus 5. Reply with only the result.
                  max_output_tokens: 256
                  tools:
                    - type: function
                      name: add
                      description: Calculate the sum of two integers
                      parameters:
                        type: object
                        properties:
                          a:
                            type: integer
                          b:
                            type: integer
                        required:
                          - a
                          - b
                  tool_choice: required
              Return a tool result:
                summary: Return a tool result
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  input:
                    - role: user
                      content: >-
                        Call add to calculate 7 plus 5. Reply with only the
                        result.
                    - id: rs_02179438033280700000000000000000000ffffac182854dc3db8
                      type: reasoning
                      summary:
                        - type: summary_text
                          text: >-
                            The user wants me to call the add tool with 7 and 5,
                            then answer only the result.
                      status: completed
                    - arguments: '{"a": 7, "b": 5}'
                      call_id: call_00_xiyoaq8n8w0u81x9ey3zxpsw
                      name: add
                      type: function_call
                      id: fc_02179438033307400000000000000000000ffffac1828547e8f95
                      status: completed
                    - type: function_call_output
                      call_id: call_00_xiyoaq8n8w0u81x9ey3zxpsw
                      output: '{"result": 12}'
                  max_output_tokens: 256
                  tools:
                    - type: function
                      name: add
                      description: Calculate the sum of two integers
                      parameters:
                        type: object
                        properties:
                          a:
                            type: integer
                          b:
                            type: integer
                        required:
                          - a
                          - b
              Specify a function:
                summary: Specify a function
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  input: Call add to calculate 7 plus 5. Reply with only the result.
                  max_output_tokens: 256
                  tools:
                    - type: function
                      name: add
                      description: Calculate the sum of two integers
                      parameters:
                        type: object
                        properties:
                          a:
                            type: integer
                          b:
                            type: integer
                        required:
                          - a
                          - b
                  tool_choice:
                    type: function
                    name: add
      responses:
        '200':
          description: >-
            Response successful. Streaming examples show only selected events
            and fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseResource'
              examples:
                Text response:
                  summary: Text response
                  value:
                    id: resp_0217943193643199f744ac2d426a90baacb0f446edf7bf61e63e8
                    object: response
                    created_at: 1794319365
                    status: completed
                    model: deepseek-ai/deepseek-v4.1-flash-1017
                    output:
                      - id: >-
                          msg_02179431936536500000000000000000000ffffac151e26ef6568
                        type: message
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: '2'
                    usage:
                      input_tokens: 40
                      output_tokens: 25
                      total_tokens: 65
                Function-call response:
                  summary: Function-call response
                  value:
                    id: resp_02179438033189547c8075984f4c09bb3b0ca9abced541e6c9855
                    object: response
                    created_at: 1794380332
                    status: completed
                    model: deepseek-ai/deepseek-v4.1-flash-1017
                    output:
                      - id: >-
                          rs_02179438033280700000000000000000000ffffac182854dc3db8
                        type: reasoning
                        status: completed
                      - id: >-
                          fc_02179438033307400000000000000000000ffffac1828547e8f95
                        type: function_call
                        status: completed
                        call_id: call_00_xiyoaq8n8w0u81x9ey3zxpsw
                        name: add
                        arguments: '{"a": 7, "b": 5}'
                    usage:
                      input_tokens: 313
                      output_tokens: 74
                      total_tokens: 387
                Response after a tool result:
                  summary: Response after a tool result
                  value:
                    id: resp_02179438033408347c8075984f4c09bb3b0ca9abced541e22181d
                    object: response
                    created_at: 1794380334
                    status: completed
                    model: deepseek-ai/deepseek-v4.1-flash-1017
                    output:
                      - id: >-
                          msg_02179438033491100000000000000000000ffffac183b0fcf5900
                        type: message
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: '12'
                    usage:
                      input_tokens: 405
                      output_tokens: 2
                      total_tokens: 407
            text/event-stream:
              schema:
                type: string
              x-event-data-schema:
                $ref: '#/components/schemas/ResponseStreamEvent'
              example: >+
                event: response.created

                data: {"type": "response.created", "sequence_number": 0,
                "response": {"id":
                "resp_0217943210303454d7552398ca1982f1d8c06d525f58d827d6f79",
                "object": "response", "created_at": 1794321031, "status":
                "in_progress", "model": "deepseek-ai/deepseek-v4.1-flash-1017",
                "output": []}}


                event: response.output_text.delta

                data: {"type": "response.output_text.delta", "content_index": 0,
                "delta": "2", "item_id":
                "msg_02179432103119100000000000000000000ffffac15568e439000",
                "output_index": 1, "sequence_number": 14}


                event: response.completed

                data: {"type": "response.completed", "sequence_number": 18,
                "response": {"id":
                "resp_0217943210303454d7552398ca1982f1d8c06d525f58d827d6f79",
                "object": "response", "created_at": 1794321031, "status":
                "completed", "model": "deepseek-ai/deepseek-v4.1-flash-1017",
                "output": [{"id":
                "rs_02179432103109200000000000000000000ffffac15568ebe30c0",
                "type": "reasoning", "status": "completed"}, {"id":
                "msg_02179432103119100000000000000000000ffffac15568e439000",
                "type": "message", "status": "completed", "role": "assistant",
                "content": [{"type": "output_text", "text": "2"}]}], "usage":
                {"input_tokens": 34, "output_tokens": 12, "total_tokens": 46}}}

        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  msg: authorization api key not valid
                  code: unauthorized
                  message: >-
                    authorization api key not valid (request_id:
                    506ecc85-247e-4494-a5a9-00eef0053dcb)
                  type: authentication_error
                  traceId: d53ec10d0b8218f36fd5a15e7422f41a
                  request_id: 506ecc85-247e-4494-a5a9-00eef0053dcb
        default:
          description: >-
            Other error response. Use the HTTP status, error message, and
            request ID to investigate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ResponseCreateRequest:
      type: object
      required:
        - model
        - input
      description: Responses protocol request body. `model` and `input` are required.
      properties:
        model:
          type: string
          example: deepseek-ai/deepseek-v4.1-flash-1017
          description: >-
            ID of the model to generate the response. Use `GET /models` to list
            models and confirm that the model supports the Responses protocol.
        input:
          anyOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ResponseInputItem'
          description: >-
            Input text or an array of input items. Items may include messages,
            reasoning items, function calls, and function call results.
        instructions:
          type: string
          description: Instructions passed to the model.
        max_output_tokens:
          type: integer
          example: 128
          description: >-
            Total token budget for this generation, including reasoning tokens
            and visible output tokens. Must be at least `1`; the model
            determines the maximum. This parameter name applies to the Responses
            protocol.
          minimum: 1
        text:
          type: object
          description: >-
            Text output format configuration. Use `format` to specify JSON
            Schema requirements for structured output.
          properties:
            format:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - json_schema
                  description: Output format, set to `json_schema`.
                strict:
                  type: boolean
                  enum:
                    - true
                  description: Strict mode setting, set to `true` in this definition.
                name:
                  type: string
                  description: Schema name for structured output.
                schema:
                  type: object
                  description: >-
                    JSON Schema defining the output object structure and field
                    constraints.
                  additionalProperties: true
              additionalProperties: true
              required:
                - type
                - name
                - schema
              description: JSON Schema structured output format.
          additionalProperties: true
          required:
            - format
        stream:
          type: boolean
          enum:
            - true
            - false
          description: >-
            Whether to stream output. When `true`, receive incremental results
            through named SSE events.
        tools:
          type: array
          description: >-
            Function tools available to the model. When the model returns a
            `function_call` item, the client executes the function and returns
            its result through `function_call_output`.
          items:
            type: object
            required:
              - type
              - name
              - parameters
            properties:
              type:
                const: function
                description: Tool type, set to `function`.
              name:
                type: string
                description: Function name, used to match a `function_call` item.
              description:
                type: string
              parameters:
                type: object
                additionalProperties: true
                description: JSON Schema describing the function input parameters.
            additionalProperties: true
        tool_choice:
          description: >-
            Controls tool selection. Use `auto` to let the model choose, `none`
            to disable tool calls, or `required` to require a tool call. Use
            `{"type":"function","name":"get_weather"}` to select a specific
            function.
          oneOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - type: object
              required:
                - type
                - name
              properties:
                type:
                  const: function
                name:
                  type: string
              additionalProperties: true
      additionalProperties: true
    ResponseResource:
      type: object
      required:
        - id
        - object
        - created_at
        - status
        - model
        - output
      properties:
        id:
          type: string
          description: Response identifier.
        object:
          type: string
          description: Response object type.
        created_at:
          type: integer
          description: Response creation time as a Unix timestamp in seconds.
        status:
          type: string
          description: >-
            Response status, such as `in_progress`, `completed`, or
            `incomplete`.
        model:
          type: string
          description: Identifier of the model that generated the response.
        output:
          type: array
          description: >-
            Output items, which may include messages, reasoning items, and
            function calls.
          items:
            $ref: '#/components/schemas/ResponseOutputItem'
        usage:
          anyOf:
            - $ref: '#/components/schemas/ResponseUsage'
            - type: 'null'
          description: Token usage for this request. May be `null`.
      additionalProperties: true
    ErrorResponse:
      type: object
      description: >-
        Errors may use top-level fields, a nested `error` object, or an object
        with `object=error`. Handle the structure actually returned and retain
        the error information and request identifiers for troubleshooting.
      anyOf:
        - type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              example: invalid_request_error
              description: >-
                Error type, which distinguishes authentication, request format,
                rate limiting, and other issues.
            code:
              type:
                - string
                - integer
                - 'null'
              description: >-
                Error code. May be a string, integer, or `null`. Use the error
                type and message to investigate; do not rely only on numeric
                codes.
            message:
              type: string
              description: >-
                Error message, which may include a request or trace identifier.
                Retain the complete message for troubleshooting.
          additionalProperties: true
        - type: object
          required:
            - error
          properties:
            error:
              type: object
              required:
                - message
              properties:
                message:
                  type: string
                  description: >-
                    Error message, which may include a request or trace
                    identifier. Retain the complete message for troubleshooting.
                type:
                  type: string
                  description: >-
                    Error type, which distinguishes authentication, request
                    format, rate limiting, and other issues.
                code:
                  type:
                    - string
                    - integer
                    - 'null'
                  description: >-
                    Error code. May be a string, integer, or `null`. Use the
                    error type and message to investigate; do not rely only on
                    numeric codes.
                msg:
                  type: string
                  description: Short error description.
                request_id:
                  type: string
                  description: >-
                    Platform-generated request ID for request correlation and
                    troubleshooting.
                traceId:
                  type: string
                  description: Trace identifier returned in the error response.
                trace_id:
                  type: string
                  description: Trace identifier returned in the error response.
              additionalProperties: true
              description: Error information object.
            type:
              type: string
              example: error
              description: Top-level type identifier in an error response.
          additionalProperties: true
        - type: object
          required:
            - object
            - message
          properties:
            object:
              type: string
              enum:
                - error
              description: Error object type, set to `error`.
            message:
              type: string
              description: >-
                Error message, which may include a request or trace identifier.
                Retain the complete message for troubleshooting.
            type:
              type: string
              example: BadRequestError
              description: >-
                Error type, which distinguishes authentication, request format,
                rate limiting, and other issues.
            code:
              type:
                - integer
                - string
                - 'null'
              description: >-
                Error code. May be a string, integer, or `null`. Use the error
                type and message to investigate; do not rely only on numeric
                codes.
          additionalProperties: true
    ResponseInputItem:
      oneOf:
        - $ref: '#/components/schemas/ResponseInputMessage'
        - $ref: '#/components/schemas/ResponseReasoningItem'
        - $ref: '#/components/schemas/ResponseFunctionCall'
        - $ref: '#/components/schemas/ResponseFunctionCallOutput'
      description: >-
        Responses input item: a message, reasoning item, function call, or
        function call result.
    ResponseOutputItem:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: >-
            Output item type, such as `message`, `reasoning`, or
            `function_call`.
        id:
          type: string
          description: Output item identifier.
        status:
          description: Output item status.
      allOf:
        - if:
            required:
              - type
            properties:
              type:
                const: message
          then:
            $ref: '#/components/schemas/ResponseOutputMessage'
        - if:
            required:
              - type
            properties:
              type:
                const: reasoning
          then:
            $ref: '#/components/schemas/ResponseReasoningItem'
          else:
            properties:
              status:
                type: string
        - if:
            required:
              - type
            properties:
              type:
                const: function_call
          then:
            $ref: '#/components/schemas/ResponseFunctionCall'
      additionalProperties: true
    ResponseUsage:
      type: object
      properties:
        input_tokens:
          type: integer
          description: Number of input tokens for this request.
        output_tokens:
          type: integer
          description: >-
            Total number of generated tokens for this request, including
            reasoning tokens.
        total_tokens:
          type: integer
          description: Sum of input and output tokens.
        output_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: >-
                Output tokens used for reasoning. Already included in
                `output_tokens`; do not add them again.
          additionalProperties: true
          description: >-
            Output token details. Reasoning tokens are a subset of the output
            total.
      additionalProperties: true
    ResponseInputMessage:
      type: object
      required:
        - role
        - content
      properties:
        type:
          const: message
          description: Item type, set to `message`.
        role:
          type: string
          example: user
          description: Message role.
        content:
          anyOf:
            - type: string
            - type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/ResponseInputText'
          description: Message text or an array of `input_text` content blocks.
      additionalProperties: true
    ResponseReasoningItem:
      type: object
      required:
        - type
      properties:
        type:
          const: reasoning
          description: Item type, set to `reasoning`.
        id:
          type: string
          description: Reasoning item identifier.
        summary:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              text:
                type: string
            additionalProperties: true
          description: Reasoning summary content blocks.
        status:
          type:
            - string
            - 'null'
          description: >-
            Reasoning item status. May be `null`. This field differs from the
            top-level response `status`; use the top-level `status` to determine
            whether the entire request has completed.
      additionalProperties: true
    ResponseFunctionCall:
      type: object
      required:
        - type
        - call_id
        - name
        - arguments
      properties:
        type:
          const: function_call
          description: Item type, set to `function_call`.
        id:
          type: string
          description: Function call item identifier.
        call_id:
          type: string
          description: Function call ID, used to associate the execution result.
        name:
          type: string
          description: Name of the function the model chose to call.
        arguments:
          type: string
          description: Function arguments as a JSON-encoded string. Parse before execution.
        status:
          type: string
          description: Function call item status.
      additionalProperties: true
    ResponseFunctionCallOutput:
      type: object
      required:
        - type
        - call_id
        - output
      properties:
        type:
          const: function_call_output
          description: Item type, set to `function_call_output`.
        call_id:
          type: string
          description: The `call_id` of the corresponding function call item.
        output:
          type: string
          description: Result text returned after the client executes the function.
      additionalProperties: true
    ResponseInputText:
      type: object
      required:
        - type
        - text
      properties:
        type:
          const: input_text
          description: Content block type, set to `input_text`.
        text:
          type: string
          description: Input text.
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate with an API key using Bearer authentication. Do not expose
        real keys in documentation, code, or repositories.

````

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