Skip to main content
PlanetScale database management API for managing organizations, databases, branches, and deploy requests. Best for database automation workflows — creating branches for schema changes, managing deploy requests, and monitoring database health. Unlike Vercel (hosting/deployment), PlanetScale handles the database layer with Git-like branching for schema management. 6 example endpoints available through Lava’s AI Gateway. See the PlanetScale API docs for full documentation.
This provider requires your own credentials — connect your API key or OAuth account before use.
This is a catch-all provider — any valid URL under https://api.planetscale.com/v1 is supported. Any PlanetScale API endpoint. Construct URL as https://api.planetscale.com/v1/{path}. The endpoints below are curated examples.

Endpoints

List organizations

GET https://api.planetscale.com/v1/organizations — Free
const data = await lava.gateway('https://api.planetscale.com/v1/organizations', { method: 'GET' });

List databases

GET https://api.planetscale.com/v1/organizations/{org}/databases — Free
const data = await lava.gateway('https://api.planetscale.com/v1/organizations/{org}/databases', { method: 'GET' });

List database branches

GET https://api.planetscale.com/v1/organizations/{org}/databases/{db}/branches — Free
const data = await lava.gateway('https://api.planetscale.com/v1/organizations/{org}/databases/{db}/branches', { method: 'GET' });

Create a database branch

POST https://api.planetscale.com/v1/organizations/{org}/databases/{db}/branches — Free
const data = await lava.gateway('https://api.planetscale.com/v1/organizations/{org}/databases/{db}/branches', { body: {"name":"feature-branch","parent_branch":"main"} });

Update database settings

PATCH https://api.planetscale.com/v1/organizations/{org}/databases/{db} — Free
const data = await lava.gateway('https://api.planetscale.com/v1/organizations/{org}/databases/{db}', { method: 'PATCH', body: {"production_branch_web_console":true} });

Delete a database branch

DELETE https://api.planetscale.com/v1/organizations/{org}/databases/{db}/branches/{branch} — Free
const data = await lava.gateway('https://api.planetscale.com/v1/organizations/{org}/databases/{db}/branches/{branch}', { method: 'DELETE' });

Next Steps

All Providers

Browse all supported AI providers

Forward Proxy

Learn how to construct proxy URLs and authenticate requests