Animation API Documentation
Integrate text-to-video and image-to-video generation through the dedicated artworks API surface.
API Basics
Base URL
https://api.llamagen.aiAuth
Authorization: Bearer YOUR_API_TOKENContent Type
application/jsonEndpoints
POST
/v1/artworks/generationsCreate an animation or video artwork generation job.
GET
/v1/artworks/generations/{generationId}Poll status and retrieve final video output.
Create Text-to-Video Generation
curl -X POST https://api.llamagen.ai/v1/artworks/generations \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cinematic shot of a young explorer running through a glowing forest.",
"videoOptions": {
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"generate_audio": true
}
}'Create Image-to-Video Generation
curl -X POST https://api.llamagen.ai/v1/artworks/generations \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Animate this character with a slow dolly-in and wind moving the cloak.",
"videoOptions": {
"image": "https://cdn.example.com/first-frame.png",
"last_frame_image": "https://cdn.example.com/last-frame.png",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}'Check Generation Status
curl https://api.llamagen.ai/v1/artworks/generations/gen_123456789 \
-H "Authorization: Bearer YOUR_API_TOKEN"1{2 "id": "gen_123456789",3 "status": "PROCESSED",4 "prompt": "A cinematic shot of a young explorer running through a glowing forest.",5 "comics": [6 {7 "page": 0,8 "prompt": "A cinematic shot of a young explorer running through a glowing forest.",9 "videoUrl": "https://s.llamagen.ai/generated-video.mp4"10 }11 ]12}videoOptions
durationnumberTarget duration in seconds.
resolutionstring480p, 720p, 1080p, or 4k.
aspect_ratiostring16:9, 9:16, 1:1, 4:3, 3:4, and other supported ratios.
generate_audiobooleanWhether the model should generate matching audio.
imagestringOptional first-frame image URL for image-to-video.
last_frame_imagestringOptional final-frame image URL.
reference_imagesarrayOptional reference image URLs.
reference_videosarrayOptional reference video URLs.
reference_audiosarrayOptional reference audio URLs.
seednumberOptional deterministic seed when supported by the model.
Status Lifecycle
LOADING
The video job is queued or rendering.
PROCESSED
The response includes final video output.
FAILED
The job failed and should be retried or inspected.
Error Handling
Authentication failures return 403. Rate limits return 429. Insufficient credits return a payment-related error. Treat 5xx responses as retryable with exponential backoff.