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

> ## Agent Instructions
> For AgentScope Python, use https://docs.agentscope.io/stable/en/index for new projects. For existing projects, check the installed agentscope version and use matching versioned documentation.
> The /latest/ alias points to the newest documentation and may move ahead of /stable/ when a development version exists. Do not mix AgentScope 1.x and 2.x APIs.
> State the AgentScope version when providing installation commands or code examples. ReMe uses its own continuously updated /reme/latest/ documentation.

# Clone a voice from audio

> Clone a voice using OpenAI or DashScope voice enrollment.

Supports OpenAI and Qwen-TTS uploads and CosyVoice audio URLs.

Args:
    body: Clone request with engine, model, and audio.
    user_id: Injected authenticated user ID.
    access: Injected access service.

Returns:
    CloneVoiceResponse with the generated voice_id.



## OpenAPI

````yaml /en/versions/2.0.12/deploy/openapi.json post /voice-profile/clone
openapi: 3.1.0
info:
  title: AgentScope
  version: 2.0.12
servers: []
security: []
paths:
  /voice-profile/clone:
    post:
      tags:
        - voice_profile
      summary: Clone a voice from audio
      description: |-
        Clone a voice using OpenAI or DashScope voice enrollment.

        Supports OpenAI and Qwen-TTS uploads and CosyVoice audio URLs.

        Args:
            body: Clone request with engine, model, and audio.
            user_id: Injected authenticated user ID.
            access: Injected access service.

        Returns:
            CloneVoiceResponse with the generated voice_id.
      operationId: clone_voice_voice_profile_clone_post
      parameters:
        - name: x-user-id
          in: header
          required: true
          schema:
            type: string
            description: >-
              Caller's user ID. Temporary header-based identity; will be
              replaced by JWT auth.
            title: X-User-Id
          description: >-
            Caller's user ID. Temporary header-based identity; will be replaced
            by JWT auth.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloneVoiceRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloneVoiceResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CloneVoiceRequest:
      properties:
        engine:
          type: string
          title: Engine
        credential_id:
          type: string
          title: Credential Id
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        audio_base64:
          anyOf:
            - type: string
              maxLength: 13981016
            - type: 'null'
          title: Audio Base64
        audio_filename:
          type: string
          title: Audio Filename
          default: voice.wav
        audio_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Audio Url
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
        prefix:
          type: string
          title: Prefix
          default: agentscope
        consent:
          anyOf:
            - type: string
            - type: 'null'
          title: Consent
      type: object
      required:
        - engine
        - credential_id
      title: CloneVoiceRequest
      description: Request body for voice cloning.
    CloneVoiceResponse:
      properties:
        voice_id:
          type: string
          title: Voice Id
        credential_id:
          type: string
          title: Credential Id
      type: object
      required:
        - voice_id
        - credential_id
      title: CloneVoiceResponse
      description: Response body for voice cloning.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.