Connect to AI
Databases Bearer Token

Turso REST API

Edge-hosted distributed SQLite database API

Turso is a distributed database built on libSQL, a fork of SQLite, designed for edge deployment with low latency worldwide. It provides developers with a managed SQLite database that replicates to multiple regions, offering both HTTP and WebSocket APIs for database operations. Turso enables applications to access data with single-digit millisecond latency from anywhere in the world while maintaining strong consistency guarantees.

Base URL https://[database-name]-[org-name].turso.io

API Endpoints

MethodEndpointDescription
POST/v1/executeExecute a single SQL statement and return results
POST/v2/pipelineExecute multiple SQL statements in a pipeline with conditional execution
POST/v1/batchExecute multiple SQL statements in a batch transaction
GET/v1/databasesList all databases in your organization
POST/v1/databasesCreate a new database instance
DELETE/v1/databases/{database_name}Delete a database instance
GET/v1/databases/{database_name}Get details about a specific database
POST/v1/databases/{database_name}/tokensCreate an authentication token for database access
GET/v1/databases/{database_name}/locationsList all replica locations for a database
POST/v1/databases/{database_name}/locationsAdd a replica to a new location
GET/v1/databases/{database_name}/statsGet usage statistics for a database
GET/v1/organizationsList organizations accessible to the authenticated user
POST/v1/databases/{database_name}/seedSeed a database from a dump file or another database
GET/v1/databases/{database_name}/schemaGet the current database schema
POST/v1/databases/{database_name}/backupCreate a manual backup of the database

Code Examples

curl -X POST https://my-db-myorg.turso.io/v1/execute \
  -H 'Authorization: Bearer eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9...' \
  -H 'Content-Type: application/json' \
  -d '{
    "statements": [
      {
        "q": "SELECT * FROM users WHERE id = ?",
        "params": [123]
      }
    ]
  }'

Use Turso from Claude / Cursor / ChatGPT

Get a hosted MCP endpoint for Turso. Paste your Turso API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls Turso directly with your credentials — no local install, works on mobile.

turso_query Execute SQL queries against a Turso database and return structured results for AI processing
turso_batch_execute Execute multiple SQL statements in a transaction for complex database operations
turso_schema_inspector Retrieve and analyze database schema to help AI understand table structures and relationships
turso_database_manager Create, list, and manage Turso database instances across multiple regions
turso_analytics Query database usage statistics and performance metrics for optimization insights

Connect in 60 seconds

Paste your Turso key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.

Connect Turso to your AI →

Related APIs