Text-to-Video
Sora text-to-video API for generating short videos from text prompts.
Overview
- Method:
POST - Path:
/v1/videos - Content-Type:
application/json - Category: Video Models (Video) / Sora Video
Authentication
- Header:
Authorization: Bearer <token>
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Text prompt for generating the video |
| model | string | No | Model name, supports sora-2, sora-2-pro; default is sora-2 |
| seconds | string | No | Video duration as a string, supports 4, 8, 12; default is 4 |
| size | string | No | Video 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 "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN" \
-d '{
"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": "8",
"size": "1280x720"
}'JavaScript (fetch) Example
javascript
fetch('https://api.gpt.ge/v1/videos', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
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: '8',
size: '1280x720'
})
})
.then(res => res.json())
.then(console.log)Python Example (requests)
python
import requests
resp = requests.post(
'https://api.gpt.ge/v1/videos',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
json={
'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': '8',
'size': '1280x720'
}
)
print(resp.json())Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Video task ID |
| object | string | Returned object type, usually video |
| created_at | integer | Creation timestamp |
| status | string | Task status |
| completed_at | null | Completion time, null if not finished |
| error | null | Error information, null on success |
| expires_at | null | Expiration time, currently null |
| model | string | Model used |
| progress | integer | Task progress |
| remixed_from_video_id | null | Remix source video ID, currently null if unused |
| seconds | string | Video duration |
| size | string | Video 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": "8",
"size": "1280x720"
}