{"uid":"cap_D3iFXF_3JlWtrGRSP1fa1","slug":"natural-language-to-sql-translator-schema-aware-read-only-flagged-466621dd","name":"Natural Language to SQL Translator (Schema-Aware, Read-Only Flagged)","description":"Natural language to SQL for YOUR schema (Postgres, MySQL, SQLite, BigQuery), read-only flagged — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/ai/text-to-sql?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"schema":{"type":"string","description":"required: CREATE TABLE statements, up to 12,000 chars"},"dialect":{"enum":["postgres","mysql","sqlite","bigquery"],"type":"string","description":"optional: postgres | mysql | sqlite | bigquery"},"question":{"type":"string","description":"required, up to 1,000 chars"}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"text-to-sql","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.01,"receipt_id":"g402-<16hex>"},"sources":[{"ok":true,"name":"<source>"}],"limitations":"<text>","generated_at":"<iso time>","evidence_hash":"sha256:<64hex>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-FbO0FU65hlRxeGlv5X9e","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a natural language question into a SQL query tailored to a user-supplied schema, supporting Postgres, MySQL, SQLite, and BigQuery dialects, with read-only safety flagging.","exampleAgentPrompt":"Using my Postgres schema (with tables orders, customers, and products defined by these CREATE TABLE statements: ...), write a SQL query that answers: 'Which customers placed more than 5 orders in the last 30 days?'","exampleUseCases":[{"title":"Self-serve analytics for non-technical users","prompt":"I have a MySQL database with these tables — CREATE TABLE sales (...), CREATE TABLE products (...) — can you write a SQL query that answers: 'What were the top 10 best-selling products by revenue last quarter?'"},{"title":"AI chatbot over a BigQuery data warehouse","prompt":"My BigQuery warehouse has these schemas: CREATE TABLE events (...), CREATE TABLE users (...). Translate this question into valid BigQuery SQL: 'How many unique users triggered a purchase event in the last 7 days?'"},{"title":"SQLite-backed app question answering","prompt":"Here are my SQLite table definitions: CREATE TABLE tasks (...), CREATE TABLE projects (...). Write a SQL query that answers: 'Which projects have overdue tasks assigned to more than two people?'"}],"resultDescription":"Returns a generated SQL query string matched to the provided schema and dialect, phrased to answer the natural language question. The response is flagged as read-only safe, meaning the generated SQL is a SELECT statement or equivalent that will not mutate data.","failureModes":["Schema too large — exceeds the 12,000-character limit for CREATE TABLE statements","Question too long — exceeds the 1,000-character question limit","Ambiguous question that cannot be mapped to schema columns without clarification","Unsupported dialect value provided","Schema references tables or columns not defined in the provided CREATE TABLE statements","Payment not included or insufficient (x402 payment required at $0.01 USDC)"],"whenToPreferThis":"Choose this endpoint when you need schema-aware, dialect-specific SQL generation grounded in your actual database structure, rather than generic SQL snippets. Prefer it over generic LLM prompting when you need read-only safety guarantees, support for a specific SQL dialect (Postgres, MySQL, SQLite, BigQuery), and a structured API contract with predictable pricing. Ideal for building natural language interfaces over existing databases in agentic pipelines.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T06:45:24.710Z","isFirstParty":false,"canonicalSlug":"natural-language-to-sql-translator-schema-aware-read-only-flagged-466621dd"}