Rate limit: 20 requests per minute per API key. The
mode field toggles between query_writer (default) and analyst, which adds commentary and requires an Exa key for enrichment.Request fields
User prompt or question.
Either
query_writer for SQL only or analyst for SQL plus narrative analysis.Optional prior turns to maintain context. Supply objects with
role and content fields.Example SSE Stream
Stream handling
- Each SSE event is emitted as
data:. - Watch for
type=finalto retrieve the generated SQL and an execution-ready query ID. - Treat
type=errorevents as terminal; the connection closes immediately afterward.