Skip to main content
OpenCode is a 100% open-source, terminal-focused AI coding assistant that runs multiple models and integrates deeply with developer tools for coding automation.

Prerequisites

Before you begin, ensure you have a Cerebras API Key. Get an API key from the Cerebras Cloud console.

Configure OpenCode

1

Install OpenCode in your terminal

Run the following:
After installation, reload your shell configuration so the opencode command is available in your current session:
If you use bash, run source ~/.bashrc instead.
2

Select Cerebras

Run the following command, then select Cerebras from the dropdown menu:
step1
3

Configure API key

Enter your Cerebras API key:step2
4

Select a model and start coding!

Launch OpenCode in your project directory:
Once inside the OpenCode interface, type /models and press Enter to open the model selector. Choose a Cerebras model from the list.If a newly released model does not appear, refresh OpenCode’s model catalog, then reopen the model selector:
step3Now you can start coding!step4

Available Models

OpenCode supports all Cerebras models for AI coding assistance: You can switch between models at any time by typing /models inside the OpenCode interface.
If a Cerebras model doesn’t appear in the /models picker, refresh the OpenCode model cache from your terminal:
You can also add a model explicitly through your OpenCode config. Create or edit opencode.json in your project or home directory:

Troubleshooting

If you see an error immediately after selecting a Cerebras model:
  • 401 Unauthorized — Your API key is missing or invalid. Re-run opencode auth login, select Cerebras, and paste a fresh key from the Cloud Console.
  • 403 Forbidden or “model not available” — Cerebras models in OpenCode require a paid Cerebras plan. Upgrade in the Cloud Console, then restart OpenCode.
  • 404 Not Found or “model not found” — The model ID isn’t recognized by your OpenCode installation. Run opencode models --refresh to update the cached model list, then re-run /models.
  • 429 Too Many Requests — You’ve hit a rate limit. Wait and retry, or check your current usage in the Cloud Console.
  • Missing opencode command after install — Reload your shell (source ~/.zshrc or source ~/.bashrc) so the new binary is on your PATH.