For providers
Provider spec
What your sandbox API must implement, and keep up, to be listed and routed to on SandboxPlease.
We route to any E2B-compatible API with no code on our side: send us its base URL and a test key through the application form, we run the conformance suite against it, and a person decides whether to list it. Any other API needs an adapter we write first. What you get and how routing treats you are on For sandbox providers.
The API we call
Control routes live on your API base URL. Sandbox routes live on each sandbox's own host, https://49983-{id}.{domain}; port N of a sandbox is served at https://N-{id}.{domain}. If your API only has the older v1 routes (create on POST /sandboxes, resume on POST /sandboxes/{id}/connect with a timeout), say so in your application.
| Control API | What we expect |
|---|---|
POST /v2/sandboxes | Create from templateID, with timeout (s), envVars, metadata and cpuCount when resized. |
GET /sandboxes/{id} | Sandbox details: state (running), domain, envdAccessToken, cpuCount, memoryMB. |
DELETE /sandboxes/{id} | Kill. 404 for an unknown or already killed sandbox. |
GET /v2/sandboxes?limit=100 | List the account's sandboxes, paged with the x-next-token header. |
POST /sandboxes/{id}/pause | Pause, keeping memory and disk (if you offer pause). |
POST /v2/sandboxes/{id}/connect | Resume a paused sandbox and return its details (if you offer pause). |
| In the sandbox | What we expect |
|---|---|
POST /process.Process/Start | Run /bin/bash -l -c <cmd> and stream stdout, stderr and the exit code (Connect protocol). |
POST /files?path= | Write a file from the raw request body. |
GET /files?path= | Read a file as raw bytes. |
POST /filesystem.Filesystem/ListDir | List a folder, depth 1. |
Authentication
Control calls send the account key as X-API-Key. Sandbox calls send the sandbox's envdAccessToken as X-Access-Token. Every call is https to a public host, with no redirects. We create sandboxes with metadata.sandboxplease = "1" and kill any we no longer track.
Error codes
Routing reads your HTTP status, so return the right one.
| Status | What SandboxPlease does |
|---|---|
| 401, 403 | Wrong or revoked key. Never retried on you: the create falls back to the next provider, and a customer on their own key is told to fix it. |
| 404 | Unknown sandbox. Kill treats it as already gone. |
| 429 | Rate limited. The create falls back to the next provider. |
| 5xx, timeout, network error | The create falls back to the next provider. |
| Other 4xx | The create falls back to the next provider. A customer on their own key sees your response body, so make it say what to change. |
A failed create counts toward your success rate over the last 24 hours. A failure the account caused does not, nor does it count in your uptime: a plan or funds limit, a 429, a refused key, or an error in our adapter. 3 creates in a row that answer 5xx, time out, fail on the network, or start a sandbox that fails or never becomes ready pause routing to you for 30 seconds, doubling up to 10 minutes. On credits, 3 refusals of our whole account in a row pause only creates on credits, the same way (every routing rule).
Conformance suite
The suite runs these checks in order against your API with your test key. Ports and pause/resume run only if you offer them; every other check must pass.
- 1createCreates a small sandbox with a 5 minute lifetime.
- 2execRuns
echo out; echo err >&2; exit 7: stdout, stderr and the exit code come back apart. - 3filesWrites a file, reads the same bytes back and finds it when listing its folder.
- 4portsReturns an https URL for port 8080 (only if the provider exposes ports).
- 5pause/resumePauses, resumes, then runs a command again (only if the provider pauses).
- 6killKills the sandbox; it is then reported as not alive.
- 7cold startCreates and kills 3 sandboxes and reports the median time to a usable sandbox.
- 8bad keyA wrong API key is refused with 401 or 403, and not retried.
- 9unknown sandboxAn unknown sandbox id is reported as not alive, and killing it succeeds.
Each check reports its time and, when it fails, the call that broke it and the status it got, never your response body. We run it while we review your application; to get the report, or a new run after a change to your API, ask us.
Prices
We bill your public list rates with no markup and no fees. Where you bill only what a sandbox uses, or include minutes in a plan, we bill your list rate on the full allocation for the whole run. For most providers we read the pricing page every 30 minutes; a new price waits for a person to approve it with an effective date, and until then customers pay the last approved one. A price drop is flagged urgent. When your price changes, tell us.
Status page
A public status page that machines can read: Atlassian Statuspage or incident.io (/api/v2/summary.json), Instatus (/summary.json) or Better Stack. When it covers more than sandboxes, name the sandbox component. Open incidents show on our status page next to the uptime we measure ourselves on real creates and with a probe whenever a provider goes quiet.
Listing rules
| State | When |
|---|---|
| Listed | A person approves your application. A provider listed from it carries a New badge until it has 30 days of probe data, and runs on customers' own keys at once, on credits once our key for it is set. |
| Ranked lower or paused | Failed creates, a failing daily check or our account with you running out: the rules and their numbers are at /providers#routing. |
| Hidden from the catalog | When we watch you by calling your API, because we have no status page of yours to read, and it answers 5xx or nothing. You come back as soon as it answers, and you still show on /status. |
| Delisted | Only by a person: when you ask, or when your API stops working with SandboxPlease. |