Skip to main content
Create and manage runtimes (sandboxes) with the Gravix Layer Python or TypeScript SDK, the CLI, or the REST API.

Install

Authenticate

Create an API key in the console, then set it in your environment:
Or pass it when constructing the client:
Create the key in the Quickstart. It is shown once.

Cloud, region, and template

The SDK places runtimes on AWS / us-east-1 and uses the base-small template. Set cloud and region on the client, not on runtime.create().
Environment overrides: GRAVIXLAYER_CLOUD and GRAVIXLAYER_REGION. AWS us-east-1 (Virginia) and ap-south-1 (Mumbai) are available today; Azure and GCP are coming soon. The REST API still sends cloud and region in the create body. The SDKs fill those fields from the client so your application code stays small.

Create and run a sandbox

More create options: Create Runtime.

Run code

Every run_code / runCode call returns structured output (text, success, and optional error details).
JavaScript and persistent contexts: Run Code.

Run commands

Use run_cmd / runCmd for shell commands. Pass a single string, or a command plus args.
Install packages and scripts: Run Command.

Read and write files

Use sandbox.file (not files).
Full file API: Write File, Read File.

List and clean up

Language notes

Always call kill() when you are finished.

What’s next

Quickstart

Secrets, network policies, and a fuller walkthrough

CLI Usage

Install the CLI and manage sandboxes from your terminal

Snapshots

Checkpoint a runtime and create more from it

Templates

Base sizes and custom template builds

How a runtime works

Lifecycle, defaults, and what is inside a sandbox