K V
Key-value stores and rate limiting - CapyDB Knight/Valkyrie ("K/V"). One store per project, in its own KV cell; Upstash-REST and RESP compatible.
AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
organization_id?stringScopes the listing to one organization. Required for platform-admin callers, who have no implicit organization.
KV stores in the organization.
application/json- response
kv_stores*array<>curl -X GET 'https://capydb.dev/api/capydb/v1/kv'{ "kv_stores": [ { "id": "string", "project_id": "string", "organization_id": "string", "host_id": "string", "state": "provisioning", "mem_max_mb": 0, "maxmemory_mb": 0, "maxmemory_policy": "string", "persistence": "rdb", "public_host": "string", "token": "string", "token_prefix": "string", "last_error": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "credentials": { "redis_host": "string", "redis_port": 0, "redis_url": "string", "rest_url": "string", "rest_token": "string", "token_required": true }, "stopped_reason": "org_suspended" } ]}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
projectID*stringProject id.
The KV store.
application/json- response
A K/V store (CapyDB Knight/Valkyrie): the key-value and rate-limiting service. It runs in its own KV cell - the same isolated runtime primitive as a database cell - beside your database, on the same node, in the same region. Powered by Valkey; compatible with Redis® OSS clients and protocols. A project may have a K/V store with or without a database.
id*stringproject_id*stringorganization_id*stringhost_id*stringstate*stringK/V stores have no scale-to-zero lifecycle: a rate limiter cannot absorb a resume on the first request after an idle period. stopped is not idle sleep - it is a store the platform stopped (stopped_reason says why; org_suspended when the organization's suspension reached the offline rung). Its data is kept and it starts again when the reason clears.
"provisioning""running""stopped""error""destroying"mem_max_mb*integerHard memory ceiling enforced by the operating system. Derived from the project's plan.
maxmemory_mb*integerThe point at which Valkey starts evicting per maxmemory_policy. Held at half of mem_max_mb so that a background snapshot, which briefly needs extra memory, cannot hit the hard ceiling.
maxmemory_policy*stringEviction policy applied once maxmemory_mb is reached.
persistence*stringrdb: the keyspace is snapshotted to disk and survives a restart. There are no backups and no point-in-time recovery for K/V - treat it as durable-across-restart, not as a system of record.
"rdb""none"public_host?stringThe hostname the store answers on. Identical to the project's database hostname; the two are separated by port.
token?stringThe access token, in plaintext. Returned ONLY when the store is created and when the token is rotated, and never recoverable afterwards. Store it immediately.
token_prefix?stringThe leading fragment of the current token, for display and support. Not a credential.
last_error?stringcreated_at*stringdate-timeupdated_at*stringdate-timecredentials?Present only on create and rotate, where the plaintext token exists: a complete, connectable set of endpoints. Absent on every other read.
stopped_reason?"org_suspended"Present while state is stopped: who stopped the store. org_suspended - the organization is offline for a suspension; the store starts again automatically when the suspension lifts.
"org_suspended"curl -X GET 'https://capydb.dev/api/capydb/v1/projects/string/kv'{ "id": "string", "project_id": "string", "organization_id": "string", "host_id": "string", "state": "provisioning", "mem_max_mb": 0, "maxmemory_mb": 0, "maxmemory_policy": "string", "persistence": "rdb", "public_host": "string", "token": "string", "token_prefix": "string", "last_error": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "credentials": { "redis_host": "string", "redis_port": 0, "redis_url": "string", "rest_url": "string", "rest_token": "string", "token_required": true }, "stopped_reason": "org_suspended"}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
projectID*stringProject id.
The KV store, with its one-time token, and the provisioning job.
application/json- response
job*kv_store*A K/V store (CapyDB Knight/Valkyrie): the key-value and rate-limiting service. It runs in its own KV cell - the same isolated runtime primitive as a database cell - beside your database, on the same node, in the same region. Powered by Valkey; compatible with Redis® OSS clients and protocols. A project may have a K/V store with or without a database.
curl -X POST 'https://capydb.dev/api/capydb/v1/projects/string/kv'{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }, "kv_store": { "id": "string", "project_id": "string", "organization_id": "string", "host_id": "string", "state": "provisioning", "mem_max_mb": 0, "maxmemory_mb": 0, "maxmemory_policy": "string", "persistence": "rdb", "public_host": "string", "token": "string", "token_prefix": "string", "last_error": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "credentials": { "redis_host": "string", "redis_port": 0, "redis_url": "string", "rest_url": "string", "rest_token": "string", "token_required": true }, "stopped_reason": "org_suspended" }}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
projectID*stringProject id.
Deletion job accepted.
application/json- response
job*curl -X DELETE 'https://capydb.dev/api/capydb/v1/projects/string/kv'{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
projectID*stringProject id.
Connection details.
application/json- response
Connection details for a K/V store. rest_url with an access token works with any Redis®-compatible HTTP client. redis_url is the RESP-over-TLS endpoint for long-lived processes, and is the only one of the two that supports blocking commands and pub/sub. Both answer on the same hostname as the project's database, separated by port.
redis_host*stringredis_port*integerredis_url*stringRESP-over-TLS connection URL. The access token is the password. When token_required is true this URL omits it - only the token's hash is stored, so it cannot be reproduced - and you must splice in your saved token, or rotate to receive a complete URL.
rest_url*stringrest_token?stringPresent only in the create and rotate responses, which carry the token for the only time.
token_required*booleanTrue when redis_url carries no password and you must supply the token yourself.
curl -X GET 'https://capydb.dev/api/capydb/v1/projects/string/kv/credentials'{ "redis_host": "string", "redis_port": 0, "redis_url": "string", "rest_url": "string", "rest_token": "string", "token_required": true}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
projectID*stringProject id.
The KV store, with its new one-time token.
application/json- response
kv_store*A K/V store (CapyDB Knight/Valkyrie): the key-value and rate-limiting service. It runs in its own KV cell - the same isolated runtime primitive as a database cell - beside your database, on the same node, in the same region. Powered by Valkey; compatible with Redis® OSS clients and protocols. A project may have a K/V store with or without a database.
curl -X POST 'https://capydb.dev/api/capydb/v1/projects/string/kv/rotate-token'{ "kv_store": { "id": "string", "project_id": "string", "organization_id": "string", "host_id": "string", "state": "provisioning", "mem_max_mb": 0, "maxmemory_mb": 0, "maxmemory_policy": "string", "persistence": "rdb", "public_host": "string", "token": "string", "token_prefix": "string", "last_error": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "credentials": { "redis_host": "string", "redis_port": 0, "redis_url": "string", "rest_url": "string", "rest_token": "string", "token_required": true }, "stopped_reason": "org_suspended" }}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
projectID*stringProject id.
Flush job accepted.
application/json- response
job*curl -X POST 'https://capydb.dev/api/capydb/v1/projects/string/kv/flush'{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}