StateSet Sandbox - Quick Start
Get up and running with StateSet Sandbox in 5 minutes.1. Get Your API Key
api_key from the response — you’ll need it!
2. Install the SDK
TypeScript / Node.js:- Rust:
sdk-rust/README.md - Ruby:
sdk-ruby/README.md - Go:
sdk-go/README.md - PHP:
sdk-php/README.md - Java:
sdk-java/README.md - Kotlin:
sdk-kotlin/README.md - Swift:
sdk-swift/README.md
3. Create Your First Sandbox
TypeScript
Python
cURL
4. Write and Read Files
TypeScript
Python
5. Interactive REPL Sessions
REPL sessions let you execute code interactively with persistent state across calls — ideal for data exploration, iterative development, and AI agent workflows.
Note: Requires REPL_ENABLED=true on the controller.
cURL
TypeScript
6. Choose a Template
Templates pre-configure your sandbox with the right tools:Validate Computer-Use Template (optional)
7. Use with AI Frameworks
StateSet Sandbox integrates with popular AI frameworks so your agents can execute code safely:LangChain
OpenAI Function Calling
Vercel AI SDK
8. Full Example: AI Agent Task
Environment Variables
What’s Next?
- Python SDK Guide — full Python reference
- Node.js SDK Guide — full TypeScript reference
- LangChain Guide — build LangChain agents with sandboxes
- OpenAI Guide — OpenAI function calling integration
- Vercel AI SDK Guide — AI SDK tool integration
- Templates Guide — all available sandbox templates
- API Reference — full REST API documentation
- Production Guide — deployment and operations
Troubleshooting
Auth failures (401/403)- Verify
STATESET_API_KEYis set and valid. - For API key auth (non-JWT), ensure the key belongs to your org.
- Check your plan’s max runtime and concurrent sandbox limits.
- Reduce CPU/memory or shorten timeouts if you hit rate limits.
- Increase
timeoutfor long-running commands (up to 10 minutes). - Prefer smaller steps and check stdout/stderr for partial output.
- Artifact routes require
ARTIFACTS_ENABLED=trueand storage config.
Next steps
Sandbox API reference
Every endpoint behind the SDK calls above.
Runtime selection
Container, gVisor or MicroVM, and what each costs.
Security guide
Before running anything untrusted.
Deployments
Self-hosting the same controller.