|
| 1 | +{ |
| 2 | + "openapi": "3.0.0", |
| 3 | + "info": { |
| 4 | + "title": "AIML API", |
| 5 | + "version": "1.0.0" |
| 6 | + }, |
| 7 | + "servers": [ |
| 8 | + { |
| 9 | + "url": "https://api.aimlapi.com" |
| 10 | + } |
| 11 | + ], |
| 12 | + "paths": { |
| 13 | + "/v2/video/generations": { |
| 14 | + "post": { |
| 15 | + "operationId": "_v2_video_generations", |
| 16 | + "requestBody": { |
| 17 | + "required": true, |
| 18 | + "content": { |
| 19 | + "application/json": { |
| 20 | + "schema": { |
| 21 | + "type": "object", |
| 22 | + "properties": { |
| 23 | + "model": { |
| 24 | + "type": "string", |
| 25 | + "enum": [ |
| 26 | + "bytedance/dreamina-seedance-2-0-mini" |
| 27 | + ] |
| 28 | + }, |
| 29 | + "provider": { |
| 30 | + "type": "string", |
| 31 | + "description": "Provider routing override. `bytedance` runs native ByteDance with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the ByteDance -> fal.ai fallback chain. Case-insensitive.", |
| 32 | + "example": "auto" |
| 33 | + }, |
| 34 | + "prompt": { |
| 35 | + "type": "string", |
| 36 | + "description": "The text description of the scene, subject, or action to generate in the video." |
| 37 | + }, |
| 38 | + "image_url": { |
| 39 | + "type": "string", |
| 40 | + "format": "uri", |
| 41 | + "description": "A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video." |
| 42 | + }, |
| 43 | + "last_image_url": { |
| 44 | + "type": "string", |
| 45 | + "format": "uri", |
| 46 | + "description": "A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video." |
| 47 | + }, |
| 48 | + "audio_url": { |
| 49 | + "type": "string", |
| 50 | + "format": "uri", |
| 51 | + "description": "URL, Base64-encoded string or asset ID of the audio. The duration of the audio file specified in the parameter must not exceed 15.2 seconds. If audio is provided, at least one reference image or video is required." |
| 52 | + }, |
| 53 | + "video_url": { |
| 54 | + "type": "string", |
| 55 | + "format": "uri", |
| 56 | + "description": "The public URL of the video. Only video URLs are supported." |
| 57 | + }, |
| 58 | + "image_urls": { |
| 59 | + "type": "array", |
| 60 | + "items": { |
| 61 | + "type": "string", |
| 62 | + "format": "uri" |
| 63 | + }, |
| 64 | + "minItems": 1, |
| 65 | + "maxItems": 9, |
| 66 | + "description": "Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc." |
| 67 | + }, |
| 68 | + "audio_urls": { |
| 69 | + "type": "array", |
| 70 | + "items": { |
| 71 | + "type": "string", |
| 72 | + "format": "uri" |
| 73 | + }, |
| 74 | + "minItems": 1, |
| 75 | + "maxItems": 3, |
| 76 | + "description": "Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 3 files, combined duration must not exceed 15 seconds. If audio is provided, at least one reference image (image_urls) or video (video_urls) is required." |
| 77 | + }, |
| 78 | + "video_urls": { |
| 79 | + "type": "array", |
| 80 | + "items": { |
| 81 | + "type": "string", |
| 82 | + "format": "uri" |
| 83 | + }, |
| 84 | + "minItems": 1, |
| 85 | + "maxItems": 3, |
| 86 | + "description": "Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Each video must be between ~480p (640x640) and ~720p (834x1112) in resolution." |
| 87 | + }, |
| 88 | + "aspect_ratio": { |
| 89 | + "type": "string", |
| 90 | + "enum": [ |
| 91 | + "21:9", |
| 92 | + "16:9", |
| 93 | + "4:3", |
| 94 | + "1:1", |
| 95 | + "3:4", |
| 96 | + "9:16" |
| 97 | + ], |
| 98 | + "default": "16:9", |
| 99 | + "description": "The aspect ratio of the generated video." |
| 100 | + }, |
| 101 | + "resolution": { |
| 102 | + "type": "string", |
| 103 | + "enum": [ |
| 104 | + "480p", |
| 105 | + "720p" |
| 106 | + ], |
| 107 | + "default": "720p", |
| 108 | + "description": "An enumeration where the short side of the video frame determines the resolution." |
| 109 | + }, |
| 110 | + "duration": { |
| 111 | + "type": "integer", |
| 112 | + "description": "The length of the output video in seconds.", |
| 113 | + "enum": [ |
| 114 | + 4, |
| 115 | + 5, |
| 116 | + 6, |
| 117 | + 7, |
| 118 | + 8, |
| 119 | + 9, |
| 120 | + 10, |
| 121 | + 11, |
| 122 | + 12, |
| 123 | + 13, |
| 124 | + 14, |
| 125 | + 15 |
| 126 | + ], |
| 127 | + "default": "5" |
| 128 | + }, |
| 129 | + "generate_audio": { |
| 130 | + "type": "boolean", |
| 131 | + "default": true, |
| 132 | + "description": "Whether to generate audio for the video." |
| 133 | + }, |
| 134 | + "seed": { |
| 135 | + "type": "integer", |
| 136 | + "description": "Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen." |
| 137 | + }, |
| 138 | + "watermark": { |
| 139 | + "type": "boolean", |
| 140 | + "default": false, |
| 141 | + "description": "Whether the video contains a watermark." |
| 142 | + } |
| 143 | + }, |
| 144 | + "required": [ |
| 145 | + "model", |
| 146 | + "prompt" |
| 147 | + ], |
| 148 | + "title": "bytedance/dreamina-seedance-2-0-mini" |
| 149 | + } |
| 150 | + } |
| 151 | + } |
| 152 | + }, |
| 153 | + "responses": { |
| 154 | + "200": { |
| 155 | + "content": { |
| 156 | + "application/json": { |
| 157 | + "schema": { |
| 158 | + "type": "object", |
| 159 | + "properties": { |
| 160 | + "id": { |
| 161 | + "type": "string", |
| 162 | + "description": "The ID of the generated video.", |
| 163 | + "example": "60ac7c34-3224-4b14-8e7d-0aa0db708325" |
| 164 | + }, |
| 165 | + "status": { |
| 166 | + "type": "string", |
| 167 | + "enum": [ |
| 168 | + "queued", |
| 169 | + "generating", |
| 170 | + "completed", |
| 171 | + "error" |
| 172 | + ], |
| 173 | + "description": "The current status of the generation task.", |
| 174 | + "example": "completed" |
| 175 | + }, |
| 176 | + "video": { |
| 177 | + "type": "object", |
| 178 | + "nullable": true, |
| 179 | + "properties": { |
| 180 | + "url": { |
| 181 | + "type": "string", |
| 182 | + "format": "uri", |
| 183 | + "description": "The URL where the file can be downloaded from.", |
| 184 | + "example": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4" |
| 185 | + } |
| 186 | + }, |
| 187 | + "required": [ |
| 188 | + "url" |
| 189 | + ] |
| 190 | + }, |
| 191 | + "error": { |
| 192 | + "type": "object", |
| 193 | + "nullable": true, |
| 194 | + "properties": { |
| 195 | + "name": { |
| 196 | + "type": "string" |
| 197 | + }, |
| 198 | + "message": { |
| 199 | + "type": "string" |
| 200 | + } |
| 201 | + }, |
| 202 | + "required": [ |
| 203 | + "name", |
| 204 | + "message" |
| 205 | + ], |
| 206 | + "description": "Description of the error, if any." |
| 207 | + }, |
| 208 | + "meta": { |
| 209 | + "type": "object", |
| 210 | + "nullable": true, |
| 211 | + "properties": { |
| 212 | + "usage": { |
| 213 | + "type": "object", |
| 214 | + "nullable": true, |
| 215 | + "properties": { |
| 216 | + "credits_used": { |
| 217 | + "type": "number", |
| 218 | + "description": "The number of tokens consumed during generation.", |
| 219 | + "example": 120000 |
| 220 | + }, |
| 221 | + "usd_spent": { |
| 222 | + "type": "number", |
| 223 | + "description": "The total amount of money spent by the user in USD.", |
| 224 | + "example": 0.06 |
| 225 | + } |
| 226 | + }, |
| 227 | + "required": [ |
| 228 | + "credits_used", |
| 229 | + "usd_spent" |
| 230 | + ] |
| 231 | + } |
| 232 | + }, |
| 233 | + "description": "Additional details about the generation." |
| 234 | + } |
| 235 | + }, |
| 236 | + "required": [ |
| 237 | + "id", |
| 238 | + "status" |
| 239 | + ] |
| 240 | + } |
| 241 | + } |
| 242 | + }, |
| 243 | + "description": "Successful response." |
| 244 | + } |
| 245 | + }, |
| 246 | + "x-hideTryItPanel": true, |
| 247 | + "x-codeSamples": [ |
| 248 | + { |
| 249 | + "lang": "cURL", |
| 250 | + "source": "curl --request POST \\\n --url 'https://api.aimlapi.com/v2/video/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\"model\": \"bytedance/dreamina-seedance-2-0-mini\", \"prompt\": \"Describe what you want the model to generate.\", \"image_url\": \"https://example.com/input.jpg\", \"duration\": \"5\"}'" |
| 251 | + }, |
| 252 | + { |
| 253 | + "lang": "JavaScript", |
| 254 | + "source": "const response = await fetch('https://api.aimlapi.com/v2/video/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"model\": \"bytedance/dreamina-seedance-2-0-mini\",\n \"prompt\": \"Describe what you want the model to generate.\",\n \"image_url\": \"https://example.com/input.jpg\",\n \"duration\": \"5\"\n}),\n});\n\nconsole.log(await response.json());" |
| 255 | + }, |
| 256 | + { |
| 257 | + "lang": "Python", |
| 258 | + "source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v2/video/generations\",\n headers={\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n \"Content-Type\": \"application/json\",\n },\n json={'model': 'bytedance/dreamina-seedance-2-0-mini', 'prompt': 'Describe what you want the model to generate.', 'image_url': 'https://example.com/input.jpg', 'duration': '5'},\n)\n\nprint(response.json())" |
| 259 | + } |
| 260 | + ] |
| 261 | + } |
| 262 | + } |
| 263 | + }, |
| 264 | + "components": { |
| 265 | + "securitySchemes": { |
| 266 | + "access-token": { |
| 267 | + "scheme": "bearer", |
| 268 | + "bearerFormat": "<YOUR_AIMLAPI_KEY>", |
| 269 | + "type": "http", |
| 270 | + "description": "Bearer key" |
| 271 | + } |
| 272 | + } |
| 273 | + } |
| 274 | +} |
0 commit comments