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

# Create Message

> Send a structured list of input messages, and the model will generate the next message in the conversation.



## OpenAPI

````yaml en/api-reference/endpoints/openapi/anthropic/openapi.yaml POST /v1/messages
openapi: 3.1.0
info:
  title: Anthropic Claude-compatible endpoint
  description: Call the native Anthropic Messages API. All Claude models are supported
  version: 1.0.0
servers:
  - url: https://ai.cubeuaeai.com
security:
  - bearerAuth: []
paths:
  /v1/messages:
    post:
      summary: Create a message
      description: >-
        Send a list of structured input messages. The model generates the next
        message in the conversation.
      operationId: createMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - max_tokens
                - messages
              properties:
                model:
                  type: string
                  enum:
                    - claude-sonnet-4-6
                    - claude-sonnet-4-5-20250929
                    - claude-sonnet-4-20250514
                    - claude-opus-4-6
                    - claude-opus-4-5-20251101
                    - claude-opus-4-1-20250805
                    - claude-opus-4-20250514
                    - claude-haiku-4-5-20251001
                    - claude-3-7-sonnet-20250219
                    - claude-3-5-sonnet-20241022
                  description: The model used for completion.
                  example: claude-sonnet-4-6
                messages:
                  type: array
                  minItems: 1
                  description: >-
                    List of input messages. Each message includes a role and
                    content.
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - user
                          - assistant
                        description: Role of the message author.
                      content:
                        oneOf:
                          - type: string
                          - type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - text
                                    - image
                                text:
                                  type: string
                                source:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                    media_type:
                                      type: string
                                    data:
                                      type: string
                        description: >-
                          Message content. Can be a string or an array of
                          content blocks.
                  example:
                    - role: user
                      content: Hello, Claude!
                max_tokens:
                  type: integer
                  minimum: 1
                  description: Maximum number of tokens to generate before stopping.
                  example: 1024
                system:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                          text:
                            type: string
                  description: System prompt. Provides context and instructions for Claude.
                metadata:
                  type: object
                  properties:
                    user_id:
                      type: string
                      description: >-
                        An external identifier for the user associated with the
                        request.
                  description: An object that describes request metadata.
                stop_sequences:
                  type: array
                  items:
                    type: string
                  description: >-
                    Custom text sequences. The model stops generating when it
                    encounters them.
                temperature:
                  type: number
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: 'Randomness injected into the response. Range: 0.0 to 1.0.'
                  example: 1
                top_p:
                  type: number
                  minimum: 0
                  maximum: 1
                  description: >-
                    Use nucleus sampling. Prefer either temperature or top_p,
                    not both.
                top_k:
                  type: integer
                  minimum: 0
                  description: >-
                    Sample only from the top K options for each subsequent
                    token.
                stream:
                  type: boolean
                  default: false
                  description: >-
                    Whether to incrementally stream the response using
                    server-sent events (SSE).
                tools:
                  type: array
                  items:
                    type: object
                    required:
                      - name
                      - input_schema
                    properties:
                      name:
                        type: string
                        description: Tool name.
                      description:
                        type: string
                        description: Description of what the tool does.
                      input_schema:
                        type: object
                        description: JSON Schema for the tool input.
                  description: Tool definitions the model can use.
                tool_choice:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - auto
                        - any
                        - tool
                      description: How the model uses the provided tools.
                    name:
                      type: string
                      description: Name of the tool to use (when type is "tool").
                  description: Controls how the model uses the provided tools.
                thinking:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - enabled
                        - disabled
                      description: Whether to enable extended thinking.
                    budget_tokens:
                      type: integer
                      minimum: 1024
                      description: Maximum number of tokens used for thinking.
                  description: >-
                    Extended thinking configuration. When enabled, the model
                    thinks deeply before replying.
      responses:
        '200':
          description: Message created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Message:
      type: object
      required:
        - id
        - type
        - role
        - content
        - model
        - stop_reason
        - usage
      properties:
        id:
          type: string
          example: msg_01XFDUDYJgAACzvnptvVoYEL
        type:
          type: string
          example: message
        role:
          type: string
          example: assistant
        content:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - text
                  - thinking
                  - tool_use
              text:
                type: string
              thinking:
                type: string
              id:
                type: string
              name:
                type: string
              input:
                type: object
          example:
            - type: text
              text: Hello! How can I help you?
        model:
          type: string
          example: claude-sonnet-4-6
        stop_reason:
          type: string
          enum:
            - end_turn
            - max_tokens
            - stop_sequence
            - tool_use
            - null
        stop_sequence:
          type: string
          nullable: true
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            cache_creation_input_tokens:
              type: integer
            cache_read_input_tokens:
              type: integer
    Error:
      type: object
      properties:
        type:
          type: string
          example: error
        error:
          type: object
          properties:
            type:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````