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

# Claude 聊天

> Anthropic Claude Messages API 格式的请求。
需要在请求头中包含 `anthropic-version`。




## OpenAPI

````yaml /openapi/relay.json post /v1/messages
openapi: 3.0.1
info:
  title: OmniMux Gateway API
  description: >-
    OpenAI-compatible relay API for OmniMux (geminix.cc). Use Authorization:
    Bearer sk-... and base URL https://api.geminix.cc/v1 for SDKs.
  version: 1.0.0
servers:
  - url: https://api.geminix.cc
    description: OmniMux production API
security:
  - BearerAuth: []
tags:
  - name: 获取模型列表
  - name: OpenAI格式(Chat)
  - name: OpenAI格式(Responses)
  - name: 图片生成
  - name: 图片生成/OpenAI兼容格式
  - name: 图片生成/Qwen千问
  - name: 视频生成
  - name: 视频生成/Sora兼容格式
  - name: 视频生成/Kling格式
  - name: 视频生成/即梦格式
  - name: Claude格式(Messages)
  - name: Gemini格式
  - name: OpenAI格式(Embeddings)
  - name: 文本补全(Completions)
  - name: OpenAI音频(Audio)
  - name: 重排序(Rerank)
  - name: Moderations
  - name: Realtime
  - name: 未实现
  - name: 未实现/Fine-tunes
  - name: 未实现/Files
paths:
  /v1/messages:
    post:
      tags:
        - Claude
      summary: Claude 聊天
      description: |
        Anthropic Claude Messages API 格式的请求。
        需要在请求头中包含 `anthropic-version`。
      operationId: createMessage
      parameters:
        - name: anthropic-version
          in: header
          description: Anthropic API 版本
          required: true
          example: ''
          schema:
            type: string
            example: '2023-06-01'
        - name: x-api-key
          in: header
          description: Anthropic API Key (可选，也可使用 Bearer Token)
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClaudeRequest'
            examples: {}
      responses:
        '200':
          description: 成功创建响应
          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: |
        使用 Bearer Token 认证。
        格式: `Authorization: Bearer sk-xxxxxx`

````