Skip to main content

OpenClaw beginner setup with UniKey

This guide starts from a clean machine and gets OpenClaw running with the UniKey OpenAI-compatible API.

UniKey Relay is built on NewAPI, so OpenClaw should be configured as an OpenAI-compatible provider:

Base URL: https://www.getunikey.ai/v1
API Key: your UniKey API key
Model: claude-sonnet-4-6 or gpt-5.2

1. Install Node.js

OpenClaw requires a recent Node.js runtime. Use Node.js 24 if possible. Node.js 22.14+ is also acceptable.

macOS

If you use Homebrew:

brew install node
node -v
npm -v

Linux

Use your distribution package manager or NodeSource. After installation:

node -v
npm -v

Windows

Install Node.js from the official Node.js installer, then open PowerShell and verify:

node -v
npm -v

If node is not recognized, close and reopen PowerShell after installation.

2. Install OpenClaw

Follow the current OpenClaw installer for your platform. After installation, verify that the CLI is available:

openclaw --version

On Windows PowerShell:

openclaw --version

3. Initialize OpenClaw

Run onboarding:

openclaw onboard --install-daemon

If your OpenClaw version separates daemon installation from onboarding, run:

openclaw gateway install
openclaw gateway restart

Then verify:

openclaw gateway status

4. Create a UniKey API key

  1. Open https://www.getunikey.ai/.
  2. Log in.
  3. Open the API key or token page.
  4. Create a new API key.
  5. Copy it once and store it in a password manager or local secret store.

Never paste the key into public chat, Git commits, browser frontend code, or shared screenshots.

5. Configure the provider

OpenClaw stores local configuration in this file:

SystemFile path
macOS~/.openclaw/openclaw.json
Linux~/.openclaw/openclaw.json
Windows%USERPROFILE%\.openclaw\openclaw.json

Recommended method:

  1. Open the OpenClaw dashboard at http://127.0.0.1:18789/.
  2. Go to the model/provider settings area.
  3. Add an OpenAI-compatible or custom OpenAI provider.
  4. Fill in:
FieldValue
Provider nameunikey
Base URLhttps://www.getunikey.ai/v1
API keyYour UniKey API key
Default modelclaude-sonnet-4-6 or gpt-5.2

Save the configuration. OpenClaw will write the final JSON structure into openclaw.json.

6. Restart and test

Restart the gateway:

openclaw gateway restart
openclaw gateway status

Then switch to a UniKey model if your OpenClaw CLI supports model switching:

openclaw models set unikey/claude-sonnet-4-6

Open the dashboard again:

http://127.0.0.1:18789/

Start a new agent/chat task and send:

Say one sentence confirming that OpenClaw is using UniKey.

If the model responds, OpenClaw is using the UniKey API successfully.

Troubleshooting

SymptomWhat to check
openclaw command not foundReopen the terminal. Confirm the OpenClaw install path is in PATH.
node command not foundReinstall Node.js and reopen the terminal.
Gateway not installedRun openclaw gateway install, then openclaw gateway restart.
401 unauthorizedCheck that the UniKey API key is copied correctly and has no extra spaces.
404 model not foundUse /v1/models or the UniKey model list, then choose an accessible model.
429 or insufficient creditsCheck UniKey usage, rate limits, and AI Credits balance.
Dashboard changes override CLI switchingReopen ~/.openclaw/openclaw.json or the Windows path and confirm the selected model in the dashboard.