Imagifly Developer docs
HTTP API

Video generation

Text-to-video, reference-to-video and first/last-frame tasks over JSON or multipart.

Submit a task

POST /api/v1/videos/generations

The endpoint accepts application/json or multipart/form-data. Use multipart when you upload local reference files; use JSON when every input is already a URL or a short field.

Request fields

FieldTypeRequiredDescription
modelstringYesVideo model ID from the catalog.
promptstringYesWhat happens in the clip.
variantstringNoModel variant, e.g. fast, 2.0, 2.5.
workflowFormatstringNot2v (text), r2v (references) or fl2v (first/last frame).
durationstringNoClip length in seconds, e.g. 5, 10; must be in durationOptions.
fpsstringNoFrame rate, e.g. 24; must be in fpsOptions.
sizestringNoOutput resolution, e.g. 1280x720.
ratiostringNoAspect ratio, e.g. 16:9, 9:16, 1:1.
qualitystringNostandard or high.
seednumberNoReproducibility seed.
referenceImagesarrayNoReference images: URLs in JSON, files in multipart.
referenceVideosarrayNoReference videos, same input rules.
referenceAudiosarrayNoReference audio, same input rules.
firstFrame / firstFrameUrlfile / stringNoOpening frame.
lastFrame / lastFrameUrlfile / stringNoClosing frame.

Available models, sizes, durations and workflow formats differ per model — read them from the catalog instead of hard-coding.

Example (JSON)

curl -X POST https://imagifly.net/api/v1/videos/generations \
  -H "Authorization: Bearer $IMAGIFLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-H3",
    "prompt": "A paper boat drifting down a rain-soaked street, neon reflections",
    "duration": "6",
    "ratio": "16:9"
  }'

Example (multipart)

curl -X POST https://imagifly.net/api/v1/videos/generations \
  -H "Authorization: Bearer $IMAGIFLY_API_KEY" \
  -F "model=MiniMax-H3" \
  -F "prompt=Slow push-in on the character, wind in the hair" \
  -F "workflowFormat=fl2v" \
  -F "duration=5" \
  -F "firstFrame=@./first.png" \
  -F "lastFrame=@./last.png"

Response 202 Accepted

{
  "ok": true,
  "generation": {
    "id": "vid_9c31be...",
    "status": "generating",
    "cost": 120,
    "size": "1280x720",
    "duration": 6,
    "aspectRatio": "16:9",
    "fps": 24
  }
}
FieldDescription
generation.costCredits charged for this task.
generation.sizeOutput resolution.
generation.durationClip length in seconds.
generation.aspectRatioNormalized aspect ratio.
generation.fpsFrame rate.

Poll a task

GET /api/v1/videos/generations/{id}
{
  "ok": true,
  "generation": {
    "id": "vid_9c31be...",
    "status": "success",
    "error": null,
    "durationMs": 184000,
    "videoUrls": ["https://imagedelivery.net/.../public"]
  }
}

Video tasks usually take minutes. Poll every 5 seconds and stop when the status is success or failed.

Model catalog

GET /api/v1/videos/models

This endpoint is public and only returns models that are currently available on the platform.

{
  "ok": true,
  "models": [
    {
      "id": "MiniMax-H3",
      "label": "MiniMax H3",
      "credits": 120,
      "aspectRatios": ["16:9", "9:16", "1:1"],
      "resolutions": [{ "resolution": "720p", "size": "1280x720", "credits": 120 }],
      "defaultSize": "1280x720",
      "defaultDurationSeconds": 6,
      "minDurationSeconds": 4,
      "maxDurationSeconds": 10,
      "durationOptions": [4, 5, 6, 8, 10],
      "fpsOptions": [24],
      "billingUnit": "second",
      "mode": "text-to-video",
      "referenceImageLimit": 0,
      "referenceVideoLimit": 0,
      "referenceAudioLimit": 0,
      "workflowFormats": [{ "id": "t2v", "requiresFirstFrame": false }],
      "variants": [{ "id": "fast", "label": "Fast", "credits": 90, "size": "1280x720" }]
    }
  ]
}

Always read durations, sizes, variants and reference limits from this response: a value that works for one model is often rejected by another with 400 INVALID_VIDEO_REQUEST.

Notes

  • A video model that is temporarily disabled returns 503 MODEL_UNAVAILABLE on submit and is omitted from the catalog.
  • quality is validated but not every model uses it; unsupported combinations fail fast with 400.
  • Failed tasks are refunded automatically; a successful task is charged once. There is no retry endpoint — submit a new task.

On this page