POST

Run Python 3 code in an isolated sandbox with optional stdin and args; returns stdout, stderr, and exit code. Powered by self-hosted Piston

/v1/code/run/python

Web · piston

Request → Response

Examples from schemas.json.

Requestapplication/json
POST /v1/code/run/python
Content-Type: application/json

{
  "code": "example",
  "stdin": "example",
  "args": [
    "string"
  ]
}
Responseapplication/json
HTTP/1.1 200 OK
Content-Type: application/json

// Endpoint-specific body after 402 settlement

Overview

Run Python 3 code in an isolated sandbox with optional stdin and args; returns stdout, stderr, and exit code. Powered by self-hosted Piston.

Request schema

Body: JSON · application/json

FieldTypeDescription
codestringrequired
stdinstringoptional
argsarrayoptional
IMPLEMENTATION
curl -X POST https://api.tools402.dev/v1/code/run/python \
  -H "Content-Type: application/json" \
  -d '{
  "code": "example",
  "stdin": "example",
  "args": [
    "string"
  ]
}'

402 payment flow omitted — see Integrations for settlement.