# 24K Labs AI Debug Assist

> 24K Labs AI Debug Assist is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.2/call, status unknown (last checked 2026-09-15).

Analyzes code snippets using Claude AI to diagnose bugs, explain errors, and suggest fixes, billed per request in USDC on Base L2.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/debug-assist
- Price: $0.2/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/24k-labs-ai-debug-assist-a1ebf8f0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PJJ9O_FPMxlzb_Pl2eJNe

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 24k-labs-ai-debug-assist-a1ebf8f0 -d '<json body>'
```

Example prompt: Can you debug this Python function for me? It keeps returning None when it should return a list — here's the code: `def get_items(db): results = db.query('SELECT * FROM items') return results` — the language is Python.

## When to prefer this

Choose this endpoint when an AI agent needs to programmatically debug code snippets without a subscription or API key, paying only $0.20 USDC per call on Base L2. Ideal for autonomous agents that encounter runtime errors during code execution and need on-demand AI-powered diagnosis. Best suited when you need Claude-quality debugging without setting up a full Anthropic API account.

## Known failure modes

- Missing or empty code field returns an error response
- Unsupported or ambiguous language may reduce diagnostic accuracy
- Payment failure (insufficient USDC balance) blocks the request via x402 protocol
- Very large code snippets may exceed token limits or increase cost
- Malformed JSON input may result in a 400 error

## How this service works

Find bugs, explain errors, suggest fixes.

## Output

A JSON object containing the Claude model used (e.g. claude-sonnet-4-5), a natural-language explanation of the bug or issue found in the code with suggested fixes, and the number of tokens consumed by the request.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "code": {
   "type": "string",
   "description": "Primary input content"
  },
  "context": {
   "type": "string",
   "description": "Optional context or instructions"
  },
  "language": {
   "type": "string",
   "description": "Programming language (code services)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "claude-sonnet-4-5",
  "result": "The variable is None at that point. Check for a missing return...",
  "tokens_used": 220
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-ai-debug-assist-a1ebf8f0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
