Infra overview · Choose a coding agent
OpenCode for minimal spending
OpenCode is a free, open-source coding agent. Connect a model provider and pay for that provider’s usage. No OpenCode subscription is required for this path; paid models and optional plans have their own charges.
1. Install and launch
Use the official installation instructions for your operating system. If Node.js and npm are already installed, the npm option is:
npm install -g opencode-ai
opencode --version
Create or select a new, empty project folder in your terminal, then run opencode there. Keep terminal command access enabled so the agent can do setup work.
2. Connect a low-cost model
- Choose a supported provider, such as OpenRouter, and check its current model rates and billing requirements.
- Create a provider key, set a spending limit, and save it in a project-specific Bitwarden item. Keep recovery codes and account login details there too.
- In OpenCode, type
/connectand select your provider. Enter the key through the credential prompt, not a chat message or a project file. - Type
/modelsand choose a low-cost model that supports coding and tools. If you plan to paste screenshots, confirm image support too.
Free-model availability and promotional credits change. This route does not depend on a trial, and does not promise free model usage. See official provider and model selection documentation.
3. Start the project
Paste the setup prompt from the main guide. The agent creates your own repository and continues setup. Once the project exists, ask it to read AGENTS.md before making changes.
All new credentials belong in your project’s Bitwarden collection. Ask the agent to retrieve them only through authorized vault access; keep values out of source files, logs, and chat.