Ask in plain English. Get JSON back.
One endpoint that translates natural language into a plan across every shape, runs it, and returns rows. The LLM call uses your key - see BYOK LLM.
LLMs are creative. Planners are deterministic.
Most "NL to SQL" tools pipe a prompt into a model and hope. The model picks shapes based on training-data bias, not on what your data actually contains.
We pass real cardinality from oc-stats to the cost walker.
Cheap plans rank above expensive ones before the LLM picks. The model still chooses, but it's choosing
from a shortlist that already passes a cost test.
Every response carries the chosen plan + per-node cost. You can override.
POST /v1/tenants/:t/ask
{
"q": "Top 5 customers by spend in March
who haven't logged in this week"
} {
"plan": "sql.aggregate + sql.semi_join",
"cost": { "rows_estimate": 5, "io_cost": 8.2 },
"rows": [ { "id": "c_84", "spend": 4204.10 }, ... ],
"explain": { "nodes": [ ... ] }
} The LLM sees real cardinality from oc-stats, not synthetic estimates. Cheap plans rank above expensive ones before generation.
Same NL question → same plan → same rows (modulo data). Replays are stable; A/B tests are honest.
Every /ask response carries the plan it ran. If the LLM picked wrong, pin a shape and re-run.
Your key. Your audit. Your bill.
Most managed DBs that do NL queries mark up LLM tokens 2–5×. We don't bill them at all. You bring your own OpenAI, Anthropic, Gemini, or Groq key; every prompt and completion is visible in your provider's dashboard.
Read BYOK LLM →- Providers OpenAI · Anthropic · Gemini · Groq
- At rest Envelope-encrypted
- Audit Provider · model · prompt + completion tokens
- Fallback Platform key, opt-in only
- under designConversational follow-up. /ask is single-turn today.
- under designSelf-correcting retries on parse errors.