What text-to-SQL prompts cost, and what schema selection saves

Measured on schemagate's six test schemas with its built-in token estimator, averaged over each schema's golden questions. Reproduce with python tests/bench.py.

schemaobjectsfull schema, every callschemagate, averagereduction
Commerce422,48360476%
Clinical claims271,56854365%
Claims warehouse (star)513,31288073%
Bank ledger and trading392,25563772%
IoT telemetry402,12544879%
Hostile (4 schemas, copies of everything)26016,09544497%

The selection stays at about six tables however large the schema is, so the saving grows with the database. Real databases look like the last row.

Your numbers

Tokens per question: full schema → selected . Questions per day . Input price $ per million tokens.

This multiplies four numbers you typed; it knows nothing about your provider's actual pricing. The demo fills the token counts from a live question.

Two things that cost nothing

The selector never calls a model — BM25 plus a hashed embedder, offline, milliseconds. And the optional one-sentence table descriptions can be written by any chat window you already have instead of an API key: schemagate describe prints the prompt and takes the JSON reply.

pip install schemagateGitHub