base-small is the default. Use browser-small to drive a browser, and desktop-small to see and control the screen. Use claude or codex when that coding CLI should already be installed. Build a template when packages or files must be in the image before the runtime boots. To save a runtime that is already running, use a snapshot.
Start from a template
template="claude" or --template claude (and the same for codex) to start from an agent template. More create options are on Create a runtime.
Build a template
Build from a public Docker image (from_image) plus build steps, or from a Dockerfile string. build_and_wait blocks until the template is ready. Raise the timeout for a large image.
Build from a public image
Build from a Dockerfile
Pass the Dockerfile contents directly. Put system packages and language installs in the Dockerfile. Setstart_cmd and ready_cmd on the builder so the app is launched and checked.
Compare base sizes
The three base templates share one toolchain. They differ in CPU, memory, and disk.What’s included
Full definition:
base.Dockerfile in the Python SDK examples.
Users and layout
python3. The seeded workspace venv is on
PATH (python / pip resolve there). Prefer pip install or uv pip install
into /workspace/.venv.
Start with a coding CLI
Building from the Dockerfile yourself is optional (custom packages, a baked
CLAUDE.md, private variants). Prefer 8 GB+ disk if you do.
Runtimes deny outbound traffic by default. Attach an identity provider secret — ANTHROPIC_API_KEY for claude, OPENAI_API_KEY for codex — and a network policy that allows the model API. At minimum allow api.anthropic.com or api.openai.com on TCP 443, and add auth or package-registry hosts when you need them. Step-by-step: Claude Code on Gravix Layer.
What a build keeps
The Docker filesystem becomes the runtime image. Some image settings are applied. Others are ignored so platform defaults stay in effect.Supported
Not supported (silently ignored)
These may appear in a Dockerfile or image config. The build continues and uses platform defaults. The build does not fail because of them.
Platform-owned env keys from the image are also skipped when merging:
PATH, HOME, HOSTNAME, SHELL, USER, LOGNAME.
Not supported (will fail or is unavailable)
Call the builder
List your templates
Read the build status
Prefer
build_and_wait for a simple blocking workflow. It starts the build and polls until a terminal status.Endpoint
POST /v1/agents/runtime
POST /v1/agents/template/build
GET /v1/agents/template · GET /v1/agents/template/:id · DELETE /v1/agents/template/:id