Analytics
Changed onTime-bucketed metrics per model endpoint, including request counts, success/error rates, and latency percentiles. prepare_duration reflects queue/prepare time before execution; duration is request execution time. Use with the Queue/Webhooks flow to monitor SLAs.
Metric Selection: You must specify which metrics to include using the expand query parameter. Only requested metrics will be populated in the response, allowing you to optimize query performance and data transfer.
Available Metrics:
The expand parameter accepts these values, grouped by category:
Volume
- request_count: Total number of requests in the time bucket
- success_count: Successful requests (2xx responses)
- user_error_count: User errors (4xx responses)
- error_count: Server errors (5xx responses)
Error type breakdown
- startup_error_count: Startup errors (startup timeout, scheduling failure)
- connection_error_count: Connection errors (timeout, disconnected, refused)
- timeout_error_count: Request timeout errors
- runtime_error_count: Runtime errors (internal error, server error)
Queue / prepare latency
- p50_prepare_duration, p75_prepare_duration, p90_prepare_duration, p95_prepare_duration, p99_prepare_duration: Time from request submission until execution starts
Request execution latency
- p25_duration, p50_duration, p75_duration, p90_duration, p95_duration, p99_duration: Time spent processing the request
Cold boot
- cold_boot_count: Requests with cold boot (startup > 1s)
- p50_cold_boot_duration, p75_cold_boot_duration, p90_cold_boot_duration: Cold boot duration percentiles
Billing
- total_billable_duration: Aggregate billed execution time
Key Features:
- Selective metric inclusion via expand parameter
- Performance metrics (latency percentiles, duration stats)
- Reliability metrics (success/error rates, request counts)
- Error type breakdown (startup, connection, timeout, runtime)
- Cold boot metrics (count, latency percentiles)
- Billing duration tracking
- Time-bucketed data for trend analysis
- Single or multi-model analytics
- Flexible date range and timeframe options
Common Use Cases:
- Monitor model performance and reliability
- Generate performance dashboards
- Analyze latency trends and patterns
- Track error rates and success metrics
See Queue API docs for more details.
Required permissions: models:metrics:read. Key presets that include them: API, SERVERLESS, READONLY, FULL. See key permissions.
Request
- Base URLhttps://api.fal.ai/v1
- URLhttps://api.fal.ai/v1/models/analytics
- AuthAPI key in header Authorization
Query parameters
Maximum number of items to return. Actual maximum depends on query type and expansion parameters.
Pagination cursor from previous response. Encodes the page number.
Timezone for date aggregation and boundaries. All timestamps in responses are in UTC, but this controls how dates are bucketed.
Aggregation timeframe for timeseries data (auto-detected from date range if not specified). Auto-detection uses: minute (<2h), hour (<2d), day (<64d), week (<183d), month (>=183d).
Whether to adjust start/end dates to align with timeframe boundaries and use exclusive end. Defaults to true. When true, dates are aligned to the start of the timeframe period (e.g., start of day) and end is made exclusive (e.g., start of next day). When false, uses exact dates provided.
Response
Analytics data retrieved successfully
Changes
- info
the endpoint scheme security
readonlyApiKeywas added to the API - info
the endpoint scheme security
apiKeywas removed from the API
- info