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

# Create a Claude Messages response

> Request using the Anthropic Claude Messages API format.
Include the `anthropic-version` request header.




## OpenAPI

````yaml /openapi/relay.en.json post /v1/messages
openapi: 3.0.1
info:
  title: AIOHub API
  description: AIOHub public API
  version: 1.0.0
servers:
  - url: https://api.aiohub.org
security:
  - BearerAuth: []
tags:
  - name: List models
  - name: OpenAI Chat
  - name: OpenAI Responses
  - name: Image generation
  - name: OpenAI Images
  - name: Video generation
  - name: Claude Messages
  - name: Gemini API
  - name: OpenAI Embeddings
  - name: Text completions
  - name: OpenAI Audio
  - name: Realtime API
paths:
  /v1/messages:
    post:
      tags:
        - Claude Messages
      summary: Create a Claude Messages response
      description: |
        Request using the Anthropic Claude Messages API format.
        Include the `anthropic-version` request header.
      operationId: createMessage
      parameters:
        - name: anthropic-version
          in: header
          description: Anthropic API version
          required: true
          example: ''
          schema:
            type: string
            example: '2023-06-01'
        - name: x-api-key
          in: header
          description: Anthropic API key. Optional; you can also use a Bearer token.
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClaudeRequest'
            examples: {}
      responses:
        '200':
          description: Response created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaudeResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    ClaudeRequest:
      type: object
      required:
        - model
        - messages
        - max_tokens
      properties:
        model:
          type: string
          example: claude-3-opus-20240229
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ClaudeMessage'
        system:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                properties: {}
        cache_control:
          type: object
          properties: {}
        inference_geo:
          type: string
        max_tokens:
          type: integer
          minimum: 1
        temperature:
          type: number
          minimum: 0
          maximum: 1
        top_p:
          type: number
        top_k:
          type: integer
        stream:
          type: boolean
        stop_sequences:
          type: array
          items:
            type: string
        tools:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              description:
                type: string
              input_schema:
                type: object
                properties: {}
        tool_choice:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - auto
                    - any
                    - tool
                    - none
                name:
                  type: string
        thinking:
          type: object
          properties:
            type:
              type: string
              enum:
                - enabled
                - disabled
            budget_tokens:
              type: integer
        context_management:
          type: object
          properties: {}
        output_config:
          type: object
          properties: {}
        output_format:
          type: object
          properties: {}
        container:
          oneOf:
            - type: string
            - type: object
              properties: {}
        mcp_servers:
          type: array
          items:
            type: object
            properties: {}
        metadata:
          type: object
          properties:
            user_id:
              type: string
        speed:
          type: string
          enum:
            - standard
            - fast
        service_tier:
          type: string
          enum:
            - auto
            - standard_only
    ClaudeResponse:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          example: message
        role:
          type: string
          example: assistant
        content:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              text:
                type: string
        model:
          type: string
        stop_reason:
          type: string
          enum:
            - end_turn
            - max_tokens
            - stop_sequence
            - tool_use
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            cache_creation_input_tokens:
              type: integer
            cache_read_input_tokens:
              type: integer
    ClaudeMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
        content:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - text
                      - image
                      - tool_use
                      - tool_result
                  text:
                    type: string
                  source:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - base64
                          - url
                      media_type:
                        type: string
                      data:
                        type: string
                      url:
                        type: string
                  id:
                    type: string
                  name:
                    type: string
                  input:
                    type: object
                    properties: {}
                  tool_use_id:
                    type: string
                  content:
                    type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk-xxx)

````