$0.1
per call · USD Coin on Base
Run Python in a throwaway container with no network and a read-only filesystem, and report what it did against the caller's examples.
Endpoint
POST https://api.statemind.ai/v1/x402/execute1
Calls / 30d
1
Unique payers / 30d
Aug 16
Last called
exact
Payment scheme
Call this service
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/execute", {
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 -X POST \
"https://api.statemind.ai/v1/x402/execute" \
-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
0xaa7116cdda58286f4cda40c6f735762c22447104USD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913Is this your API?
Pin it to the top of Developer Tools and the homepage with a featured placement.
More from Python Code Validator & similar services
Python Code Validator · Static
api.statemind.ai
Check Python for syntax errors, lint and type mistakes, unsafe constructs and hardcoded credentials, and against the examples the caller supplies, without running it.
Python Code Validator · Repair
api.statemind.ai
Return corrected Python for code that fails those checks: the fix is applied and re-checked, and only returned when it holds.
Loyalspark · Recipient API Offers
api.loyalspark.online
Onchain loyalty platform on Base Network. Businesses launch branded rewards in minutes, customers earn real value with every purchase, and AI agents automate the rest via REST and MCP. Free plan mints up to 1,000 tokens per month; every call is scoped by row-level security to the wallet behind the API key. 16 skill guides at loyalspark.online/.well-known/skills/index.md.