Skip to main content
Generative-media gateway for fal.ai — run image, video, audio, and speech models (FLUX, Kling, Veo, and hundreds more) with your own fal API key. Best when an agent needs to generate or transform media from a prompt or an input file and then retrieve a hosted output URL. Unlike a single-model image API, fal exposes a large catalog behind one async queue, so slow jobs like video generation submit instantly and are polled to completion. 5 example endpoints available through Lava’s AI Gateway. See the fal.ai API docs for full documentation.
This provider requires your own credentials — connect your API key or OAuth account before use.
This is a catch-all provider — any valid URL under https://queue.fal.run is supported. fal.ai generative media (image, video, audio, speech). Default to the ASYNC QUEUE at https://queue.fal.run — the Lava gateway has a ~25s edge timeout, so long jobs must never block a single request. Model ids look like fal-ai/{model} (e.g. fal-ai/flux/dev, fal-ai/flux/schnell). Queue flow: (1) submit POST https://queue.fal.run/{model_id} with the model input as body_json — returns immediately with request_id, status_url, and response_url; (2) poll GET https://queue.fal.run/{model_id}/requests/{request_id}/status until status is COMPLETED (do NOT use the /status/stream SSE endpoint — it holds the connection open and can 504); (3) fetch the output with GET https://queue.fal.run/{model_id}/requests/{request_id}, which returns the media URLs. Cancel with PUT https://queue.fal.run/{model_id}/requests/{request_id}/cancel. The SYNCHRONOUS host https://fal.run/{model_id} blocks until generation finishes — use it ONLY for fast, sub-25s image models; video and other slow models WILL time out, always queue them. Models take file inputs as URLs — pass any public or presigned URL, or an inline data URI (data:image/png;base64,…) for smaller files. To host a local file on fal’s CDN instead: POST https://rest.fal.ai/storage/upload/initiate with body_json {“content_type”: …, “file_name”: …} returns upload_url and file_url; PUT the raw file bytes directly to upload_url with a plain HTTP client (presigned — no fal key, not routed through Lava), then pass file_url in the model input. Authenticate by connecting your own fal key — Lava attaches the Authorization: Key header for you. See https://docs.fal.ai for each model input schema. The endpoints below are curated examples.

Endpoints

Submit a generation job to the async queue. Returns immediately with request_id, status_url, and response_url while the job runs on fal. Use this for every model — required for video and other slow models that would exceed the gateway timeout synchronously.

POST https://queue.fal.run/fal-ai/flux/dev — Free

Run a model synchronously — blocks until generation finishes and returns the output directly. Only for fast, sub-25s models (e.g. FLUX schnell); video and slow models will 504, use the queue instead.

POST https://fal.run/fal-ai/flux/schnell — Free

Poll the status of a queued request (IN_QUEUE, IN_PROGRESS, COMPLETED). Poll this endpoint; do not use /status/stream, which holds the connection open and can time out.

GET https://queue.fal.run/fal-ai/flux/dev/requests/{request_id}/status — Free

Fetch the result of a completed queued request. Returns the model output, including hosted URLs for generated images, video, or audio.

GET https://queue.fal.run/fal-ai/flux/dev/requests/{request_id} — Free

Cancel a queued request that has not started running yet. Returns 202 Accepted, or 400 if the job already completed.

PUT https://queue.fal.run/fal-ai/flux/dev/requests/{request_id}/cancel — Free

Next Steps

All Providers

Browse all supported AI providers

Forward Proxy

Learn how to construct proxy URLs and authenticate requests