{"uid":"cap_Ewwgy-hJy8VSwgLYwHs3r","slug":"blockrun-ai-4754e82d","name":"BlockRun.AI Managed Python Sandbox Create","description":"Create a managed Python 3.11 sandbox. Two billing modes selected by 'timeout': ≤300s = flat rate (CPU $0.01, GPU varies). >300s = per-hour billing for the full requested lifetime, no refund on early terminate. Max 24h.","url":"https://blockrun.ai/api/v1/modal/sandbox/create","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"cpu":{"type":"number","description":"CPU cores (max 1 CPU-only, 8 for GPU sandboxes, default: 1)"},"gpu":{"type":"string","description":"Optional GPU type. One of: T4, L4, A10G, A100, H100. Flat (≤300s): T4 $0.05, L4 $0.08, A10G $0.1, A100 $0.2, H100 $0.4. Hourly: T4 $1.5, L4 $2, A10G $2.5, A100 $4, H100 $8/hour."},"image":{"type":"string","description":"Managed image. Only `python:3.11` is currently available."},"memory":{"type":"number","description":"Memory in MB (max 1024 CPU-only, 32768 for GPU sandboxes, default: 512)"},"timeout":{"type":"number","description":"Sandbox lifetime in seconds (max 86400 = 24h, default: 300). >300s switches to hourly billing."}}},"responseSchema":null,"example":{"request":{"image":"python:3.11"},"response":{"config":{"cpu":1,"gpu":null,"image":"python:3.11","memory":512,"timeout":300},"status":"running","created_at":"2026-05-29T23:45:55.856722+00:00","sandbox_id":"sb-H0Tnpm1iOwAKIJXfZVpc7E"}},"exampleRequest":{"image":"python:3.11"},"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"1.00","reviews":0,"stars":null,"state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.011","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.011","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_46Q9X1YuPCRC8OmNZxU-r","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.011","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Creates a managed Python 3.11 sandbox with configurable CPU, GPU, memory, and lifetime, using flat-rate or hourly billing depending on timeout duration.","exampleAgentPrompt":"Spin up a managed Python 3.11 sandbox on BlockRun with 4 CPU cores, 8192 MB of memory, a T4 GPU, and a 600-second lifetime so I can run a machine learning job.","exampleUseCases":[{"title":"GPU sandbox for model fine-tuning","prompt":"Create a Python 3.11 sandbox on BlockRun with an A10G GPU, 16 GB of memory, 8 CPU cores, and a 2-hour lifetime so I can fine-tune a small language model on my custom dataset."},{"title":"Quick data processing script runner","prompt":"Spin up a flat-rate Python 3.11 sandbox with 2 CPU cores and 4096 MB of memory for about 3 minutes — I just need to run a quick data transformation script without setting up any infrastructure."},{"title":"Isolated environment for AI inference","prompt":"Launch a managed BlockRun sandbox with an L4 GPU, 8 CPU cores, 12 GB of RAM, and a 1-hour lifetime so I can load a computer vision model and run batch inference on a set of images."}],"resultDescription":"Returns a sandbox object including a unique sandbox ID, connection details, and metadata about the provisioned environment (CPU, GPU, memory, timeout, billing mode). The sandbox is ready to accept command execution calls.","failureModes":["Invalid GPU type specified — must be one of T4, L4, A10G, A100, H100","CPU cores exceed limit — CPU-only sandboxes max 1 core, GPU sandboxes max 8","Memory exceeds limit — CPU-only max 1024 MB, GPU max 32768 MB","Timeout exceeds 86400 seconds (24h)","Payment failure — insufficient USDC balance or x402 payment rejected","Image not available — only python:3.11 is currently supported","Billing mode mismatch — timeout >300s triggers hourly billing without proration on early termination"],"whenToPreferThis":"Use this endpoint when you need an isolated, managed Python 3.11 execution environment with configurable resources, especially when GPU acceleration (T4, L4, A10G, A100, H100) is required. Prefer over raw cloud VM provisioning when you want a flat-rate short job (≤300s) or a longer-lived hourly-billed environment without managing infrastructure. Best for agentic workflows that need to programmatically create and execute sandboxed code.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":2,"lastUsedAt":"2026-07-22T20:23:23.841Z","lastSuccessfullyRanAt":"2026-07-22T20:23:23.841Z","lastHealthCheckAt":"2026-09-13T12:33:48.067Z","isFirstParty":false}