OpenClaw Setup
Use your ClaudeStore API key with OpenClaw via a custom anthropic-messages provider in ~/.openclaw/openclaw.json. Recommended config, model IDs, verification, and troubleshooting.
Config file: ~/.openclaw/openclaw.json. Provider id: claudestore. API mode: anthropic-messages. baseUrl: https://api3.claudestore.store. Env var: CLAUDESTORE_API_KEY. Primary model: claudestore/claude-sonnet-4-6.
Why this setup
OpenClaw lets you register additional model providers via the models.providers block in its config file. For Claude models served by ClaudeStore, the cleanest integration is to add ClaudeStore as a custom anthropic-messages provider.
- OpenClaw treats it as a first-class Anthropic-compatible provider.
- System blocks, tool use, content blocks, and reasoning are preserved end-to-end.
- You keep using normal OpenClaw model refs (
claudestore/claude-sonnet-4-6).
openai-completions providers, but for Claude on ClaudeStore the Anthropic Messages path is the recommended route — don't pick the OpenAI-compatible mode unless you have a specific reason.Config path
OpenClaw reads its config from a single JSON file in your home directory:
~/.openclaw/openclaw.jsonThe CLI exposes openclaw config and openclaw configure helpers, but for a provider this specific it's faster and clearer to edit the JSON directly. The snippet below is drop-in.
Environment variable
Export your ClaudeStore key so the config can reference it via placeholder:
export CLAUDESTORE_API_KEY="YOUR_SK_CS4_KEY"Storing the key in an env var keeps it out of openclaw.json and out of any backups or git history of dotfiles.
Minimal working config
Drop this into ~/.openclaw/openclaw.json (the file is parsed as JSON5, so trailing commas and comments are allowed):
{
env: {
CLAUDESTORE_API_KEY: "YOUR_SK_CS4_KEY",
},
agents: {
defaults: {
model: { primary: "claudestore/claude-sonnet-4-6" },
},
},
models: {
mode: "merge",
providers: {
claudestore: {
baseUrl: "https://api3.claudestore.store",
apiKey: "${CLAUDESTORE_API_KEY}",
api: "anthropic-messages",
models: [
{
id: "claude-sonnet-4-6",
name: "Claude Sonnet 4.6",
reasoning: true,
input: ["text", "image"],
contextWindow: 1000000,
maxTokens: 64000,
},
{
id: "claude-opus-4-7",
name: "Claude Opus 4.7",
reasoning: true,
input: ["text", "image"],
contextWindow: 1000000,
maxTokens: 128000,
},
{
id: "claude-haiku-4-5",
name: "Claude Haiku 4.5",
reasoning: true,
input: ["text", "image"],
contextWindow: 200000,
maxTokens: 64000,
},
],
},
},
},
}Stick to the recommended ids
claudestore and primary model must be claudestore/claude-sonnet-4-6. Don't use anthropic/... refs as the primary model in this config — those route through OpenClaw's built-in Anthropic provider, not through ClaudeStore.Why no /v1 in baseUrl
In OpenClaw's Anthropic-compatible provider flow, baseUrl is the provider root. OpenClaw appends the Anthropic Messages path itself.
- ✅ Correct:
https://api3.claudestore.store - ❌ Wrong:
https://api3.claudestore.store/v1
Adding /v1 here will double up the path and you'll see 404s on every request.
Verification
After saving the config, run these checks in order:
openclaw gateway statusConfirms OpenClaw can reach the configured providers.
openclaw models listYou should see claudestore/claude-sonnet-4-6, claudestore/claude-opus-4-7, and claudestore/claude-haiku-4-5 in the output.
openclaw models set claudestore/claude-sonnet-4-6openclaw dashboardSend a small request from the dashboard and confirm the call shows up under the claudestore provider.
Advanced: 1M context
For long-context work on Sonnet 4.6 or Opus 4.7, enable the 1M context flag per model:
{
agents: {
defaults: {
models: {
"claudestore/claude-sonnet-4-6": { params: { context1m: true } },
"claudestore/claude-opus-4-7": { params: { context1m: true } },
},
},
},
}Sonnet/Opus only
context1m on supported Sonnet and Opus models. Leave Haiku at its standard context window — turning it on there will fail at the model side.Important limitation: /fast
/fast is not 1:1 through a gateway
/fast behavior was built around direct Anthropic transport. When traffic is routed through a custom gateway provider like claudestore, OpenClaw does not automatically inject Anthropic's service-tier behavior the same way. Treat /fast as a best-effort hint here, not a guaranteed transport-level contract.Troubleshooting
404s from the provider
Almost always caused by /v1 in baseUrl. Use https://api3.claudestore.store as the bare root and let OpenClaw build the path.
Wrong provider mode
If you set api: "openai-completions", OpenClaw will try to talk OpenAI Chat Completions to an Anthropic-shaped endpoint. Switch back to api: "anthropic-messages".
Primary model not found
The primary model ref must include the provider prefix: claudestore/claude-sonnet-4-6. A bare claude-sonnet-4-6 or an anthropic/claude-sonnet-4-6 won't resolve to the ClaudeStore provider.
API key not exported
Confirm the env var is loaded in the shell that launches OpenClaw:
echo $CLAUDESTORE_API_KEYIf empty, re-export it and restart the shell. The placeholder ${CLAUDESTORE_API_KEY} in the config is resolved at process start.
OpenClaw starts but model is missing
Usually a naming mismatch: the model id inside providers.claudestore.modelsdoesn't match the ref used in agents.defaults.model.primary. The full ref is <providerId>/<modelId>.
Windows setup
1. Install OpenClaw
OpenClaw ships as a npm package and as standalone Windows binaries:
npm install -g openclaw
openclaw --versionOr grab openclaw-windows-x64.exe from GitHub Releases and put it on your PATH.
2. Config path on Windows
OpenClaw reads %USERPROFILE%\.openclaw\openclaw.json (e.g. C:\Users\<you>\.openclaw\openclaw.json):
mkdir $env:USERPROFILE\.openclaw -ErrorAction SilentlyContinue
notepad $env:USERPROFILE\.openclaw\openclaw.jsonPaste the minimal config from the section above. Save as UTF-8 (no BOM).
3. Persist CLAUDESTORE_API_KEY
setx CLAUDESTORE_API_KEY "YOUR_SK_CS4_KEY"setx only updates NEW terminals. Close the current PowerShell, open a new one, then verify with echo $env:CLAUDESTORE_API_KEY.GUI alternative: Win+R → sysdm.cpl → Environment Variables → User variables → New.
4. Verify
openclaw gateway status
openclaw models list
openclaw models set claudestore/claude-sonnet-4-65. WSL
If you launch OpenClaw from inside WSL, use the Linux config path ~/.openclaw/openclaw.json and re-export the env var in ~/.bashrc:
export CLAUDESTORE_API_KEY="YOUR_SK_CS4_KEY"6. Troubleshooting
- "openclaw is not recognized" — open a fresh PowerShell, or add
%APPDATA%\npmto PATH. - Placeholder
${CLAUDESTORE_API_KEY}not resolved — env var not set in the shell that launchedopenclaw. Usesetxand reopen. - JSON parse error — Notepad saved with BOM. Save the file as UTF-8 without BOM (use VS Code or Notepad++).
- PowerShell quoting — wrap all values in double quotes; cmd.exe rules differ.
- Antivirus blocks
node.exe/openclaw.exe— whitelist the binary and the hostapi3.claudestore.store.