P

Python Code Validator · Static

by Python Code Validator

POSTBase

$0.01

per call · USD Coin on Base

Check Python for syntax errors, lint and type mistakes, unsafe constructs and hardcoded credentials, and against the examples the caller supplies, without running it.

Endpoint

POST https://api.statemind.ai/v1/x402/static

4

Calls / 30d

2

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.statemind.ai/v1/x402/static", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "code": "def bitcount(n):\n    count = 0\n    while n:\n        n ^= n - 1\n    return count\n",
    "options": {
      "examples": "assert bitcount(127) == 7\nassert bitcount(0) == 0"
    }
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://api.statemind.ai/v1/x402/static" \
  -H "Content-Type: application/json" \
  -d '{"code":"def bitcount(n):\n    count = 0\n    while n:\n        n ^= n - 1\n    return count\n","options":{"examples":"assert bitcount(127) == 7\nassert bitcount(0) == 0"}}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "diagnostics": [
    {
      "code": "python:example-mismatch",
      "message": "assert bitcount(127) == 7 failed: the code loops forever",
      "severity": "error"
    }
  ],
  "fixed_code": "def bitcount(n):\n    count = 0\n    while n:\n        n &= n - 1\n        count += 1\n    return count\n",
  "score": 0.4,
  "valid": false
}

Payment details

Pay to0xaa7116cdda58286f4cda40c6f735762c22447104
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 Python Code Validator & similar services