POST /v1/agents/runtime
Base templates
These are the foundational images for coding agents, code execution, and shell work. All three share the same toolchain; they differ only 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.
Which size to pick
Agent templates (Claude Code / Codex)
Gravix Layer provides platform agent templates with the coding CLI already installed. Use them by name when creating a runtime — for example--template claude / template="claude".
Building from the Dockerfile yourself is optional (custom packages, baked
CLAUDE.md, private variants). Prefer 8 GB+ disk if you do build a custom image.
Sandboxes deny egress by default. For the agent to call the model API:
- Create an Identity provider secret —
ANTHROPIC_API_KEYfor Claude,OPENAI_API_KEYfor Codex — and attach it when creating the runtime. - Create a network policy allowlist that includes the vendor API hosts (at minimum
api.anthropic.com/api.openai.comon TCP 443; add auth and package-registry hosts as needed) and attach it to the runtime.
Build a custom template
Build a template when you need packages, files, or a different base image baked in before the runtime boots. To save the state of a runtime that is already running, use a snapshot instead. You can build from:- A public Docker image (
from_image) plus SDK build steps, or - A Dockerfile string (
dockerfile) for full control of the image layers
build_and_wait (raise timeout_secs for large images).
POST /v1/agents/template/build
From a Docker image
From a Dockerfile
Pass the Dockerfile contents directly. Put system packages and language installs in the Dockerfile; you still setstart_cmd / ready_cmd on the builder so Gravix can launch and verify the app during the snapshot phase.
Supported vs not supported
Gravix exports the Docker filesystem into the runtime image. Some Dockerfile / image settings are applied; others are ignored so platform defaults stay in control.Supported
Not supported (silently ignored)
These may appear in a Dockerfile or image config. Gravix builds anyway and uses platform defaults instead — 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)
TemplateBuilder reference
Manage templates
GET /v1/agents/template · GET /v1/agents/template/:id · DELETE /v1/agents/template/:id
Build status
Prefer
build_and_wait for a simple blocking workflow. It starts the build and polls until a terminal status.