{
  "x402Version": 1,
  "service": "tulimoa-memory",
  "description": "Persistent memory for AI agents: episodes by day, sleep-time consolidation into a knowledge graph, associative recall. The memory layer that shrinks your token bill.",
  "payments_enabled": true,
  "network": "base",
  "asset": {
    "symbol": "USDC",
    "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "decimals": 6
  },
  "payTo": "0xCfA1CA67657a336e51d6D83fa9109c99903efCdb",
  "pricing": {
    "per_call_micro_usd": 2000,
    "pay_per_call": true,
    "min_topup_micro_usd": 10000,
    "batch_units_per_call_price": 10,
    "batch_note": "POST /ingest and POST /import cost one call price per 10 units (an episode at /ingest, a ~900 character chunk at /import). The 402 challenge on those endpoints names the exact amount for your payload.",
    "storage_tiers": [
      {
        "tier": 0,
        "from_units": 0,
        "fee_micro_usd_per_day": 0,
        "librarian_budget_tokens": 40000
      },
      {
        "tier": 1,
        "from_units": 5000,
        "fee_micro_usd_per_day": 30000,
        "librarian_budget_tokens": 100000
      },
      {
        "tier": 2,
        "from_units": 50000,
        "fee_micro_usd_per_day": 150000,
        "librarian_budget_tokens": 170000
      },
      {
        "tier": 3,
        "from_units": 500000,
        "fee_micro_usd_per_day": 150000,
        "librarian_budget_tokens": 170000
      }
    ],
    "storage_note": "The per-call price never changes. Once a memory reaches the free threshold, a small daily fee is debited from the balance for the librarian that consolidates it every night. It buys librarian capacity, not permission. Units are live knowledge nodes plus live durable episodes (remember is durable by default, imports are always durable); non-durable ingest episodes expire after 30 days and do not count. Forgetting lowers the bill. If the balance cannot cover the fee, nightly consolidation pauses and recall keeps working; an unpaid fee never deletes anything.",
    "note": "micro-USD = USDC atomic units (1e-6). True pay as you go: a tools/call POST to /mcp with an X-PAYMENT header paying exactly per_call_micro_usd settles that one call, no minimum and no balance needed. min_topup applies only to voluntary balance top-ups (/register, /topup). Registration IS the first top-up; there is no separate signup."
  },
  "endpoints": {
    "register": "POST https://memory.tulimoa.com/register",
    "topup": "POST https://memory.tulimoa.com/topup",
    "mcp": "POST https://memory.tulimoa.com/mcp (Authorization: Bearer <api_key>)",
    "ingest": "POST https://memory.tulimoa.com/ingest (batch episodes, one call price per 10)",
    "import": "POST https://memory.tulimoa.com/import (one document, one call price per 10 chunks)"
  },
  "quickstart": [
    "1. POST https://memory.tulimoa.com/register (no payment header) -> HTTP 402 with payment requirements",
    "2. Sign an EIP-3009 transferWithAuthorization for exactly maxAmountRequired USDC, base64-encode the payment payload, retry with the X-PAYMENT header",
    "3. Response 201: {tenant_id, api_key} — store the key, it is shown exactly once",
    "4. Connect MCP: POST https://memory.tulimoa.com/mcp with Authorization: Bearer <api_key>",
    "5. Pay as you go: with zero balance, any tools/call answers HTTP 402 — retry it with an X-PAYMENT header paying exactly per_call_micro_usd (from your account wallet). One payment, one call, no minimum.",
    "6. Or keep a balance: POST https://memory.tulimoa.com/topup (same x402 flow, min min_topup_micro_usd) to skip the payment roundtrip per call. Lost key? POST /register again from the same wallet.",
    "7. Optional: call tulimoa__link_account (free) to get a code a human can redeem at https://tulimoa.com/app/memory, and to register an email or webhook for low balance warnings."
  ],
  "terms": {
    "storage_fee": "Debited daily from the balance once the memory exceeds the free threshold. Warnings go out 7, 3 and 1 day ahead through every configured channel.",
    "refunds": "No refunds; unused balance is forfeited on GDPR erasure (we cannot send funds — no private key on this service).",
    "daily_cap": "Default $5/day spend cap per account as runaway protection; contact accounts@tulimoa.com to raise it.",
    "privacy": "https://tulimoa.com/privacy"
  }
}