# x402 Doctor - Fix Broken x402 Endpoint

> x402 Doctor - Fix Broken x402 Endpoint is a paid API for AI agents from x402-doctor.fizzl.eu, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-10).

Diagnoses a broken x402 payment endpoint and returns concrete, stack-specific code fixes (Express, Next.js, Hono, or raw HTTP) with your own payTo, amount, network, and route filled in.

## Facts

- Endpoint: GET https://x402-doctor.fizzl.eu/api/v1/fix?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-doctor-fix-broken-x402-endpoint-3ff6827d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_B82ZfmAOM1JQxiBanXIae

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-doctor-fix-broken-x402-endpoint-3ff6827d
```

Example prompt: My x402 endpoint at https://api.myapp.com/premium-data is broken and I can't figure out why — can you diagnose it and give me the exact Express code to fix it?

## When to prefer this

Use this endpoint when you have an x402 payment endpoint that is misbehaving and you want both a diagnosis and ready-to-paste code fixes tailored to your specific server framework. Prefer this over the plain diagnosis endpoint when you need actionable code output, not just a description of what's wrong. It's ideal for automated CI workflows that need to self-heal x402 configurations or for developer agents that should suggest concrete pull-request-ready patches.

## Known failure modes

- Endpoint URL is not publicly reachable — returns error or empty fixes
- Stack auto-detection fails if server sends no recognizable framework headers (use 'stack' param to override)
- Endpoint is already correct — returns overall:pass with no fixes
- Invalid or malformed URL provided — request fails validation
- Endpoint behind auth or firewall that blocks the diagnostic probe

## How this service works

How do I fix my broken x402 endpoint? Diagnoses it, then returns per problem the concrete change as code for your stack (Express, Next.js, Hono or raw HTTP), filled in with your own payTo, amount, network and route.

## Output

Returns an overall status (pass/warn/fail), a summary, the detected server stack, and an array of fixes — each with a title, severity, explanation of why it's broken, ordered steps to resolve it, and ready-to-use code snippets labeled by stack (Express, Next.js, Hono, raw HTTP) with your actual payTo address, amount, network, and route already filled in.

## 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",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "Your x402 endpoint (public http(s) URL)."
      },
      "stack": {
       "enum": [
        "express",
        "next",
        "hono",
        "node",
        "python",
        "generic"
       ],
       "type": "string",
       "description": "Your stack, if detection from response headers is wrong. Default: detected."
      },
      "method": {
       "enum": [
        "GET",
        "POST"
       ],
       "type": "string",
       "description": "HTTP method of the endpoint. Default: try GET, then POST."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "url",
      "fixes"
     ],
     "properties": {
      "url": {
       "type": "string"
      },
      "fixes": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "title",
         "why",
         "steps",
         "code"
        ],
        "properties": {
         "why": {
          "type": "string"
         },
         "code": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "label": {
             "type": "string"
            },
            "stack": {
             "type": "string"
            },
            "snippet": {
             "type": "string"
            },
            "language": {
             "type": "string"
            }
           }
          }
         },
         "steps": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "title": {
          "type": "string"
         },
         "checks": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "recipe": {
          "type": "string"
         },
         "verify": {
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-doctor-fix-broken-x402-endpoint-3ff6827d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-doctor.fizzl.eu](https://www.zero.xyz/host/x402-doctor.fizzl.eu/llms.txt)
