sandboxplease 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Minitap, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,228 @@
1
+ Metadata-Version: 2.4
2
+ Name: sandboxplease
3
+ Version: 0.1.0
4
+ Summary: One API key, every agent sandbox provider: create sandboxes on E2B, Daytona, Modal, Vercel and more, with routing and fallbacks. Python client for SandboxPlease.
5
+ Keywords: sandbox,sandboxes,ai-agents,agents,code-execution,code-interpreter,e2b,daytona,modal,microvm,llm,mcp
6
+ Author: SandboxPlease
7
+ Author-email: SandboxPlease <support@sandboxplease.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Typing :: Typed
23
+ Requires-Dist: httpx>=0.27
24
+ Requires-Python: >=3.10
25
+ Project-URL: Homepage, https://sandboxplease.com
26
+ Project-URL: Documentation, https://sandboxplease.com/docs
27
+ Project-URL: Repository, https://github.com/minitap-ai/sandboxplease-sdks
28
+ Project-URL: Issues, https://github.com/minitap-ai/sandboxplease-sdks/issues
29
+ Project-URL: Changelog, https://github.com/minitap-ai/sandboxplease-sdks/blob/main/CHANGELOG.md
30
+ Description-Content-Type: text/markdown
31
+
32
+ [![SandboxPlease: one API for every agent sandbox](https://raw.githubusercontent.com/minitap-ai/sandboxplease-sdks/main/.github/assets/banner.webp)](https://sandboxplease.com)
33
+
34
+ # sandboxplease (Python)
35
+
36
+ One API key, every agent sandbox provider: E2B, Daytona, Modal, Vercel Sandbox and more, with routing and
37
+ fallbacks, at exactly the provider's list price. Sync and async, fully typed, Python 3.10+.
38
+
39
+ [Docs](https://sandboxplease.com/docs) · [API reference](https://sandboxplease.com/docs/api-reference) · [Providers](https://sandboxplease.com/sandboxes) · [Examples](https://github.com/minitap-ai/sandboxplease-sdks/tree/main/examples) · [Changelog](https://github.com/minitap-ai/sandboxplease-sdks/blob/main/CHANGELOG.md)
40
+
41
+ Install the released SDK from PyPI. To build from a checkout, follow the [source setup instructions](https://github.com/minitap-ai/sandboxplease-sdks/blob/main/CONTRIBUTING.md).
42
+
43
+ ```bash
44
+ pip install sandboxplease
45
+ export SANDBOXPLEASE_API_KEY=sp-v1-... # https://sandboxplease.com/settings/keys
46
+ ```
47
+
48
+ ```python
49
+ from sandboxplease import SandboxPlease
50
+
51
+ with SandboxPlease() as sp, sp.sandboxes.create() as sbx:
52
+ out = sbx.exec("python3 -c 'print(1 + 1)'", check=True)
53
+ print(f"{sbx.provider} says {out.stdout}")
54
+ ```
55
+
56
+ The sandbox is killed when the `with` block exits.
57
+
58
+ The quickstart requires SandboxPlease API access and an enabled provider.
59
+
60
+ ## Pick by capability
61
+
62
+ `require` keeps only the providers that have every capability, by name or by value
63
+ ([every capability](https://sandboxplease.com/docs/capabilities)):
64
+
65
+ ```python
66
+ with sp.sandboxes.create(provider={"require": {"gpu": "any", "vcpu": 8, "pause": True}}) as gpu_box:
67
+ gpu_box.exec("nvidia-smi")
68
+ ```
69
+
70
+ ## More
71
+
72
+ ```python
73
+ sbx = sp.sandboxes.create(
74
+ "e2b/standard",
75
+ provider={"order": ["e2b", "daytona"], "require": ["ports"], "region": "eu"},
76
+ timeout=600,
77
+ idle_timeout=300, # killed after 5 minutes without a call
78
+ network={"allow": ["pypi.org", "*.github.com"]},
79
+ )
80
+ sbx.provider # "e2b"
81
+ sbx.region # "eu"
82
+ sbx.size # {"name": "standard", "cpu": 2, "memory_gb": 4}
83
+ sbx.price_per_hour # 0.1656, USD per hour: the provider's list price, billed per second, no markup
84
+ sbx.cold_start_ms # 412
85
+ sbx.fallback # None, or {"from": "e2b", "reason": "plan_limit", "message": "..."} when another provider took over
86
+ if sbx.fallback:
87
+ print(f"{sbx.fallback['message']} Running on {sbx.provider}.")
88
+ sbx.exec("npm test", on_stdout=print, on_stderr=print) # streamed as it runs
89
+ sbx.files.write("/app/main.py", "print(1)")
90
+ sbx.files.read("/app/main.py")
91
+ sbx.files.list("/app")
92
+ sbx.ports.url(3000)
93
+ sbx.pause()
94
+ sbx.resume()
95
+ sbx.kill()
96
+
97
+ sp.sandboxes.list()
98
+ sp.sandboxes.kill_all() # every sandbox this key reaches, when your agent lost track
99
+ sp.sandboxes.kill_all(older_than_hours=6) # only the ones started 6+ hours ago
100
+ sp.sandboxes.get(sbx.id)
101
+ sp.catalog()
102
+ sp.base_image() # sandboxplease/base, the default image, on every provider
103
+ sp.key() # {"balance_usd": ..., "credit_limit_usd": ..., "limit_remaining_usd": ...}: check before a long job
104
+ sp.quote(gpu={"type": "A100"}, duration=3600) # what create would run and cost, nothing started
105
+ ```
106
+
107
+ `quote` takes the arguments of `sandboxes.create()` and returns the providers create would try, in order, each with the
108
+ vCPUs and memory it really serves and its price per hour (`compute`, `gpu`, `devices`, `total`), plus the providers
109
+ left out and why. Quote before an expensive sandbox and tell the person the price.
110
+
111
+ Async: `AsyncSandboxPlease` has the same surface with `await` and `async with`.
112
+
113
+ `exec` returns an `ExecResult` (`stdout`, `stderr`, `exit_code`); a non-zero exit is returned unless you pass
114
+ `check=True`, which raises `CommandError` with the tail of stderr.
115
+
116
+ ## Provider options
117
+
118
+ Pass a provider's own create fields; only the picked provider's entry is sent, so one call can carry options for every fallback. `provider_sandbox_id` is the id to hand to the vendor's SDK.
119
+
120
+ ```python
121
+ sbx = sp.sandboxes.create(
122
+ provider={"order": ["e2b", "modal"]},
123
+ provider_options={
124
+ "e2b": {"template": "my-python-template", "metadata": {"team": "ml"}},
125
+ "modal": {"encryptedPorts": [8080]},
126
+ },
127
+ )
128
+ print(sbx.provider, sbx.provider_sandbox_id, sbx.provider_metadata)
129
+ ```
130
+
131
+ Every provider's fields: https://sandboxplease.com/docs/provider-options
132
+
133
+ ## Snapshots and parallel copies
134
+
135
+ Set a sandbox up once, snapshot it, then start copies of it to run work in parallel. Needs a provider with the `fork`
136
+ (memory and running processes kept) or `snapshot` (filesystem only) feature.
137
+
138
+ ```python
139
+ from concurrent.futures import ThreadPoolExecutor
140
+
141
+ base = sp.sandboxes.create(provider={"require": ["snapshot"]})
142
+ base.exec("pip install pytest", check=True)
143
+ snap = base.snapshot()
144
+ copies = sp.sandboxes.create(from_snapshot=snap["id"], count=5)
145
+ with ThreadPoolExecutor() as pool:
146
+ results = list(pool.map(lambda i: copies[i].exec(f"pytest tests/shard_{i}"), range(len(copies))))
147
+ for sbx in [base, *copies]:
148
+ sbx.kill()
149
+ sp.snapshots.delete(snap["id"])
150
+ ```
151
+
152
+ Copies run on the snapshot's provider, size and region, with no fallback. `sp.snapshots.list()` and
153
+ `sp.snapshots.get(snapshot_id)` read them back; a snapshot expires after 7 days. With `AsyncSandboxPlease`, run the
154
+ copies with `asyncio.gather`.
155
+
156
+ ## Mobile devices (private beta)
157
+
158
+ Attach cloud devices to a miniSandbox sandbox (the only provider that takes them). Your agent drives them from inside
159
+ the sandbox with miniSandbox's device tool, documented by miniSandbox. Kinds: `android_phone`, `android_tablet`, `ios_simulator` (an iPhone), `ipad`, `apple_watch` and
160
+ `iphone_duo` (a foldable iPhone). Coming soon: `android_physical`, `android_tv` and `iphone_physical`; asking for one
161
+ raises `FeatureNotLiveError` and records your interest.
162
+
163
+ ```python
164
+ with sp.sandboxes.create(devices=[{"kind": "android_phone", "os_version": "15"}]) as sbx:
165
+ print(sbx.provider, sbx.devices) # minisandbox [{'id': ..., 'kind': 'android_phone', 'os_version': '15'}]
166
+ ```
167
+
168
+ Until your account is in the beta, create raises `FeatureNotLiveError` and records your interest. Pausing
169
+ the sandbox releases its devices and stops their billing; resuming boots new devices of the same kinds, so reinstall
170
+ the app after a resume. Guide: https://sandboxplease.com/docs/mobile-devices
171
+
172
+ Limits: at most 3 devices per sandbox (more raises `InvalidRequestError` with code `too_many_devices`) and 10 attached
173
+ at once per workspace, across its running sandboxes (a create or resume past it raises `DeviceLimitError`, with
174
+ `in_use`). Need more? Contact support at support@sandboxplease.com.
175
+
176
+ Each device bills per started minute while attached, on credits even when the sandbox runs on your own provider key,
177
+ and a create holds its first 10 minutes. `catalog()` lists every kind with its `price_per_minute` (`None` while a
178
+ kind is coming soon); `sbx.device_price_per_minute` is what its devices cost per minute together.
179
+
180
+ ```python
181
+ phone = next(d for d in sp.catalog()["devices"] if d["kind"] == "android_phone")
182
+ print(f"{phone['label']}: ${phone['price_per_minute']}/min")
183
+ ```
184
+
185
+ ## Errors
186
+
187
+ Every error subclasses `SandboxPleaseError` and prints what to do next:
188
+
189
+ ```text
190
+ sandboxplease.InsufficientCreditsError: [insufficient_credits] Balance $0.00 is too low to start this sandbox
191
+ hint: Add credits at https://sandboxplease.com/settings/credits or use your own provider key (BYOK) at https://sandboxplease.com/settings/byok.
192
+ docs: https://sandboxplease.com/docs/errors#insufficient_credits
193
+ request: req_6aa641ea3ed59a24cb563a01
194
+ ```
195
+
196
+ Branch on `err.code` or the class: `InsufficientCreditsError` (`.balance`), `KeyLimitError` (the key's credit limit or
197
+ daily cap, `.rule`), `NoEligibleProviderError` (`.skipped`), `ProviderError` (`.attempts`), `KeyPolicyError` (`.rule`,
198
+ the key policy rule that refused the call), `PermissionDeniedError` (a new account's limits, a suspended account),
199
+ `InvalidRequestError`, `NotFoundError`, `SandboxEndedError`, `SandboxPausedError`, `AuthenticationError`,
200
+ `RateLimitError` (`.rule` when a key policy limit refused it), `DeviceLimitError`, `APIConnectionError`, `CommandError`,
201
+ `FeatureNotLiveError` (`.feature`). `err.hint`, `err.docs_url` and `err.request_id` are there too.
202
+
203
+ ## Configuration
204
+
205
+ ```python
206
+ SandboxPlease(
207
+ api_key="sp-v1-...", # default: SANDBOXPLEASE_API_KEY
208
+ base_url="https://api.sandboxplease.com", # default: SANDBOXPLEASE_BASE_URL, then this
209
+ timeout=60.0, # seconds per request
210
+ max_retries=2, # on 429, 5xx and network errors, with exponential backoff
211
+ )
212
+ ```
213
+
214
+ Reads, kills, file writes and `sandboxes.create` are retried; `create` sends an `Idempotency-Key`, so a retry never
215
+ starts a second sandbox. `exec`, `pause`, `resume` and `snapshot` are not retried.
216
+
217
+ ## Development
218
+
219
+ ```bash
220
+ uv sync
221
+ uv run ruff format --check . && uv run ruff check . && uv run pyright && uv run pytest
222
+ ```
223
+
224
+ End-to-end tests and the rest: [CONTRIBUTING.md](https://github.com/minitap-ai/sandboxplease-sdks/blob/main/CONTRIBUTING.md).
225
+
226
+ ## License
227
+
228
+ MIT
@@ -0,0 +1,197 @@
1
+ [![SandboxPlease: one API for every agent sandbox](https://raw.githubusercontent.com/minitap-ai/sandboxplease-sdks/main/.github/assets/banner.webp)](https://sandboxplease.com)
2
+
3
+ # sandboxplease (Python)
4
+
5
+ One API key, every agent sandbox provider: E2B, Daytona, Modal, Vercel Sandbox and more, with routing and
6
+ fallbacks, at exactly the provider's list price. Sync and async, fully typed, Python 3.10+.
7
+
8
+ [Docs](https://sandboxplease.com/docs) · [API reference](https://sandboxplease.com/docs/api-reference) · [Providers](https://sandboxplease.com/sandboxes) · [Examples](https://github.com/minitap-ai/sandboxplease-sdks/tree/main/examples) · [Changelog](https://github.com/minitap-ai/sandboxplease-sdks/blob/main/CHANGELOG.md)
9
+
10
+ Install the released SDK from PyPI. To build from a checkout, follow the [source setup instructions](https://github.com/minitap-ai/sandboxplease-sdks/blob/main/CONTRIBUTING.md).
11
+
12
+ ```bash
13
+ pip install sandboxplease
14
+ export SANDBOXPLEASE_API_KEY=sp-v1-... # https://sandboxplease.com/settings/keys
15
+ ```
16
+
17
+ ```python
18
+ from sandboxplease import SandboxPlease
19
+
20
+ with SandboxPlease() as sp, sp.sandboxes.create() as sbx:
21
+ out = sbx.exec("python3 -c 'print(1 + 1)'", check=True)
22
+ print(f"{sbx.provider} says {out.stdout}")
23
+ ```
24
+
25
+ The sandbox is killed when the `with` block exits.
26
+
27
+ The quickstart requires SandboxPlease API access and an enabled provider.
28
+
29
+ ## Pick by capability
30
+
31
+ `require` keeps only the providers that have every capability, by name or by value
32
+ ([every capability](https://sandboxplease.com/docs/capabilities)):
33
+
34
+ ```python
35
+ with sp.sandboxes.create(provider={"require": {"gpu": "any", "vcpu": 8, "pause": True}}) as gpu_box:
36
+ gpu_box.exec("nvidia-smi")
37
+ ```
38
+
39
+ ## More
40
+
41
+ ```python
42
+ sbx = sp.sandboxes.create(
43
+ "e2b/standard",
44
+ provider={"order": ["e2b", "daytona"], "require": ["ports"], "region": "eu"},
45
+ timeout=600,
46
+ idle_timeout=300, # killed after 5 minutes without a call
47
+ network={"allow": ["pypi.org", "*.github.com"]},
48
+ )
49
+ sbx.provider # "e2b"
50
+ sbx.region # "eu"
51
+ sbx.size # {"name": "standard", "cpu": 2, "memory_gb": 4}
52
+ sbx.price_per_hour # 0.1656, USD per hour: the provider's list price, billed per second, no markup
53
+ sbx.cold_start_ms # 412
54
+ sbx.fallback # None, or {"from": "e2b", "reason": "plan_limit", "message": "..."} when another provider took over
55
+ if sbx.fallback:
56
+ print(f"{sbx.fallback['message']} Running on {sbx.provider}.")
57
+ sbx.exec("npm test", on_stdout=print, on_stderr=print) # streamed as it runs
58
+ sbx.files.write("/app/main.py", "print(1)")
59
+ sbx.files.read("/app/main.py")
60
+ sbx.files.list("/app")
61
+ sbx.ports.url(3000)
62
+ sbx.pause()
63
+ sbx.resume()
64
+ sbx.kill()
65
+
66
+ sp.sandboxes.list()
67
+ sp.sandboxes.kill_all() # every sandbox this key reaches, when your agent lost track
68
+ sp.sandboxes.kill_all(older_than_hours=6) # only the ones started 6+ hours ago
69
+ sp.sandboxes.get(sbx.id)
70
+ sp.catalog()
71
+ sp.base_image() # sandboxplease/base, the default image, on every provider
72
+ sp.key() # {"balance_usd": ..., "credit_limit_usd": ..., "limit_remaining_usd": ...}: check before a long job
73
+ sp.quote(gpu={"type": "A100"}, duration=3600) # what create would run and cost, nothing started
74
+ ```
75
+
76
+ `quote` takes the arguments of `sandboxes.create()` and returns the providers create would try, in order, each with the
77
+ vCPUs and memory it really serves and its price per hour (`compute`, `gpu`, `devices`, `total`), plus the providers
78
+ left out and why. Quote before an expensive sandbox and tell the person the price.
79
+
80
+ Async: `AsyncSandboxPlease` has the same surface with `await` and `async with`.
81
+
82
+ `exec` returns an `ExecResult` (`stdout`, `stderr`, `exit_code`); a non-zero exit is returned unless you pass
83
+ `check=True`, which raises `CommandError` with the tail of stderr.
84
+
85
+ ## Provider options
86
+
87
+ Pass a provider's own create fields; only the picked provider's entry is sent, so one call can carry options for every fallback. `provider_sandbox_id` is the id to hand to the vendor's SDK.
88
+
89
+ ```python
90
+ sbx = sp.sandboxes.create(
91
+ provider={"order": ["e2b", "modal"]},
92
+ provider_options={
93
+ "e2b": {"template": "my-python-template", "metadata": {"team": "ml"}},
94
+ "modal": {"encryptedPorts": [8080]},
95
+ },
96
+ )
97
+ print(sbx.provider, sbx.provider_sandbox_id, sbx.provider_metadata)
98
+ ```
99
+
100
+ Every provider's fields: https://sandboxplease.com/docs/provider-options
101
+
102
+ ## Snapshots and parallel copies
103
+
104
+ Set a sandbox up once, snapshot it, then start copies of it to run work in parallel. Needs a provider with the `fork`
105
+ (memory and running processes kept) or `snapshot` (filesystem only) feature.
106
+
107
+ ```python
108
+ from concurrent.futures import ThreadPoolExecutor
109
+
110
+ base = sp.sandboxes.create(provider={"require": ["snapshot"]})
111
+ base.exec("pip install pytest", check=True)
112
+ snap = base.snapshot()
113
+ copies = sp.sandboxes.create(from_snapshot=snap["id"], count=5)
114
+ with ThreadPoolExecutor() as pool:
115
+ results = list(pool.map(lambda i: copies[i].exec(f"pytest tests/shard_{i}"), range(len(copies))))
116
+ for sbx in [base, *copies]:
117
+ sbx.kill()
118
+ sp.snapshots.delete(snap["id"])
119
+ ```
120
+
121
+ Copies run on the snapshot's provider, size and region, with no fallback. `sp.snapshots.list()` and
122
+ `sp.snapshots.get(snapshot_id)` read them back; a snapshot expires after 7 days. With `AsyncSandboxPlease`, run the
123
+ copies with `asyncio.gather`.
124
+
125
+ ## Mobile devices (private beta)
126
+
127
+ Attach cloud devices to a miniSandbox sandbox (the only provider that takes them). Your agent drives them from inside
128
+ the sandbox with miniSandbox's device tool, documented by miniSandbox. Kinds: `android_phone`, `android_tablet`, `ios_simulator` (an iPhone), `ipad`, `apple_watch` and
129
+ `iphone_duo` (a foldable iPhone). Coming soon: `android_physical`, `android_tv` and `iphone_physical`; asking for one
130
+ raises `FeatureNotLiveError` and records your interest.
131
+
132
+ ```python
133
+ with sp.sandboxes.create(devices=[{"kind": "android_phone", "os_version": "15"}]) as sbx:
134
+ print(sbx.provider, sbx.devices) # minisandbox [{'id': ..., 'kind': 'android_phone', 'os_version': '15'}]
135
+ ```
136
+
137
+ Until your account is in the beta, create raises `FeatureNotLiveError` and records your interest. Pausing
138
+ the sandbox releases its devices and stops their billing; resuming boots new devices of the same kinds, so reinstall
139
+ the app after a resume. Guide: https://sandboxplease.com/docs/mobile-devices
140
+
141
+ Limits: at most 3 devices per sandbox (more raises `InvalidRequestError` with code `too_many_devices`) and 10 attached
142
+ at once per workspace, across its running sandboxes (a create or resume past it raises `DeviceLimitError`, with
143
+ `in_use`). Need more? Contact support at support@sandboxplease.com.
144
+
145
+ Each device bills per started minute while attached, on credits even when the sandbox runs on your own provider key,
146
+ and a create holds its first 10 minutes. `catalog()` lists every kind with its `price_per_minute` (`None` while a
147
+ kind is coming soon); `sbx.device_price_per_minute` is what its devices cost per minute together.
148
+
149
+ ```python
150
+ phone = next(d for d in sp.catalog()["devices"] if d["kind"] == "android_phone")
151
+ print(f"{phone['label']}: ${phone['price_per_minute']}/min")
152
+ ```
153
+
154
+ ## Errors
155
+
156
+ Every error subclasses `SandboxPleaseError` and prints what to do next:
157
+
158
+ ```text
159
+ sandboxplease.InsufficientCreditsError: [insufficient_credits] Balance $0.00 is too low to start this sandbox
160
+ hint: Add credits at https://sandboxplease.com/settings/credits or use your own provider key (BYOK) at https://sandboxplease.com/settings/byok.
161
+ docs: https://sandboxplease.com/docs/errors#insufficient_credits
162
+ request: req_6aa641ea3ed59a24cb563a01
163
+ ```
164
+
165
+ Branch on `err.code` or the class: `InsufficientCreditsError` (`.balance`), `KeyLimitError` (the key's credit limit or
166
+ daily cap, `.rule`), `NoEligibleProviderError` (`.skipped`), `ProviderError` (`.attempts`), `KeyPolicyError` (`.rule`,
167
+ the key policy rule that refused the call), `PermissionDeniedError` (a new account's limits, a suspended account),
168
+ `InvalidRequestError`, `NotFoundError`, `SandboxEndedError`, `SandboxPausedError`, `AuthenticationError`,
169
+ `RateLimitError` (`.rule` when a key policy limit refused it), `DeviceLimitError`, `APIConnectionError`, `CommandError`,
170
+ `FeatureNotLiveError` (`.feature`). `err.hint`, `err.docs_url` and `err.request_id` are there too.
171
+
172
+ ## Configuration
173
+
174
+ ```python
175
+ SandboxPlease(
176
+ api_key="sp-v1-...", # default: SANDBOXPLEASE_API_KEY
177
+ base_url="https://api.sandboxplease.com", # default: SANDBOXPLEASE_BASE_URL, then this
178
+ timeout=60.0, # seconds per request
179
+ max_retries=2, # on 429, 5xx and network errors, with exponential backoff
180
+ )
181
+ ```
182
+
183
+ Reads, kills, file writes and `sandboxes.create` are retried; `create` sends an `Idempotency-Key`, so a retry never
184
+ starts a second sandbox. `exec`, `pause`, `resume` and `snapshot` are not retried.
185
+
186
+ ## Development
187
+
188
+ ```bash
189
+ uv sync
190
+ uv run ruff format --check . && uv run ruff check . && uv run pyright && uv run pytest
191
+ ```
192
+
193
+ End-to-end tests and the rest: [CONTRIBUTING.md](https://github.com/minitap-ai/sandboxplease-sdks/blob/main/CONTRIBUTING.md).
194
+
195
+ ## License
196
+
197
+ MIT
@@ -0,0 +1,81 @@
1
+ [project]
2
+ name = "sandboxplease"
3
+ version = "0.1.0"
4
+ description = "One API key, every agent sandbox provider: create sandboxes on E2B, Daytona, Modal, Vercel and more, with routing and fallbacks. Python client for SandboxPlease."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ keywords = [
9
+ "sandbox",
10
+ "sandboxes",
11
+ "ai-agents",
12
+ "agents",
13
+ "code-execution",
14
+ "code-interpreter",
15
+ "e2b",
16
+ "daytona",
17
+ "modal",
18
+ "microvm",
19
+ "llm",
20
+ "mcp",
21
+ ]
22
+ requires-python = ">=3.10"
23
+ classifiers = [
24
+ "Development Status :: 4 - Beta",
25
+ "Intended Audience :: Developers",
26
+ "Operating System :: OS Independent",
27
+ "Programming Language :: Python :: 3",
28
+ "Programming Language :: Python :: 3 :: Only",
29
+ "Programming Language :: Python :: 3.10",
30
+ "Programming Language :: Python :: 3.11",
31
+ "Programming Language :: Python :: 3.12",
32
+ "Programming Language :: Python :: 3.13",
33
+ "Programming Language :: Python :: 3.14",
34
+ "Topic :: Software Development :: Libraries :: Python Modules",
35
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
36
+ "Typing :: Typed",
37
+ ]
38
+ dependencies = ["httpx>=0.27"]
39
+
40
+ [[project.authors]]
41
+ name = "SandboxPlease"
42
+ email = "support@sandboxplease.com"
43
+
44
+ [project.urls]
45
+ Homepage = "https://sandboxplease.com"
46
+ Documentation = "https://sandboxplease.com/docs"
47
+ Repository = "https://github.com/minitap-ai/sandboxplease-sdks"
48
+ Issues = "https://github.com/minitap-ai/sandboxplease-sdks/issues"
49
+ Changelog = "https://github.com/minitap-ai/sandboxplease-sdks/blob/main/CHANGELOG.md"
50
+
51
+ [dependency-groups]
52
+ dev = [
53
+ "griffe>=2.3.0",
54
+ "pyright>=1.1.400",
55
+ "pytest>=8",
56
+ "ruff>=0.14",
57
+ ]
58
+
59
+ [build-system]
60
+ requires = ["uv_build>=0.9,<0.14"]
61
+ build-backend = "uv_build"
62
+
63
+ [tool.ruff]
64
+ line-length = 120
65
+
66
+ [tool.ruff.lint]
67
+ select = [
68
+ "E",
69
+ "F",
70
+ "I",
71
+ "UP",
72
+ "B",
73
+ ]
74
+
75
+ [tool.pyright]
76
+ include = [
77
+ "src",
78
+ "tests",
79
+ "scripts",
80
+ ]
81
+ typeCheckingMode = "strict"
@@ -0,0 +1,55 @@
1
+ [project]
2
+ name = "sandboxplease"
3
+ version = "0.1.0"
4
+ description = "One API key, every agent sandbox provider: create sandboxes on E2B, Daytona, Modal, Vercel and more, with routing and fallbacks. Python client for SandboxPlease."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ authors = [{ name = "SandboxPlease", email = "support@sandboxplease.com" }]
9
+ keywords = ["sandbox", "sandboxes", "ai-agents", "agents", "code-execution", "code-interpreter", "e2b", "daytona", "modal", "microvm", "llm", "mcp"]
10
+ requires-python = ">=3.10"
11
+ classifiers = [
12
+ "Development Status :: 4 - Beta",
13
+ "Intended Audience :: Developers",
14
+ "Operating System :: OS Independent",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3 :: Only",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Topic :: Software Development :: Libraries :: Python Modules",
23
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
24
+ "Typing :: Typed",
25
+ ]
26
+ dependencies = ["httpx>=0.27"]
27
+
28
+ [project.urls]
29
+ Homepage = "https://sandboxplease.com"
30
+ Documentation = "https://sandboxplease.com/docs"
31
+ Repository = "https://github.com/minitap-ai/sandboxplease-sdks"
32
+ Issues = "https://github.com/minitap-ai/sandboxplease-sdks/issues"
33
+ Changelog = "https://github.com/minitap-ai/sandboxplease-sdks/blob/main/CHANGELOG.md"
34
+
35
+ [dependency-groups]
36
+ dev = [
37
+ "griffe>=2.3.0",
38
+ "pyright>=1.1.400",
39
+ "pytest>=8",
40
+ "ruff>=0.14",
41
+ ]
42
+
43
+ [build-system]
44
+ requires = ["uv_build>=0.9,<0.14"]
45
+ build-backend = "uv_build"
46
+
47
+ [tool.ruff]
48
+ line-length = 120
49
+
50
+ [tool.ruff.lint]
51
+ select = ["E", "F", "I", "UP", "B"]
52
+
53
+ [tool.pyright]
54
+ include = ["src", "tests", "scripts"]
55
+ typeCheckingMode = "strict"