---
title: "LLM CODE DEBUGGING — POST {code, error} and get a diagnosis"
method: POST
path: "/api/debug-code"
tags: ["AI Utilities"]
---

# LLM CODE DEBUGGING — POST {code, error} and get a diagnosis

`POST /api/debug-code`

## Request

- Base URL: `https://api.webbersites.com`
- URL: `https://api.webbersites.com/api/debug-code`
- Auth: API key in header `X-PAYMENT`

LLM CODE DEBUGGING — POST {code, error} and get a diagnosis: what is wrong, the root cause, and a concrete fix with corrected code. Paste the failing snippet plus the error message or stack trace; any language, up to 20,000 chars combined. Optional {language} and {context} ('happens only on the second call'). Fast cheap LLM under the hood. Want deterministic no-AI lint instead? POST /api/lint/:language ($0.002).

Price: $0.01 per call, paid in USDC via the x402 protocol (see the x402 security scheme).

## Request body

- object
  - `code` string, required: The failing code snippet (required)
  - `error` string: Error message, stack trace, or a description of the wrong behavior
  - `language` string: Optional language hint, e.g. python, javascript, elixir
  - `context` string: Optional extra context: what you expected, when it happens, what you tried

## Response `200`

Success

- object
  - `diagnosis` string: what is wrong, in plain language
  - `root_cause` string
  - `fix` string: the concrete change to make
  - `fixed_code` string: corrected version of the snippet, when applicable
  - `confidence` string: high, medium, or low
  - `model` string
  - `usage` object

## Other responses

- `402`: Payment required — the response body lists accepted payment methods (amount, asset, network, pay-to address). Retry the request with a signed X-PAYMENT header.

---

[API](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api.md) · [All operations](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api/revisions/c14a76c67a94?raw)
