{"uid":"cap_rRY26nBsagNX1r-W3d0vr","slug":"agentbit-counter-9a407b9c","name":"AgentBit Counter","description":"Atomic per-agent integer counter (incr/decr/get/set/reset), scoped to the paying wallet. For tallies, quotas, sequence numbers.","url":"https://agentbit.app/v1/memory/counter?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"key":{"type":"string","description":"The counter key."},"value":{"type":"integer","description":"Value for set."},"amount":{"type":"integer","description":"Step for incr/decr (default 1)."},"namespace":{"type":"string","description":"Optional group (default \"default\")."},"operation":{"enum":["incr","decr","get","set","reset"],"type":"string","description":"What to do."},"ttl_seconds":{"type":"integer","description":"Optional expiry in seconds (max 90 days; omit for none)."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_FaknYxLRS8qcfLVX6ei2i","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Provides an atomic per-agent integer counter with increment, decrement, get, set, and reset operations scoped to the calling wallet.","exampleAgentPrompt":"Increment my counter named 'api-calls-today' by 1 in the 'rate-limits' namespace and tell me the new value.","exampleUseCases":[{"title":"API rate-limit quota enforcement","prompt":"Decrement my 'requests-remaining' counter by 1 in the 'quota' namespace and tell me the new value so I know if I'm about to hit my limit."},{"title":"Per-session sequence number generation","prompt":"Increment the 'order-seq' counter by 1 in the 'orders' namespace and give me the resulting value to use as my next order ID."},{"title":"Resetting a daily usage tally","prompt":"Reset my 'daily-calls' counter to 0 in the 'metrics' namespace — I want to start fresh for the new day."}],"resultDescription":"Returns the updated integer value of the named counter after the requested operation, along with the key and namespace. For 'get', returns the current value without modification. For 'reset', returns 0. Includes any TTL metadata if expiry was set.","failureModes":["Key not found on 'get' or 'decr' before first 'set'/'incr' — may return 0 or error","Invalid operation enum value — returns 400 bad request","TTL exceeds 90-day maximum — rejected with validation error","Missing required 'key' or 'operation' fields — 400 error","Counter value integer overflow — undefined behavior for very large values","Payment failure or wallet scope mismatch — 402 or 403 error"],"whenToPreferThis":"Choose this endpoint when your agent needs lightweight, persistent integer state scoped to its own wallet identity — for rate limiting, tallying events, generating monotonic sequence numbers, or enforcing quotas — without spinning up a full database. Ideal for stateless agents that need a single shared counter across multiple calls or sessions, and when atomic increment/decrement semantics matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T06:42:44.304Z","isFirstParty":false,"canonicalSlug":"agentbit-counter-9a407b9c"}