Prerequisites
-
OpenCode is installed (
opencode --version). -
You have created an API Key on the API Keys page of the DreamTo console and set it as an environment variable:
Config file location
If the file already exists, merge only the provider-related fields and keep your other settings.
Setup
OpenCode’s config format changed in V2. Choose the tab for your version:- OpenCode V2 (new)
- Legacy (provider + npm)
The new format uses a top-level To call GPT over the Responses protocol, change
providers, with package selecting the protocol, settings.baseURL the address, and env the environment variable holding the key:opencode.jsonc
package to @opencode/ai/providers/openai-compatible/responses.models are the model IDs sent to DreamTo and must match the Model Marketplace; name is only the display name in the UI. You can add a limit to a model (such as {"context": 200000, "output": 64000}) to help OpenCode manage context.
Verify
Runopencode in your project directory, type /models, choose a model under dreamto/... or dreamto-claude/..., and send a message to test.
FAQ
401
401
Make sure the terminal that starts OpenCode can read
DREAMTO_API_KEY (echo $DREAMTO_API_KEY). If you previously saved other credentials for a provider of the same name with /connect, they may take precedence.404 / model not found
404 / model not found
- Set
baseURLtohttps://api.dreamto.ai/v1for both providers: the OpenAI compatible package appends/chat/completionsand the Anthropic package appends/messages. - Models are referenced as
provider/model ID, for exampledreamto-claude/claude-sonnet-5-5.
Protocol and model mismatch
Protocol and model mismatch
package (npm in the legacy format) determines the protocol. Put Claude models under the Anthropic compatible provider and GPT / DeepSeek and similar models under the OpenAI compatible provider.
