API reference
Follow a redirect to a fresh signed link for the finished MP4.
GET https://loopling.ai/v1/video/generations/{id}/content
string · required
Your API key, as Bearer lpl_….
idstring · required
The generation’s id. Another account’s ID answers 404.
Locationstring<uri>
A fresh signed MP4 link. Needs no key.
curl
# 302 to a fresh signed URL; -L follows it and -o saves the MP4.
curl -L https://loopling.ai/v1/video/generations/vgen_01J9X6K3M8Q2/content \
-H "Authorization: Bearer $LOOPLING_API_KEY" \
-o lantern.mp4Node
import fs from 'node:fs'
const clip = await fetch('https://loopling.ai/v1/video/generations/vgen_01J9X6K3M8Q2/content', {
headers: { Authorization: `Bearer ${process.env.LOOPLING_API_KEY}` },
redirect: 'follow',
})
await fs.promises.writeFile('lantern.mp4', Buffer.from(await clip.arrayBuffer()))Python
import os, requests
res = requests.get(
"https://loopling.ai/v1/video/generations/vgen_01J9X6K3M8Q2/content",
headers={"Authorization": f"Bearer {os.environ['LOOPLING_API_KEY']}"},
allow_redirects=True,
)
open("lantern.mp4", "wb").write(res.content)HTTP/1.1 302 Found
Location: https://media.loopling.ai/…?sig=…
Cache-Control: no-store
X-Request-Id: 0b7c6f1e-2d4a-4e8b-9c3f-5a1d7e2b8c40{
"error": {
"type": "invalid_request_error",
"code": "generation_not_ready",
"message": "The generation is still running; poll its status first.",
"request_id": "0b7c6f1e-2d4a-4e8b-9c3f-5a1d7e2b8c40"
}
}{
"error": {
"type": "not_found_error",
"code": "result_expired",
"message": "The result was kept for the retention window and has been removed.",
"request_id": "0b7c6f1e-2d4a-4e8b-9c3f-5a1d7e2b8c40"
}
}{
"error": {
"type": "not_found_error",
"code": "result_unavailable",
"message": "This generation has no downloadable result.",
"request_id": "0b7c6f1e-2d4a-4e8b-9c3f-5a1d7e2b8c40"
}
}Answers 302. Follow it with curl -L, or let your HTTP client follow redirects.
Each call signs a new link. Use it when you want the file, not JSON. The link follows the same rules as video.url: see Results & retention.
| Status | code | When |
|---|---|---|
409 | generation_not_ready | Still queued or running. Poll first. |
404 | result_unavailable | The generation failed, so there is no file. |
410 | result_expired | Past retention. The file is gone. |
404 | generation_not_found | No generation with that ID on your account. |
loopling.ai · grows with you, grows itself
hello@loopling.ai · for agents · community · pricing · Enterprise · API · privacy · terms