{"uid":"cap__hzbVWapdLHAPHET5-KCd","slug":"24k-labs-text-to-sql-35d59bd6","name":"24K Labs Text-to-SQL","description":"A curated directory of x402 services — each one on the list on purpose, with the health, uptime, and independent trust grades from across the ecosystem gathered in one place.","url":"https://api.24klabs.ai/api/text-to-sql","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"schema":{"type":"string"},"dialect":{"type":"string"},"request":{"type":"string"}}},"responseSchema":{"type":"json","example":{"sql":"SELECT ..."}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8bNVe2yPz8V6-Tm_7zk3r","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","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 using AI","exampleAgentPrompt":"Convert this question into SQL for me: 'What are the top 10 customers by total revenue in the last 90 days?' — my tables are customers(id, name) and orders(id, customer_id, amount, created_at).","exampleUseCases":[{"title":"Business analyst self-service queries","prompt":"I need a SQL query that finds all users who signed up in the last 30 days but haven't placed an order yet — my tables are users(id, email, created_at) and orders(id, user_id, created_at)."},{"title":"Dashboard metric SQL generation","prompt":"Write me a SQL query for: 'What is the month-over-month revenue growth for each product category?' using my schema: sales(id, product_id, category, amount, sale_date)."},{"title":"Non-technical team database access","prompt":"Can you turn this into a SQL query I can run? 'Show me all support tickets that are still open and were created more than 7 days ago, sorted by oldest first.' My tickets table has columns: id, status, subject, created_at."}],"resultDescription":"Returns a JSON object containing a 'sql' field with a complete, ready-to-run SQL query (typically a SELECT statement) generated from the input natural language question.","failureModes":["Ambiguous natural language input produces an incorrect or unexpected SQL query","Missing or incomplete schema context leads to generic or hallucinated table/column names","Complex multi-join queries may be incomplete or syntactically incorrect","API returns error if required fields (question/schema) are missing","Rate limits or payment failures may result in 402 or 429 errors"],"whenToPreferThis":"Choose this endpoint when you need to programmatically convert natural language questions into SQL queries at low cost ($0.02 per call), especially in agentic workflows where users without SQL knowledge need to query relational databases. It is ideal for building self-service analytics tools, chatbot database interfaces, or automating report generation from plain-English descriptions.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:02:27.231Z","isFirstParty":false}