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

# Kling Avatar

> [Core Function] Kling Avatar is a specialized portrait animation model. [Strengths] It precisely animates a portrait image to lip-sync with an audio file or TTS audio ID. [Best For] Highly recommended for: virtual presenters, talking head videos, and digital avatars. [Limitations] Do NOT use this model for full-body action or general image animation. [Routing] Use this model explicitly when the user wants to make a portrait 'speak' with provided audio.



## OpenAPI

````yaml /model-api/kling/kling-i2v.json post /kling/kling-avatar
openapi: 3.1.0
info:
  description: The image-to-video models API from Kling AI.
  version: 1.0.0
  contact:
    name: Modellix Support
    email: support@modellix.ai
  title: Kling Image-to-Video Models API
servers:
  - url: https://api.modellix.ai/api/v1
    description: The image-to-video models API from Kling AI.
security:
  - bearerAuth: []
paths:
  /kling/kling-avatar:
    post:
      summary: Kling Avatar
      description: >-
        [Core Function] Kling Avatar is a specialized portrait animation model.
        [Strengths] It precisely animates a portrait image to lip-sync with an
        audio file or TTS audio ID. [Best For] Highly recommended for: virtual
        presenters, talking head videos, and digital avatars. [Limitations] Do
        NOT use this model for full-body action or general image animation.
        [Routing] Use this model explicitly when the user wants to make a
        portrait 'speak' with provided audio.
      operationId: klingAvatarAsync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KlingAvatarRequest'
            examples:
              with_audio_id:
                summary: Using TTS audio ID
                value:
                  image: https://example.com/avatar.jpg
                  audio_id: audio-abc123
                  prompt: Speaking with a smile, camera slowly zooms in
                  mode: pro
              with_sound_file:
                summary: Using audio file
                value:
                  image: https://example.com/avatar.jpg
                  sound_file: https://example.com/audio.mp3
                  prompt: Natural speaking gestures
                  mode: std
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncTaskResponse'
              example:
                code: 0
                message: success
                data:
                  status: pending
                  task_id: task-avatar001
                  model_id: model-123
                  get_result:
                    method: GET
                    url: https://api.modellix.ai/api/v1/tasks/task-avatar001
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    KlingAvatarRequest:
      type: object
      required:
        - image
      properties:
        prompt:
          type: string
          description: >-
            Prompt for defining avatar's actions, emotions, and camera movements
            (1-2500 characters). Optional.
          minLength: 1
          maxLength: 2500
          example: Speaking with a smile, camera slowly zooms in
        image:
          type: string
          description: >-
            Reference image for digital human avatar. Supports URL or Base64
            encoded string. Supported formats: JPG/JPEG/PNG. Maximum file size:
            10MB. Minimum resolution: 300x300px. Aspect ratio should be between
            1:2.5 and 2.5:1. Do not include Base64 prefix (e.g.,
            'data:image/png;base64,').
          minLength: 1
          example: https://example.com/avatar.jpg
        audio_id:
          type: string
          description: >-
            Audio ID generated by TTS API. Mutually exclusive with sound_file -
            exactly one must be provided. Only supports audio generated within
            the last 30 days. Audio duration must be between 2-300 seconds.
          minLength: 1
          example: audio-abc123
        sound_file:
          type: string
          description: >-
            Audio file URL or Base64 encoded string. Mutually exclusive with
            audio_id - exactly one must be provided. Supported formats:
            mp3/wav/m4a/aac. Maximum file size: 5MB. Audio duration must be
            between 2-300 seconds.
          minLength: 1
          example: https://example.com/audio.mp3
        mode:
          type: string
          description: >-
            Generation mode: std (standard, cost-effective) or pro
            (professional, higher quality but longer processing)
          default: std
          enum:
            - std
            - pro
          example: std
      oneOf:
        - required:
            - audio_id
        - required:
            - sound_file
    AsyncTaskResponse:
      type: object
      required:
        - code
        - message
        - data
      properties:
        code:
          type: integer
          description: Response code, 0 indicates success
          example: 0
        message:
          type: string
          description: Response message
          example: success
        data:
          type: object
          required:
            - status
            - task_id
            - model_id
          properties:
            status:
              type: string
              enum:
                - pending
                - processing
              description: Task status
              example: pending
            task_id:
              type: string
              description: Unique task identifier
              example: task-abc123
            model_id:
              type: string
              description: Model ID
              example: model-123
            get_result:
              type: object
              description: API information to query the task result
              properties:
                method:
                  type: string
                  description: HTTP method
                  example: GET
                url:
                  type: string
                  description: Full URL to query the task result
                  example: https://api.modellix.ai/api/v1/tasks/task-abc123
          description: Detailed data about the submitted asynchronous task.
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: Error code (equals HTTP status code)
          example: 400
        message:
          type: string
          description: Error message
          example: 'Invalid parameters: parameter ''image'' is required'
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 400
            message: 'Invalid parameters: parameter ''image'' is required'
    Unauthorized:
      description: Unauthorized - Invalid or missing API Key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            message: 'Authentication failed: invalid API key'
    TooManyRequests:
      description: Too many requests - Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          description: Maximum requests per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Remaining quota in current window
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: Rate limit window reset time (Unix timestamp)
          schema:
            type: integer
            example: 1704067260
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 429
            message: >-
              Rate limit exceeded: 100 requests per minute, retry after 60
              seconds
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 500
            message: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API Key authentication. Format: `Bearer YOUR_API_KEY`.'

````