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
- Open
https://www.getunikey.ai/. - Log in.
- Open the API key or token page.
- Create a new API key.
- 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:
| System | File path |
|---|---|
| macOS | ~/.openclaw/openclaw.json |
| Linux | ~/.openclaw/openclaw.json |
| Windows | %USERPROFILE%\.openclaw\openclaw.json |
Recommended method:
- Open the OpenClaw dashboard at
http://127.0.0.1:18789/. - Go to the model/provider settings area.
- Add an OpenAI-compatible or custom OpenAI provider.
- Fill in:
| Field | Value |
|---|---|
| Provider name | unikey |
| Base URL | https://www.getunikey.ai/v1 |
| API key | Your UniKey API key |
| Default model | claude-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
| Symptom | What to check |
|---|---|
openclaw command not found | Reopen the terminal. Confirm the OpenClaw install path is in PATH. |
node command not found | Reinstall Node.js and reopen the terminal. |
| Gateway not installed | Run openclaw gateway install, then openclaw gateway restart. |
| 401 unauthorized | Check that the UniKey API key is copied correctly and has no extra spaces. |
| 404 model not found | Use /v1/models or the UniKey model list, then choose an accessible model. |
| 429 or insufficient credits | Check UniKey usage, rate limits, and AI Credits balance. |
| Dashboard changes override CLI switching | Reopen ~/.openclaw/openclaw.json or the Windows path and confirm the selected model in the dashboard. |