Task: Video Extension
Luma video extension API for extending an already generated video task.
Overview
- Method:
POST - Path:
/luma/generations/{task_id}/extend - Content-Type:
application/json - Category: Video Models (Video) / Luma Video
Authentication
- Header:
Authorization: Bearer <token>
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | string | Yes | Task ID of the already generated video |
Request Parameters
JSON Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
| user_prompt | string | Yes | Extension prompt |
| expand_prompt | boolean | No | Whether to enable prompt optimization |
| image_url | string | No | Reference image URL or Base64 |
| image_end_url | string | No | Keyframe image URL or Base64 |
| notify_hook | string | No | Callback URL |
Request Example
curl Example
bash
curl -X POST "https://api.gpt.ge/luma/generations/your_task_id/extend" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN" \
-d '{
"user_prompt": "add cat",
"expand_prompt": true,
"image_url": "https://example.com/reference.png",
"image_end_url": "https://example.com/keyframe.png",
"notify_hook": "https://example.com/hook"
}'JavaScript (fetch) Example
javascript
fetch('https://api.gpt.ge/luma/generations/your_task_id/extend', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
user_prompt: 'add cat',
expand_prompt: true,
image_url: 'https://example.com/reference.png',
image_end_url: 'https://example.com/keyframe.png',
notify_hook: 'https://example.com/hook'
})
})
.then(res => res.json())
.then(console.log)Python Example (requests)
python
import requests
resp = requests.post(
'https://api.gpt.ge/luma/generations/your_task_id/extend',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
json={
'user_prompt': 'add cat',
'expand_prompt': True,
'image_url': 'https://example.com/reference.png',
'image_end_url': 'https://example.com/keyframe.png',
'notify_hook': 'https://example.com/hook'
}
)
print(resp.json())Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Task ID |
| prompt | string | Submitted prompt |
| state | string | Task status |
| created_at | string | Creation time |
| video | null | Video result, null if not yet generated |
| liked | null | Like information, currently null |
| estimate_wait_seconds | null | Estimated wait time, currently null |
Response Example (200)
json
{
"id": "9d4b7516-77e5-481a-b015-48313946f33b",
"prompt": "cat dance",
"state": "pending",
"created_at": "2024-07-01T07:35:13.498660Z",
"video": null,
"liked": null,
"estimate_wait_seconds": null
}