# x402 Payment Error Diagnostics

> x402 Payment Error Diagnostics is a paid API for AI agents from code-toll-production.up.railway.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-24).

Diagnoses a failed x402 payment by returning a structured error code, human-readable explanation, and exact remediation steps

## Facts

- Endpoint: GET https://code-toll-production.up.railway.app/diagnose?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-24
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-payment-error-diagnostics-b8c9c009
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dVJHJb8323pHJSZ8WyYIR

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 x402-payment-error-diagnostics-b8c9c009
```

Example prompt: My x402 payment just failed with an insufficient_funds error — my wallet has 0.003 USDC but the call requires 0.01 USDC. Can you diagnose what went wrong and tell me exactly how to fix it?

## When to prefer this

Choose this endpoint when an x402 or HTTP 402 payment has failed and you need a structured, actionable diagnosis with exact remediation steps — especially when building agents that need to self-heal from payment errors. Prefer it over generic error lookup services when the error is specifically in the x402 micropayment protocol context.

## Known failure modes

- Missing required 'error' query parameter — returns 400 bad request
- Unrecognized error code — may return generic or null explanation
- Service unavailable on Railway hosting — returns 503
- Malformed query parameters — returns 400 with validation error

## How this service works

Diagnose a failed x402 payment. Returns structured error code, human explanation, and exact fix. Example: /diagnose?error=insufficient_funds&balance=0.003&required=0.01

## Output

Returns a structured JSON object containing: a canonical error code, a plain-English explanation of why the payment failed, and a precise step-by-step fix the caller can act on immediately.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-payment-error-diagnostics-b8c9c009/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from code-toll-production.up.railway.app](https://www.zero.xyz/host/code-toll-production.up.railway.app/llms.txt)
