What you need
- A Runloop API key (
RUNLOOP_API_KEY) - One of:
- Python 3.11+ and
uv - Node.js 18+ and
npm
- Python 3.11+ and
- Optional model provider keys:
ANTHROPIC_API_KEYOPENAI_API_KEY
Environment variables
Set your Runloop API key before running any command:Instead of exporting provider keys directly, you can store them as Runloop
account secrets and map them into your devbox at runtime. See Account
Secrets.
The starter image is used when you start a devbox without specifying an image, and as the default base when you build a blueprint without providing Dockerfile content. It includes:
- Core tools: jq, sudo
- Extras: dnsutils, iputils-ping, less, vim, rsync, gh
- Python stack: Python 3.12, pip, uv
- Node stack: Node 22.15.0, npm, Yarn 1.22.22 via corepack
Setup
Clone the reference implementation:Create a blueprint with OpenCode
opencode blueprint with OpenCode preinstalled.
Create a devbox with OpenCode
opencode web, enables a tunnel, and prints the OpenCode URL.
Optional: create devbox without blueprint (manual install)
Use this when you want zero upfront setup:Manual mode is slower because OpenCode is installed in a fresh devbox each
run.
How the integration works internally
Each run follows this flow:- Create a devbox (from blueprint or fresh)
- Install OpenCode (manual mode only)
- Write OpenCode config in the devbox
- Start OpenCode on
0.0.0.0:3000 - Create a Runloop tunnel and print the URL
OpenCode Dockerfile
Use this Dockerfile when creating the blueprint:OpenCode config
Use this OpenCode config payload:Write config into the devbox filesystem
The starter writes config to/home/user/.config/opencode/opencode.json before starting OpenCode:
Snippets
Creating a blueprint with OpenCode
Creating a devbox with OpenCode
Common issues
- Missing API key errors
- Confirm
RUNLOOP_API_KEYis set in your shell before running commands.
- Confirm
- Provider/model errors
- Set
ANTHROPIC_API_KEYorOPENAI_API_KEYbased on the model you are using.
- Set
- Slow startup
- Use blueprint mode (
create-blueprintonce, thenrun) instead of--manual.
- Use blueprint mode (
Next steps
- Start from the source reference repo: runloopai/opencode-starter
- Review Devbox overview
- Learn about Blueprints
- Learn how Tunnels expose local services securely
