Get Video Content
Download the generated video content for a completed task. If the task is not complete, the endpoint returns an error. On success, the response body is a binary video stream.
Try It
GET
/v1/videos/{task_id}/contenthttps://api-platform.ope.aiEndpoints
| Endpoint | Auth | Purpose |
|---|---|---|
GET /v1/videos/{task_id}/content | Authorization: Bearer <api-key> | Download video content with an API key |
GET /api/videos/{task_id}/content | token: <jwt> | Frontend-token proxy download |
Use the token header for a normal frontend JWT. Admin JWTs may use Authorization: Bearer <jwt>.
Authentication
Use Bearer token authentication.
- Header:
Authorization: Bearer <api-key> - Example:
Authorization: Bearer sk-xxxxxx
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | Video task ID |
Request Examples
- cURL
- JavaScript
- Python
curl -L "https://api-platform.ope.ai/v1/videos/{task_id}/content" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-o output.mp4
const taskId = "video_690d9b52e2b081908a05ded32cbfc629";
const res = await fetch(`https://api-platform.ope.ai/v1/videos/${taskId}/content`, {
headers: {Authorization: `Bearer ${process.env.OPEAI_API_KEY}`},
});
const blob = await res.blob();
console.log("status:", res.status, "type:", blob.type, "size:", blob.size);
import os
import requests
with requests.get(
"https://api-platform.ope.ai/v1/videos/video_690d9b52e2b081908a05ded32cbfc629/content",
headers={"Authorization": f"Bearer {os.environ['OPEAI_API_KEY']}"},
stream=True,
timeout=300,
) as r:
r.raise_for_status()
with open("output.mp4", "wb") as f:
for chunk in r.iter_content(chunk_size=1024 * 1024):
if chunk:
f.write(chunk)
Response Example
- 200
- 400
- 404
Content-Type: video/mp4 or another video format
The response body is a binary video stream and can be saved directly as a file. The platform sets cache headers for repeated reads of completed task content.
HTTP/1.1 200 OK
Content-Type: video/mp4
Content-Length: 15728640
[Binary video data]
{
"error": {
"message": "task not ready",
"type": "invalid_request_error",
"param": null,
"code": "task_not_ready"
}
}
{
"error": {
"message": "task not found",
"type": "not_found_error",
"param": null,
"code": "task_not_found"
}
}