{
 "openapi": "3.0.3",
 "info": {
  "title": "Video to audio (foley) (default): MMAudio",
  "version": "2026-11-21",
  "description": "Curated ZeroGPU tool from the ZeroGPU lineup catalog. Calls go straight to the upstream Space hkchengrex/MMAudio; send your own HF token as a bearer token so the call uses your ZeroGPU quota."
 },
 "servers": [
  {
   "url": "https://hkchengrex-mmaudio.hf.space"
  }
 ],
 "x-zerogpu": {
  "category": "Music and sound",
  "slot": "Video to audio (foley)",
  "need": "Add synchronized sound to silent generated video.",
  "role": "default",
  "space": "hkchengrex/MMAudio",
  "space_url": "https://huggingface.co/spaces/hkchengrex/MMAudio",
  "model": "MMAudio",
  "license": "CC-BY-NC (weights)",
  "license_class": "nc",
  "gpu_seconds_booked": "120",
  "notes": "Proven and stateless. Strip the track out if the caller only wants sound.",
  "caveats": "",
  "lineup_call": "/video_to_audio(video, prompt, negative_prompt=\"music\", seed=-1, num_steps=25, cfg_strength=4.5, duration=8) \u2192 video with 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/video_to_audio": {
   "post": {
    "description": "Add synchronized sound to silent generated video. Step 1 of 2: returns {\"event_id\"}; then GET /gradio_api/call/video_to_audio/{event_id} reads an SSE stream whose `event: complete` data is the JSON output array (`event: error` on failure). Upstream: https://huggingface.co/spaces/hkchengrex/MMAudio. License: CC-BY-NC (weights). \n\nUpstream description: Generate audio conditioned on a video and text prompt. This function extracts visual features from a video, combines them with text conditioning, and synthesizes synchronized audio using the MMAudio model. The output is a video file with generated audio.\nReturns, in order: output: filepath",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "data"
        ],
        "properties": {
         "data": {
          "type": "array",
          "minItems": 2,
          "maxItems": 7,
          "items": {},
          "description": "Positional inputs, in this order:\n0. video: filepath (required)\n1. prompt: str (required)\n2. negative_prompt: str (default \"music\")\n3. seed: int (default -1)\n4. num_steps: int (default 25)\n5. cfg_strength: float (default 4.5)\n6. duration: float (default 8)"
         }
        }
       }
      }
     }
    },
    "x-gradio-parameters": [
     {
      "name": "video",
      "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": "prompt",
      "schema": {
       "type": "string"
      },
      "required": true,
      "default": null
     },
     {
      "name": "negative_prompt",
      "schema": {
       "type": "string"
      },
      "required": false,
      "default": "music"
     },
     {
      "name": "seed",
      "schema": {
       "type": "integer"
      },
      "required": false,
      "default": -1
     },
     {
      "name": "num_steps",
      "schema": {
       "type": "integer"
      },
      "required": false,
      "default": 25
     },
     {
      "name": "cfg_strength",
      "schema": {
       "type": "number"
      },
      "required": false,
      "default": 4.5
     },
     {
      "name": "duration",
      "schema": {
       "type": "number"
      },
      "required": false,
      "default": 8
     }
    ],
    "operationId": "music_video_to_audio_foley",
    "tags": [
     "Music and sound"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ],
    "summary": "Video to audio (foley) (default): MMAudio",
    "responses": {
     "200": {
      "description": "Job accepted.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "event_id"
         ],
         "properties": {
          "event_id": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/gradio_api/call/video_to_audio/{event_id}": {
   "get": {
    "summary": "Read the result stream for /video_to_audio",
    "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": "music_video_to_audio_foley_result",
    "tags": [
     "Music and sound"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}