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

> Generate a message from the specified model and message list. Results are returned in the `content` 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 /messages
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:
  /messages:
    post:
      tags:
        - Messages
      summary: Create a message
      description: >-
        Generate a message from the specified model and message list. Results
        are returned in the `content` array. SSE streaming is supported.


        Before making a request, confirm that the model supports this protocol
        and the parameters you need.
      operationId: createMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessagesCreateRequest'
            examples:
              Basic request:
                summary: Basic request
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  messages:
                    - role: user
                      content: Reply with only 2
                  max_tokens: 128
                  thinking:
                    type: disabled
              Enable thinking:
                summary: Enable thinking
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  messages:
                    - role: user
                      content: Reply with only 2
                  max_tokens: 128
                  thinking:
                    type: enabled
              Disable thinking:
                summary: Disable thinking
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  messages:
                    - role: user
                      content: Reply with only 2
                  max_tokens: 128
                  thinking:
                    type: disabled
              Streaming request:
                summary: Streaming request
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  messages:
                    - role: user
                      content: Reply with only 2
                  max_tokens: 128
                  stream: true
              Tool call:
                summary: Tool call
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  messages:
                    - role: user
                      content: >-
                        Call add to calculate 7 plus 5. Reply with only the
                        result.
                  max_tokens: 256
                  tools:
                    - name: add
                      description: Calculate the sum of two integers
                      input_schema:
                        type: object
                        properties:
                          a:
                            type: integer
                          b:
                            type: integer
                        required:
                          - a
                          - b
                  tool_choice:
                    type: any
              Return a tool result:
                summary: Return a tool result
                value:
                  model: deepseek-ai/deepseek-v4.1-flash-1017
                  messages:
                    - role: user
                      content: >-
                        Call add to calculate 7 plus 5. Reply with only the
                        result.
                    - role: assistant
                      content:
                        - type: tool_use
                          id: call_00_4o4c8mg38xr3w8nngkhcxpgy
                          name: add
                          input:
                            a: 7
                            b: 5
                    - role: user
                      content:
                        - type: tool_result
                          tool_use_id: call_00_4o4c8mg38xr3w8nngkhcxpgy
                          content: '{"result": 12}'
                  max_tokens: 256
                  tools:
                    - name: add
                      description: Calculate the sum of two integers
                      input_schema:
                        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
                  messages:
                    - role: user
                      content: >-
                        Call add to calculate 7 plus 5. Reply with only the
                        result.
                  max_tokens: 256
                  tools:
                    - name: add
                      description: Calculate the sum of two integers
                      input_schema:
                        type: object
                        properties:
                          a:
                            type: integer
                          b:
                            type: integer
                        required:
                          - a
                          - b
                  tool_choice:
                    type: tool
                    name: add
      responses:
        '200':
          description: >-
            Message response. Streaming examples show only selected events and
            fields.


            For some models, `message_start.message` may omit `type` and `role`.
            Parse SSE data according to the event type.
          headers:
            x-request-id:
              description: Request ID.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessagesResponse'
              examples:
                Text response:
                  summary: Text response
                  value:
                    id: 96ab71e2-00a8-4a67-8e68-a9dfa8573976
                    type: message
                    role: assistant
                    model: deepseek-ai/deepseek-v4.1-flash-1017
                    content:
                      - type: text
                        text: '2'
                    stop_reason: end_turn
                    stop_sequence: null
                    usage:
                      input_tokens: 8
                      output_tokens: 1
                Tool-call response:
                  summary: Tool-call response
                  value:
                    id: 0217943803281155bf05a230eba2dfb3c75629cf63151ec575d1a
                    type: message
                    role: assistant
                    model: deepseek-ai/deepseek-v4.1-flash-1017
                    content:
                      - type: tool_use
                        id: call_00_4o4c8mg38xr3w8nngkhcxpgy
                        name: add
                        input:
                          a: 7
                          b: 5
                    stop_reason: tool_use
                    stop_sequence: null
                    usage:
                      input_tokens: 313
                      output_tokens: 53
                Response after a tool result:
                  summary: Response after a tool result
                  value:
                    id: 0217943803298524f08adabc2a0b7ee0ad3a2fcb671c8c46a32f8
                    type: message
                    role: assistant
                    model: deepseek-ai/deepseek-v4.1-flash-1017
                    content:
                      - type: text
                        text: '12'
                    stop_reason: end_turn
                    stop_sequence: null
                    usage:
                      input_tokens: 127
                      output_tokens: 2
            text/event-stream:
              schema:
                type: string
              x-event-data-schema:
                $ref: '#/components/schemas/MessagesStreamEvent'
              example: >+
                event: message_start

                data: {"type": "message_start", "message": {"id":
                "e77c5da2-7722-4fd6-ad6b-c6dbbee349fd", "type": "message",
                "role": "assistant", "model":
                "deepseek-ai/deepseek-v4.1-flash-1017", "content": [], "usage":
                {"input_tokens": 34, "output_tokens": 0}}}


                event: content_block_delta

                data: {"type": "content_block_delta", "index": 1, "delta":
                {"type": "text_delta", "text": "2"}}


                event: message_stop

                data: {"type": "message_stop"}

        '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:
                    c2d8a163-3159-461b-8a87-3aea2749931d)
                  type: authentication_error
                  traceId: 3bf3d036a9e57cdf48ed20cc898e287b
                  request_id: c2d8a163-3159-461b-8a87-3aea2749931d
        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:
    MessagesCreateRequest:
      type: object
      description: >-
        Messages protocol request body. `model`, `max_tokens`, and `messages`
        are required.
      required:
        - model
        - max_tokens
        - messages
      properties:
        model:
          type: string
          description: >-
            ID of the model to generate the message. Use `GET /models` to list
            models and confirm that the model supports the Messages protocol.
          example: deepseek-ai/deepseek-v4.1-flash-1017
        max_tokens:
          type: integer
          description: >-
            Output token limit for this request. Must be at least `1`; the model
            determines the maximum. This field is required by the Messages
            protocol, which does not use the Chat Completions parameter
            `max_completion_tokens`.
          example: 128
          minimum: 1
        messages:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/AnthropicMessage'
          description: >-
            Messages in conversation order, with at least one message. Use
            `user` for user messages and `assistant` for model replies. Return
            tool results as `tool_result` content blocks in a user message.
        stream:
          type: boolean
          description: >-
            Whether to stream output. When `true`, receive incremental content
            through named SSE events.
          enum:
            - true
            - false
        thinking:
          type: object
          description: >-
            Reasoning configuration. Use `type=enabled` or `type=disabled` to
            request reasoning on or off. Support varies by model.
          properties:
            type:
              type: string
              description: 'Thinking mode: enabled or disabled.'
              enum:
                - enabled
                - disabled
          additionalProperties: true
          required:
            - type
        output_config:
          type: object
          description: Model output configuration.
          properties:
            format:
              type: object
              description: >-
                Structured output format. Use `type` and `schema` to specify the
                output format and JSON Schema. Support varies by model. An HTTP
                200 response does not guarantee that schema constraints were
                enforced. Validate the response on the client. Use
                `output_config.format` for new integrations; the platform also
                accepts the legacy `output_format` field.
              properties:
                type:
                  type: string
                  enum:
                    - json_schema
                  description: Output format. Must be `json_schema`.
                schema:
                  type: object
                  description: >-
                    JSON Schema defining the output object structure and field
                    constraints.
                  additionalProperties: true
              additionalProperties: true
          additionalProperties: true
        tools:
          type: array
          description: >-
            Function tools available to the model. When the model returns a
            `tool_use` content block, the client executes the tool and returns
            its result through `tool_result`.
          items:
            type: object
            required:
              - name
            properties:
              name:
                type: string
                description: Tool name, used to match a `tool_use` content block.
              description:
                type: string
                description: Tool description, used by the model to decide when to call it.
              input_schema:
                type: object
                additionalProperties: true
                description: JSON Schema that describes the tool input parameters.
            additionalProperties: true
        tool_choice:
          description: >-
            Controls tool selection. Use `{"type":"auto"}` to let the model
            choose, `{"type":"any"}` to require a tool call, or
            `{"type":"none"}` to disable tool calls. Use
            `{"type":"tool","name":"get_weather"}` to select a specific tool.
          oneOf:
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - auto
                    - any
                    - none
              additionalProperties: true
            - type: object
              required:
                - type
                - name
              properties:
                type:
                  const: tool
                name:
                  type: string
              additionalProperties: true
      additionalProperties: true
    MessagesResponse:
      type: object
      required:
        - id
        - type
        - role
        - model
        - content
      properties:
        id:
          type: string
          description: Response identifier.
        type:
          type: string
          enum:
            - message
          description: Response object type, set to `message`.
        role:
          type: string
          enum:
            - assistant
          description: Response message role, set to `assistant`.
        model:
          type: string
          description: Identifier of the model that generated the response.
        content:
          type: array
          description: >-
            Response content blocks, which may include text, reasoning content,
            and tool calls.
          items:
            oneOf:
              - $ref: '#/components/schemas/TextBlock'
              - $ref: '#/components/schemas/ThinkingBlock'
              - $ref: '#/components/schemas/ToolUseBlock'
              - type: object
                required:
                  - type
                properties:
                  type:
                    type: string
                    not:
                      enum:
                        - text
                        - thinking
                        - tool_use
                        - tool_result
                additionalProperties: true
        stop_reason:
          type:
            - string
            - 'null'
          description: Reason generation ended. May be `null` before generation ends.
        stop_sequence:
          type:
            - string
            - 'null'
          description: >-
            Stop sequence that ended generation. May be `null` if none was
            triggered.
        usage:
          $ref: '#/components/schemas/AnthropicUsage'
          description: Token usage for this request.
      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
    AnthropicMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
          description: 'Message role: `user` for the user or `assistant` for the model.'
        content:
          oneOf:
            - type: string
            - type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/TextBlock'
                  - $ref: '#/components/schemas/ThinkingBlock'
                  - $ref: '#/components/schemas/ToolUseBlock'
                  - $ref: '#/components/schemas/ToolResultBlock'
              minItems: 1
          description: >-
            Message text or an array of content blocks. User messages may
            contain text and tool results; model messages may contain text,
            reasoning content, and tool calls.
      additionalProperties: true
      allOf:
        - if:
            required:
              - role
            properties:
              role:
                const: user
          then:
            properties:
              content:
                oneOf:
                  - type: string
                  - type: array
                    minItems: 1
                    items:
                      oneOf:
                        - $ref: '#/components/schemas/TextBlock'
                        - $ref: '#/components/schemas/ToolResultBlock'
        - if:
            required:
              - role
            properties:
              role:
                const: assistant
          then:
            properties:
              content:
                oneOf:
                  - type: string
                  - type: array
                    minItems: 1
                    items:
                      oneOf:
                        - $ref: '#/components/schemas/TextBlock'
                        - $ref: '#/components/schemas/ThinkingBlock'
                        - $ref: '#/components/schemas/ToolUseBlock'
    TextBlock:
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          description: Content block type, set to `text`.
        text:
          type: string
          description: Text content.
      additionalProperties: true
    ThinkingBlock:
      type: object
      required:
        - type
        - thinking
      properties:
        type:
          type: string
          enum:
            - thinking
          description: Content block type, set to `thinking`.
        thinking:
          type: string
          description: Reasoning content returned by the model.
        signature:
          type: string
          description: Signature field for the reasoning content block.
      additionalProperties: true
    ToolUseBlock:
      type: object
      required:
        - type
        - id
        - name
        - input
      properties:
        type:
          const: tool_use
          description: Content block type, set to `tool_use`.
        id:
          type: string
          description: Tool call ID, used to associate the tool result.
        name:
          type: string
          description: Name of the tool the model chose to call.
        input:
          type: object
          additionalProperties: true
          description: Tool input parameters as an object.
      additionalProperties: true
    AnthropicUsage:
      type: object
      properties:
        input_tokens:
          type: integer
          description: Number of input tokens for this request.
        output_tokens:
          type: integer
          description: Number of output tokens for this request.
      additionalProperties: true
    ToolResultBlock:
      type: object
      required:
        - type
        - tool_use_id
        - content
      properties:
        type:
          const: tool_result
          description: Content block type, set to `tool_result`.
        tool_use_id:
          type: string
          description: The `id` of the corresponding `tool_use` content block.
        content:
          type: string
          description: Result text returned after the client executes the tool.
      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.