Tutorial
From prompt to SQL in three steps.
The whole product is one POST. Create a project in the dashboard so TTSQL
knows your schema, generate an API key, then call /api/v1 with
your prompt. Set execute: true to also run the generated SQL
against the database connected to that project.
-
01 Create a project and connect its database/schema in the dashboard.
- 02 Generate an API key on the API Keys page.
-
03
POST a prompt to
/api/v1
and read query
from the response.
Guide 01
Make your first text-to-SQL request
Send a prompt and the project_id whose schema TTSQL should use. The response includes the generated SQL. Add execute: true to also run it against that project's connected database.
Generate SQL
curl
curl -X POST https://ttsql.com/api/v1 \
-H "x-api-key: $TTSQL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Revenue by plan this month",
"project_id": 1,
"execute": false
}'