Beyond these five, HTTP over WebSockets is a transport variant rather than a sixth pattern: it carries the same request and response format as
run() over a persistent wss://ws.fal.run connection, and unlike realtime() it works with any endpoint.
Direct (run)
The simplest way to call a model. Sends a direct HTTP request to fal.run and returns the result. No queue, no retries, no polling.
run for quick scripts, prototyping, or any model with fast response times where you want the lowest overhead. Because there is no queue involved, the call goes straight to a runner and returns the response directly. The tradeoff is that direct calls do not retry on failure. If the runner returns an error or times out, you get the error immediately.
Learn more
Subscribe (Queue-backed synchronous)
Likerun, but uses the queue under the hood. Submits a request, polls automatically, and blocks until the result is ready. You get automatic retries and reliability with a simple interface.
subscribe is a good choice when you want the simplicity of a blocking call combined with queue-backed reliability. It handles polling for you, so the code looks almost identical to run, but your request is durable and will be retried if a runner fails. Reach for it in simple integrations, backend scripts, or anywhere you do not need to manage the request lifecycle yourself.
Learn more
Asynchronous (submit)
The recommended approach for production. Submit a request to the queue and return immediately, then poll for status or receive results via webhook.
Polling:
Status types
Thehandler.status() method returns one of three types. Pass with_logs=True to include runner logs.
In JavaScript, the equivalent types are
InQueueQueueStatus, InProgressQueueStatus, and CompletedQueueStatus. See the full Python SDK reference and JavaScript SDK reference for details.
Webhook (no polling needed):
Learn Async Inference
Streaming (stream)
For models that produce output progressively. Each event arrives as it is generated, so you can display partial results without waiting for the full response. This is useful for showing image generation previews or streaming LLM tokens.
The
stream() method connects to the /stream path on the model endpoint. Not all models support streaming. Check the model’s API documentation for availability.