Skip to main content
For each request to your fal App, fal adds headers such as the request ID and caller identity. The system also forwards custom headers from the caller. You can read these inside your endpoint handler via self.current_request.headers.get(). Request headers are per-request context, complementing environment variables which are per-runner context. Use headers when you need to identify the specific request or caller (for logging, tracing, or per-user logic), and environment variables for runner-wide information like FAL_APP_NAME or FAL_KEY.

Available Headers

Custom headers passed by the caller are also forwarded to your app. Most headers that start with x-fal- are reserved for the gateway, and a caller cannot set them. The documented platform headers are the exception. A caller can set those, including X-Fal-Tags, but the gateway handles them and does not forward them to your app.

Correlating with External Tools

Sentry

Attach the request ID to Sentry events so you can find the exact fal request that caused an error:

Structured Logging

Include the request ID in your log output for correlation with fal’s built-in logs:

Custom Headers

Callers can pass custom headers that are forwarded to your app:
Header names are case-insensitive. X-My-Header and x-my-header both work.

Response Header Size Limit

The total size of all response headers returned by your app is limited to 16 KB. This includes platform headers injected by fal (like x-fal-request-id and X-Fal-Billable-Units) and any custom headers your app sets, such as billing units or routing hints from provide_hints(). If the combined headers exceed 16 KB, the response will fail. Keep custom header values short. If you use provide_hints(), avoid returning large lists of model names or long strings — each hint value contributes to the total header size.
The system processes platform headers like X-Fal-Request-Start-Timeout, X-Fal-No-Retry, X-Fal-Retry-Config, X-Fal-Store-IO, and X-Fal-Tags before requests reach your runner. These controls are not available in self.current_request.headers. Your app receives the identity and CDN headers listed above, along with custom caller headers.

Environment Variables

Per-runner context: FAL_KEY, FAL_APP_NAME, FAL_RUNNER_STATE, and more