models.providers, and DreamTo can be connected over either the Anthropic Messages or the OpenAI Chat Completions protocol.
Prerequisites
- OpenClaw is installed and initialized (you have run
openclaw onboard). - You have created an API Key on the API Keys page of the DreamTo console. We recommend first confirming in the console or with cURL that the key and model work.
Config file
OpenClaw reads its config from~/.openclaw/openclaw.json (JSON5, so comments are allowed). You can edit the file directly, or open the Config page of the control panel at http://127.0.0.1:18789 and edit it in the Raw JSON editor. Run openclaw config file to see the path of the config file in effect.
Setup
1
Set the API Key environment variable
${DREAMTO_API_KEY} to avoid a plaintext key in the file.2
Add providers
~/.openclaw/openclaw.json
models[].idis the model ID sent to DreamTo and must match the Model Marketplace.- Models are referenced as
provider ID/model ID, and the value inprimarymust exactly match a definition above. - Set
contextWindowandmaxTokensto the model’s actual specs; if omitted, OpenClaw uses conservative defaults.
3
Apply and verify
After you save, the Gateway reloads the config automatically. If it doesn’t take effect, run
openclaw gateway restart. Then start a new session and send a message to test. If config validation fails, run openclaw doctor --fix.You can also switch the default model from the command line:Gemini models
The native Gemini protocol uses different paths from the two above, so create a separate provider for it (protocol: Google Generative AI) with the address set to justhttps://api.dreamto.ai. Requests should end up at https://api.dreamto.ai/v1beta/models/<model ID>:generateContent. OpenClaw versions may build the path differently; if you get a 404, check for a duplicated or missing /v1beta.
FAQ
401
401
Make sure the OpenClaw Gateway process can read
DREAMTO_API_KEY. When the Gateway runs as a service, add the variable to the service environment or put the key directly in the config.404 / model not found
404 / model not found
- The Anthropic provider’s
baseUrlhas no/v1; the OpenAI provider’sbaseUrlincludes/v1. - The
provider/modelreferenced inprimarymust be defined underproviders.
The client shows only a generic error
The client shows only a generic error
Make one direct call with the same key and model using the cURL examples to tell whether it’s a config issue or an API issue. When troubleshooting, include the
X-Request-Id from the response headers.Reasoning parameter errors
Reasoning parameter errors
If a model doesn’t accept the reasoning effort parameter, set
compat: { supportsReasoningEffort: false } on that model, or remove reasoning: true.
