How to use OpenCode with any AI model
OpenCode is an open-source coding agent. The AnyModel installer writes its config so you can run GPT, Claude or Gemini through one key.
Setup
- 1.Create a free account and copy your API key.
- 2.
Run one command — it writes the config for you:
bash <(curl -fsSL "https://anymodel.org/i?tool=opencode&model=claude-sonnet-4-6") <YOUR_API_KEY>
On Windows, use the PowerShell variant from your Instructions page (the key is shown there).
- 3.Start coding. Switch models any time by changing the model id — same key, same endpoint.
Popular models for OpenCode
See all on the models page, or compare two side by side.
FAQ
Do I need a subscription to use OpenCode?
No. AnyModel is pay-per-token with one prepaid balance and no subscription.
Which models can I use in OpenCode?
All of them — GPT, Claude, Gemini, DeepSeek, Qwen and more, through one endpoint. You switch by changing the model id.
Is my data stored?
By default we keep request history. For sensitive work, turn on Ghost Mode for a zero-retention key — prompts and responses aren't stored on our side.
AnyModel