Getting started
1. Make a key
Section titled “1. Make a key”Sign in to the console, open Account, and under Developer keys name a key for what will use it — my laptop, the nightly job — and make it. The key is shown once; copy it then. It starts with persql_ and signs in as you, to every database in your account, so keep it the way you keep a password. Revoke it from the same page and anything holding it stops at once.
2. Call the API
Section titled “2. Call the API”Send the key as a bearer token. Every route lives under https://api.persql.com/api/v1 and answers JSON.
curl https://api.persql.com/api/v1/databases \
-H "Authorization: Bearer persql_..."
Make a database, then run a statement in it:
curl https://api.persql.com/api/v1/databases \
-H "Authorization: Bearer persql_..." \
-H "Content-Type: application/json" \
-d '{"name":"Ledger"}'
curl https://api.persql.com/api/v1/databases/db_.../query \
-H "Authorization: Bearer persql_..." \
-H "Content-Type: application/json" \
-d '{"sql":"CREATE TABLE expenses (day TEXT, category TEXT, amount REAL)"}'
The HTTP API reference lists every route.
3. Or use the terminal
Section titled “3. Or use the terminal”npm install -g @persql/cli
persql login # opens the browser; approve the code it shows
persql create Ledger
persql query ledger "SELECT 1 AS one"
persql login --key persql_... saves a key instead, for a machine with no browser. The CLI reference has every command.
4. Give it to an agent
Section titled “4. Give it to an agent”persql mcp --config prints the snippet a Claude, Cursor or any MCP client takes. A hosted agent that cannot hold a key — a connector at claude.ai — is given https://api.persql.com/mcp alone and signs in through your browser. MCP →