Authentication

Create a key in your account and send it from your server. Do not expose it in browser JavaScript. A key can use your available credits and access only its account’s tasks.

Authorization: Bearer adf_your_private_key
Content-Type: application/json

GET /api/v1/credits returns your available and reserved credits.

Upload an image and reference

Send multipart form data to POST /api/v1/uploads, with your photo in photo. The response includes an asset id. JPG, PNG and WebP are accepted up to 10 MB.

curl https://aidanceflow.com/api/v1/uploads \
  -H "Authorization: Bearer $AIDANCEFLOW_API_KEY" \
  -F "photo=@character.jpg"

For custom motion, send an MP4 or MOV in video to POST /api/v1/references. The server returns a reference_id and verified duration. Keep the actual clip within 3–30 seconds, or 3–10 seconds for image orientation. Optional start and duration form fields require the configured server video processor.

Create a generation task

POST /api/v1/generate accepts a prepared template_id or a custom reference_id. Supply a unique idempotency key. Reusing the same key returns the existing task rather than charging for another submission.

{
  "reference_id": "your_reference_id",
  "input_ids": ["your_image_id"],
  "orientation": "video",
  "prompt": "Keep the character clear and follow the reference movement",
  "keep_audio": false,
  "consent": true,
  "idempotency_key": "a-unique-request-key-001"
}

Custom motion costs the displayed per-second rate, rounded up to a whole credit. Prepared template costs may differ. Models and prices are selected server-side, not supplied by the API caller.

Poll, list and download

GET /api/v1/tasks/{id} returns the task and refreshes its provider status when appropriate. GET /api/v1/tasks lists your latest tasks. A successful task includes the private result URL and download deadline.

Fetch an API result with GET /api/v1/tasks/{id}/download and your bearer key. Pending and uncertain requests are not completed videos. Keep your own copy before the deadline.

Errors and credit handling

401Missing or invalid API key
402Insufficient available credits
409Active-task limit or payment state conflict
413 / 422Media size, duration or input validation failed
429Rate limit; wait before retrying
503Required provider capability is not configured

A confirmed technical failure returns reserved credits. An uncertain submission keeps them reserved until reconciliation. Do not replace its idempotency key and automatically retry an uncertain request.