Telnyx Storage: KV — Documentation Index
KV documentation within the Storage section of the Telnyx developer docs (https://developers.telnyx.com). Root index: https://developers.telnyx.com/llms.txt · Storage index: https://developers.telnyx.com/development/llms/storage-llms-txt.md · Full content for this subsection: https://developers.telnyx.com/development/llms/storage-kv-llms-full-txt.md
Get Started
- KV: Telnyx KV is globally distributed key-value storage for low-latency reads from edge functions. Use it through the function binding or the REST API.
- Quick Start: Create a KV namespace, bind it to your edge function, and read or write data — through the function binding or the REST API.
Concepts
- How KV Works: The Telnyx KV data model: path-like keys, opaque byte values, optional server-side TTL, no per-key metadata, and a single global store with read-your-writes consistency.
- Key Expiration: Telnyx KV supports server-side TTL — set it when writing through the binding, as a REST parameter, or with a CLI flag — so keys expire automatically.
Examples
- Session Storage: Store user sessions at the edge with Telnyx KV and expire them with a server-side TTL.
- API Response Caching: Cache expensive upstream API responses at the edge with Telnyx KV and a short server-side TTL.
- Feature Flags: Read feature flags on the request path from Telnyx KV and flip them without redeploying.
Reference
- Overview: The KV runtime API — the methods available on a bound namespace, plus their option and result types.
- KvNamespace: The KV binding’s runtime API — read, write, delete, and list on a bound namespace, with option and result types and their behavior.
- CLI: Manage Telnyx KV namespaces and keys from your terminal with the CLI — create, list, put, get, and delete.
- Best Practices: Practical guidance for Telnyx KV: naming keys, serializing values, and handling missing keys.
Platform
- Pricing: Pricing for Telnyx KV: free tier limits and per-million-operation rates for reads, writes, deletes, and lists, with free egress.
API Reference (KV)
kv namespaces
- List KV namespaces: Lists the KV namespaces for the authenticated user’s organization. Results use page-based pagination (
page[number]/page[size]). - Create a KV namespace: Creates a new KV namespace. Provisioning is asynchronous: the namespace is returned with status
pendingand becomes usable once it reachesprovision_ok. - Get a KV namespace: Retrieves a KV namespace by its ID, including its provisioning status.
- Delete a KV namespace: Deletes a KV namespace and all of the keys it contains. Deletion is asynchronous: the namespace is returned with status
deleting. Deleting a namespace whose…
kv keys
- List keys: Lists the keys in a namespace. Returns key names and metadata only, never values. Results are paginated with
limitand an opaquecursor. - Get a key’s value: Returns the raw stored value for a key. The response body is the value exactly as it was written; the
Content-Typeheader echoes the value’s stored content t… - Set a key’s value: Creates or replaces the value for a key. The request body is stored verbatim as the value — no base64, no JSON envelope — up to 1 MiB. The request’s `Content-T…
- Delete a key: Deletes a key. Idempotent: deleting a key that does not exist still succeeds. The namespace itself must exist and be provisioned.