# KG-NINJA Agent Error Fix Receipt KG-NINJA provides a small paid x402 endpoint for AI agents and developers. Paid endpoints: POST /fix-error POST /summarize-url POST /shell-risk-check POST /agent-visibility-report Free preview: GET /fix-error/preview Pricing: GET /pricing.json x402 config: GET /x402/config Human explanation: GET /buy Purpose: Submit a failing command, error message, or log snippet. Receive a concise JSON repair receipt containing root cause, one next command, retry plan, risk note, and prevention note. You can also summarize a public URL or score the risk of a shell command before execution. Fast start: - GET /catalog.json for existing offers, limits, input examples and free alternatives - POST /match with either need or intent, max_price_usdc (decimal string) and network (eip155 identifier) for free goal matching; no purchase or authorization occurs - GET /offers.json or /offers.xml to opt in to offer revision updates; filter by intent, max_price_usdc and network, poll hourly, and deduplicate by item.id - GET /find for human goal matching and subscription links - GET /goal for the primary buyer, pain, result, CTA, and paid endpoint - GET /agent.json for machine-readable metadata - GET /payment-options.json for x402 payment details - GET /openapi.json for request/response contracts - GET /proof.json for machine-readable x402 mainnet paid flow proof - GET /proof.md for human-readable proof and cautious interpretation - GET /share-card.json for concise social/share metadata - GET /capabilities for the paid routes and payment protocol - GET /buy for a human-readable landing page Autonomous purchase decision: - Use the autonomous_purchase contract in /agent.json, including its buy/skip criteria. - Preview is a fixed sample; paid output is deterministic triage, not an executed or guaranteed fix. - Buy only within an existing authorized wallet budget; validate price, network, asset and recipient. - Do not authorize a second payment while the first payment or delivery is unresolved. - Verify the result schema and settlement evidence; 402 alone is not revenue or delivery. Agent payment flow: 1. Read /agent.json 2. Read /goal 3. Read /payment-options.json 4. Read /.well-known/x402/discovery/resources 5. POST /fix-error without payment to receive 402 5b. POST /hyperxosist-query without payment to receive 402 6. Retry POST /fix-error with x402 payment 7. Expect 200 paid response First-time agent path: 1. Read /.well-known/x402/discovery/resources 2. Read /agent.json 3. Read /payment-options.json 4. Read /goal 5. POST /fix-error, /hyperxosist-query, or /agent-visibility-report without payment to receive 402 6. Retry with x402 payment proof 7. Expect 200 paid response When to use /fix-error: - A command, build, deployment, API call, or service check failed and the next action is unclear. - A retry produced a new error or failed at a different stage. - The runtime, dependency version, environment, or deployment target changed. - A machine-readable diagnosis is needed before automation continues. Complete request examples: {"command":"npm run build","error":"Error: Cannot find module 'hono'","environment":"Node.js Cloudflare Worker build"} {"command":"npm run deploy","error":"401 Unauthorized: API token invalid","environment":"CI deployment"} {"command":"curl http://127.0.0.1:3000/health","error":"Connection refused","environment":"Linux service"} What you receive after payment: - HTTP 200 with one JSON repair receipt. - Fields: root_cause, next_command, retry_plan, risk_note, prevention_note, generated_at. - Apply the receipt, then submit only a new or materially changed error as another request. Expected output schema: {"type":"object","required":["root_cause","next_command","retry_plan","risk_note","prevention_note","generated_at"],"properties":{"root_cause":{"type":"string"},"next_command":{"type":"string"},"retry_plan":{"type":"array","items":{"type":"string"}},"risk_note":{"type":"string"},"prevention_note":{"type":"string"},"generated_at":{"type":"string","format":"date-time"}}} Complete response example: {"root_cause":"The build cannot resolve the hono package from the current project dependencies.","next_command":"npm install hono","retry_plan":["Install the missing dependency.","Run npm run build again.","If the error remains, verify package.json and the active working directory.","Submit the new error output as a separate /fix-error request."],"risk_note":"Review package changes before deployment. Do not include tokens or secrets in error logs.","prevention_note":"Commit the lockfile and run dependency installation before the build step.","generated_at":"2026-06-14T00:00:00.000Z"} Repeat-use scenarios: - Submit the new error after applying the previous receipt's next command. - Submit the failure again after changing dependencies, runtime, or environment. - Submit each distinct build or deployment failure stage separately. - Use a new request when fresh logs add evidence. - Do not repeat an unchanged request unless the execution context changed. Agent Visibility Report: - Endpoint: POST /agent-visibility-report - Purpose: returns a privacy-safe report about machine discoverability and payment readiness. - Unpaid request: returns 402 Payment Required. - Paid request: returns structured JSON with scores, gaps, matched discovery patterns, and next fix. - Paid value: observed machine-discovery patterns, payment-readiness scoring, metadata gaps, and one actionable next fix. - Privacy: aggregate-only; no raw IP, raw User-Agent, wallet address, receipt, tx hash, or event-level log is exposed. Payment: x402 required for POST /fix-error. x402 required for POST /summarize-url. x402 required for POST /shell-risk-check. x402 required for POST /agent-visibility-report. Current mode: mainnet. Current network: eip155:8453. Current price: $0.01. Real revenue: true only after settled mainnet payment. Trust signal: mainnet_paid_flow_verified: true Proof JSON: /proof.json Proof page: /proof.md Share card: /share-card.json Safe claim: This service can complete a real x402 mainnet paid API flow. Not claiming: a fully autonomous AI independently chose to buy, attribution to any specific company, or recurring external revenue yet. Safety: This service does not guarantee a fix. It provides diagnostic guidance only. It avoids destructive commands by default.