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

# Claude Format - Tool Calling Messages

> - Generic Anthropic Messages API reference with tool calling for all compatible models
- Tool calling: supports Function Calling with tool definitions
- Multimodal input: supports text + image mixed input
- Extended thinking: supports thinking/reasoning mode
- Supports streaming and non-streaming responses




## OpenAPI

````yaml openapi/en/claude-format-tool-calling-messages.json POST /v1/messages
openapi: 3.1.0
info:
  title: Claude Format - Tool Calling Messages
  version: '1.0'
servers:
  - url: https://api.aihubmax.com
security:
  - BearerAuth: []
paths:
  /v1/messages:
    post:
      tags:
        - Text Series > Claude Format
      summary: Claude Format - Tool Calling Messages
      description: >
        - Generic Anthropic Messages API reference with tool calling for all
        compatible models

        - Tool calling: supports Function Calling with tool definitions

        - Multimodal input: supports text + image mixed input

        - Extended thinking: supports thinking/reasoning mode

        - Supports streaming and non-streaming responses
      operationId: claude-format-tool-calling-messages
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClaudeMessagesRequest'
            examples:
              tool-calling-weather:
                summary: Weather Query
                description: Let the model call a weather tool
                value:
                  model: claude-sonnet-4-6
                  max_tokens: 1024
                  messages:
                    - role: user
                      content: >-
                        What's the weather like in San Francisco now? Is it good
                        for the beach?
                  tools:
                    - name: get_weather
                      description: Get current weather for a specified city
                      input_schema:
                        type: object
                        properties:
                          city:
                            type: string
                            description: City name
                          unit:
                            type: string
                            enum:
                              - celsius
                              - fahrenheit
                            description: Temperature unit
                        required:
                          - city
              tool-calling-search:
                summary: Web Search
                description: Let the model call a search tool to find information
                value:
                  model: claude-sonnet-4-6
                  max_tokens: 2048
                  messages:
                    - role: user
                      content: Search for the latest features in React 19
                  tools:
                    - name: web_search
                      description: Search the internet for latest information
                      input_schema:
                        type: object
                        properties:
                          query:
                            type: string
                            description: Search keywords
                          num_results:
                            type: integer
                            description: Number of results
                            default: 5
                        required:
                          - query
              tool-calling-multi-tools:
                summary: Multiple Tools
                description: Define multiple tools for the model to choose from
                value:
                  model: claude-sonnet-4-6
                  max_tokens: 2048
                  messages:
                    - role: user
                      content: >-
                        Check tomorrow's weather in New York, then create an
                        outdoor running event on my calendar
                  tools:
                    - name: get_weather
                      description: Get weather forecast
                      input_schema:
                        type: object
                        properties:
                          city:
                            type: string
                            description: City name
                          days:
                            type: integer
                            description: Forecast days (1-7)
                        required:
                          - city
                    - name: create_calendar_event
                      description: Create a calendar event
                      input_schema:
                        type: object
                        properties:
                          title:
                            type: string
                            description: Event title
                          date:
                            type: string
                            description: Date (YYYY-MM-DD)
                          time:
                            type: string
                            description: Time (HH:MM)
                          duration_minutes:
                            type: integer
                            description: Duration in minutes
                        required:
                          - title
                          - date
              tool-calling-send-email:
                summary: Send Email
                description: Let the model call an email sending tool
                value:
                  model: claude-sonnet-4-6
                  max_tokens: 1024
                  messages:
                    - role: user
                      content: >-
                        Send an email to the team notifying them about a product
                        review meeting tomorrow at 3 PM
                  tools:
                    - name: send_email
                      description: Send an email
                      input_schema:
                        type: object
                        properties:
                          to:
                            type: array
                            items:
                              type: string
                            description: Recipients list
                          subject:
                            type: string
                            description: Email subject
                          body:
                            type: string
                            description: Email body
                          cc:
                            type: array
                            items:
                              type: string
                            description: CC list
                        required:
                          - to
                          - subject
                          - body
      responses:
        '200':
          $ref: '#/components/responses/ClaudeMessagesSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    ClaudeMessagesRequest:
      type: object
      required:
        - model
        - messages
        - max_tokens
      properties:
        model:
          type: string
          description: Model name, e.g. claude-sonnet-4-6
          example: claude-sonnet-4-6
        messages:
          type: array
          description: List of messages in the conversation
          items:
            type: object
            required:
              - role
              - content
            properties:
              role:
                type: string
                description: Role of the message sender
                enum:
                  - user
                  - assistant
              content:
                type: string
                description: Content of the message (string or array of content blocks)
        max_tokens:
          type: integer
          description: Maximum number of tokens to generate (required)
        system:
          oneOf:
            - type: string
              description: System prompt as a string
            - type: array
              description: System prompt as an array of content blocks
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - text
                  text:
                    type: string
          description: System prompt
        temperature:
          type: number
          description: Sampling temperature (0-1)
          minimum: 0
          maximum: 1
        top_p:
          type: number
          description: Nucleus sampling parameter (0-1)
          minimum: 0
          maximum: 1
        top_k:
          type: integer
          description: Top-K sampling parameter
        stream:
          type: boolean
          description: Whether to stream the response
          default: false
        stop_sequences:
          type: array
          description: Custom stop sequences that will cause the model to stop generating
          items:
            type: string
        tools:
          type: array
          description: List of tools the model may use
          items:
            type: object
            properties:
              name:
                type: string
                description: Tool name
              description:
                type: string
                description: Tool description
              input_schema:
                type: object
                description: JSON Schema for the tool input
        tool_choice:
          type: object
          description: How the model should use the provided tools
          properties:
            type:
              type: string
              description: Tool choice type
              enum:
                - auto
                - any
                - tool
            name:
              type: string
              description: Tool name (when type is 'tool')
        metadata:
          type: object
          description: Request metadata
          properties:
            user_id:
              type: string
              description: External user ID for abuse detection
    ClaudeMessagesResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique message ID
          example: msg_abc123
        type:
          type: string
          description: Object type
          enum:
            - message
        role:
          type: string
          description: Role
          enum:
            - assistant
        content:
          type: array
          description: Response content blocks
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - text
              text:
                type: string
                example: Hello! How can I help you today?
        model:
          type: string
          description: Model used
        stop_reason:
          type: string
          description: Reason the generation stopped
          enum:
            - end_turn
            - max_tokens
            - stop_sequence
            - tool_use
          example: end_turn
        usage:
          type: object
          description: Token usage statistics
          properties:
            input_tokens:
              type: integer
              description: Number of input tokens
              example: 25
            output_tokens:
              type: integer
              description: Number of output tokens
              example: 150
    ErrorResponse400:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
    ErrorResponse401:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid API key
            type:
              type: string
              example: authentication_error
    ErrorResponse403:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Access denied
            type:
              type: string
              example: permission_error
    ErrorResponse429:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Rate limit exceeded
            type:
              type: string
              example: rate_limit_error
    ErrorResponse500:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Internal server error
            type:
              type: string
              example: server_error
  responses:
    ClaudeMessagesSuccess:
      description: Claude Messages API response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClaudeMessagesResponse'
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse400'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse401'
    PaymentRequired:
      description: Insufficient balance
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse400'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse403'
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse429'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse500'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        ## All APIs require Bearer Token authentication ##

        Add to request header:

        `Authorization: Bearer YOUR_API_KEY`

````