Rate limits and attachment size limits for bulk trace/run queries
Last updated: November 24, 2026
Overview
Bulk or scheduled programmatic pulls of runs and traces are rate limited. The limits depend on which API version you use and whether an attachment goes through the dataset UI or the trace ingestion path. This article covers both.
Rate limits on query endpoints
The legacy POST /api/v1/runs/query endpoint (and the SDK methods list_runs/listRuns, read_run/readRun that call it) enforces a low limit: 10 requests per 10 seconds. That limit is shared across the whole workspace, not per API key, so one bulk job running on one key can cause 429s on a completely different key in the same workspace.
The SmithDB-backed v2 endpoints have much higher, per-key allowances:
POST /api/v2/runs/query: 300 requests per 10 seconds, per API key.POST /api/v2/traces/query: 1,000 requests per 10 seconds, per API key.
These are per API key, not shared across the workspace, so separate integrations using separate keys don't throttle each other the way they do on v1.
There is no documented cap on the number of IDs you can pass in the trace_ids array on traces/query. The page_size parameter only limits how many traces are returned per call (up to 100); it doesn't limit how many IDs you can submit. Since no maximum is published, keep batches to a moderate size (tens of IDs per call) rather than assuming an arbitrarily large array is safe.
If you still hit 429s during migration or high-volume use, honor the Retry-After header and back off with jitter rather than retrying immediately.
What traces/query returns
traces/query returns trace root runs and optional trace-wide aggregates (trace_aggregates: total_tokens, total_cost, first_token_time). It does not return every child run in the tree. If you need all runs in a trace, call GET /api/v2/traces/{trace_id}/runs for each trace in addition to traces/query.
traces/query also defaults min_start_time to 24 hours before the request if you don't set it explicitly. For backfills or historical pulls, always pass explicit min_start_time/max_start_time bounds, otherwise the scan window silently narrows to the last day.
Attachment size limits
The 20MB limit you may run into is specific to uploading attachments to dataset examples through the LangSmith UI. It does not apply to trace attachments.
Binary attachments uploaded programmatically with a trace (through the @traceable/traceable attachment APIs) go through a different ingestion path with a much larger default limit: 200 MiB per attachment. If you need to attach files larger than the 20MB UI limit (images, audio, PDFs, etc.), attach them programmatically with the trace instead of uploading through the dataset UI.
Migrating off the legacy v1 endpoints
The v1 query endpoints and the list_runs/listRuns/read_run/readRun SDK methods are deprecated. LangSmith Cloud removes them on January 31, 2027; self-hosted LangSmith removes them in v0.19. Move bulk/programmatic reads to POST /api/v2/runs/query and POST /api/v2/traces/query before then.
Using the v2 methods requires langsmith>=0.10.15 (Python) or langsmith>=0.8.9 (TypeScript), and self-hosted LangSmith v0.16 or later.