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

# Use CerasAI with OpenClaw

> Connect OpenClaw directly to CerasAI with a custom OpenAI-compatible provider.

## Before you begin

Install OpenClaw CLI, create a key on the
[API Keys](https://console.cerasai.cloud/keys) page, and choose a model on the
[Models](https://console.cerasai.cloud/models) page.

**1. Set your API key**

Set your key in the Gateway’s environment:

```bash theme={"system"}
export CERASAI_API_KEY="your-key"
```

For a managed service, set the variable in its service configuration.

**2. Configure CerasAI**

The configuration uses `deepseek-ai/DeepSeek-V4.1-Flash-1017` as an example.

Merge into `~/.openclaw/openclaw.json`, keeping existing settings. Set the token
limits to match your model.

> [accordion] OpenClaw configuration
>
> ```json ~/.openclaw/openclaw.json theme={"system"}
> {
>   "agents": {
>     "defaults": {
>       "model": { "primary": "cerasai/deepseek-ai/DeepSeek-V4.1-Flash-1017" },
>       "models": {
>         "cerasai/deepseek-ai/DeepSeek-V4.1-Flash-1017": {}
>       },
>       "thinkingDefault": "high"
>     }
>   },
>   "models": {
>     "mode": "merge",
>     "providers": {
>       "cerasai": {
>         "baseUrl": "https://api.cerasai.cloud/v1",
>         "apiKey": "${CERASAI_API_KEY}",
>         "api": "openai-completions",
>         "models": [
>           {
>             "id": "deepseek-ai/DeepSeek-V4.1-Flash-1017",
>             "name": "deepseek-ai/DeepSeek-V4.1-Flash-1017",
>             "reasoning": true,
>             "input": ["text"],
>             "contextWindow": 1048576,
>             "maxTokens": 393216,
>             "compat": {
>               "supportsReasoningEffort": true,
>               "supportedReasoningEfforts": ["low", "high", "max"],
>               "reasoningEffortMap": {
>                 "low": "low",
>                 "high": "high",
>                 "max": "max",
>                 "xhigh": "max"
>               },
>               "thinkingFormat": "deepseek",
>               "maxTokensField": "max_tokens"
>             },
>             "thinkingLevelMap": {
>               "minimal": null,
>               "low": "low",
>               "medium": null,
>               "high": "high",
>               "xhigh": null,
>               "max": "max"
>             }
>           }
>         ]
>       }
>     }
>   }
> }
> ```

To add another model or tier, copy the entry in `models.providers.cerasai.models`.
Set `id` and `name` to the ID from the [model catalog](https://console.cerasai.cloud/models),
and adjust `contextWindow` and `maxTokens` to match the model. Also add
`cerasai/<model-id>` to `agents.defaults.models`.

**3. Restart the Gateway**

Restart your Gateway to load the provider and key:

```bash theme={"system"}
openclaw gateway restart
```

## Model and reasoning effort

* **Model and tier:** Use `/model cerasai/<model-id>`; in the TUI, use `/models`.
* **Reasoning effort:** Use `/think low`, `/think high`, or `/think max`.

> [accordion] Use a local TUI without a Gateway
>
> With the same configuration and your key exported:
>
> ```bash theme={"system"}
> openclaw tui --local
> ```
>
> Use `/models` and `/think`. Omit the startup `--thinking` flag, which overrides
> the session’s effort selection.

Issues common to every agent are listed under [Common issues](https://docs.cerasai.com/agent-integrations#common-issues).

## Resources

* [OpenClaw documentation](https://docs.openclaw.ai/gateway/config-tools/custom-providers)
* [CerasAI models](https://console.cerasai.cloud/models)


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