Neural Inverse is Open Source →
FaqWhy do I see 524 errors on Neural Inverse API calls?

Why do I see 524 errors on Neural Inverse API calls?

The 524 error class on Neural Inverse Cloud indicates that your request timed out because ClickHouse ran out of resources or out of time while processing your query. This typically occurs when queries scan too much data due to overly broad filter conditions. For older data retrieval endpoints, the recommended fix is to move to the v2 data APIs instead of tuning the old query, as the older APIs are less performant at scale.

General Approaches

To prevent 524 errors across API endpoints:

  1. Use v2 data APIs for extraction: Follow the Observations API v2 upgrade guidance for row-level data and use Metrics API v2 for aggregates.
  2. Always use the endpoint's timestamp filters: v2 Observations uses fromStartTime and toStartTime; Metrics API v2 uses fromTimestamp and toTimestamp inside the JSON query; older trace reads use fromTimestamp and toTimestamp URL parameters.
  3. Add specific filters: Use userId, sessionId, name, tags, or other filters to narrow your query

Older trace reads

The older trace read endpoints remain available, but are not recommended as the default for new data extraction workflows. They are particularly susceptible to 524 errors on large projects.

Follow the Observations API v2 upgrade guidance to move trace and observation extraction workflows to the v2 API. For aggregate reporting, use Metrics API v2.

Additional Self-Host Options

For self-hosted deployments that still use older trace reads, you can configure server-side defaults and restrictions for the GET /api/public/traces endpoint via environment variables. Enforcement order: rejection → default date range → default fields.

VariableTypeDescription
LANGFUSE_API_TRACES_REJECT_NO_DATE_RANGE"true" / "false" (default: "false")Reject requests that do not include a fromTimestamp parameter with HTTP 400.
LANGFUSE_API_TRACES_DEFAULT_DATE_RANGE_DAYSPositive integer (optional)When no fromTimestamp is provided, automatically apply a lookback window of N days from toTimestamp (or now). Ignored when rejection is enabled.
LANGFUSE_API_TRACES_DEFAULT_FIELDSComma-separated string (optional)Default field groups returned when the caller does not specify a fields query parameter. Valid groups: core, io, scores, observations, metrics. E.g. "core" or "core,io". An explicit fields query parameter always overrides this default.

Recommended starting point for large projects: set LANGFUSE_API_TRACES_DEFAULT_FIELDS=core and LANGFUSE_API_TRACES_DEFAULT_DATE_RANGE_DAYS=3. This keeps input/output out of the default response (users can still request them explicitly via fields=core,io) and caps the scan window.


Was this page helpful?