# Named Counter Increment API

> Named Counter Increment API is a paid API for AI agents from x402-services-production.up.railway.app, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-23).

Increments a named counter by a specified amount, authenticated by a secret token, and returns the updated count

## Facts

- Endpoint: POST https://x402-services-production.up.railway.app/api/counter?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/named-counter-increment-api-6b870f50
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-cFQQbr9aiCcT1y4YPSGV

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 named-counter-increment-api-6b870f50 -d '<json body>'
```

Example prompt: Increment the counter named 'page-views' by 1 using my token 'abc123secret'.

## When to prefer this

Use this endpoint when you need a simple, persistent, named counter that can be incremented on demand without setting up a database or state management system. It is ideal for lightweight event tracking, call counting, or any scenario where a shared counter identified by name and claimed by a secret token suffices.

## Known failure modes

- Missing or invalid token — counter not claimed or unauthorized, returns error
- Counter name out of range (empty or >128 chars) — validation error
- Invalid increment amount (non-numeric) — returns 400-style error
- Counter not found or token mismatch — unauthorized response
- Service unavailable — Railway hosting downtime

## How this service works

Atomic counter: increment-and-return a named counter (collision-free running totals & IDs across agent runs). Send { name, token, by? }.

## Output

Returns the updated counter value after the increment is applied. The response reflects the new running total for the named counter associated with the provided token.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "name",
  "token"
 ],
 "properties": {
  "by": {
   "type": "number",
   "description": "Increment amount, default 1"
  },
  "name": {
   "type": "string",
   "description": "Counter name (1-128 chars)"
  },
  "token": {
   "type": "string",
   "description": "Your secret token (claims the counter)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/named-counter-increment-api-6b870f50/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-services-production.up.railway.app](https://www.zero.xyz/host/x402-services-production.up.railway.app/llms.txt)
