# Onchain & Trading Intelligence — Idempotency Key Management

> Onchain & Trading Intelligence — Idempotency Key Management 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-09-14).

Registers or validates an idempotency key with a TTL to ensure pay-per-call trading intelligence requests are not double-billed or duplicated.

## Facts

- Endpoint: POST https://x402-services-production.up.railway.app/api/idempotency
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchain-trading-intelligence-idempotency-key-management-5c0c9b5b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6woMVZxVhoaCmFlWe-buR

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 onchain-trading-intelligence-idempotency-key-management-5c0c9b5b -d '<json body>'
```

Example prompt: Register an idempotency key 'trade-req-20240615-001' with my secret token and set it to expire in 3600 seconds so my trading agent doesn't double-pay for a duplicate call.

## When to prefer this

Use this endpoint before any pay-per-call trading intelligence tool call when you need to guarantee exactly-once billing semantics — particularly when network retries, agent restarts, or parallelism could cause the same logical request to be submitted more than once. Essential for high-frequency trading agents, fleet deployments, or any workflow where a duplicate $0.003 charge per call would compound at scale.

## Known failure modes

- Missing required 'key' or 'token' field returns a 400 validation error
- Invalid or unauthorized token returns a 401/403 response
- Key already exists returns a conflict or duplicate-detected response
- TTL value out of acceptable range may return a validation error
- Service unavailability on Railway returns a 502/503

## How this service works

Idempotency key: returns firstTime:true only once per key within ttl (dedupe retries/double-sends). Send { key, token, ttlSec? }.

## Output

Returns a confirmation that the idempotency key has been registered along with its expiry time. If the key already exists, indicates a duplicate request so the caller can suppress the re-submission and avoid paying again.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "key",
  "token"
 ],
 "properties": {
  "key": {
   "type": "string",
   "description": "Idempotency key"
  },
  "token": {
   "type": "string",
   "description": "Your secret token"
  },
  "ttlSec": {
   "type": "number",
   "description": "TTL seconds, default 86400"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchain-trading-intelligence-idempotency-key-management-5c0c9b5b/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)
