{
 "openapi": "3.0.3",
 "info": {
  "title": "Text to speech (default): Fish Audio Drama 3 (35B MoE, 3B active)",
  "version": "2026-11-21",
  "description": "Curated ZeroGPU tool from the ZeroGPU lineup catalog. Calls go straight to the upstream Space fishaudio/Drama-3; send your own HF token as a bearer token so the call uses your ZeroGPU quota."
 },
 "servers": [
  {
   "url": "https://fishaudio-drama-3.hf.space"
  }
 ],
 "x-zerogpu": {
  "category": "Speech and voice",
  "slot": "Text to speech",
  "need": "Narration, voice-overs and spoken replies from a preset or a described voice.",
  "role": "default",
  "space": "fishaudio/Drama-3",
  "space_url": "https://huggingface.co/spaces/fishaudio/Drama-3",
  "model": "Fish Audio Drama 3 (35B MoE, 3B active)",
  "license": "Fish Audio Community License 1.0 (commercial under US$500k revenue)",
  "license_class": "cond",
  "gpu_seconds_booked": "28\u201346",
  "notes": "Official. Top open-weights model on the Artificial Analysis Speech Arena (Elo 1277, #8 of 106, 49 above Breeze TTS 2). Fish reports #1 on AA's Pronunciation Robustness test. mode=\"Design\" casts a voice from a written description; 83 languages; bracketed acting cues.",
  "caveats": "On xlarge, where seconds count double. Pass description, name and scene explicitly: their defaults are a pirate-captain example. The API clones only three unlabelled preset recordings, so prefer Design. Limit: 60 takes per 10 minutes per caller. Offering Drama 3 as a hosted TTS service needs a separate Fish license.",
  "lineup_call": "/perform(text (\u2264600 chars, [bracketed] cues), mode=\"Surprise\"|\"Design\"|\"Clone\", description=<voice, \u2264300 chars>, name, scene, voice=\"clone1\"|\"clone2\"|\"clone3\", transcript, temperature=1.0, top_p=0.9, top_k=0) \u2192 streamed audio, metrics, take list",
  "api_style": "v2"
 },
 "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/v2/perform": {
   "post": {
    "summary": "Text to speech (default): Fish Audio Drama 3 (35B MoE, 3B active)",
    "description": "Narration, voice-overs and spoken replies from a preset or a described voice. Step 1 of 2: returns {\"event_id\"}; then GET /gradio_api/call/perform/{event_id} reads an SSE stream whose `event: complete` data is the JSON output array (`event: error` on failure). Upstream: https://huggingface.co/spaces/fishaudio/Drama-3. License: Fish Audio Community License 1.0 (commercial under US$500k revenue). Caveats: On xlarge, where seconds count double. Pass description, name and scene explicitly: their defaults are a pirate-captain example. The API clones only three unlabelled preset recordings, so prefer Design. Limit: 60 takes per 10 minutes per caller. Offering Drama 3 as a hosted TTS service needs a separate Fish license. \n\nUpstream description: Output must be fetched from GET /gradio_api/call/perform/{event_id}. Returns an array of 3 elements of the following format: [\"output ({'type': 'object', 'description': 'JSON object with url key to fetch the output'})\", \"output_1 ({'type': 'string'})\", \"output_2 ({'type': 'string', 'enum': []})\"]",
    "operationId": "speech_text_to_speech",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "text": {
          "type": "string",
          "description": "If omitted, the Space substitutes its demo text (\"[clears throat] Ladies and gentlemen... [hesitates] I had a \\u2026\"); send \"\" for none."
         },
         "mode": {
          "enum": [
           "Surprise",
           "Clone",
           "Design"
          ],
          "title": "Radio",
          "type": "string"
         },
         "voice": {
          "enum": [
           "clone1",
           "clone2",
           "clone3"
          ],
          "title": "Radio",
          "type": "string"
         },
         "transcript": {
          "type": "string",
          "description": "If omitted, the Space substitutes its demo text (\"I'm confused why some people have super short timelines, yet\\u2026\"); send \"\" for none."
         },
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string",
          "description": "If omitted, the Space substitutes its demo text (\"gravelly old male voice, about seventy, weathered and slow, \\u2026\"); send \"\" for none."
         },
         "scene": {
          "type": "string",
          "description": "If omitted, the Space substitutes its demo text (\"a storm-battered tavern at the edge of the harbor\"); send \"\" for none."
         },
         "temperature": {
          "type": "number",
          "description": "numeric value between 0.3 and 1.3"
         },
         "top_p": {
          "type": "number",
          "description": "numeric value between 0.5 and 1"
         },
         "top_k": {
          "type": "number",
          "description": "numeric value between 0 and 100"
         }
        },
        "required": [
         "text",
         "transcript",
         "description",
         "scene"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Job accepted.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "event_id"
         ],
         "properties": {
          "event_id": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "tags": [
     "Speech and voice"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  },
  "/gradio_api/call/perform/{event_id}": {
   "get": {
    "summary": "Fetch results for /perform",
    "description": "Returns a stream of server-sent events (SSE). The final event has `event: complete` with `data` containing a JSON array of outputs.",
    "operationId": "speech_text_to_speech_result",
    "parameters": [
     {
      "name": "event_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The event_id returned by the POST request"
     }
    ],
    "responses": {
     "200": {
      "description": "SSE stream with event: complete containing a JSON array of outputs",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "tags": [
     "Speech and voice"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  },
  "/gradio_api/upload": {
   "post": {
    "summary": "Upload File",
    "operationId": "speech_text_to_speech_upload",
    "parameters": [
     {
      "name": "upload_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "nullable": true,
       "default": null
      },
      "description": "Optional ID to track upload progress"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "files": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "binary"
          },
          "description": "One or more files to upload"
         }
        },
        "required": [
         "files"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "List of file paths where the uploaded files were saved",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "string"
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid content type or invalid file name",
      "content": {
       "text/plain": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "413": {
      "description": "File exceeds maximum allowed size",
      "content": {
       "text/plain": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}