{"openapi":"3.0.1","info":{"title":"Gaga OpenAPI","description":"API Documentation for Gaga. Base URL: https://api.gaga.art\n","version":"1.0"},"servers":[{"url":"https://platform.gaga.art","description":"Generated server url"}],"security":[{"api-key":[]}],"paths":{"/v1/generations":{"post":{"tags":["Generations"],"summary":"Submit video generation","operationId":"generate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequestVo"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IDOnlyResponse"}}}}},"x-codeSamples":[{"label":"cURL","source":"curl -X POST \"https://api.gaga.art/v1/generations\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"avatar-h1-pro\",\n    \"resolution\": \"720p\",\n    \"aspectRatio\": \"16:9\",\n    \"source\": {\n      \"type\": \"image\",\n      \"content\": 123\n    },\n    \"chunks\": [{\n      \"conditions\": [\n          {\n              \"type\": \"text\",\n              \"content\": \"say hello\"\n          },\n          {\n              \"type\": \"audio\",\n              \"content\": \"11232355\"\n          }\n      ],\n      \"enablePromptEnhancement\": true\n    }]\n  }'\n","lang":"shell"},{"label":"JavaScript","source":"const requestBody = {\n  model: \"avatar-h1-pro\",\n  resolution: \"720p\",\n  aspectRatio: \"16:9\",\n  source: {\n    type: \"image\",\n    content: 123\n  },\n  chunks: [{\n      conditions: [\n          {\n              type: \"text\",\n              content: \"say hello\"\n          },\n          {\n              type: \"audio\",\n              content: \"11232355\"\n          }\n      ],\n    enablePromptEnhancement: true\n  }]\n};\n\nfetch('https://api.gaga.art/v1/generations', {\n  method: 'POST',\n  headers: {\n    'Authorization': 'Bearer YOUR_API_KEY',\n    'Content-Type': 'application/json'\n  },\n  body: JSON.stringify(requestBody)\n})\n.then(response => response.json())\n.then(data => console.log(data));\n","lang":"javascript"},{"label":"Python","source":"import requests\nimport json\n\nurl = \"https://api.gaga.art/v1/generations\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_API_KEY\",\n    \"Content-Type\": \"application/json\"\n}\ndata = {\n    \"model\": \"avatar-h1-pro\",\n    \"resolution\": \"720p\",\n    \"aspectRatio\": \"16:9\",\n    \"source\": {\n        \"type\": \"image\",\n        \"content\": 123\n    },\n    \"chunks\": [{\n        \"conditions\": [\n            {\n                \"type\": \"text\",\n                \"content\": \"say hello\"\n            },\n            {\n                \"type\": \"audio\",\n                \"content\": \"11232355\"\n            }\n        ],\n        \"enablePromptEnhancement\": True\n    }]\n}\n\nresponse = requests.post(url, headers=headers, json=data)\nprint(response.json())\n","lang":"python"}]}},"/v1/audios":{"post":{"tags":["Audio Generations"],"summary":"Submit audio generation","description":"According to the specified voice and text, generate audio.","operationId":"audioGenerate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudioGenerateRequestVo"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AudioGenerateResponseVo"}}}}},"x-codeSamples":[{"label":"cURL","source":"curl -X POST \"https://api.gaga.art/v1/audios\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"voiceId\": 700900863176773,\n    \"text\": \"Hello, this is a test audio generation.\"\n  }'\n","lang":"shell"},{"label":"JavaScript","source":"const requestBody = {\n  voiceId: 700900863176773,\n  text: \"Hello, this is a test audio generation.\"\n};\n\nfetch('https://api.gaga.art/v1/audios', {\n  method: 'POST',\n  headers: {\n    'Authorization': 'Bearer YOUR_API_KEY',\n    'Content-Type': 'application/json'\n  },\n  body: JSON.stringify(requestBody)\n})\n.then(response => response.json())\n.then(data => console.log(data));\n","lang":"javascript"},{"label":"Python","source":"import requests\nimport json\n\nurl = \"https://api.gaga.art/v1/audios\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_API_KEY\",\n    \"Content-Type\": \"application/json\"\n}\ndata = {\n    \"voiceId\": 700900863176773,\n    \"text\": \"Hello, this is a test audio generation.\"\n}\n\nresponse = requests.post(url, headers=headers, json=data)\nprint(response.json())\n","lang":"python"}]}},"/v1/assets":{"post":{"tags":["Assets"],"summary":"Upload asset","description":"Upload an asset that can be used for video generation or video extension.","operationId":"uploadAsset","requestBody":{"content":{"application/json":{"schema":{"required":["file"],"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IDOnlyResponse"}}}}},"x-codeSamples":[{"label":"cURL","source":"curl -X POST \"https://api.gaga.art/v1/assets\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: multipart/form-data\" \\\n  -F \"file=@/path/to/your/video.mp4\"\n","lang":"shell"},{"label":"JavaScript","source":"const formData = new FormData();\nformData.append('file', fileInput.files[0]);\n\nfetch('https://api.gaga.art/v1/assets', {\n  method: 'POST',\n  headers: {\n    'Authorization': 'Bearer YOUR_API_KEY'\n  },\n  body: formData\n})\n.then(response => response.json())\n.then(data => console.log(data));\n","lang":"javascript"},{"label":"Python","source":"import requests\n\nurl = \"https://api.gaga.art/v1/assets\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n}\nfiles = {\n    \"file\": open(\"/path/to/your/video.mp4\", \"rb\")\n}\n\nresponse = requests.post(url, headers=headers, files=files)\nprint(response.json())\n","lang":"python"}]}},"/v1/generations/{id}":{"get":{"tags":["Generations"],"summary":"Get video generation status","description":"Get the status and the result video of a video generation task.","operationId":"getGenerationDetail","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/GenerationResponseVo"}}}}},"x-codeSamples":[{"label":"cURL","source":"curl -X GET \"https://api.gaga.art/v1/generations/123\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n","lang":"shell"},{"label":"JavaScript","source":"fetch('https://api.gaga.art/v1/generations/123', {\n  method: 'GET',\n  headers: {\n    'Authorization': 'Bearer YOUR_API_KEY'\n  }\n})\n.then(response => response.json())\n.then(data => console.log(data));\n","lang":"javascript"},{"label":"Python","source":"import requests\n\nurl = \"https://api.gaga.art/v1/generations/123\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n}\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n","lang":"python"}]}},"/v1/assets/{id}":{"get":{"tags":["Assets"],"summary":"Get asset info","operationId":"getAssetById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PlatformAssetView"}}}}},"x-codeSamples":[{"label":"cURL","source":"curl -X GET \"https://api.gaga.art/v1/assets/123\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n","lang":"shell"},{"label":"JavaScript","source":"fetch('https://api.gaga.art/v1/assets/123', {\n  method: 'GET',\n  headers: {\n    'Authorization': 'Bearer YOUR_API_KEY'\n  }\n})\n.then(response => response.json())\n.then(data => console.log(data));\n","lang":"javascript"},{"label":"Python","source":"import requests\n\nurl = \"https://api.gaga.art/v1/assets/123\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n}\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n","lang":"python"}]},"delete":{"tags":["Assets"],"summary":"Delete asset","operationId":"deleteAssetById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IDOnlyResponse"}}}}},"x-codeSamples":[{"label":"cURL","source":"curl -X DELETE \"https://api.gaga.art/v1/assets/123\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n","lang":"shell"},{"label":"JavaScript","source":"fetch('https://api.gaga.art/v1/assets/123', {\n  method: 'DELETE',\n  headers: {\n    'Authorization': 'Bearer YOUR_API_KEY'\n  }\n})\n.then(response => response.json())\n.then(data => console.log(data));\n","lang":"javascript"},{"label":"Python","source":"import requests\n\nurl = \"https://api.gaga.art/v1/assets/123\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n}\n\nresponse = requests.delete(url, headers=headers)\nprint(response.json())\n","lang":"python"}]}}},"components":{"schemas":{"Chunk":{"type":"object","properties":{"duration":{"type":"integer","description":"Length of generated video (seconds).\n\n**gaga-1**, **gaga-2** and **gaga-4**: only support 5 seconds and 10 seconds.\n\n**avatar-h1** and **avatar-h1-pro**: support up to 60 seconds.\n","format":"int32","example":5},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/Condition"}},"enablePromptEnhancement":{"type":"boolean"}}},"Condition":{"type":"object","properties":{"type":{"type":"string","description":"Type of source content","example":"audio","enum":["text","audio"]},"content":{"type":"object","description":"Content data.\n\n- **text** type: text content.\n\n- **audio** type: Asset ID.\n\n**gaga-1**, **gaga-2** and **gaga-4**: text type is required, and audio type is optional.\n\n**avatar-h1** and **avatar-h1-pro**: audio type is required, and text type is optional.\n","example":"123456789"}}},"GenerationRequestVo":{"required":["chunks"],"type":"object","properties":{"model":{"type":"string","description":"model name","example":"gaga-2","enum":["avatar-h1","avatar-h1-pro","gaga-1","gaga-2","gaga-4"]},"aspectRatio":{"type":"string","description":"image aspect ratio, width:height.\n\n**gaga-1**, **gaga-2** and **gaga-4**: supports 16:9 and 9:16.\n\n**avatar-h1** and **avatar-h1-pro**: support all three aspect ratio.\n","example":"16:9","enum":["16:9","9:16","1:1"]},"resolution":{"type":"string","description":"output video resolution.\n\n**gaga-1** and **gaga-2**: supports 720p and 1080p.\n\n**gaga-4**: supports 540p\n\n**avatar-h1** and **avatar-h1-pro**: support 540p and 720p.\n","example":"720p","enum":["540p","720p","1080p"]},"source":{"$ref":"#/components/schemas/SourceCondition"},"chunks":{"type":"array","items":{"$ref":"#/components/schemas/Chunk"}}}},"SourceCondition":{"type":"object","properties":{"type":{"type":"string","description":"Type of source content","example":"image","enum":["image"]},"content":{"type":"object","description":"Image Asset ID. Optional for gaga-4 text-only generation.","example":"123456789"}}},"IDOnlyResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64"}}},"AudioGenerateRequestVo":{"required":["text","voiceId"],"type":"object","properties":{"voiceId":{"type":"integer","description":"Refer to the document 'Voices'","format":"int64","example":700900863176773},"text":{"type":"string"}}},"AudioGenerateResponseVo":{"type":"object","properties":{"id":{"type":"integer","description":"Assets id, used for subsequent video generation","format":"int64","example":2435454223},"duration":{"type":"number","format":"double"},"url":{"type":"string"}}},"GenerationResponseVo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"status":{"type":"string","enum":["PreProcessing","Pending","Running","Success","Fail","Canceled"]},"resultVideoURL":{"type":"string"},"resultVideoId":{"type":"integer","format":"int64"},"createTime":{"type":"string","format":"date-time"}}},"PlatformAssetView":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"url":{"type":"string"}}}},"securitySchemes":{"api-key":{"type":"apiKey","name":"Authorization","in":"header","bearerFormat":"bearer"}}}}