Skip to content

Image-to-Video

Sora image-to-video API for generating short videos from uploaded images.


Overview

  • Method: POST
  • Path: /v1/videos
  • Content-Type: multipart/form-data
  • Category: Video Models (Video) / Sora Video

Authentication

  • Header: Authorization: Bearer <token>

Request Parameters

FieldTypeRequiredDescription
promptstringYesText prompt describing the video content to generate
input_referencefileYesUploaded reference image; dimensions must exactly match size
modelstringNoModel name, supports sora-2, sora-2-pro; default is sora-2
secondsstringNoVideo length as a string, supports 4, 8, 12; default is 4
sizestringNoVideo size, supports 720x1280, 1280x720, 1024x1792, 1792x1024; 1792 sizes only supported by sora-2-pro

Request Example

curl Example

bash
curl -X POST "https://api.gpt.ge/v1/videos" \
  -H "Authorization: Bearer $YOUR_TOKEN" \
  -F "prompt=A fierce tiger bursts into a farmhouse yard, the village dog runs away in fear, and a cat jumps out to defeat the tiger." \
  -F "input_reference=@/path/to/image.png" \
  -F "model=sora-2" \
  -F "seconds=4" \
  -F "size=720x1280"

JavaScript (fetch) Example

javascript
const formData = new FormData();
formData.append('prompt', 'A fierce tiger bursts into a farmhouse yard, the village dog runs away in fear, and a cat jumps out to defeat the tiger.');
formData.append('input_reference', fileInput.files[0]);
formData.append('model', 'sora-2');
formData.append('seconds', '4');
formData.append('size', '720x1280');

fetch('https://api.gpt.ge/v1/videos', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  },
  body: formData
})
  .then(res => res.json())
  .then(console.log);

Python Example (requests)

python
import requests

with open('/path/to/image.png', 'rb') as f:
    files = {'input_reference': f}
    data = {
        'prompt': 'A fierce tiger bursts into a farmhouse yard, the village dog runs away in fear, and a cat jumps out to defeat the tiger.',
        'model': 'sora-2',
        'seconds': '4',
        'size': '720x1280'
    }

    resp = requests.post(
        'https://api.gpt.ge/v1/videos',
        headers={'Authorization': 'Bearer YOUR_TOKEN'},
        files=files,
        data=data
    )

print(resp.json())

Response Fields

FieldTypeDescription
idstringVideo task ID
objectstringReturned object type, usually video
created_atintegerCreation timestamp
statusstringTask status
completed_atnullCompletion time, null if not finished
errornullError information, null on success
expires_atnullExpiration time, currently null
modelstringModel used
progressintegerTask progress
remixed_from_video_idnullRemix source video ID, currently null if unused
secondsstringVideo duration
sizestringVideo size

Success Response Example (200)

json
{
  "id": "video_68f082321ed08193a4eaf01376fa10bc0284bd663de64dc5",
  "object": "video",
  "created_at": 1760592434,
  "status": "queued",
  "completed_at": null,
  "error": null,
  "expires_at": null,
  "model": "sora-2",
  "progress": 0,
  "remixed_from_video_id": null,
  "seconds": "4",
  "size": "720x1280"
}