Run a Step then Generate
CoT for code

Steprun.ai is a Secure REPL Sandbox Runtime Environment for Agentic & AI use cases

Core API Endpoints

API Reference
POST/api/v1/sessions

Create a new sandbox session

DELETE/api/v1/sessions/{session_id}

Destroy an existing session

POST/api/v1/sessions/{session_id}/exec

Execute code in the sandbox environment

POST/api/v1/sessions/{session_id}/packages

Install packages in the sandbox environment

POST/api/v1/sessions/{session_id}/hibernate

Hibernate a session to save resources

POST/api/v1/sessions/{session_id}/restore

Restore a previously hibernated session

Core Advantages

Escape if-else hell

Focus on the current execution path only, skipping exponential branching complexity.

Debug line by line

Catch and fix errors instantly–line by line, no post-hoc tracing.

Declare now, implement later

Define function stubs first, fill logic only when called (like human iterative coding).

Hibernate & restore

Persist sessions mid-execution, ideal for long-running processes and iterative workflows.

API in Action

API Request Examples

1. Create a Session

// Request
POST /api/v1/sessions
Content-Type: application/json

{
 "runtime":"python3.9"
}

// Response
{
 "session_id":"sess_abc123xyz",
 "status":"ready",
 "runtime":"python3.9",
 "created_at":"2023-05-15T15:30:45Z"
}

2. Execute Code

// Request
POST /api/v1/sessions/sess_abc123xyz/exec
Content-Type: application/json

{
 "code":"def find_primes(n):\n    if n <Link 2:\n        return []\n    return [x for x in range(2, n+1) if all(x % y != 0 for y in range(2, int(x**0.5) + 1))]\n\nprint(find_primes(20))"
}

// Response
{
 "status":"success",
 "output":"[2, 3, 5, 7, 11, 13, 17, 19]",
 "execution_time": 0.0045
}

3. Install Package

// Request
POST /api/v1/sessions/sess_abc123xyz/packages
Content-Type: application/json

{
 "packages": ["numpy","pandas==1.4.2"]
}

// Response
{
 "status":"success",
 "installed": [
    {"name":"numpy","version":"1.23.5"},
    {"name":"pandas","version":"1.4.2"}
  ]
}

Perfect for AI Platforms & Tools

Our sandbox runtime provides the execution environment that AI platforms need

For AI Platforms

Integrate our sandbox API to safely execute code generated by your AI models

  • Secure execution of AI-generated code
  • Step-by-step validation and debugging
  • Isolated environments for each user

For Developers

Build interactive coding tutorials or educational platforms

  • Interactive code examples in documentation
  • Educational platforms with live code execution
  • Collaborative coding environments

Ready to Power Your Applications?

Get started with our sandbox runtime API today