Run OpenCode in the cloud
Updated
Run OpenCode on a cloud box that stays on: its free models or your own provider signed in on the box, the permissions it starts with and how to change them, headless runs with opencode run, and what it costs.
On this page6
OpenCode works with almost any model provider, and comes with free models that need no account. On a Prized box it runs in a tmux session on a Linux machine that stays on, so it keeps working with your laptop closed while its edits sync back to your project.
1. Start OpenCode on a box
New to Prized? Sign up: the tour starts a box on $30 of free credit and gives you the command that installs the CLI (Quickstart). Then sync your project to the box:
cd ~/code/myproject
prized setup --sync --no-start--no-start keeps setup from starting Claude Code there. Then start OpenCode on the box and open its session:
prized agents run opencode --attach --dir code/myprojectThe first run installs OpenCode 2 from a pinned release, checked against its SHA-256; that copy does not update itself. If you installed OpenCode on the box yourself, that copy runs instead, and it must be OpenCode 2.
2. Pick a model, and sign in on the box
Your laptop's OpenCode sign-in stays on your laptop. On the box, choose one of these:
- OpenCode's free models. No account and no key. They are free for a limited time, and some may use what you send to improve the model, so keep private code off them (OpenCode's free models).
- Your provider, signed in on the box. Type
/connectin OpenCode and pick the provider, or runopencode auth loginin a shell on the box. A sign-in that offers a code to enter, such as GitHub Copilot's, finishes in a browser on any device. OpenCode keeps it on the box, under~/.local/share/opencode. - A provider key as a Secret. Add
ANTHROPIC_API_KEY,OPENAI_API_KEY,OPENROUTER_API_KEYor another provider's key as a Secret, so its real value never sits on the box's disk (Keys for other agents). OpenCode reads keys when its background server starts, and that server keeps running after you quit OpenCode: once the key is added, runopencode service restartin a new shell on the box (prized ssh).
Then /models in OpenCode picks the model. opencode models in a shell lists every model your providers offer, written provider/model.
3. What it may do without asking
OpenCode starts permissive: it edits files and runs commands without asking. Only reading .env files, touching paths outside the project, and the same tool call repeated three times stop to ask, and a question waits until you come back (OpenCode's permissions). To make it ask or refuse, set rules in the permission block of opencode.json in your project, which syncs to the box, or in ~/ on the box:
{
"permission": {
"bash": { "*": "allow", "git push *": "ask", "rm *": "deny" }
}
}The last matching rule wins. Shift+Tab switches between OpenCode's two built-in agents: Build does the work, and Plan works out what to do without editing your files.
4. Close the lid, and check on it
Give OpenCode its task and close the laptop: the opencode session belongs to the box, and its edits reach your laptop when it wakes (Sync).
- From a terminal:
prized ssh -s opencode. If the session is gone,prized agents run opencode --attach --dir code/myprojectstarts OpenCode again, andopencode --continuethere picks the last session back up. - From your phone: open the box on the dashboard and pick OpenCode from the arrow beside Open terminal.
On the free credit an idle box sleeps after 2 hours. OpenCode printing in its session counts as use, and prized box auto-pause BOX off keeps the box up through a quiet stretch of up to 12 hours, and with no limit on a plan or after a top-up (Auto-pause).
Hand it a task without a terminal
prized prompt --provider opencode --cwd code/myproject --auto --detach "run the test suite and fix what fails"This runs opencode run headless on the box and returns at once; prized events --follow follows it. Without --auto, the run sets OpenCode's shell commands to ask, which a headless run answers no, so it edits files but runs nothing; --auto runs opencode run --auto, which approves every permission your config does not deny. --model takes OpenCode's provider/model ids. --effort needs --model: OpenCode runs it as that model's variant (provider/model#high), and a model without the variant fails the run (Prompt an agent remotely).
What it costs
OpenCode's free models cost nothing while they are free; any other provider bills you directly, as on your laptop. Prized bills the box: a Small (4 vCPU, 16 GB) is $0.137 an hour awake, $1.37 for a 10 hour run overnight, and only its disk while it sleeps (Billing).
Rather work in a window? opencode Desktop runs its sessions on the box too.