Cloudflare KV / D1 through Squiid

Edge key-value store and SQLite database bound to your Workers. Cloudflare KV / D1 is next up on Squiid, being built now.

Next up Provisioned Provisioned. Squiid creates the project or account for you and keeps the provider keys.

What Cloudflare KV / D1 is

Cloudflare KV and D1 are the two data primitives that sit next to Workers. KV is a key-value store replicated to Cloudflare's edge, optimised for reads that happen far more often than writes, with configurable TTLs and eventual consistency measured in seconds. D1 is a serverless SQLite database with a real SQL interface, sessions for read replication, and time travel restore that rewinds the database to any point in the last 30 days without you managing backups. Both are managed through Wrangler and the Cloudflare API, so creating a namespace or a database is a command rather than a console visit.

For an AI-coded app KV holds configuration, feature flags, cached API responses, session lookups and anything else read on every request. D1 holds relational data for projects that are edge-first and do not want a Postgres connection from a Worker: form submissions, small catalogs, per-user records, analytics rollups. Bindings mean a Worker reads and writes them without a connection string or a credential of any kind in the code. D1's read replication through sessions keeps reads fast in distant regions while writes still go to the primary.

Why connect it through Squiid

Squiid provisions the namespaces and databases and holds the Cloudflare API token. Access runs through https://api.squiid.io/v1/cloudflare-kv-d1/... with Authorization: Bearer $SQUIID_API_KEY, and Wrangler and the REST clients work by pointing their base URL at the gateway (gateway convention). Reads, writes, storage and D1 rows are metered against prepaid credits at Cloudflare's list price and appear on the same monthly invoice as your Workers, R2 bucket and model providers.

  • One account, one key, one bill, one dashboard. Cloudflare KV / D1 sits beside every other service your project uses, on the same invoice and the same credit balance.
  • Key custody. Squiid holds the Cloudflare KV / D1 credentials. Your code carries SQUIID_API_KEY, so CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, KV_NAMESPACE_ID, D1_DATABASE_ID never land in a repository, a preview deployment or an agent’s context.
  • Metering you can see. Every call is counted per service and per day, so you know what Cloudflare KV / D1 costs before the month ends.
  • Pause on zero. When prepaid credits run out the gateway stops authorizing usage instead of running up a bill you did not fund.
  • One rotation. Rotating the Squiid key cuts off every agent, worker and deployment at once, with no provider key to hunt down.

What you get

  • Provisioned KV namespaces and D1 databases
  • Edge-replicated reads with TTL support
  • SQLite over SQL with time travel restore
  • Direct bindings from your Workers
  • Cloudflare list pricing, no markup

How to connect Cloudflare KV / D1

One variable replaces the provider credentials this service would normally need. Requests go to the gateway and the official SDKs work by pointing their base URL at it (gateway convention).

# .env
# replaces CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, KV_NAMESPACE_ID, D1_DATABASE_ID
SQUIID_API_KEY=sq_live_xxxxxxxxxxxxxxxxxxxxxxxx

# every request: https://api.squiid.io/v1/cloudflare-kv-d1/...
# header:       Authorization: Bearer $SQUIID_API_KEY
01

Add it in your dashboard

Open the Squiid catalog, add Cloudflare KV / D1 and fund credits. Squiid provisions the project and keeps the provider keys.

02

Put the one key in your env

Add SQUIID_API_KEY to .env and delete CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, KV_NAMESPACE_ID, D1_DATABASE_ID. Nothing else from Cloudflare KV / D1 needs to exist in your project.

03

Point your agent at it

Claude Code, Cursor and Codex read the same variable and call https://api.squiid.io/v1/cloudflare-kv-d1/. Agents use KV for cached reads and feature flags and D1 for relational data when the whole app already runs on Workers.

Pricing through Squiid

Cloudflare charges per read, write and delete plus stored data for KV, and per row read and written plus storage for D1, at the provider's listed price. Squiid passes that through at par: one dollar of prepaid credit is one dollar of Cloudflare KV / D1 usage, with no markup and no per-request margin.

Cloudflare KV / D1 has no subscription attached on Squiid today. If a plan is required for a feature you need, it passes through at the provider’s listed price with no Squiid fee.

Squiid adds no markup to provider prices. There is a free plan at $0 a month with a 15% fee when you top up credits, Solo at $19.97 a month with a top-up fee that starts at 8% and falls to 3.5% as your spend grows, Team from $29.97 a seat a month with the same ladder one point lower, and Custom with a rate of 3% or less. Credits are prepaid, so Cloudflare KV / D1 usage stops when the balance reaches zero rather than producing an invoice you did not fund. Auto top-up with a cap keeps production running without handing anyone an open-ended card.

If you leave

Export: there is no Cloudflare account transfer, so KV namespaces and D1 databases are dumped and re-created in your own account. Squiid never owns your code, your schema or your domain, and the gateway speaks Cloudflare KV / D1's own API, so the client change is a base URL. The handover page lists what happens for every provider in the catalogue.

Works with every coding agent

Cloudflare KV / D1 through Squiid is just an HTTP call with a bearer token, so every agentic coding tool can use it with the single key already in your environment:

Vibe coding a feature on Cloudflare KV / D1 usually means asking for it in plain language and letting the agent write the integration. Because the key is Squiid’s rather than the provider’s, it can do that without ever holding a credential that could be leaked, logged or committed.

Related services

Questions people ask

Is D1 a real SQL database?

Yes, it is SQLite with a SQL interface, migrations and time travel restore. It suits small to medium relational workloads at the edge.

Is KV consistent?

KV is eventually consistent. Writes propagate globally within seconds, which is fine for config and caches and wrong for a bank balance.

Can Cursor set these up through Squiid?

Yes. Wrangler runs through the gateway with SQUIID_API_KEY, so namespaces and databases are created without a Cloudflare token in your project.

How are they billed?

Per operation and per gigabyte stored at Cloudflare's listed price, drawn from prepaid credits with no markup.

D1 or Neon for a Workers app?

D1 is simplest when everything runs on Workers and the data is modest. Neon is the choice when you want full Postgres features and larger datasets.

Connect Cloudflare KV / D1 with one key.

KV is an eventually consistent key-value store replicated worldwide for fast reads, and D1 is a serverless SQLite database with time travel restore. Both are provisioned by Squiid.