{
 "openapi": "3.0.3",
 "info": {
  "title": "Voice cloning (commercial): Qwen3-TTS Base",
  "version": "2026-11-21",
  "description": "Curated ZeroGPU tool from the ZeroGPU lineup catalog. Calls go straight to the upstream Space Qwen/Qwen3-TTS; send your own HF token as a bearer token so the call uses your ZeroGPU quota."
 },
 "servers": [
  {
   "url": "https://qwen-qwen3-tts.hf.space"
  }
 ],
 "x-zerogpu": {
  "category": "Speech and voice",
  "slot": "Voice cloning",
  "need": "Speak new text in a voice from a short reference clip.",
  "role": "commercial",
  "space": "Qwen/Qwen3-TTS",
  "space_url": "https://huggingface.co/spaces/Qwen/Qwen3-TTS",
  "model": "Qwen3-TTS Base",
  "license": "Apache-2.0",
  "license_class": "open",
  "gpu_seconds_booked": "60",
  "notes": "Ranked #3 for cloning, and commercially usable. ref_text is required unless use_xvector_only=true.",
  "caveats": "",
  "lineup_call": "/generate_voice_clone(ref_audio, ref_text, target_text, language=\"Auto\", use_xvector_only=false) \u2192 audio",
  "api_style": "v1"
 },
 "components": {
  "securitySchemes": {
   "hfToken": {
    "type": "http",
    "scheme": "bearer",
    "description": "Your own Hugging Face token (read scope is enough). It is sent only to the upstream Space and bills that call to your account's ZeroGPU quota. Without it the call runs on the small anonymous quota."
   }
  },
  "schemas": {}
 },
 "paths": {
  "/gradio_api/call/generate_voice_clone": {
   "post": {
    "description": "Speak new text in a voice from a short reference clip. Step 1 of 2: returns {\"event_id\"}; then GET /gradio_api/call/generate_voice_clone/{event_id} reads an SSE stream whose `event: complete` data is the JSON output array (`event: error` on failure). Upstream: https://huggingface.co/spaces/Qwen/Qwen3-TTS. License: Apache-2.0. \n\nUpstream description: Generate speech using Base (Voice Clone) model.\nReturns, in order: Generated Audio: filepath; Status: str",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "data"
        ],
        "properties": {
         "data": {
          "type": "array",
          "minItems": 3,
          "maxItems": 6,
          "items": {},
          "description": "Positional inputs, in this order:\n0. ref_audio: filepath (required)\n1. ref_text: str (required)\n2. target_text: str (required)\n3. language: Literal['Auto', 'Chinese', 'English', 'Japanese', 'Korean', 'French', 'German', 'Spanish', 'Portuguese', 'Russian'] (default \"Auto\")\n4. use_xvector_only: bool (default false)\n5. model_size: Literal['0.6B', '1.7B'] (default \"1.7B\")"
         }
        }
       }
      }
     }
    },
    "x-gradio-parameters": [
     {
      "name": "ref_audio",
      "schema": {
       "type": "object",
       "required": [
        "path",
        "meta"
       ],
       "description": "A file. Set path to a public https URL (or a path returned by POST /gradio_api/upload on the same Space) and meta to {\"_type\": \"gradio.FileData\"}.",
       "properties": {
        "path": {
         "type": "string"
        },
        "url": {
         "type": "string"
        },
        "orig_name": {
         "type": "string"
        },
        "meta": {
         "type": "object",
         "properties": {
          "_type": {
           "type": "string",
           "enum": [
            "gradio.FileData"
           ]
          }
         }
        }
       }
      },
      "required": true,
      "default": null
     },
     {
      "name": "ref_text",
      "schema": {
       "type": "string"
      },
      "required": true,
      "default": null
     },
     {
      "name": "target_text",
      "schema": {
       "type": "string"
      },
      "required": true,
      "default": null
     },
     {
      "name": "language",
      "schema": {
       "type": "string",
       "enum": [
        "Auto",
        "Chinese",
        "English",
        "Japanese",
        "Korean",
        "French",
        "German",
        "Spanish",
        "Portuguese",
        "Russian"
       ]
      },
      "required": false,
      "default": "Auto"
     },
     {
      "name": "use_xvector_only",
      "schema": {
       "type": "boolean"
      },
      "required": false,
      "default": false
     },
     {
      "name": "model_size",
      "schema": {
       "type": "string",
       "enum": [
        "0.6B",
        "1.7B"
       ]
      },
      "required": false,
      "default": "1.7B"
     }
    ],
    "operationId": "speech_voice_cloning_commercial",
    "tags": [
     "Speech and voice"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ],
    "summary": "Voice cloning (commercial): Qwen3-TTS Base",
    "responses": {
     "200": {
      "description": "Job accepted.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "event_id"
         ],
         "properties": {
          "event_id": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/gradio_api/call/generate_voice_clone/{event_id}": {
   "get": {
    "summary": "Read the result stream for /generate_voice_clone",
    "description": "Server-sent events. The final `event: complete` carries a JSON array of outputs; `event: error` means the call failed.",
    "parameters": [
     {
      "name": "event_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SSE stream",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "operationId": "speech_voice_cloning_commercial_result",
    "tags": [
     "Speech and voice"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}