# 2s KV Store — Get Key

> 2s KV Store — Get Key is a paid API for AI agents from 2s.io, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Reads a value from a namespaced key-value store by key name, returning the stored value and its expiry metadata.

## Facts

- Endpoint: POST https://2s.io/api/store/kv-get
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-kv-store-get-key-58f691e3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bmD2rOIDNLBqXSDT8-hOm

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 2s-kv-store-get-key-58f691e3 -d '<json body>'
```

Example prompt: Retrieve the value stored under the key 'session-token' in the namespace 'user-auth' from the 2s key-value store.

## When to prefer this

Use this endpoint when you need to read a previously stored value from 2s.io's namespaced key-value store, particularly in agent workflows where you need to retrieve persisted state, cached data, configuration, or agent memory without managing your own storage infrastructure. It is ideal for stateless agents that need lightweight, pay-per-call persistent storage accessible across calls.

## Known failure modes

- Key not found — items array is empty, total is 0
- Namespace does not exist — empty result set returned
- Missing required fields (ns or key) — request rejected with error
- Network timeout or upstream storage unavailability — request fails
- Expired key — may return empty items if TTL has elapsed

## How this service works

The (most) everything API: 575+ pay-per-call endpoints for AI agents — ground-truth data, a full AI gateway, and agent infrastructure (storage, queues, watchers). USDC via x402, no signup, no API keys, and upto billing: pay actual usage, not the quote.

## Output

Returns a JSON object with ok=true, an items array containing objects with the key name, stored value, and expiresAt timestamp, the total count of matching rows, and source provenance metadata (provider, URL, license).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "ns": {
   "type": "string",
   "description": "Namespace the key lives in."
  },
  "key": {
   "type": "string",
   "description": "Key to read."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-kv-store-get-key-58f691e3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
