Skip to content

Commit 2282a1b

Browse files
Merge branch 'main' of https://github.com/aimlapi/api-docs
2 parents 57b8b02 + 025158b commit 2282a1b

13 files changed

Lines changed: 393 additions & 736 deletions

File tree

docs/SUMMARY.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@
254254
* [Seedance 1.0 lite (Image-to-Video)](api-references/video-models/bytedance/seedance-1.0-lite-image-to-video.md)
255255
* [Seedance 1.0 pro (Text-to-Video)](api-references/video-models/bytedance/seedance-1.0-pro-text-to-video.md)
256256
* [Seedance 1.0 pro (Image-to-Video)](api-references/video-models/bytedance/seedance-1.0-pro-image-to-video.md)
257+
* [Seedance 1.0 pro fast](api-references/video-models/bytedance/seedance-1.0-pro-fast.md)
257258
* [OmniHuman](api-references/video-models/bytedance/omnihuman.md)
258259
* [OmniHuman 1.5](api-references/video-models/bytedance/omnihuman-1.5.md)
259260
* [Google](api-references/video-models/google/README.md)
@@ -308,8 +309,6 @@
308309
* [ltxv-2](api-references/video-models/ltxv/ltxv-2.md)
309310
* [ltxv-2-fast](api-references/video-models/ltxv/ltxv-2-fast.md)
310311
* [Luma AI](api-references/video-models/luma-ai/README.md)
311-
* [Luma 1 (Text-to-Video) \[legacy\]](api-references/video-models/luma-ai/luma-ai-text-to-video-v1-legacy.md)
312-
* [Luma Ray 1.6 (Text-to-Video)](api-references/video-models/luma-ai/luma-ai-v2.md)
313312
* [Luma Ray 2](api-references/video-models/luma-ai/luma-ray-2.md)
314313
* [Luma Ray Flash 2](api-references/video-models/luma-ai/luma-ray-flash-2.md)
315314
* [Magic](solutions/magic/README.md)

docs/api-references/model-database.md

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

docs/api-references/text-models-llm/README.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/api-references/video-models/README.md

