OpenRouter tests a text-to-SQL agent across six models and shows how data notes raise accuracy to 99%
Text-to-SQL Agent: How It Works and What Makes It Accurate
OpenRouter ran a text-to-SQL agent on six current models through its tool calling API on October 22, 2026, using a synthetic shop database and 22 questions with known answers. Across completed runs, the agent answered 95% correctly from the schema alone (244 of 256) and 99% with a five-line note about data quirks (246 of 248). With the notes, openai/gpt-6-luna answered all 44 runs correctly at $0.16 per 1,000 questions, the same score as anthropic/claude-sonnet-5.5 at $6.20, and the post recommends a read-only database connection because a check on the query text can be bypassed.
OpenRouter's six-model text-to-SQL test shows a five-line data note lifting accuracy from 95% to 99%, with a concrete prompt recipe and read-only safety setup teams can reuse.
Source:OpenRouter Announcements · openrouter.ai