APIs/Sandbox API

Sandbox API — Cloud Linux Sandboxes for AI Agents

Create an isolated cloud machine over REST, run commands, read and write files, then stop it. Pay per second from the same Muapi key and credit balance you use for 500+ image, video and audio models.

from $0.036/hr
Billed per second while running
$0
While a sandbox is stopped
1 key
Shared with 500+ media models

Sizes and pricing

small2 vCPU · 4 GB RAM$0.036/hr
default4 vCPU · 8 GB RAM$0.072/hr
large8 vCPU · 16 GB RAM$0.144/hr

Pass profile when creating a sandbox. Billed per second while running; stopped sandboxes are free.

Quickstart

# 1. create
curl -X POST https://api.muapi.ai/api/v1/sandboxes \
  -H "x-api-key: $MUAPI_KEY" -H "Content-Type: application/json" \
  -d '{"profile": "default"}'   # small | default | large

# 2. run a command
curl -X POST https://api.muapi.ai/api/v1/sandboxes/$ID/commands \
  -H "x-api-key: $MUAPI_KEY" -H "Content-Type: application/json" \
  -d '{"command": "python3 --version", "timeout_seconds": 30}'

# 3. stop (free while stopped)
curl -X POST https://api.muapi.ai/api/v1/sandboxes/$ID/stop \
  -H "x-api-key: $MUAPI_KEY"

Endpoints

POST/api/v1/sandboxesCreate a sandbox
GET/api/v1/sandboxesList your sandboxes
POST/api/v1/sandboxes/{id}/commandsRun a shell command (sync or detached)
PUT/api/v1/sandboxes/{id}/filesWrite a file
GET/api/v1/sandboxes/{id}/files?path=Read a file
POST/api/v1/sandboxes/{id}/stopStop (billing pauses)
POST/api/v1/sandboxes/{id}/resumeResume a stopped sandbox
DELETE/api/v1/sandboxes/{id}Delete a sandbox

What teams build with it

Coding agents

Give an agent a real machine to clone repos, install packages, run tests and fix failures.

Code execution

Run untrusted or generated code away from your own infrastructure.

Hosted open-source apps

Run apps like Open Generative AI in the cloud with the user's own Muapi key.

Media pipelines

Run ffmpeg or custom scripts on outputs from Muapi image, video and audio models.

FAQ

What is a sandbox API?

A sandbox API lets your code or AI agent create an isolated cloud Linux machine on demand, run shell commands, read and write files, then stop or delete it, all over REST.

How is it priced?

Billed per second from your Muapi credits while running: $0.036/hour (small), $0.072/hour (default) or $0.144/hour (large). Stopped sandboxes are free. You need a $1 balance to start.

Same key as image and video generation?

Yes. One key and one credit balance cover sandboxes and 500+ image, video and audio models.

What happens when credits run out or the sandbox is idle?

It is stopped automatically when your balance cannot cover usage or after 15 minutes without activity. A stopped sandbox's files are kept for 14 days.