v1
latestOpenAPI 3.1.02026-07-1730321418.0 KBSQL
Text-to-SQL (NSQL)
Generate and optionally execute a natural-language text-to-SQL (NSQL) query.
This endpoint generates a SQL query using a natural language query (NSQL) and optionally executes it. The SQL query is generated by the specified model and executed if the Accept header is not set to application/sql. When stream is true, the response is streamed as Server-Sent Events (SSE).
post/v1/nsql
Headers
Acceptstring required
The format of the response, one of 'application/json' (default), 'application/vnd.spiceai.nsql.v1+json', 'application/sql', 'text/csv' or 'text/plain'. 'application/sql' will only return the SQL query generated by the model.
Request body
Response
SQL query executed successfully