Key-value setup flow
Enable KV for the Service
Set
[capabilities].kv = true in tovuk.toml, then run
tovuk deploy --dry-run --json so the agent can confirm enabled
capabilities, meters, limits, and required fixes before provisioning the
namespace.Inspect the runtime binding
Deploy the Worker, read
TOVUK_KV_CACHE from the runtime environment
(TOVUK_KV_<NAME> for other binding names), and use
tovuk service show service_1 --json to verify kvNamespaces, current
usage, limits, and next actions.CLI workflow
API
POST /v1/services/{service_id}/kv/namespacesGET /v1/services/{service_id}/kv/{namespace}/keysGET /v1/services/{service_id}/kv/{namespace}/values/{key}PUT /v1/services/{service_id}/kv/{namespace}/values/{key}DELETE /v1/services/{service_id}/kv/{namespace}/values/{key}PUT /v1/services/{service_id}/kv/{namespace}/bulkPOST /v1/services/{service_id}/kv/{namespace}/bulkPOST /v1/services/{service_id}/kv/{namespace}/bulk/removalsDELETE /v1/services/{service_id}/kv/namespaces/{namespace}
code, message, agent_instruction, and
docs_url fields when the next action is not obvious.
Dashboard
The dashboard Resources view athttps://tovuk.com/account/resources can list
KV keys, read one key, write one key, and delete one key through the same API
routes, limits, and meters as the CLI. Key listing is metered as kv_lists,
reads as kv_reads, writes as kv_writes, deletes as kv_deletes, and stored
bytes as kv_storage_bytes. Use the CLI or API bulk routes for bulk reads,
writes, and removals.
Meters and caps
KV usage is metered askv_reads, kv_writes, kv_deletes, kv_lists, and
kv_storage_bytes.
Limits
- KV keys are limited to 512 bytes.
- Values are limited to 25 MiB.
- Metadata is limited to 1024 bytes.
expirationTtlSecondsmust be at least 30 seconds.- Key list pages default to 1000 keys and accept limits from 10 to 1000.
- Bulk reads accept 100 keys. Bulk writes and deletes accept 10000 keys, and bulk request bodies must fit 100 MB.