> ## 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.

# CosyVoice Clone

> [Core Function] CosyVoice Clone clones a speaker from a public reference audio URL and synthesizes new speech in one async request; only the final audio is returned. [Strengths] No voice enrollment management; language_hint applies to both cloning and synthesis; SSML, hot_fix, and prosody controls. [Best For] One-off cloned narration and demos where a lasting voice library is not needed. [Limitations] Do NOT use this to obtain a reusable voice library entry; the cloned voice is temporary and is not returned. Reference URL must be publicly accessible. model must be cosyvoice-v3.5-plus or cosyvoice-v3.5-flash. [Routing] Choose cosyvoice-v3.5-plus for higher speech quality; cosyvoice-v3.5-flash for lower latency.



## OpenAPI

````yaml /media-model-api/alibaba/alibaba-s2s.json post /alibaba/cosyvoice-clone
openapi: 3.1.0
info:
  title: Alibaba CosyVoice Voice Clone API
  description: >-
    CosyVoice one-shot voice cloning and speech synthesis. Submit a public
    reference audio URL with text as an async task; poll GET
    /api/v1/tasks/{task_id} for the audio. The cloned voice is temporary and is
    not returned or persisted. Target TTS models: cosyvoice-v3.5-plus and
    cosyvoice-v3.5-flash.
  version: 3.0.0
  contact:
    name: Modellix Support
    email: support@modellix.ai
servers:
  - url: https://api.modellix.ai/api/v1
    description: Modellix API
security:
  - bearerAuth: []
