> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw

> Add DreamTo under OpenClaw's models.providers and power your personal AI assistant with Claude, GPT and other models.

[OpenClaw](https://docs.openclaw.ai) is an open-source personal AI assistant that connects to chat apps and carries out tasks. It supports custom model services through `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](https://www.dreamto.ai/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.

> [!WARNING]
>
> Merge only the `models` and `agents.defaults` fields below; don't overwrite the whole config.

## Setup

**1. Set the API Key environment variable**

```bash theme={null}
export DREAMTO_API_KEY="sk-xxxx"
```

Reference it in the config as `${DREAMTO_API_KEY}` to avoid a plaintext key in the file.

**2. Add providers**

```json5 ~/.openclaw/openclaw.json theme={null}
{
  models: {
    mode: "merge",
    providers: {
      // Claude family: Anthropic Messages, baseUrl without /v1
      "dreamto-claude": {
        baseUrl: "https://api.dreamto.ai",
        apiKey: "${DREAMTO_API_KEY}",
        api: "anthropic-messages",
        models: [
          {
            id: "claude-sonnet-5-5",
            name: "Claude Sonnet 5.5",
            reasoning: true,
            input: ["text", "image"],
            contextWindow: 200000,
            maxTokens: 32000,
          },
        ],
      },
      // GPT / DeepSeek, etc.: OpenAI Chat Completions, baseUrl with /v1
      "dreamto-openai": {
        baseUrl: "https://api.dreamto.ai/v1",
        apiKey: "${DREAMTO_API_KEY}",
        api: "openai-completions",
        models: [
          { id: "deepseek-v4.1-flash-1017", name: "DeepSeek V4.1 Flash", contextWindow: 128000 },
          { id: "gpt-6.2-sol", name: "GPT-6.1 Sol", reasoning: true, contextWindow: 200000 },
        ],
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "dreamto-claude/claude-sonnet-5-5" },
    },
  },
}
```

* `models[].id` is the model ID sent to DreamTo and must match the [Model Marketplace](https://www.dreamto.ai/models).
* Models are referenced as `provider ID/model ID`, and the value in `primary` must exactly match a definition above.
* Set `contextWindow` and `maxTokens` to 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:

```bash theme={null}
openclaw config set agents.defaults.model.primary "dreamto-openai/gpt-6.2-sol"
```

## 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 just `https://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

> [accordion] 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.

> [accordion] 404 / model not found
>
> * The Anthropic provider's `baseUrl` has no `/v1`; the OpenAI provider's `baseUrl` includes `/v1`.
> * The `provider/model` referenced in `primary` must be defined under `providers`.

> [accordion] The client shows only a generic error
>
> Make one direct call with the same key and model using the [cURL examples](https://docs.dreamto.ai/en/integrations/sdks.md) to tell whether it's a config issue or an API issue. When troubleshooting, include the `X-Request-Id` from the response headers.

> [accordion] Reasoning parameter errors
>
> If a model doesn't accept the reasoning effort parameter, set `compat: { supportsReasoningEffort: false }` on that model, or remove `reasoning: true`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.