Skip to main content

Errors

Every error has the same format:

{
"code": "sql_rejected",
"message": "The generated SQL query was rejected.",
"details": { "violations": [{ "code": "unknown_column", "params": {} }] }
}
  • code is stable and in English. Program against it.
  • message is translated into the resolved language (locale → Accept-Language → tenant default → pt-BR) and can be shown to the user, but its text may change.
  • details carries extra data, which varies by code.

Every response, success or error, carries the X-Request-ID header (req_…). Record it in your logs and include it when asking for support.

Codes​

HTTPcodeMeaning and action
400end_user_requiredThe tenant requires end_user and the question came without it.
401invalid_api_keyHeader missing, malformed, key does not exist or was revoked. Do not repeat without fixing it.
404request_not_foundUnknown request_id, belongs to another tenant or cannot be rated (feedback and history).
404not_foundRoute does not exist.
405method_not_allowedHTTP method not accepted by the route (see the Allow header).
409schema_not_configuredThe tenant has not registered the DDL in the panel yet.
409llm_not_configuredThe tenant has not configured the LLM provider, model and key.
409unsupported_llm_providerThe saved provider is no longer accepted; the administrator needs to change it.
409secret_unreadableThe saved LLM key can no longer be read; the administrator needs to register it again.
413payload_too_largeBody above 96 KiB.
422invalid_requestInvalid body or query, or unknown field. details.fields lists the fields.
422invalid_end_userend_user in the wrong format: looks like an email or a name, contains spaces or is too short.
422question_too_longQuestion above 2,000 characters (details.limit).
422invalid_max_rowsInvalid max_rows.
422prompt_too_largeSchema, context and examples do not fit in the prompt. Tell the administrator.
422no_answerThe LLM concluded that the schema does not answer the question. Ask the user to rephrase.
422sql_rejectedThe generated SQL did not pass the SQL Guard, even after the automatic correction. details.violations is a list of {code, params} with generic codes.
422invalid_feedbackInvalid rating in /v1/feedback.
429rate_limitedRequest limit reached. details.scope = "end_user" when the limit is the end user's. Respect Retry-After.
500internal_errorUnexpected error. Send the X-Request-ID to support.
502llm_errorFailure of the tenant's LLM. See details.reason below.
503service_unavailablePlatform database unreachable or overloaded. Comes with Retry-After.
503not_readyService without database access; try again.

sql_rejected​

So as not to reveal what your administrator hid, hidden tables and columns appear as unknown_table and unknown_column, and column names are never returned. The real reason stays in the panel's History. Rephrasing the question usually solves it; if a legitimate question is rejected often, add an example for it in the panel.

llm_error and details.reason​

reasonAction
timeout, llm_unavailable, llm_rate_limitedTransient: try again with backoff.
invalid_llm_key, invalid_modelThe administrator needs to fix the LLM configuration in the panel.
empty_response, invalid_responseThe LLM returned something unusable; try again or rephrase.

Suggested retry policy​

SituationWhat to do
429Wait the number of seconds in Retry-After before repeating.
502 with a transient reason, 503Exponential backoff (1 s, 2 s, 4 s), at most 3 attempts.
401, 409, 422Do not repeat the same request.
Timeout of your HTTP client on /v1/askDo not retry automatically: each attempt spends tokens. Let the user try again.