Skip to main content
POST
/
videos
/
generate
Generate a new video
curl --request POST \
  --url https://api.elytron.com/v1/videos/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "duration": 10,
  "quality": "hd",
  "aspect_ratio": "16:9",
  "style": "realistic"
}
'
{
  "video_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "pending",
  "estimated_completion": "2023-11-07T05:31:56Z"
}
Generate a new video from a text prompt using our AI models.

Request Body

The request body should contain the video generation parameters:
ParameterTypeRequiredDescription
promptstringYesText description of the video to generate (max 1000 characters)
durationintegerNoVideo duration in seconds (1-60, default: 10)
qualitystringNoVideo quality: sd, hd, or 4k (default: hd)
aspect_ratiostringNoAspect ratio: 16:9, 9:16, 1:1, or 4:3 (default: 16:9)
stylestringNoVisual style: realistic, cartoon, anime, cinematic, or documentary (default: realistic)

Example Request

curl -X POST "https://api.elytron.com/v1/videos/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A majestic eagle soaring over snow-capped mountains at sunset",
    "duration": 15,
    "quality": "hd",
    "aspect_ratio": "16:9",
    "style": "cinematic"
  }'

Response

Returns a 201 Created status with the video generation details:
{
  "data": {
    "video_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "pending",
    "estimated_completion": "2024-01-01T12:05:00Z"
  },
  "meta": {
    "timestamp": "2024-01-01T12:00:00Z",
    "request_id": "req_123456789"
  }
}

Error Responses

400 Bad Request

{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "The prompt field is required",
    "details": {
      "field": "prompt",
      "reason": "Required field is missing"
    }
  }
}

401 Unauthorized

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid API key"
  }
}

429 Too Many Requests

{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Try again later.",
    "details": {
      "retry_after": 60
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Video generation parameters

prompt
string
required

Text description of the video to generate

Maximum string length: 1000
duration
integer
default:10

Video duration in seconds

Required range: 1 <= x <= 60
quality
enum<string>
default:hd

Video quality setting

Available options:
sd,
hd,
4k
aspect_ratio
enum<string>
default:16:9

Video aspect ratio

Available options:
16:9,
9:16,
1:1,
4:3
style
enum<string>
default:realistic

Visual style for the video

Available options:
realistic,
cartoon,
anime,
cinematic,
documentary

Response

Video generation started successfully

video_id
string<uuid>

Unique identifier for the generated video

status
enum<string>

Current generation status

Available options:
pending,
processing
estimated_completion
string<date-time>

Estimated time when generation will complete