paths:
  /alibaba/cosyvoice-clone:
    post:
      summary: CosyVoice Clone
      description: >-
        [Core Function] CosyVoice Clone clones a speaker from a public reference
        audio URL and synthesizes new speech in one async request; only the
        final audio is returned. [Strengths] No voice enrollment management;
        language_hint applies to both cloning and synthesis; SSML, hot_fix, and
        prosody controls. [Best For] One-off cloned narration and demos where a
        lasting voice library is not needed. [Limitations] Do NOT use this to
        obtain a reusable voice library entry; the cloned voice is temporary and
        is not returned. Reference URL must be publicly accessible. model must
        be cosyvoice-v3.5-plus or cosyvoice-v3.5-flash. [Routing] Choose
        cosyvoice-v3.5-plus for higher speech quality; cosyvoice-v3.5-flash for
        lower latency.
      operationId: cosyvoiceClone
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CosyVoiceCloneRequest'
            example:
              model: cosyvoice-v3.5-plus
              url: https://example.com/reference.wav
              text: There is a large garden behind my house.
              language_hint: en
              format: mp3
              enable_preprocess: false
      responses:
        '200':
          description: >-
            Task submitted successfully. Poll GET /api/v1/tasks/{task_id} until
            the task completes; synthesized audio is returned on the task
            result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncTaskResponse'
              example:
                code: 0
                message: success
                data:
                  status: pending
                  task_id: task-cosyvoice-clone-001
                  model_id: alibaba/cosyvoice-clone
                  get_result:
                    method: GET
                    url: >-
                      https://api.modellix.ai/api/v1/tasks/task-cosyvoice-clone-001
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CosyVoiceCloneRequest:
      type: object
      required:
        - model
        - url
        - text
      description: >-
        One-shot voice clone + TTS request. Required: model, url, text. The
        cloned voice is temporary and is not returned.
      properties:
        model:
          $ref: '#/components/schemas/CosyVoiceEphemeralTargetModel'
        url:
          type: string
          description: Publicly accessible reference audio URL for cloning.
          minLength: 1
          maxLength: 2048
          example: https://example.com/reference.wav
        text:
          type: string
          description: >-
            Text to synthesize with the temporarily cloned voice. Required. Max
            20,000 Unicode characters. Supports plain text and SSML (set
            enable_ssml to true).
          minLength: 1
          maxLength: 20000
          example: There is a large garden behind my house.
        language_hint:
          type: string
          description: Language hint for both cloning and synthesis. Default zh.
          enum:
            - zh
            - en
            - fr
            - de
            - ja
            - ko
            - ru
            - pt
            - th
            - id
            - vi
          default: zh
          example: en
        max_prompt_audio_length:
          type: number
          description: >-
            Max reference audio duration in seconds used for cloning (3.0–30.0).
            Default 10.0.
          minimum: 3
          maximum: 30
          default: 10
          example: 10
        enable_preprocess:
          type: boolean
          description: >-
            Enable noise reduction and audio enhancement before cloning. Default
            false.
          default: false
          example: false
        format:
          type: string
          description: Output audio encoding format. Default mp3.
          enum:
            - mp3
            - pcm
            - wav
            - opus
          default: mp3
          example: mp3
        sample_rate:
          type: integer
          description: Output sample rate in Hz. Default 22050.
          enum:
            - 8000
            - 16000
            - 22050
            - 24000
            - 44100
            - 48000
          default: 22050
          example: 24000
        volume:
          type: integer
          description: Output volume. Default 50. Range 0–100.
          minimum: 0
          maximum: 100
          default: 50
          example: 50
        rate:
          type: number
          description: Speech rate multiplier. Default 1.0. Range 0.5–2.0.
          minimum: 0.5
          maximum: 2
          default: 1
          example: 1
        pitch:
          type: number
          description: Pitch multiplier. Default 1.0. Range 0.5–2.0.
          minimum: 0.5
          maximum: 2
          default: 1
          example: 1
        bit_rate:
          type: integer
          description: >-
            Audio bit rate in kbps. Optional. Range 6–510. Only supported when
            format is opus; do not send for mp3, pcm, or wav.
          minimum: 6
          maximum: 510
          example: 32
        instruction:
          type: string
          description: >-
            Optional speaking-style instruction. Weighted length ≤100 (CJK
            ideographs count as 2).
          example: Speak in a friendly customer-service tone.
        seed:
          type: integer
          description: Random seed. Default 0. Range 0–65535.
          minimum: 0
          maximum: 65535
          default: 0
          example: 0
        enable_ssml:
          type: boolean
          description: >-
            Whether to parse text as SSML. Default false. When true, text must
            follow Alibaba CosyVoice SSML rules.
          default: false
          example: false
        hot_fix:
          type: object
          description: >-
            Text hot-fix before synthesis. Optional object with pronunciation
            (custom pinyin) and replace (text substitution) arrays, per Alibaba
            CosyVoice HTTP API.
          example:
            replace:
              - Modellix: Modelix
    AsyncTaskResponse:
      description: Response object for asynchronous task submission.
      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
          description: >-
            Task submission details. Poll GET /api/v1/tasks/{task_id} until
            status is success; audio appears in result.resources.
          properties:
            status:
              type: string
              enum:
                - pending
                - processing
              description: Initial task status
              example: pending
            task_id:
              type: string
              description: Unique task identifier for polling
              example: task-cosyvoice-clone-001
            model_id:
              type: string
              description: Model ID in provider/model format
              example: alibaba/cosyvoice-clone
            get_result:
              type: object
              description: >-
                Endpoint to query the task result. See Common API: Query Task
                Result.
              properties:
                method:
                  type: string
                  example: GET
                url:
                  type: string
                  example: >-
                    https://api.modellix.ai/api/v1/tasks/task-cosyvoice-clone-001
    CosyVoiceEphemeralTargetModel:
      type: string
      description: Target CosyVoice v3.5 TTS model used for synthesis after cloning.
      enum:
        - cosyvoice-v3.5-plus
        - cosyvoice-v3.5-flash
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 400
        message:
          type: string
          example: 'Invalid parameters: model is required'
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized - Invalid or missing API Key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Modellix API Key. Format: Bearer <your_api_key>'

````