requests, with no package to install. Save it as agent37.py next to your code and set AGENT37_API_KEY to a key from the dashboard.
agent37.py
Run code in a sandbox
Sandbox.create() starts a sandbox from the default template, a Linux machine with Python, Node, git and build tools. Keyword arguments become the create request body, such as Sandbox.create(template="agent37-ubuntu", type="vm").
exec runs a shell command inside the sandbox and returns exit_code, stdout, stderr and truncated. Pass user="root" to run as root. Files persist between calls, so install packages in one call and use them in the next. See Run commands for limits and background processes.
Leaving the with block deletes the sandbox, which removes its data and ends billing. Call sandbox.delete() yourself when you create one outside a with block.
The SDK covers the calls most scripts need. Every other operation is a plain HTTPS request in the API reference, sent with the same Authorization: Bearer header.