Turso integration

Turso cost alerts with reversible brakes

Costbrake watches Turso through a read-only Platform API token: it reads your organization's usage for the current billing cycle, covering rows read, rows written, syncs and storage, every 5 minutes on Pro and Team, and prices anything past your plan's quota at its overage rates.

Free checks hourly and sends email. Pro at $12 a month and Team at $39 a month add 2 brakes an admin confirms by hand: make one database read-only, or block all its queries. Every brake has an Undo.

Turso at a glance

Reads
Organization usage for the current billing cycle: rows read, rows written, syncs and storage, per database for the 20 busiest
Key
Read-only Platform API token restricted to your organization, with the read and org:read scopes
Setup
Your AI agent mints the token with the Turso CLI, or you run turso auth api-tokens mint and paste it
Free plan
Hourly checks, email alerts
Pro and Team
Every 5 minutes
Spike checks
No speed-up; stays at every 5 minutes
Brakes
2: block writes, block reads and writes (needs a second token with db:configure)

Brakes

2 brakes for Turso

An admin picks a brake, confirms it, and can undo it later. Brakes come with Pro and Team.

  • Admin confirms

    Block writes

    Makes one database read-only: inserts, updates and deletes fail until writes are unblocked, while reads keep working.

    UndoRestores the database's previous write setting.

    Rows read and storage keep counting, so it stops a write loop but not the cost of heavy reads.

  • Admin confirms

    Block reads and writes

    Blocks all queries on one database, so it stops consuming rows read and written; its data stays intact.

    UndoRestores the database's previous read and write settings.

    Every app using that database fails until you undo it, and its storage keeps billing.

Can you set a hard spending limit on Turso?

Only at your plan's quota. With Overages disabled, Turso blocks your databases once you exceed the limit on any single metric, such as storage, rows read, rows written or syncs, even if the other metrics are well under quota. With Overages enabled, you go past the limits and pay per usage for the extra, with no dollar cap.

Turning overages off later doesn't cancel overages you already incurred. On the Free plan there are no overages: you need to upgrade to a paid plan to go further. Plan quotas and rates are in Turso pricing.

SettingWhat happens at the limitThe gap
Overages disabledDatabases are blocked once any one metric is over quotaBlocks every database, not only the one that ran away
Overages enabledUsage continues and the extra is billed per unitNo dollar cap
Free planBlocked at the limit until you upgradeNo way to pay for a little extra
CostbrakeUsage priced every 5 minutes, spike alerts, 2 brakes per databaseAn admin confirms every brake

What Costbrake reads from Turso

Costbrake reads your organization's usage for the current billing cycle, along with your plan, its quotas and whether overages are on. Usage inside the quota is already paid for by the plan fee, which Costbrake spreads over the month; usage past the quota is priced at your plan's overage rates. Per-database figures cover your 20 busiest databases; the rest are grouped as one line.

With overages off, Turso blocks queries at the quota instead of billing for them, so only the plan fee shows as spend and there is no extra cost to alert on. Costbrake earns its keep with overages on, where a runaway query past the quota turns into real dollars.

The Turso tokens

Turso mints Platform API tokens only through its CLI or API. The read token is restricted to your organization and carries two scopes: read, which covers GET-style routes such as databases, configuration and usage, and org:read, which covers organization data such as billing. Mint it with explicit scopes, because an organization token without scopes can do everything its user can do in the organization.

Brakes need a second token with the read and db:configure scopes, which can change database configuration. Your AI agent can mint both with the Turso CLI and hand them over without printing them, as described in agent setup.

How a Turso brake works

Costbrake never brakes on its own. On Pro and Team, an admin turns the killswitch on for the connection, picks a database, types the connection name and clicks Brake now. The brake changes that database's configuration only, so your other databases keep serving.

  • Block writes is the lighter brake: reads keep working, so apps that only read stay up.
  • Block reads and writes stops rows read and written for that database until Undo.
  • Neither brake deletes data, and idle databases cost only storage.

What triggers a Turso alert

A spike alert fires when an hour costs more than 3 times your 7-day hourly average and at least $5 more, once Costbrake has 24 hours of history. Budget alerts fire at 50, 80 and 100 percent by default, and Pro adds forecast alerts. Free sends email; Pro adds Slack, Discord and webhooks; Team adds PagerDuty. Compare plans on the pricing page.

Questions and answers

Does Costbrake stop Turso spend automatically?

No. Costbrake alerts you, and an admin on Pro or Team decides whether to brake. A brake needs the killswitch turned on for the connection, the connection name typed in, and a click on Brake now. Every brake has an Undo.

Is the Costbrake Turso token read-only?

Yes. It carries only the read and org:read scopes, which cover GET-style routes and organization data. Brakes use a separate token with the db:configure scope that you add only if you want brakes.

Why does Costbrake show only my Turso plan fee?

With overages off, Turso blocks your databases at the plan quota instead of billing for extra usage, so the plan fee is the only spend. Usage inside the quota is already paid for, so Costbrake only shows extra dollars once usage passes the quota with overages on.

How often does Costbrake check Turso?

Every 5 minutes on Pro and Team, and hourly on Free. Turso checks don't speed up during a spike.

Does blocking a Turso database delete data?

No. Both brakes only change the database's read and write settings. The data stays intact, and Undo restores the settings it had before.

Sources

Updated

Start with 14 days of Pro, free

Catch the next Turso spike before the invoice.

14 days of Pro, then Free for 2 accounts. No card needed.