Provider Templates
Provider templates let you integrate with popular AI APIs using a single provider field instead of writing custom polling configuration. AsyncQueue knows how to submit, poll, and collect results from each supported provider.
Available Providers
Section titled “Available Providers”| ID | Provider | Description | Poll Interval | Max Duration |
|---|---|---|---|---|
fal | fal.ai | Image and video generation | 3s | 10 min |
replicate | Replicate | Open-source AI models | 5s | 10 min |
runwayml | RunwayML | Video generation (Gen-3, Gen-4) | 5s | 10 min |
luma | Luma AI | Dream Machine video generation | 5s | 10 min |
elevenlabs-dubbing | ElevenLabs | Video/audio dubbing and translation | 10s | 30 min |
stability-video | Stability AI | Stable Video Diffusion | 10s | 10 min |
Listing Providers via API
Section titled “Listing Providers via API”curl https://api.asyncqueue.io/v1/providersReturns all available templates with their full pollConfig objects.
fal.ai
Section titled “fal.ai”Generate images and video with fal.ai models (Flux, Kling, Minimax, and more).
fal.ai returns status_url and response_url in the submit response. AsyncQueue uses these directly for polling and result fetching.
curl -X POST https://api.asyncqueue.io/v1/tasks \ -H "X-API-Key: async_your_key" \ -H "Content-Type: application/json" \ -d '{ "targetUrl": "https://queue.fal.run/fal-ai/flux/dev", "method": "POST", "headers": { "Authorization": "Key fal_your_key" }, "body": "{\"prompt\": \"A cat riding a skateboard\", \"image_size\": \"landscape_16_9\"}", "provider": "fal", "onCompleteUrl": "https://your-app.com/api/image-ready" }'Status values: IN_QUEUE, IN_PROGRESS, COMPLETED
Result: Full model output fetched from the separate response_url.
Replicate
Section titled “Replicate”Run any open-source model on Replicate (Stable Diffusion, Whisper, LLaMA, video models, and thousands more).
curl -X POST https://api.asyncqueue.io/v1/tasks \ -H "X-API-Key: async_your_key" \ -H "Content-Type: application/json" \ -d '{ "targetUrl": "https://api.replicate.com/v1/models/stability-ai/stable-diffusion-3/predictions", "method": "POST", "headers": { "Authorization": "Bearer r8_your_replicate_token" }, "body": "{\"input\": {\"prompt\": \"An astronaut riding a horse\"}}", "provider": "replicate", "onCompleteUrl": "https://your-app.com/api/prediction-ready" }'Status values: starting, processing, succeeded, failed, canceled
Result: The output field from the prediction response (typically an array of URLs for image models).
RunwayML
Section titled “RunwayML”Generate video with RunwayML Gen-3, Gen-4, and Gen-4.5 models. RunwayML does not support webhooks, so polling is the only option.
curl -X POST https://api.asyncqueue.io/v1/tasks \ -H "X-API-Key: async_your_key" \ -H "Content-Type: application/json" \ -d '{ "targetUrl": "https://api.dev.runwayml.com/v1/image_to_video", "method": "POST", "headers": { "Authorization": "Bearer runway_your_key", "X-Runway-Version": "2024-11-06" }, "body": "{\"model\": \"gen4\", \"promptImage\": \"https://example.com/image.jpg\", \"promptText\": \"A timelapse on a sunny day\", \"duration\": 5}", "provider": "runwayml", "onCompleteUrl": "https://your-app.com/api/video-ready" }'Status values: PENDING, THROTTLED, RUNNING, SUCCEEDED, FAILED
Result: The output array (typically contains a video URL). Video URLs expire within 24-48 hours - download them promptly.
Luma AI
Section titled “Luma AI”Generate video with Luma AI’s Dream Machine (Ray-2 model).
curl -X POST https://api.asyncqueue.io/v1/tasks \ -H "X-API-Key: async_your_key" \ -H "Content-Type: application/json" \ -d '{ "targetUrl": "https://api.lumalabs.ai/dream-machine/v1/generations", "method": "POST", "headers": { "Authorization": "Bearer luma_your_key" }, "body": "{\"prompt\": \"A drone flyover of a mountain lake at sunrise\", \"model\": \"ray-2\"}", "provider": "luma", "onCompleteUrl": "https://your-app.com/api/video-ready" }'Status values: dreaming, completed, failed
Result: The assets.video field (a URL to the generated video).
ElevenLabs Dubbing
Section titled “ElevenLabs Dubbing”Dub and translate video or audio content. Dubbing jobs can take several minutes depending on content length.
curl -X POST https://api.asyncqueue.io/v1/tasks \ -H "X-API-Key: async_your_key" \ -H "Content-Type: application/json" \ -d '{ "targetUrl": "https://api.elevenlabs.io/v1/dubbing", "method": "POST", "headers": { "xi-api-key": "el_your_key", "Content-Type": "application/json" }, "body": "{\"source_url\": \"https://example.com/video.mp4\", \"target_lang\": \"es\"}", "provider": "elevenlabs-dubbing", "onCompleteUrl": "https://your-app.com/api/dubbing-ready" }'Status values: dubbing, dubbed, failed
Result: The dubbing_id - use it to fetch the dubbed audio via GET /v1/dubbing/{dubbing_id}/audio/{language_code} on ElevenLabs’ API.
Stability AI Video
Section titled “Stability AI Video”Generate video from images using Stable Video Diffusion.
Note: Stability AI uses HTTP status codes instead of JSON status fields. A 202 response means still processing, 200 means complete.
curl -X POST https://api.asyncqueue.io/v1/tasks \ -H "X-API-Key: async_your_key" \ -H "Content-Type: application/json" \ -d '{ "targetUrl": "https://api.stability.ai/v2beta/image-to-video", "method": "POST", "headers": { "Authorization": "Bearer sk-your-stability-key" }, "body": "{\"image\": \"base64_encoded_image_data\", \"seed\": 42}", "provider": "stability-video", "onCompleteUrl": "https://your-app.com/api/video-ready" }'Status values: HTTP 200 (complete), HTTP 202 (in progress)
Result: The binary video content URL.
Custom Providers
Section titled “Custom Providers”For AI APIs not in the template list, provide a custom pollConfig object instead of a provider name. See AI Provider Polling for the full pollConfig reference and template variable syntax.