# StateMind Python Sandbox Executor

> StateMind Python Sandbox Executor is a paid API for AI agents from api.statemind.ai, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-15).

Runs Python code in an isolated, networkless, read-only container and reports execution results against provided test examples

## Facts

- Endpoint: POST https://api.statemind.ai/v1/x402/execute
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/statemind-python-sandbox-executor-4540c974
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HqBCVVZV2wxfrMsqp9mXk

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability statemind-python-sandbox-executor-4540c974 -d '<json body>'
```

Example prompt: Run this Python function in a secure sandbox and check whether it produces the right outputs for my test examples — the function takes a list of integers and returns their sum, and my examples are: input [1,2,3] should give 6 and input [10,20] should give 30.

## When to prefer this

Use this endpoint when you need to safely execute Python code in a completely isolated environment — no network, no filesystem writes — and want to automatically validate the output against known test examples. It is ideal for grading code, verifying untrusted snippets, or running automated tests without risking side effects on the host system. Pair it with the sibling lint/check endpoint first for code that hasn't been validated yet.

## Known failure modes

- Code with syntax errors fails immediately with error details
- Infinite loops or excessive compute may be killed by resource limits
- Code requiring network access will fail since the container has no network
- Code attempting filesystem writes will fail due to read-only filesystem
- Malformed request payload returns a 4xx error
- Timeout if execution exceeds allowed duration

## How this service works

Run Python in a throwaway container with no network and a read-only filesystem, and report what it did against the caller's examples.

## Output

Returns execution results including stdout, stderr, exit code, and a pass/fail report comparing actual outputs against the caller's provided test examples, all captured from a throwaway container with no network and a read-only filesystem.

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/statemind-python-sandbox-executor-4540c974/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.statemind.ai](https://www.zero.xyz/host/api.statemind.ai/llms.txt)
