# Python

The API is plain JSON over HTTP; a client is ten lines with `httpx` or `requests`.

```python
import os, httpx

api = httpx.Client(base_url=os.environ["FLASHBOX_API_URL"], timeout=150,
                   headers={"Authorization": f"Bearer {os.environ['FLASHBOX_API_KEY']}"})

def call(method, path, **kw):
    r = api.request(method, path, **kw)
    r.raise_for_status()
    return r.json()

sb = call("POST", "/v1/sandboxes", json={})
out = call("POST", f"/v1/sandboxes/{sb['id']}/commands", json={"command": "ls -la /workspace"})
print(out["stdout"], out["checkpoint"]["id"])
```
