Tutorial / persistent lifecycle
Run your first sandbox.
This walkthrough targets a locally running Wildflower Computer API and E2B. The same lifecycle works with Blaxel, Daytona, Runloop, or Fly.io Sprites when you change the typed provider input and credential.
Follow the local installation guide to run the API at http://localhost:8080. Set its bearer key and have a credential for the sandbox provider you want to use.
1. Set the request credentials
Keep literal provider credentials out of command history. These examples read them from environment variables and send them separately from the Wildflower Computer bearer key.
export WILDFLOWER_URL="http://localhost:8080"export WILDFLOWER_API_KEY="<your-wildflower-api-key>"export E2B_API_KEY="<your-e2b-api-key>"2. Use the TypeScript SDK
Make @wildflowercomputer/sdk available from the current source repository, then run this lifecycle. The generated package is currently versioned as 0.8.0 with distribution status source-only.
import { Wildflower } from "@wildflowercomputer/sdk";const client = new Wildflower({ wildflowerApiKey: process.env.WILDFLOWER_API_KEY,});const sandbox = await client.sandboxes.create({ provider: "e2b", image: "base", timeout: 300,});const handle = client.sandboxes.attach(sandbox.id);await handle.waitUntilReady();const result = await handle.runCommand({ command: "echo hello",});await handle.writeText("/tmp/hello.txt", "hello");console.log(result.stdout, result.stderr, result.exitCode);await handle.delete();This inline example lets the SDK reuse the provider key in process memory. A connected project profile lets a fresh process resolve the same provider access without embedding the secret in application code.
3. Or use the HTTP API directly
The TypeScript package is optional. This cURL sequence performs the same create, run-command, and delete operations and makes the language-independent API visible.
export WILDFLOWER_URL="http://localhost:8080"export WILDFLOWER_API_KEY="<your-wildflower-api-key>"export PROVIDER_API_KEY="$E2B_API_KEY"sandbox_id=$( curl -fsS "$WILDFLOWER_URL/v1/sandboxes" \ -H "Authorization: Bearer $WILDFLOWER_API_KEY" \ -H "Content-Type: application/json" \ -H "X-Provider-Api-Key: $PROVIDER_API_KEY" \ -H "Idempotency-Key: logical-create-42" \ --data '{"provider":"e2b","image":"base","timeout":300}' | jq -r '.id')curl -fsS "$WILDFLOWER_URL/v1/sandboxes/$sandbox_id/exec" \ -H "Authorization: Bearer $WILDFLOWER_API_KEY" \ -H "Content-Type: application/json" \ -H "X-Provider-Api-Key: $PROVIDER_API_KEY" \ --data '{"command":"echo hello > /tmp/hello && cat /tmp/hello"}'curl -fsS -X DELETE "$WILDFLOWER_URL/v1/sandboxes/$sandbox_id" \ -H "Authorization: Bearer $WILDFLOWER_API_KEY" \ -H "X-Provider-Api-Key: $PROVIDER_API_KEY"4. Inspect persistent state
Before deletion, use GET /v1/sandboxes/{id} to read the provider and current normalized status. Provider access comes from the connected profile or the inline credential used by this client.
curl -fsS "$WILDFLOWER_URL/v1/sandboxes/$sandbox_id" \ -H "Authorization: Bearer $WILDFLOWER_API_KEY" \ -H "X-Provider-Api-Key: $PROVIDER_API_KEY"Inspect provider identity, pricing, and capabilities
The authenticated provider catalog returns each stable provider ID, display name, normalized published price, source caveat, image and timeout modes, output streams, and supported lifecycle behavior without requiring a provider credential.
curl -fsS "$WILDFLOWER_URL/v1/providers" \ -H "Authorization: Bearer $WILDFLOWER_API_KEY"Change providers
Change the typed provider input and supply that provider's credential and connection context. The provider-profile guide and generated provider directory stay synchronized with every supported adapter.
