An open-source, faster Devin alternative
TypeScript
Point SDKs and docs at app.opensandbox.ai, remove configuration page
motatoes22441ea66ee9
diff --git a/docs/configuration.mdx b/docs/configuration.mdxdeleted file mode 100644index d108b263..00000000--- a/docs/configuration.mdx+++ /dev/null@@ -1,106 +0,0 @@-----title: "Configuration"-description: "Set up API keys, URLs, and environment variables"------## Environment Variables--Both SDKs read from these environment variables:--| Variable | Description | Default |-| --- | --- | --- |-| `OPENSANDBOX_API_KEY` | Your API key for authentication | — |-| `OPENSANDBOX_API_URL` | Base URL of the OpenSandbox API | `http://localhost:8080` |--```bash-export OPENSANDBOX_API_KEY="sk-your-api-key"-export OPENSANDBOX_API_URL="https://api.opensandbox.dev"-```--## Inline Configuration--You can also pass credentials directly when creating or connecting to a sandbox:--<CodeGroup>--```typescript TypeScript-import { Sandbox } from 'opensandbox';--const sandbox = await Sandbox.create({- apiKey: 'sk-your-api-key',- apiUrl: 'https://api.opensandbox.dev',- template: 'base',-});-```--```python Python-from opensandbox import Sandbox--sandbox = await Sandbox.create(- api_key='sk-your-api-key',- api_url='https://api.opensandbox.dev',- template='base',-)-```--</CodeGroup>--<Note>- Inline configuration takes precedence over environment variables.-</Note>--## Authentication--All API requests are authenticated using your API key, sent as the `X-API-Key` header. Both SDKs handle this automatically when you provide the key via environment variable or inline config.--## Architecture: Server vs Combined Mode--OpenSandbox supports two deployment modes that affect how SDKs connect:--### Combined Mode (Default for Local Development)--In combined mode, a single process handles both the control plane and sandbox execution. The SDK talks to one URL for everything.--```-SDK → API Server (creates sandbox + runs commands)-```--### Server Mode (Production)--In server mode, the control plane and workers are separate. When you create a sandbox, the API returns a `connectURL` and `token`. The SDK then communicates directly with the worker for all data operations (commands, files, PTY).--```-SDK → Control Plane (creates sandbox, gets connectURL + token)-SDK → Worker (commands, files, PTY via connectURL)-```--This is handled transparently by the SDK — you don't need to change your code between modes.--## Sandbox Options--Full list of options available when creating a sandbox:--<CodeGroup>--```typescript TypeScript-interface SandboxOpts {- template?: string; // Container template (default: 'base')- timeout?: number; // Sandbox TTL in seconds (default: 300)- apiKey?: string; // API key override- apiUrl?: string; // API URL override- envs?: Record<string, string>; // Environment variables for the sandbox- metadata?: Record<string, string>; // Arbitrary key-value metadata-}-```--```python Python-# Sandbox.create() parameters-template: str = 'base' # Container template-timeout: int = 300 # Sandbox TTL in seconds-api_key: str | None = None # API key override-api_url: str | None = None # API URL override-envs: dict[str, str] | None = None # Environment variables for the sandbox-metadata: dict[str, str] | None = None # Arbitrary key-value metadata-```--</CodeGroup>diff --git a/docs/introduction.mdx b/docs/introduction.mdxindex b81bcf9c..6b851ce8 100644--- a/docs/introduction.mdx+++ b/docs/introduction.mdx@@ -71,9 +71,6 @@ async with Sandbox.create(template='base') as sandbox:<Card title="Quickstart" icon="rocket" href="/quickstart">Get up and running in 5 minutes.</Card>- <Card title="Configuration" icon="gear" href="/configuration">- Set up API keys and environment variables.- </Card><Card title="TypeScript SDK" icon="js" href="/sdks/typescript/overview">Full TypeScript/JavaScript SDK reference.</Card>diff --git a/docs/mint.json b/docs/mint.jsonindex a5f8f9ee..0757a984 100644--- a/docs/mint.json+++ b/docs/mint.json@@ -40,8 +40,7 @@"group": "Getting Started","pages": ["introduction",- "quickstart",- "configuration"+ "quickstart"]},{diff --git a/docs/quickstart.mdx b/docs/quickstart.mdxindex 1dda3fc8..17711c60 100644--- a/docs/quickstart.mdx+++ b/docs/quickstart.mdx@@ -3,7 +3,11 @@ title: "Quickstart"description: "Get up and running with OpenSandbox in 5 minutes"----## 1. Install the SDK+## 1. Get Your API Key++Sign up at [app.opensandbox.ai](https://app.opensandbox.ai) and grab your API key from the dashboard.++## 2. Install the SDK<CodeGroup>@@ -17,25 +21,13 @@ pip install opensandbox-sdk</CodeGroup>-## 2. Set Your API Key--<CodeGroup>--```bash TypeScript-export OPENSANDBOX_API_KEY="your-api-key"-export OPENSANDBOX_API_URL="https://api.opensandbox.dev" # optional, defaults to localhost-```+## 3. Set Your API Key-```bash Python+```bashexport OPENSANDBOX_API_KEY="your-api-key"-export OPENSANDBOX_API_URL="https://api.opensandbox.dev" # optional, defaults to localhost```-</CodeGroup>--Or pass credentials directly when creating a sandbox — see [Configuration](/configuration).--## 3. Create a Sandbox+## 4. Create a Sandbox<CodeGroup>@@ -59,7 +51,7 @@ print(f"Sandbox created: {sandbox.sandbox_id}")</CodeGroup>-## 4. Run a Command+## 5. Run a Command<CodeGroup>@@ -79,7 +71,7 @@ print(result.exit_code) # 0</CodeGroup>-## 5. Read and Write Files+## 6. Read and Write Files<CodeGroup>@@ -112,7 +104,7 @@ for e in entries:</CodeGroup>-## 6. Clean Up+## 7. Clean Up<CodeGroup>@@ -135,4 +127,3 @@ async with Sandbox.create() as sandbox:- [TypeScript SDK Reference](/sdks/typescript/overview) — full API docs for the TypeScript SDK- [Python SDK Reference](/sdks/python/overview) — full API docs for the Python SDK-- [Configuration](/configuration) — API keys, URLs, and environment setupdiff --git a/docs/sdks/python/sandbox.mdx b/docs/sdks/python/sandbox.mdxindex c8e0087f..3e1872eb 100644--- a/docs/sdks/python/sandbox.mdx+++ b/docs/sdks/python/sandbox.mdx@@ -32,7 +32,7 @@ Creates a new sandbox and returns a connected `Sandbox` instance.API key. Falls back to `OPENSANDBOX_API_KEY` env var.</ParamField><ParamField body="api_url" type="str | None" default="None">- API base URL. Falls back to `OPENSANDBOX_API_URL` env var, then `http://localhost:8080`.+ API base URL. Falls back to `OPENSANDBOX_API_URL` env var, then `https://app.opensandbox.ai`.</ParamField><ParamField body="envs" type="dict[str, str] | None" default="None">Environment variables injected into the sandbox.diff --git a/docs/sdks/typescript/sandbox.mdx b/docs/sdks/typescript/sandbox.mdxindex e7b537fd..a5dbeabe 100644--- a/docs/sdks/typescript/sandbox.mdx+++ b/docs/sdks/typescript/sandbox.mdx@@ -34,7 +34,7 @@ Creates a new sandbox and returns a connected `Sandbox` instance.API key. Falls back to `OPENSANDBOX_API_KEY` env var.</ParamField><ParamField body="apiUrl" type="string" optional>- API base URL. Falls back to `OPENSANDBOX_API_URL` env var, then `http://localhost:8080`.+ API base URL. Falls back to `OPENSANDBOX_API_URL` env var, then `https://app.opensandbox.ai`.</ParamField><ParamField body="envs" type="Record<string, string>" optional>Environment variables injected into the sandbox.diff --git a/sdks/python/README.md b/sdks/python/README.mdindex dcef59e3..b120fcc5 100644--- a/sdks/python/README.md+++ b/sdks/python/README.md@@ -36,7 +36,7 @@ asyncio.run(main())| Parameter | Env Variable | Default ||------------|------------------------|-------------------------|-| `api_url` | `OPENSANDBOX_API_URL` | `http://localhost:8080` |+| `api_url` | `OPENSANDBOX_API_URL` | `https://app.opensandbox.ai` || `api_key` | `OPENSANDBOX_API_KEY` | (none) |## Licensediff --git a/sdks/python/opensandbox/sandbox.py b/sdks/python/opensandbox/sandbox.pyindex 34bcb9b8..ce8f1d0f 100644--- a/sdks/python/opensandbox/sandbox.py+++ b/sdks/python/opensandbox/sandbox.py@@ -38,7 +38,7 @@ class Sandbox:metadata: dict[str, str] | None = None,) -> Sandbox:"""Create a new sandbox instance."""- url = api_url or os.environ.get("OPENSANDBOX_API_URL", "http://localhost:8080")+ url = api_url or os.environ.get("OPENSANDBOX_API_URL", "https://app.opensandbox.ai")url = url.rstrip("/")key = api_key or os.environ.get("OPENSANDBOX_API_KEY", "")@@ -96,7 +96,7 @@ class Sandbox:api_url: str | None = None,) -> Sandbox:"""Connect to an existing sandbox."""- url = api_url or os.environ.get("OPENSANDBOX_API_URL", "http://localhost:8080")+ url = api_url or os.environ.get("OPENSANDBOX_API_URL", "https://app.opensandbox.ai")url = url.rstrip("/")key = api_key or os.environ.get("OPENSANDBOX_API_KEY", "")diff --git a/sdks/typescript/README.md b/sdks/typescript/README.mdindex 8f39ebae..5722a3b4 100644--- a/sdks/typescript/README.md+++ b/sdks/typescript/README.md@@ -31,7 +31,7 @@ await sandbox.kill();| Option | Env Variable | Default ||-----------|------------------------|--------------------------|-| `apiUrl` | `OPENSANDBOX_API_URL` | `http://localhost:8080` |+| `apiUrl` | `OPENSANDBOX_API_URL` | `https://app.opensandbox.ai` || `apiKey` | `OPENSANDBOX_API_KEY` | (none) |## Licensediff --git a/sdks/typescript/src/sandbox.ts b/sdks/typescript/src/sandbox.tsindex e1a17775..158390fc 100644--- a/sdks/typescript/src/sandbox.ts+++ b/sdks/typescript/src/sandbox.ts@@ -59,7 +59,7 @@ export class Sandbox {}static async create(opts: SandboxOpts = {}): Promise<Sandbox> {- const apiUrl = resolveApiUrl(opts.apiUrl ?? process.env.OPENSANDBOX_API_URL ?? "http://localhost:8080");+ const apiUrl = resolveApiUrl(opts.apiUrl ?? process.env.OPENSANDBOX_API_URL ?? "https://app.opensandbox.ai");const apiKey = opts.apiKey ?? process.env.OPENSANDBOX_API_KEY ?? "";const body: Record<string, unknown> = {@@ -88,7 +88,7 @@ export class Sandbox {}static async connect(sandboxId: string, opts: Pick<SandboxOpts, "apiKey" | "apiUrl"> = {}): Promise<Sandbox> {- const apiUrl = resolveApiUrl(opts.apiUrl ?? process.env.OPENSANDBOX_API_URL ?? "http://localhost:8080");+ const apiUrl = resolveApiUrl(opts.apiUrl ?? process.env.OPENSANDBOX_API_URL ?? "https://app.opensandbox.ai");const apiKey = opts.apiKey ?? process.env.OPENSANDBOX_API_KEY ?? "";const resp = await fetch(`${apiUrl}/sandboxes/${sandboxId}`, {