- You need to keep the connection open until receiving the result
- The request cannot be interrupted
- If the connection is interrupted there is not way to obtain the result
- You will be charged for the full request whether or not you were able to receive the result
| Endpoint | Method | Description |
|---|---|---|
https://fal.run/{model_id} | POST | Adds a request to the queue for a top-level path |
https://fal.run/{model_id}/{subpath} | POST | Adds a request to the queue for an optional subpath |
model_id: the model ID consists of a namespace and model name separated by a slash, e.g.fal-ai/fast-sdxl. Many models expose only a single top-level endpoint, so you can directly call them bymodel_id.subpath: some models expose different capabilities at different sub-paths, e.g.fal-ai/flux/dev. The subpath (/devin this case) should be used
Submit a request
Here is an example of using the curl command to submit a synchronous request:Object Lifecycle
You can control how long images and other objects generated by your request remain available by including theX-Fal-Object-Lifecycle-Preference header. This header allows you to specify the expiration duration for objects created during the request processing.
The header value must be a JSON object with an expiration_duration_seconds field specifying the number of seconds the objects should remain available:
Object LifecycleThe
X-Fal-Object-Lifecycle-Preference header applies to all objects (images, files, etc.) generated during request processing. If you need different expiration times for different requests, you can include this header with each request.Start Timeout
You can set a maximum time for how long your request can wait before it starts processing using theX-Fal-Request-Timeout header. This is useful for fail-fast scenarios where you don’t want to wait indefinitely for a runner.
Start Timeout Behavior
- The timeout value is in seconds and must be at least 1 second
- The timeout applies while waiting for a runner to become available
- Once processing starts, the timeout is no longer enforced
- On timeout, the response is a
504 Gateway Timeoutwith headerX-Fal-Request-Timeout-Type: user