# OpenClaw

# OpenClaw

[OpenClaw](https://docs.openclaw.ai) is OpenAI-compatible. Add Hyphen as a
custom provider with a `/v1` base URL and your Hyphen key.

## 1. Get a key

[app.hyphen-solution.com](https://app.hyphen-solution.com) → sign in →
**Dashboard → API Keys → Create**. Copy the `sk-hy-...` key.

## 2. Configure — one copy-paste block

OpenClaw defines providers under `models.providers.<id>` and requires the model
to be allow-listed. A minimal Hyphen provider on `m3`:

```json5
{
  models: {
    providers: {
      hyphen: {
        baseUrl: "https://api.hyphen-solution.com/v1",
        apiKey: "${HYPHEN_API_KEY}",
        api: "openai-completions",
        models: [
          {
            id: "m3",
            name: "Hyphen m3",
            contextWindow: 200000,
            maxTokens: 8192,
          },
        ],
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "hyphen/m3" },
      // OpenClaw rejects a model that isn't in the allowlist:
      models: {
        "hyphen/m3": { alias: "Hyphen m3" },
      },
    },
  },
}
```

Provide the key:

```bash
export HYPHEN_API_KEY="sk-hy-YOUR_KEY"
```

Fields that matter:

- `baseUrl` — **must end in `/v1`**. Omitting `/v1` is the most common silent
  failure.
- `apiKey` — reference an environment variable (`${HYPHEN_API_KEY}`) rather than
  inlining the key.
- `api: "openai-completions"` — treat Hyphen as an OpenAI Chat Completions
  endpoint.
- The fully-qualified id is `provider/model` — here `hyphen/m3`.

## 3. Verify

Start OpenClaw and send a one-word prompt (e.g. ask it to reply `connected`).
A completion back means the provider is wired up.

:::warning[Verify the exact config keys for your build]
OpenClaw's config surface (`models.providers`, the `api` value, and the
`agents.defaults.models` allowlist) has moved between releases. **Treat the
block above as the generic OpenAI-compatible setup and verify the exact keys for
your installed version** against the
[OpenClaw model-providers docs](https://docs.openclaw.ai/concepts/model-providers).
The invariants that always hold: an OpenAI-compatible base URL ending in `/v1`,
your Hyphen key, and a Hyphen model id (`m3`, `m2.7`, `m2.5`, or `text`).
:::

## Generic fallback (any OpenClaw version)

If your build exposes a single OpenAI base URL / API key (env or settings)
rather than the multi-provider block above, set:

```bash
export OPENAI_BASE_URL="https://api.hyphen-solution.com/v1"
export OPENAI_API_KEY="sk-hy-YOUR_KEY"
```

and select an `m3` model. See [Other clients](/agents/other-clients) for the
generic OpenAI-compatible pattern.

## Troubleshooting

- **Model rejected** — add the fully-qualified id (`hyphen/m3`) to the
  `agents.defaults.models` allowlist.
- **404 / wrong path** — `baseUrl` must end in `/v1`.
- **`429`** — monthly budget spent; see [Rate limits & caps](/rate-limits).
