E

Explain Code · Explain Code

by Explain Code

POSTBase

$0.05

per call · USD Coin on Base

Clear explanation of what code does, how it works, and why.

Endpoint

POST https://api.24klabs.ai/api/explain-code

4

Calls / 30d

1

Unique payers / 30d

Aug 30

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://api.24klabs.ai/api/explain-code", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "code": "def fib(n): return n if n < 2 else fib(n-1)+fib(n-2)",
    "language": "python"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://api.24klabs.ai/api/explain-code" \
  -H "Content-Type: application/json" \
  -d '{"code":"def fib(n): return n if n < 2 else fib(n-1)+fib(n-2)","language":"python"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "model": "claude-haiku-4-5",
  "result": "This function computes Fibonacci numbers recursively...",
  "tokens_used": 180
}

Payment details

Pay to0xe73d86f185be79a33b0318d881b71f2a24371114
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Developer Tools and the homepage with a featured placement.

Get featured →

More from Explain Code & similar services