4 OpenCode login and model routes
Connect OpenCode to an available model provider. This page was checked 2026-09-14. If the menus differ, follow the current provider guide.
4.1 Connect
From the selected lab directory, run opencode. OpenCode may initially show currently available free models without extra configuration, but availability and shared quotas change. For a self-service workshop setup, configure OpenRouter. You need only one working route.
4.1.1 OpenRouter (recommended)
- Register or sign in and create a free API key on the OpenRouter API Keys page.
- Review the live model catalogue, filter for free models, and note one current choice. Model availability, upstream provider, and data policy can differ.
- In OpenCode, run
/connect, choose OpenRouter, and paste the key into the key prompt. - Run
/models, search forfree, choose that OpenRouter model, and return to the prompt.
4.1.2 NVIDIA (optional)
- Open the NVIDIA model catalogue, create or sign in to an NVIDIA account (requires verification via SMS message with your mobile phone number), choose a hosted model, and use its Get API Key flow.
- In OpenCode, run
/connect, choose NVIDIA, and paste the key into the key prompt. - Run
/models, choose an NVIDIA model available to your account, and return to the prompt.
4.1.3 OpenCode Zen (optional)
- Open OpenCode Zen authentication, sign in, and create an API key. Check the current Zen models and pricing rather than assuming that a listed model is available to your account.
- In OpenCode, run
/connect, choose OpenCode Zen, and paste the key into the key prompt. - Run
/modelsand select a model that your account actually exposes.
For any route, send a harmless orientation prompt such as What directory are you working in? Do not change files. A usable reply confirms that authentication, model selection, and the current session all work.
You can also watch the Zen, OpenRouter, or NVIDIA walkthrough.
Before the first prompt, check that the working directory contains only the workshop repository and fake data. Start with ordinary approval prompts. The labs introduce auto mode later.
4.2 Further reading
- OpenCode providers — Check the live OpenRouter, NVIDIA, and Zen authentication and model-routing instructions if the workshop menus have changed.
- OpenCode Zen — Read the current model, retention, and provider-exception table before choosing this route for anything beyond toy data.
OpenCode Zen describes zero-retention/no-training defaults with named exceptions. Check its live retention table. OpenRouter routes follow the terms of the selected provider and account.