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

# Native Claude Format

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




## OpenAPI

````yaml post /v1/messages
openapi: 3.1.0
info:
  title: UToken API
  version: 1.0.0
  description: Complete UToken API Reference Documentation
servers:
  - url: https://utoken.yoostudio.ai
    description: Production
security: []
tags:
  - name: Images / Native Gemini Format
  - name: Images / Native OpenAI Format
  - name: Images / Qwen OpenAI Compatible Format
  - name: Realtime Voice
  - name: Content Moderation
  - name: Text Embeddings
  - name: Unimplemented / Fine-tuning
  - name: Unimplemented / File Management
  - name: Models / List Models
  - name: Chat Completions
  - name: Chat Completions / Native Gemini Format
  - name: Chat Completions / Native OpenAI Format
  - name: Text Completions
  - name: Video Generation
  - name: Video Generation / Sora Format
  - name: Video Generation / Jimeng (Dreamina) Format
  - name: Video Generation / Kling AI Format
  - name: Document Reranking
  - name: Audio Processing
  - name: Audio Processing / Native OpenAI Format
paths:
  /v1/messages:
    post:
      tags:
        - Chat Completions
      summary: Native Claude Format
      description: |
        Request in Anthropic Claude Messages API format.
        Requires `anthropic-version` header to be included.
      operationId: createmessage
      parameters:
        - name: anthropic-version
          in: header
          required: true
          description: Anthropic API Version
          schema:
            type: string
            examples:
              - '2023-06-01'
        - name: x-api-key
          in: header
          required: false
          description: Anthropic API Key (optional, can also use Bearer Token)
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
                - max_tokens
              properties:
                model:
                  type: string
                  examples:
                    - claude-3-opus-20240229
                messages:
                  type: array
                  items:
                    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
                                  x-apifox-orders:
                                    - type
                                    - media_type
                                    - data
                                    - url
                                id:
                                  type: string
                                name:
                                  type: string
                                input:
                                  type: object
                                  properties: {}
                                  x-apifox-orders: []
                                tool_use_id:
                                  type: string
                                content:
                                  type: string
                              x-apifox-orders:
                                - type
                                - text
                                - source
                                - id
                                - name
                                - input
                                - tool_use_id
                                - content
                    x-apifox-orders:
                      - role
                      - content
                system:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: object
                        properties: {}
                        x-apifox-orders: []
                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: {}
                        x-apifox-orders: []
                    x-apifox-orders:
                      - name
                      - description
                      - input_schema
                tool_choice:
                  oneOf:
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - auto
                            - any
                            - tool
                        name:
                          type: string
                      x-apifox-orders:
                        - type
                        - name
                thinking:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    budget_tokens:
                      type: integer
                  x-apifox-orders:
                    - type
                    - budget_tokens
                metadata:
                  type: object
                  properties:
                    user_id:
                      type: string
                  x-apifox-orders:
                    - user_id
              x-apifox-orders:
                - model
                - messages
                - system
                - max_tokens
                - temperature
                - top_p
                - top_k
                - stream
                - stop_sequences
                - tools
                - tool_choice
                - thinking
                - metadata
      responses:
        '200':
          description: Response created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                    examples:
                      - message
                  role:
                    type: string
                    examples:
                      - assistant
                  content:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        text:
                          type: string
                      x-apifox-orders:
                        - type
                        - text
                  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
                    x-apifox-orders:
                      - input_tokens
                      - output_tokens
                      - cache_creation_input_tokens
                      - cache_read_input_tokens
                x-apifox-orders:
                  - id
                  - type
                  - role
                  - content
                  - model
                  - stop_reason
                  - usage
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        Use Bearer Token authentication
        Format: Authorization: Bearer sk-xxxxxx

````