API Reference

SQL generation

Wren AI provides a powerful text-to-SQL interface that lets users query databases using natural language.

Wren AI exposes core APIs for generating SQL from questions, running queries, and explaining results.

Endpoints Overview

  • POST /generate_sql: Convert a natural language question into a SQL query.
  • POST /run_sql: Execute SQL and return structured results.
  • GET /stream_explanation: Stream natural language explanations for non-SQL questions.

Use these endpoints to build interactive and intelligent data experiences.