Skip to content

Getting Started with OpenCode Zen

I used to waste so much time switching between different AI providers just to find a model that didn’t hallucinate basic syntax. Managing five different API keys and comparing pricing tables felt like a full-time job instead of actually coding. I wanted a single source that just worked. That is why I use OpenCode Zen. It is a curated list of models picked specifically for coding agents, and it saves me from the constant trial and error.

  • An active OpenCode account with billing details added.
  • The openclaw CLI installed on your machine.

You can get Zen running in about two minutes. I recommend using the CLI because it handles the heavy lifting for you.

Run this command to start the interactive setup:

Terminal window
openclaw onboard --auth-choice opencode-zen

If you prefer to do it in one go without the prompts, use the non-interactive version:

Terminal window
openclaw onboard --opencode-zen-api-key "$OPENCODE_API_KEY"

If you like to manage your settings manually, add this snippet to your configuration file. I usually set opencode/claude-opus-4-6 as my primary model because it handles complex logic better than most.

{
env: { OPENCODE_API_KEY: "sk-..." },
agents: {
defaults: {
model: {
primary: "opencode/claude-opus-4-6"
}
}
},
}

Sometimes things don’t go perfectly on the first try. Here are two things I usually check:

  • Authentication Errors: Make sure your key is correct. The system accepts both OPENCODE_API_KEY and OPENCODE_ZEN_API_KEY. If one fails, double-check your environment variables.
  • Request Failures: Since Zen is a hosted path in beta, check your billing dashboard. You pay per request, so ensure your balance isn’t empty.

If you run into a weird edge case, you can always ask the AI Setup Assistant for help.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.