# AgentBit Counter

> AgentBit Counter is a paid API for AI agents from agentbit.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-13).

Provides an atomic per-agent integer counter with increment, decrement, get, set, and reset operations scoped to the calling wallet.

## Facts

- Endpoint: POST https://agentbit.app/v1/memory/counter?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentbit-counter-9a407b9c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rRY26nBsagNX1r-W3d0vr

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 agentbit-counter-9a407b9c -d '<json body>'
```

Example prompt: Increment my counter named 'api-calls-today' by 1 in the 'rate-limits' namespace and tell me the new value.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Atomic per-agent integer counter (incr/decr/get/set/reset), scoped to the paying wallet. For tallies, quotas, sequence numbers.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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)."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentbit-counter-9a407b9c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentbit.app](https://www.zero.xyz/host/agentbit.app/llms.txt)
