# dbaas.dev > Managed PostgreSQL for AI agents and developers. Two modes: ephemeral (no auth, up to 60-minute TTL) and persistent (API key, full lifecycle). Spin up a fresh Postgres 18 in ~30 seconds, get a connection string, run SQL, then move on. ## Get started in 30 seconds ```bash # Ephemeral, no account curl -X POST https://api.dbaas.dev/v1/ephemeral/create \ -H 'Content-Type: application/json' \ -d '{"ttl":60}' # poll the returned pollUrl until status=running, then connect # once running: GET returns connectionString + host + port + username + password + database ``` ## Use with AI tools - **Remote MCP server** (Claude.ai connectors, claude-code, ChatGPT MCP): `https://api.dbaas.dev/v1/mcp` — Streamable HTTP transport, JSON-RPC 2.0, protocol version `2025-03-26`. Auth: `Authorization: Bearer dbaas_live_` for persistent tools. Ephemeral tools require no auth. - [Local MCP server (Claude Desktop, Cursor, Continue)](https://www.npmjs.com/package/dbaas-mcp): `npx -y dbaas-mcp` - [ChatGPT custom action](https://dbaas.dev/integrations/api): import the OpenAPI spec - **A2A agent** (async, thinking agent): card at `https://api.dbaas.dev/.well-known/agent-card.json`. **Primary interface: plain text.** Just send a natural-language request — the agent plans and executes all steps internally. No skill selection needed. Example: `{"id":"x","message":{"parts":[{"text":"create a blog DB, seed 10 rows, generate TypeScript types, and tell me how many posts per user"}]}}` — the agent provisions, creates schema, seeds data, generates ORM code, and answers the question in a single task. Submit: `POST /a2a/tasks/send` → 202 + `task_id`. Poll: `GET /a2a/tasks/{task_id}` until `state=completed`. Direct skill access also available (for deterministic use): `provision-postgres`, `get-status`, `exec-sql`, `create-schema`, `migrate-schema`, `load-sample-data`, `add-procedure`, `describe-schema`, `list-my-dbs`, `extend-ttl`, `delete-db`, `generate-query`, `chat-with-data`, `generate-orm-models`, `reset-schema`, `export-data`. Optional ownership: pass `Authorization: Bearer <32-char-token>` at submit — DB + task become token-protected. Read-once credentials: `connection_string` returned on first poll only — capture it, subsequent polls show `[redacted]`. Full guide: https://dbaas.dev/integrations/a2a ## API reference - [OpenAPI 3.2 spec](https://api.dbaas.dev/openapi.yaml): canonical machine-readable surface - [API integrations docs](https://dbaas.dev/integrations/api): human-readable guide - [MCP integration guide](https://dbaas.dev/integrations/mcp): Claude/Cursor setup ## Auth - Ephemeral endpoints (`/v1/ephemeral/*`): no auth, IP-rate-limited. - Persistent endpoints (`/v1/services/*`, `/v1/resources/*`): `Authorization: Bearer dbaas_live_<32-char>`. Generate at https://dbaas.dev/account/api-keys. ## Capabilities - Provision, list, start/stop/restart, delete persistent Postgres databases (free plan: 128Mi RAM, 70m CPU, 1Gi storage). - Get the query plan: `POST /v1/resources/:id/sql/explain` `{"sql":"...","analyze":false}` → returns Postgres EXPLAIN as JSON. Set `analyze:true` to get real timings (refused for destructive statements). Same blocking rules as `/sql`. - Run SQL via REST (SELECT/INSERT/UPDATE/DELETE/DDL). COPY and superuser functions blocked. - Single: `POST /v1/ephemeral/:id/sql` `{"sql":"..."}` → columns + rows + commandTag. - Batch: `POST /v1/ephemeral/:id/sql/batch` `{"statements":["SQL1","SQL2",...]}` → per-statement results (up to 25 statements, pod resolved once). Each statement is its own session/transaction. - Atomic multi-statement: send `{"sql":"BEGIN; stmt1; stmt2; COMMIT;"}` to `/sql` (NOT `/sql/batch`). One session, one transaction, full rollback on any error. - Delete ephemeral early: `DELETE /v1/ephemeral/:id` — frees the per-IP slot without waiting for TTL. Token-bound DBs require the same `client_token` via `Authorization: Bearer `. - A2A workflow on existing DB: pass `metadata.database_id` to `POST /a2a/tasks/send` with workflow text. Agent skips provisioning, introspects current schema, and plans operations against it. Use for "add a column", "migrate to add index", "what is X over my data" without spinning up a fresh DB. - A2A direct skill: set `metadata.skill` on submit to invoke a single skill deterministically (bypasses the planner). Free-form text in `parts` is ignored when `metadata.skill` is set. Useful for programmatic callers that don't need NL planning. - Backup (pg_dump → S3) and restore. 7-day retention. - Real-time metrics: connections, memory, CPU, storage. - Edit pg_hba.conf, rotate password, view schema. ## Limits - 1 persistent database per free-plan account. - 60 SQL queries/min/user/database. - 60 mutations/min/user; 5/min for destructive ops (delete, rotate-password). - Ephemeral TTL: 1–60 minutes (default 60). Max 2 active per IP. ## Links - Homepage: https://dbaas.dev - Sign up: https://dbaas.dev/login - Account / API keys: https://dbaas.dev/account/api-keys - Status / pricing: https://dbaas.dev/about - Source-of-truth API: https://api.dbaas.dev/openapi.yaml