loopling.ai

API reference

Download a generation

Follow a redirect to a fresh signed link for the finished MP4.

GET https://loopling.ai/v1/video/generations/{id}/content

Authorization

Authorization

string · required

Your API key, as Bearer lpl_….

Path parameters

id

string · required

The generation’s id. Another account’s ID answers 404.

Response · 302

Location

string<uri>

A fresh signed MP4 link. Needs no key.

Request

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.mp4

Node

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)

Response

302

HTTP/1.1 302 Found
Location: https://media.loopling.ai/…?sig=…
Cache-Control: no-store
X-Request-Id: 0b7c6f1e-2d4a-4e8b-9c3f-5a1d7e2b8c40

409

{
  "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"
  }
}

410

{
  "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"
  }
}

404

{
  "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.

Errors

StatuscodeWhen
409generation_not_readyStill queued or running. Poll first.
404result_unavailableThe generation failed, so there is no file.
410result_expiredPast retention. The file is gone.
404generation_not_foundNo generation with that ID on your account.

Explore models

loopling.ai · grows with you, grows itself

hello@loopling.ai · for agents · community · pricing · Enterprise · API · privacy · terms