Skip to main content
OpenCode is an open-source terminal AI coding assistant that supports custom providers in its config file. DreamTo can be connected either as OpenAI compatible (Chat Completions / Responses) or as Anthropic compatible (Messages).

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:
The new format uses a top-level providers, with package selecting the protocol, settings.baseURL the address, and env the environment variable holding the key:
opencode.jsonc
To call GPT over the Responses protocol, change package to @opencode/ai/providers/openai-compatible/responses.
The keys under 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

Run opencode in your project directory, type /models, choose a model under dreamto/... or dreamto-claude/..., and send a message to test.

FAQ

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.
  • Set baseURL to https://api.dreamto.ai/v1 for both providers: the OpenAI compatible package appends /chat/completions and the Anthropic package appends /messages.
  • Models are referenced as provider/model ID, for example dreamto-claude/claude-sonnet-5-5.
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.