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

# OpenClaw

> Use AsterWise as the model provider for your OpenClaw agent.

Before you start, install the tool and create an API key with prepaid balance in the [AsterWise app](https://app.asterwise.dev).

<Note>Based on the tool’s documented custom-provider setup. Live AsterWise compatibility has not yet been tested for this tool.</Note>

## Which API does this use?

This guide selects **Chat Completions** through `api: "openai-completions"`. The base URL is `https://api.asterwise.dev/v1`. The client builds the full endpoint: `https://api.asterwise.dev/v1/chat/completions`.

The model name chooses AsterCode or AsterWork, not the protocol. Use the base URL in the configuration below, rather than the full endpoint.

## 1. Make the key available

```bash theme={"dark"}
export ASTER_API_KEY='your AsterWise API key'
```

If OpenClaw runs as a background service, set `ASTER_API_KEY` in its service environment or in the global `~/.openclaw/.env` file (`ASTER_API_KEY=your-key`), then restart the service. A terminal export does not update an already-running service. Keep this credential file outside your project repository.

## 2. Configure the provider

Merge these settings into `~/.openclaw/openclaw.json`, preserving your existing channels and agent settings:

```json theme={"dark"}
{
  "models": {
    "mode": "merge",
    "providers": {
      "asterwise": {
        "baseUrl": "https://api.asterwise.dev/v1",
        "apiKey": "${ASTER_API_KEY}",
        "api": "openai-completions",
        "models": [
          {
            "id": "aster-code",
            "name": "AsterCode"
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "asterwise/aster-code"
      }
    }
  }
}
```

## 3. Verify the selection

Apply the configuration to your running gateway. Run `openclaw models list` to check the model inventory and `openclaw models status` to check the resolved default and authentication. In an existing chat, use `/model status` to check for a session override before sending a message. If you use a model allowlist in `agents.defaults.models`, include `asterwise/aster-code` there too.

Before your first request, set the model’s `contextWindow` and `maxTokens` from Setup recommendations. This connection supplies the language model; separate tools and channels may need their own setup.

## Check the connection

Ask “Reply with hello” first. Confirm a response appears and find the request in **Usage** in AsterWise. Then try a small coding task before a larger project.

For authentication errors, check the key and restart the tool from the terminal where you exported it. See [troubleshooting](/errors-fallback).

## Official reference

Configuration reviewed on September 16, 2026. [OpenClaw custom providers](https://docs.openclaw.ai/concepts/model-providers/custom-providers) and [configuration](https://docs.openclaw.ai/gateway/configuration).
