Request
Method:POSTPath:
/api/v1/chat/queryContent-Type:
application/json
Body parameters
string
required
The natural-language question to ask. Must be between 2 and 2,000 characters.Example:
"What were total sales by region last month?"string
default:"default"
The workspace to query. Workspaces define which database and which tables are accessible. Use
"default" unless you have configured multiple workspaces.string
The specific model name to use for this request (e.g.,
"gpt-4.1-mini" or "qwen3:8b"). If omitted, the server uses the workspace’s configured default model.string
Forces a specific AI provider for this request. One of
"cloud", "local", "hybrid", or "mock". If omitted, the server selects based on configuration.cloud— OpenAI-compatible remote APIlocal— Ollama running locallyhybrid— tries local (Ollama) first, falls back to cloudmock— deterministic mock responses (for testing)
boolean
default:"true"
Whether to include the generated SQL in the response. Set to
false if you only need the answer and table data.Response
string
The executive-summary answer written by the AI model in plain language.
string | null
The SQL query generated by the AI before the row limit was applied. Present only when
include_sql is true.string | null
The actual SQL that was executed, including any
LIMIT clause added by the guardrail layer. Always returned when a query was executed, regardless of the include_sql flag.string
The name of the AI provider that processed the request (e.g.,
"openai", "ollama", "mock").object | null
The query results as a structured table.
object | null
A chart specification if the AI determined the data is best presented visually.
object[]
List of downloadable export files generated for this response.
string[]
Any non-fatal warnings generated during processing, such as a row limit being applied.
object
Metadata about how the query was processed.
string
ISO 8601 datetime indicating when the response was generated (UTC).