LlamaGen.Ai LogoLlamaGen.Ai Brand

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.ai

Auth

Authorization: Bearer YOUR_API_TOKEN

Content Type

application/json

Endpoints

POST
/v1/artworks/generations

Create 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

durationnumber

Target duration in seconds.

resolutionstring

480p, 720p, 1080p, or 4k.

aspect_ratiostring

16:9, 9:16, 1:1, 4:3, 3:4, and other supported ratios.

generate_audioboolean

Whether the model should generate matching audio.

imagestring

Optional first-frame image URL for image-to-video.

last_frame_imagestring

Optional final-frame image URL.

reference_imagesarray

Optional reference image URLs.

reference_videosarray

Optional reference video URLs.

reference_audiosarray

Optional reference audio URLs.

seednumber

Optional 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.