Lines changed: 1 addition & 3 deletions
Large diffs are not rendered by default.
Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
# Seedance 1.0 pro fast
2+
3+
{% columns %}
4+
{% column width="66.66666666666666%" %}
5+
{% hint style="info" %}
6+
This documentation is valid for the following list of our models:
7+
8+
* `bytedance/seedance-1-0-pro-fast`
9+
{% endhint %}
10+
{% endcolumn %}
11+
12+
{% column width="33.33333333333334%" %}
13+
<a href="https://aimlapi.com/app/bytedance/seedance-1-0-pro-fast" class="button primary">Try in Playground</a>
14+
{% endcolumn %}
15+
{% endcolumns %}
16+
17+
## Setup your API Key
18+
19+
If you don’t have an API key for the AI/ML API yet, feel free to use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).
20+
21+
## How to Make a Call
22+
23+
<details>
24+
25+
<summary>Step-by-Step Instructions</summary>
26+
27+
Generating a video using this model involves sequentially calling two endpoints:
28+
29+
* The first one is for creating and sending a video generation task to the server (returns a generation ID).
30+
* The second one is for requesting the generated video from the server using the generation ID received from the first endpoint.
31+
32+
Below, you can find both corresponding API schemas.
33+
34+
</details>
35+
36+
## API Schemas
37+
38+
### Create a video generation task and send it to the server
39+
40+
You can generate a video using this API. In the basic setup, you only need a prompt. \
41+
This endpoint creates and sends a video generation task to the server — and returns a generation ID.
42+
43+
{% openapi-operation spec="seedance-1-0-pro-fast" path="/v2/video/generations" method="post" %}
44+
[OpenAPI seedance-1-0-pro-fast](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/video-models/ByteDance/seedance-1-0-pro-fast.json)
45+
{% endopenapi-operation %}
46+
47+
### Retrieve the generated video from the server
48+
49+
After sending a request for video generation, this task is added to the queue. This endpoint lets you check the status of a video generation task using its `id`, obtained from the endpoint described above.\
50+
If the video generation task status is `complete`, the response will include the final result — with the generated video URL and additional metadata.
51+
52+
{% openapi-operation spec="universal-video-endpoint-fetch" path="/v2/video/generations" method="get" %}
53+
[OpenAPI universal-video-endpoint-fetch](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/video-models/universal-video-fetch.json)
54+
{% endopenapi-operation %}
55+
56+
## Code Example
57+
58+
The code below creates a video generation task, then automatically polls the server every **15** seconds until it finally receives the video URL.
59+
60+
{% tabs %}
61+
{% tab title="Python" %}
62+
{% code overflow="wrap" %}
63+
```python
64+
import requests
65+
import time
66+
67+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
68+
api_key = "<YOUR_AIMLAPI_KEY>"
69+
base_url = "https://api.aimlapi.com/v2"
70+
71+
# Creating and sending a video generation task to the server
72+
def generate_video():
73+
url = f"{base_url}/video/generations"
74+
headers = {
75+
"Authorization": f"Bearer {api_key}",
76+
}
77+
78+
data = {
79+
"model": "bytedance/seedance-1-0-pro-fast",
80+
"prompt": "Mona Lisa puts on glasses with her hands.",
81+
"image_url": "https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/mona_lisa_extended.jpg",
82+
"duration": "5",
83+
}
84+
85+
response = requests.post(url, json=data, headers=headers)
86+
87+
if response.status_code >= 400:
88+
print(f"Error: {response.status_code} - {response.text}")
89+
else:
90+
response_data = response.json()
91+
return response_data
92+
93+
94+
# Requesting the result of the task from the server using the generation_id
95+
def get_video(gen_id):
96+
url = f"{base_url}/video/generations"
97+
params = {
98+
"generation_id": gen_id,
99+
}
100+
101+
headers = {
102+
"Authorization": f"Bearer {api_key}",
103+
"Content-Type": "application/json"
104+
}
105+
106+
response = requests.get(url, params=params, headers=headers)
107+
return response.json()
108+
109+
110+
def main():
111+
# Running video generation and getting a task id
112+
gen_response = generate_video()
113+
gen_id = gen_response.get("id")
114+
print("Generation ID: ", gen_id)
115+
116+
# Try to retrieve the video from the server every 15 sec
117+
if gen_id:
118+
start_time = time.time()
119+
120+
timeout = 1000
121+
while time.time() - start_time < timeout:
122+
response_data = get_video(gen_id)
123+
124+
if response_data is None:
125+
print("Error: No response from API")
126+
break
127+
128+
status = response_data.get("status")
129+
130+
if status in ["queued", "generating"]:
131+
print(f"Status: {status}. Checking again in 15 seconds.")
132+
time.sleep(15)
133+
else:
134+
print("Processing complete:\n", response_data)
135+
return response_data
136+
137+
print("Timeout reached. Stopping.")
138+
return None
139+
140+
141+
if __name__ == "__main__":
142+
main()
143+
```
144+
{% endcode %}
145+
{% endtab %}
146+
147+
{% tab title="JS" %}
148+
{% code overflow="wrap" %}
149+
```javascript
150+
const https = require("https");
151+
const { URL } = require("url");
152+
153+
// Replace <YOUR_AIMLAPI_KEY> with your actual AI/ML API key
154+
const apiKey = "<YOUR_AIMLAPI_KEY>";
155+
const baseUrl = "https://api.aimlapi.com/v2";
156+
157+
// Creating and sending a video generation task to the server
158+
function generateVideo(callback) {
159+
const data = JSON.stringify({
160+
model: "bytedance/seedance-1-0-pro-fast",
161+
prompt: "Mona Lisa puts on glasses with her hands.",
162+
image_url: "https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/mona_lisa_extended.jpg",
163+
duration: "5",
164+
});
165+
166+
const url = new URL(`${baseUrl}/video/generations`);
167+
const options = {
168+
method: "POST",
169+
headers: {
170+
"Authorization": `Bearer ${apiKey}`,
171+
"Content-Type": "application/json",
172+
"Content-Length": Buffer.byteLength(data),
173+
},
174+
};
175+
176+
const req = https.request(url, options, (res) => {
177+
let body = "";
178+
res.on("data", (chunk) => body += chunk);
179+
res.on("end", () => {
180+
if (res.statusCode >= 400) {
181+
console.error(`Error: ${res.statusCode} - ${body}`);
182+
callback(null);
183+
} else {
184+
const parsed = JSON.parse(body);
185+
callback(parsed);
186+
}
187+
});
188+
});
189+
190+
req.on("error", (err) => console.error("Request error:", err));
191+
req.write(data);
192+
req.end();
193+
}
194+
195+
// Requesting the result of the task from the server using the generation_id
196+
function getVideo(genId, callback) {
197+
const url = new URL(`${baseUrl}/video/generations`);
198+
url.searchParams.append("generation_id", genId);
199+
200+
const options = {
201+
method: "GET",
202+
headers: {
203+
"Authorization": `Bearer ${apiKey}`,
204+
"Content-Type": "application/json",
205+
},
206+
};
207+
208+
const req = https.request(url, options, (res) => {
209+
let body = "";
210+
res.on("data", (chunk) => body += chunk);
211+
res.on("end", () => {
212+
const parsed = JSON.parse(body);
213+
callback(parsed);
214+
});
215+
});
216+
217+
req.on("error", (err) => console.error("Request error:", err));
218+
req.end();
219+
}
220+
221+
// Initiates video generation and checks the status every 15 seconds until completion or timeout
222+
function main() {
223+
generateVideo((genResponse) => {
224+
if (!genResponse || !genResponse.id) {
225+
console.error("No generation ID received.");
226+
return;
227+
}
228+
229+
const genId = genResponse.id;
230+
console.log("Generation ID:", genId);
231+
232+
const timeout = 1000 * 1000; // 1000 sec
233+
const interval = 15 * 1000; // 15 sec
234+
const startTime = Date.now();
235+
236+
const checkStatus = () => {
237+
if (Date.now() - startTime >= timeout) {
238+
console.log("Timeout reached. Stopping.");
239+
return;
240+
}
241+
242+
getVideo(genId, (responseData) => {
243+
if (!responseData) {
244+
console.error("Error: No response from API");
245+
return;
246+
}
247+
248+
const status = responseData.status;
249+
250+
if (["queued", "generating"].includes(status)) {
251+
console.log(`Status: ${status}. Checking again in 15 seconds.`);
252+
setTimeout(checkStatus, interval);
253+
} else {
254+
console.log("Processing complete:\n", responseData);
255+
}
256+
});
257+
};
258+
checkStatus();
259+
})
260+
}
261+
262+
main();
263+
```
264+
{% endcode %}
265+
{% endtab %}
266+
{% endtabs %}
267+
268+
<details>
269+
270+
<summary>Response</summary>
271+
272+
{% code overflow="wrap" %}
273+
```json5
274+
{'id': 'FGcTGqPuBac0Masr9DI8-', 'status': 'queued', 'meta': {'usage': {'credits_used': 2000000}}}
275+
Generation ID: FGcTGqPuBac0Masr9DI8-
276+
Status: queued. Checking again in 15 seconds.
277+
Status: generating. Checking again in 15 seconds.
278+
Processing complete:
279+
{'id': 'FGcTGqPuBac0Masr9DI8-', 'status': 'succeeded', 'video': {'url': 'https://cdn.aimlapi.com/rat/seedance-1-0-pro-fast/02176939282693400000000000000000000ffffc0a88025d8e30a.mp4?X-Tos-Algorithm=TOS4-HMAC-SHA256&X-Tos-Credential=AKLTYWJkZTExNjA1ZDUyNDc3YzhjNTM5OGIyNjBhNDcyOTQ%2F20260126%2Fap-southeast-1%2Ftos%2Frequest&X-Tos-Date=20260126T020054Z&X-Tos-Expires=86400&X-Tos-Signature=79dbb3fcd4b9a29728c096ef9da104d49273a8923da0ff6f3806e1ce64eda93c&X-Tos-SignedHeaders=host'}}
280+
```
281+
{% endcode %}
282+
283+
</details>
284+
285+
**Processing time**: \~ 34 sec.
286+
287+
**Generated video** (1920x1088, without sound):
288+
289+
{% embed url="https://drive.google.com/file/d/1Gs3P4L1HMxSAZbjQJ3BGpSFTku_mhm-y/view" %}
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11
# Luma AI
22

33
The Luma AI Dream Machine API allows developers to generate, retrieve, and extend AI-generated content using a variety of inputs. This API is particularly useful for creative applications, such as generating and extending video from text prompts.
4-
5-
{% content-ref url="luma-ai-v2.md" %}
6-
[luma-ai-v2.md](luma-ai-v2.md)
7-
{% endcontent-ref %}
8-
9-
{% content-ref url="luma-ai-text-to-video-v1-legacy.md" %}
10-
[luma-ai-text-to-video-v1-legacy.md](luma-ai-text-to-video-v1-legacy.md)
11-
{% endcontent-ref %}
12-

0 commit comments

Comments
 (0)