REST API

Full OpenAPI 3.1 spec. Use from curl, Node.js, Python, Go, or any HTTP client. Ephemeral endpoints require no authentication.

OpenAPI 3.1 spec

Import into ChatGPT, Postman, Insomnia, or generate a typed client.

openapi.yaml โ†—

Authentication

Ephemeral endpoints

No auth required. Open to all. Rate limited by IP.

POST /v1/ephemeral/create
GET /v1/ephemeral/:id
POST /v1/ephemeral/:id/sql

Persistent endpoints

Requires API key in Authorization header.

Authorization: Bearer dbaas_live_โ€ฆ

Endpoint reference

MethodPathAuthDescription
POST/v1/ephemeral/createnoneCreate ephemeral database
GET/v1/ephemeral/:idnoneGet status + connection info
POST/v1/ephemeral/:id/sqlnoneExecute SQL (ephemeral)
GET/v1/resources/listAPI keyList all your databases
POST/v1/services/createAPI keyProvision persistent database
GET/v1/resources/:id/addressAPI keyGet host / port / credentials
POST/v1/resources/:id/sqlAPI keyExecute SQL (persistent)
POST/v1/resources/:id/stopAPI keyStop database
POST/v1/resources/:id/startAPI keyStart database
DELETE/v1/resources/:idAPI keyDelete database
GET/v1/resources/:id/backupsAPI keyList backups
POST/v1/resources/:id/backups/triggerAPI keyTrigger manual backup
POST/v1/resources/:id/backups/:bid/restoreAPI keyRestore from backup
GET/v1/resources/:id/metricsAPI keyCPU / memory / storage metrics

Code examples

๐Ÿš

curl โ€” ephemeral (no auth)

# 1. Create an ephemeral database (auto-deletes after TTL minutes)
curl -s -X POST https://api.dbaas.dev/v1/ephemeral/create \
  -H "Content-Type: application/json" \
  -d '{"ttl":10}' | jq .

# 2. Poll until status == "running" (~30s)
curl -s https://api.dbaas.dev/v1/ephemeral/<id> | jq .data.status

# 3. Run SQL
curl -s -X POST https://api.dbaas.dev/v1/ephemeral/<id>/sql \
  -H "Content-Type: application/json" \
  -d '{"sql":"SELECT version()"}' | jq .data.rows
๐Ÿš

curl โ€” persistent (API key)

# List your databases
curl -s https://api.dbaas.dev/v1/resources/list \
  -H "Authorization: Bearer dbaas_live_your_key_here" | jq .

# Run SQL on a persistent database
curl -s -X POST https://api.dbaas.dev/v1/resources/<id>/sql \
  -H "Authorization: Bearer dbaas_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"sql":"SELECT count(*) FROM users"}' | jq .data.rows
๐ŸŸจ

Node.js / TypeScript

import fetch from "node-fetch"; // or global fetch in Node 18+

const API = "https://api.dbaas.dev/v1";
const KEY = process.env.DBAAS_API_KEY;

// List databases
const res = await fetch(`${API}/resources/list`, {
  headers: { Authorization: `Bearer ${KEY}` },
});
const { data } = await res.json();
console.log(data); // array of database objects

// Run SQL
const sql = await fetch(`${API}/resources/${data[0].id}/sql`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ sql: "SELECT NOW()" }),
});
const result = await sql.json();
console.log(result.data.rows);
๐Ÿ

Python

import os, requests

API = "https://api.dbaas.dev/v1"
KEY = os.environ["DBAAS_API_KEY"]
HEADERS = {"Authorization": f"Bearer {KEY}"}

# List databases
dbs = requests.get(f"{API}/resources/list", headers=HEADERS).json()
db_id = dbs["data"][0]["id"]

# Run SQL
result = requests.post(
    f"{API}/resources/{db_id}/sql",
    headers={**HEADERS, "Content-Type": "application/json"},
    json={"sql": "SELECT NOW()"},
).json()
print(result["data"]["rows"])

Rate limits

Client typeGlobal limitSQL / mutation limit
Anonymous (no key)60 req / min per IP10 mutations / min per IP
API keyBypasses IP limit60 mutations / min per key ยท 60 SQL / min per DB