Skip to contentSkip to page list

Docs

npx langwatch

Trace any coding agent · Setup guide →

LangWatchQL limits, rate limits and cost

How many rows a query returns, how large and long it can be, how many queries a plan runs per minute, and what is charged.

On this page

Limits

WhatLimitOver the limit
Rows per response10,000. A statement with no LIMIT gets LIMIT 10000 added: after the last clause, or before its OFFSET if it has one.A LIMIT above 10,000 is refused with 400 lwql_not_permitted, LIMIT_TOO_HIGH
Result sizeAbout 8,000,000 bytes413 lwql_result_too_large, with no partial result
Response size with extraction functionsAbout 32,000,000 bytes after the content is readTrailing rows are dropped, and the response includes the APP_FUNCTION_RESULT_TRUNCATED diagnostic
Statement length50,000 characters422 validation_error
Run time60 seconds504 query_timeout
Memory1 GB422 query_memory_exceeded
Data read1,000,000,000 rows or 30,000,000,000 bytes422 query_scan_limit_exceeded
Threads4 per query
Queries running at once10, shared by the whole deployment, not per project or per key503 lwql_busy

Adding LIMIT 10000 is the only change LangWatch makes to your statement, with one exception: on an aggregate project whose member has a dated window, each view is also replaced by a subquery that keeps rows inside that window. The server limits are the shipped defaults, which LangWatch Cloud uses. LangWatchQL refuses a SETTINGS clause that changes them.

How many queries can I run per minute

PlanQueries per minute, per project
Free, and Launch billed monthly30
Other paid plans, including Launch billed annually60
Enterprise, and self-hosted open source120

The window is a fixed 60 seconds. Over the limit the answer is 429 lwql_rate_limited, and meta.retryAfterSeconds in the error tells you how long to wait.

How do I get more than 10,000 rows

Page through the result. Order by a time column and an id, alias those two columns to the cursor parameter names after_ts and after_id, and let the CLI rebind them for each page:

example.sqlSQL
SELECT OccurredAt AS after_ts, TraceId AS after_id, CapturedInput, CapturedOutputFROM tracesWHERE OccurredAt >= subtractDays(now(), 7)  AND (OccurredAt, TraceId) > ({after_ts:DateTime64(3)}, {after_id:String})ORDER BY OccurredAt, TraceIdLIMIT 1000
example.shBash
langwatch query --sql-file export.sql --projects <project id> --page-by keyset --format jsonl --out export.jsonl

From the REST API, page with LIMIT and OFFSET and an ORDER BY. In a UNION, give every branch its own LIMIT, or the query is refused with LIMIT_REQUIRED_PER_BRANCH.

What does a query cost

Eval functions (eval, eval_passed, eval_score and the others) are metered and charged per query. The extraction functions reference has the details.

Error codes

StatusCodeWhat it means
400malformed_requestThe request body cannot be read, for example it is not valid JSON
400lwql_unparseableThe statement is not valid ClickHouse SQL
400lwql_not_permittedThe statement uses something LangWatchQL does not allow, such as a second statement, a view or a function
400lwql_unknown_identifierThe statement uses a column that does not exist
400lwql_invalid_queryThe database rejected the statement as written, for example an aggregate in WHERE or a type clash
400lwql_parameter_missingThe statement declares a parameter the request has no value for. meta.parameters lists them: send each under parameters
400lwql_parameter_invalidA parameter value does not match its declared type. meta.parameter names it: send a DateTime as YYYY-MM-DD HH:MM:SS in UTC
401missing_credentials, invalid_credentialsNo API key, or a key LangWatch does not know
403lwql_not_enabledLangWatchQL is not enabled for this project. Ask an administrator to enable it
404project_not_foundA project named in projectId or projects does not exist, or the key cannot read it with analytics:view
413lwql_result_too_largeThe result is over the result size limit in Limits
422validation_errorThe request body does not match the expected shape, for example it sends both projectId and projects
422projects_requiredThe key reaches several projects. Send projects, a list of project ids, or "all"
422projects_unreadableThe key reads no project. Ask an administrator to grant it analytics:view on one
422query_scan_limit_exceeded, query_memory_exceededThe query reads too much data or uses too much memory
422lwql_too_many_membersThe aggregate project has too many members for one query. meta.maxMembers gives the limit
422lwql_member_grant_closedA member project of the aggregate is shared up to an end date, so the query does not run. meta.projectNames lists these projects
422lwql_app_function_key_capAn extraction function needs more distinct keys than its cap
422lwql_app_function_read_budgetThe query asks for more trace content than one run may read. Use a smaller LIMIT or run it in pages
422instant_eval_query_budget_exceededThe eval functions in the query are over their token budget
429lwql_rate_limitedToo many queries this minute for this project
503lwql_busyToo many queries are running at once
503lwql_app_function_hydration_failedThe query ran, but the conversation or trace content could not be read
503lwql_app_function_unavailableThe functions this query uses are not set up on this deployment yet. Contact support, or your administrator if you self-host
503lwql_provisioning_incompleteLangWatchQL could not read one of the datasets the query needs. Contact support, or your administrator if you self-host
503lwql_source_unavailableA table the query reads could not be reached right now. The query itself is fine: retry it in a few seconds
503lwql_unavailableLangWatchQL is not set up on this deployment. Contact support, or your administrator if you self-host
503clickhouse_unavailableThe database is down for a moment. Retry in a few seconds
504query_timeoutThe query ran past the run time limit in Limits

Common questions has the exact messages and how to fix each one.

Documentation