Skip to content

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

ParameterTypeRequiredDescription
task_idstringYesTask ID of the already generated video

Request Parameters

JSON Body Fields

FieldTypeRequiredDescription
user_promptstringYesExtension prompt
expand_promptbooleanNoWhether to enable prompt optimization
image_urlstringNoReference image URL or Base64
image_end_urlstringNoKeyframe image URL or Base64
notify_hookstringNoCallback 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

FieldTypeDescription
idstringTask ID
promptstringSubmitted prompt
statestringTask status
created_atstringCreation time
videonullVideo result, null if not yet generated
likednullLike information, currently null
estimate_wait_secondsnullEstimated 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
}