env binding or the REST API.
Key Naming
Keys may containa-z, A-Z, 0-9, and - _ / = . (no colons). Use / to group related keys:
list({ prefix: "user/" }) (or ?prefix=user/ over REST).
Value Serialization
KV stores values verbatim, so serialize complex values yourself (no base64 needed):Missing Keys
get returns null for a key that doesn’t exist — handle it explicitly:
Keep Values Small
KV is built for many small values read on the request path, not for large blobs. A value is capped at 1 MiB (1,048,576 bytes) — a larger write is rejected with413. Store big or binary objects in Cloud Storage and keep only the key or a small reference in KV.
Limits
| Limit | Value |
|---|---|
| Max value size | 1 MiB (1,048,576 bytes) — over → 413 |
| Max key length | 256 characters — over → 400 |
| Key characters | a-z A-Z 0-9 - _ / = . (no colons) |
list page size | limit 1–1000 (default 1000) |