GENCODE · Pay per run with x402 on Base
Generate And Run Agent Code
Pay for code generation and secure sandbox execution only when work happens. Generate and run Python, JavaScript, TypeScript, and Solidity with built-in web3 tooling on Base.
x402 · pay per run
>>> agent.wallet.sign("x402") runtime ready (python) execute ▸ swap 50 USDC to 0.0132 ETH result ▸ {"txHash":"0xB7f5...a30d6b"} ✓ completed in 1.8s
Paid Agent Actions
Monetize generation and execution
Charge USDC for both code generation and sandbox execution with x402. Supports EOAs and ERC-1271 smart wallet signatures.
Agent-Ready
Codegen plus runtime in one surface
Generate playground-ready code, edit it, and execute it in the same flow with Ethereum, Base, and Solana tooling already installed.
Secure Runtime
Isolated cloud execution
Every run executes in an isolated environment with managed limits, timeouts, and sandbox controls.
Live Playground
Console
Awaiting execution...
API
Paid Endpoints
- POST /api/generate (x402 · generate code for a playground tab)
- POST /api/execute (x402 · run code in the sandbox)
- GET /api/specs
- GET /api/specs/:language
Shared Language Surface
- Python
- JavaScript
- TypeScript
- Solidity
- R
- Java
- Bash
Libraries
Built-In Libraries
Python · Crypto
- web3
- eth-account
- solana
- base58
- mnemonic
Python · Data
- numpy
- pandas
- matplotlib
Python · ML
- scikit-learn
Python · Utilities
- requests
- httpx
- pyyaml
JavaScript · Crypto
- ethers@6
- viem
- solc
- @solana/kit
- @scure/bip39
JavaScript · Data
- d3-array
- danfojs-node
- mathjs
JavaScript · ML
- ml-matrix
- ml-regression
Quickstart
cURL
# 1) request code generation
curl -si -X POST https://x402.gencode.run/api/generate \
-H "Content-Type: application/json" \
-d '{"prompt":"hello world","language":"python"}'
# 2) sign PAYMENT-REQUIRED to produce PAYMENT-SIGNATURE
# 3) replay with PAYMENT-SIGNATURE
curl -X POST https://x402.gencode.run/api/generate \
-H "Content-Type: application/json" \
-H "PAYMENT-SIGNATURE: <base64>" \
-d '{"prompt":"hello world","language":"python"}'
# same x402 flow for sandbox execution
curl -X POST https://x402.gencode.run/api/execute \
-H "Content-Type: application/json" \
-H "PAYMENT-SIGNATURE: <base64>" \
-d '{"code":"print(1+1)","language":"python"}'
# supports EOAs and ERC-1271 smart wallets on Base
Generate Request
- prompt string (required)
- language string (required)
- provider string (optional; e.g. gemini)
Execute Request
- code string (required)
- language string (optional; defaults to python)
Generate Response
{
"success": true,
"output": {
"code": "print('hello world')"
}
}
Execute Response
{
"success": true,
"output": {
"text": "2"
}
}
Limits
- timeout 30s
- max code 10k
- price Loading price...