# 2s Agent Memory Put

> 2s Agent Memory Put is a paid API for AI agents from 2s.io, paid per call via x402, $0.0012/call, status unknown (last checked 2026-09-14).

Stores or updates a key-value pair in persistent agent memory with optional TTL, returning the stored item's metadata.

## Facts

- Endpoint: POST https://2s.io/api/agent/memory/put
- Price: $0.0012/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Success rate: 0% of calls made through Zero
- Activations on Zero: 3
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-agent-memory-put-da6528cc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Y2ZOvgouUars6Dmg8xk-I

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-agent-memory-put-da6528cc -d '<json body>'
```

Example prompt: Remember the value {"status":"active","score":42} under the key 'projects/2026/q1' in agent memory — keep it for 7 days (604800 seconds).

## When to prefer this

Use this endpoint when an AI agent needs to persist arbitrary JSON state between sessions or tool calls without signing up for a dedicated storage service. Ideal for lightweight stateful memory where pay-per-use pricing is preferred over monthly storage subscriptions, and when the agent already operates within the 2s.io x402 payment ecosystem.

## Known failure modes

- Key contains invalid characters (outside A-Za-z0-9._/-) — validation error returned
- Value exceeds 64 KiB serialized — payload too large error
- TTL outside range 1..31536000 — invalid parameter error
- Payment fails or insufficient USDC balance — 402 Payment Required
- Key not provided — missing required field error

## How this service works

The (most) everything API: one pay-per-call API giving AI agents ground-truth data across hundreds of endpoints — public records, finance, crypto, security, legal, health, geo, and EDI. USDC via x402, no signup, no API keys.

## Output

Returns a JSON object with ok:true and an items array containing the stored entry's key, etag, createdAt, updatedAt, expiresAt, and sizeBytes. Confirms successful write.

## Example request

```json
{
 "key": "test-memory-entry",
 "value": {
  "message": "Hello from QA test",
  "timestamp": "2024-01-15T10:30:00Z"
 },
 "ttlSeconds": 3600
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "key": {
   "type": "string",
   "description": "1-200 chars from [A-Za-z0-9._/-]."
  },
  "value": {
   "description": "Arbitrary JSON (object/array/scalar). Max 64 KiB serialized."
  },
  "ttlSeconds": {
   "type": "integer",
   "description": "Optional TTL 1..31536000. Omit for no expiry."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "data",
  "meta"
 ],
 "properties": {
  "data": {
   "type": "object",
   "required": [
    "ok",
    "items",
    "total",
    "source"
   ],
   "properties": {
    "ok": {
     "type": "boolean"
    },
    "items": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "key",
       "etag",
       "createdAt",
       "expiresAt",
       "sizeBytes",
       "updatedAt"
      ],
      "properties": {
       "key": {
        "type": "string"
       },
       "etag": {
        "type": "string"
       },
       "createdAt": {
        "type": "string"
       },
       "expiresAt": {
        "type": "string"
       },
       "sizeBytes": {
        "type": "number"
       },
       "updatedAt": {
        "type": "string"
       }
      }
     }
    },
    "total": {
     "type": "number"
    },
    "source": {
     "type": "object",
     "required": [
      "url",
      "license",
      "provider"
     ],
     "properties": {
      "url": {
       "type": "string"
      },
      "license": {
       "type": "string"
      },
      "provider": {
       "type": "string"
      }
     }
    }
   }
  },
  "meta": {
   "type": "object",
   "required": [
    "cost",
    "caller",
    "version",
    "endpoint",
    "settlement"
   ],
   "properties": {
    "cost": {
     "type": "object",
     "required": [
      "usd",
      "tier"
     ],
     "properties": {
      "usd": {
       "type": "number"
      },
      "tier": {
       "type": "number"
      }
     }
    },
    "caller": {
     "type": "string"
    },
    "version": {
     "type": "null"
    },
    "endpoint": {
     "type": "string"
    },
    "settlement": {
     "type": "object",
     "required": [
      "txHash",
      "network",
      "success"
     ],
     "properties": {
      "txHash": {
       "type": "string"
      },
      "network": {
       "type": "string"
      },
      "success": {
       "type": "boolean"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-agent-memory-put-da6528cc/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)
