#Setting Groq as a provider
1 messages Ā· Page 1 of 1 (latest)
Let me check the docs and current behavior so I donāt make up config steps.
Yep, Groq is supported, but it is not currently one of the onboarding wizardās provider choices. The wizard shows xAI (Grok), which is a different provider.
Simplest setup for Groq:
-
Put your key where the Gateway can actually see it
- temporary shell:
export GROQ_API_KEY="gsk_..." - better for daemon installs: put it in
~/.openclaw/.env
- temporary shell:
-
Set your default model in
~/.openclaw/openclaw.json:
{
env: { GROQ_API_KEY: "gsk_..." },
agents: {
defaults: {
model: { primary: "groq/llama-3.3-70b-versatile" },
},
},
}
- Restart:
openclaw gateway restart
- Verify:
openclaw models list --provider groq
openclaw models status
Docs:
About the "wake up, my friend!" token-limit hit: that visible message is tiny, but the actual request is not. OpenClaw also sends system prompt, tools, workspace context, etc., so a first run can be much larger than it looks. More here: https://docs.openclaw.ai/concepts/context
If you want, paste these and Iāll help you pinpoint it fast:
openclaw --version
openclaw status --all
openclaw models status
If this fixed the Groq part, please right-click the solution message ā Apps ā ā Mark Solution so Answer Overflow can index it.
this is my current openclaw.json:
{
"agents": {
"defaults": {
"workspace": "C:\Users\Salih Furkan\.openclaw\workspace",
"model": {
"primary": "google/gemini-3.1-pro-preview"
},
"models": {
"google/gemini-3.1-pro-preview": {}
}
}
},
"gateway": {
"mode": "local",
"auth": {
"mode": "token",
"token": "my-token-here"
},
"port": 18789,
"bind": "loopback",
"tailscale": {
"mode": "off",
"resetOnExit": false
},
"controlUi": {
"allowInsecureAuth": true
},
"nodes": {
"denyCommands": [
"camera.snap",
"camera.clip",
"screen.record",
"contacts.add",
"calendar.add",
"reminders.add",
"sms.send",
"sms.search"
]
}
},
"session": {
"dmScope": "per-channel-peer"
},
"tools": {
"profile": "coding"
},
"auth": {
"profiles": {
"google:default": {
"provider": "google",
"mode": "api_key"
}
}
},
"hooks": {
"internal": {
"enabled": true,
"entries": {
"boot-md": {
"enabled": true
}
}
}
},
"wizard": {
"lastRunAt": "2026-04-21T09:53:55.279Z",
"lastRunVersion": "2026.4.15",
"lastRunCommand": "onboard",
"lastRunMode": "local"
},
"meta": {
"lastTouchedVersion": "2026.4.15",
"lastTouchedAt": "2026-04-21T09:53:55.315Z"
}
}
Iām checking the auth/profile format so I can tell you exactly whatās missing instead of hand-waving.
Your config itself looks mostly fine, but there are 2 important gotchas here:
auth.profilesinopenclaw.jsonis not the actual secret store. Itās routing/metadata only.- Youāre still set to
google/gemini-3.1-pro-preview, andtools.profile: "coding"makes the first prompt a lot heavier.
For Groq, the minimal change is:
{
env: {
GROQ_API_KEY: "gsk_..."
},
agents: {
defaults: {
workspace: "C:\\Users\\Salih Furkan\\.openclaw\\workspace",
model: {
primary: "groq/llama-3.3-70b-versatile"
}
}
},
tools: {
profile: "messaging"
}
}
A few notes:
- You can remove this unless you need Google-specific overrides:
"models": {
"google/gemini-3.1-pro-preview": {}
}
- You do not need to add a Groq secret under
auth.profilesjust to get started. - I switched
tools.profileto"messaging"in the example because"coding"includes a much bigger tool surface, which increases prompt/context size. For a first test, thatās the safer choice.
Then run:
openclaw gateway restart
openclaw models status
openclaw models list --provider groq
Docs:
- https://docs.openclaw.ai/concepts/model-failover
- https://docs.openclaw.ai/tools
- https://docs.openclaw.ai/concepts/context
Also, if my-token-here was your real gateway token and not a placeholder, rotate it, since this thread is public.
If you want, paste:
openclaw --version
openclaw models status
and I can sanity-check the next step with you.
give me the full config json
Sure, use this as a clean full replacement openclaw.json for Groq:
{
"env": {
"GROQ_API_KEY": "gsk_your_groq_key_here"
},
"agents": {
"defaults": {
"workspace": "C:\\Users\\Salih Furkan\\.openclaw\\workspace",
"model": {
"primary": "groq/llama-3.3-70b-versatile"
}
}
},
"gateway": {
"mode": "local",
"auth": {
"mode": "token",
"token": "replace-with-your-gateway-token"
},
"port": 18789,
"bind": "loopback",
"tailscale": {
"mode": "off",
"resetOnExit": false
},
"controlUi": {
"allowInsecureAuth": true
},
"nodes": {
"denyCommands": [
"camera.snap",
"camera.clip",
"screen.record",
"contacts.add",
"calendar.add",
"reminders.add",
"sms.send",
"sms.search"
]
}
},
"session": {
"dmScope": "per-channel-peer"
},
"tools": {
"profile": "messaging"
},
"auth": {
"profiles": {
"groq:default": {
"provider": "groq",
"mode": "api_key"
}
}
},
"hooks": {
"internal": {
"enabled": true,
"entries": {
"boot-md": {
"enabled": true
}
}
}
}
}
Then run:
openclaw gateway restart
openclaw models status
If you want the bigger coding toolset later, change:
"tools": { "profile": "messaging" }
back to:
"tools": { "profile": "coding" }
Docs: https://docs.openclaw.ai/providers/groq
If you want, next I can give you the same config with Groq + Gemini fallback too.
yes
Iām checking the exact fallback JSON shape first so I donāt hand you a broken config.
Nice, hereās the full replacement config for Groq primary + Gemini fallback:
{
"env": {
"GROQ_API_KEY": "gsk_your_groq_key_here",
"GEMINI_API_KEY": "your_gemini_key_here"
},
"agents": {
"defaults": {
"workspace": "C:\\Users\\Salih Furkan\\.openclaw\\workspace",
"model": {
"primary": "groq/llama-3.3-70b-versatile",
"fallbacks": [
"google/gemini-3.1-pro-preview"
]
}
}
},
"gateway": {
"mode": "local",
"auth": {
"mode": "token",
"token": "replace-with-your-gateway-token"
},
"port": 18789,
"bind": "loopback",
"tailscale": {
"mode": "off",
"resetOnExit": false
},
"controlUi": {
"allowInsecureAuth": true
},
"nodes": {
"denyCommands": [
"camera.snap",
"camera.clip",
"screen.record",
"contacts.add",
"calendar.add",
"reminders.add",
"sms.send",
"sms.search"
]
}
},
"session": {
"dmScope": "per-channel-peer"
},
"tools": {
"profile": "messaging"
},
"auth": {
"profiles": {
"groq:default": {
"provider": "groq",
"mode": "api_key"
},
"google:default": {
"provider": "google",
"mode": "api_key"
}
}
},
"hooks": {
"internal": {
"enabled": true,
"entries": {
"boot-md": {
"enabled": true
}
}
}
}
}
Then run:
openclaw gateway restart
openclaw models status
If you want the heavier coding toolset later, switch:
"tools": { "profile": "messaging" }
to:
"tools": { "profile": "coding" }
Docs:
- https://docs.openclaw.ai/providers/groq
- https://docs.openclaw.ai/providers/google
- https://docs.openclaw.ai/concepts/model-failover
If this works, please right-click the solution message ā Apps ā ā Mark Solution so Answer Overflow indexes it.
"token": "replace-with-your-gateway-token"
what will i put here? how to get my gateway token?
Let me pull the exact gateway-token docs so I donāt send you the wrong command.
That token is not from Groq or Gemini, itās just your OpenClaw gateway shared secret for the dashboard / local gateway.
So:
- if your old config already had a real value there, keep it
- if you want to see the current one:
openclaw config get gateway.auth.token
- if you donāt have one yet, generate it:
openclaw doctor --generate-gateway-token
- then restart:
openclaw gateway restart
Important: donāt paste that token here. Itās basically an admin secret for your local gateway.
If you want to replace an existing token with a new one:
openclaw config set gateway.auth.token "<your-new-random-token>"
openclaw gateway restart
Docs:
If you want, I can also give you the exact PowerShell commands for Windows to check and set it.
Letās keep it in-thread here, no extra invite needed.
For the original question, the gateway token is local to OpenClaw:
openclaw config get gateway.auth.token
If itās missing:
openclaw doctor --generate-gateway-token
openclaw gateway restart
If this turns out to be an actual OpenClaw bug, the right escalation path is GitHub issues, not pings/invites: https://github.com/openclaw/openclaw/issues
(openclaw) PS C:\Users\Salih Furkan> openclaw gateway restart
Config observe anomaly: C:\Users\Salih Furkan.openclaw\openclaw.json (size-drop-vs-last-good:7891->1719)
š¦ OpenClaw 2026.4.15 (041266a) ā More integrations than your therapist's intake form.
Restarted Scheduled Task: OpenClaw Gateway
Gateway restart failed after 28s: service stayed stopped and port 18789 stayed free.
Service runtime: status=stopped, state=Ready
Gateway port 18789 status: free.
Gateway restart failed after 28s: service stayed stopped and health checks never came up.
Tip: openclaw gateway status --deep
Tip: openclaw doctor
(openclaw) PS C:\Users\Salih Furkan> openclaw gateway status --deep
š¦ OpenClaw 2026.4.15 (041266a) ā Self-hosted, self-updating, self-aware (just kidding... unless?).
ā
ā
Service: Scheduled Task (registered)
File logs: \tmp\openclaw\openclaw-2026-04-21.log
Config (cli): ~.openclaw\openclaw.json
Config (service): ~.openclaw\openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (env/config)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state Ready, last run 1, last run time 21.04.2026 13:16:09, Task Last Run Result=1; treating as not running.)
RPC probe: failed
RPC target: ws://127.0.0.1:18789
gateway closed (1006):
Service is loaded but not running (likely exited immediately).
File logs: \tmp\openclaw\openclaw-2026-04-21.log
Logs: schtasks /Query /TN "OpenClaw Gateway" /V /FO LIST
Other gateway-like services detected (best effort):
- \OpenClaw Gateway (system, task: \OpenClaw Gateway, run: "C:\Users\Salih Furkan.openclaw\gateway.cmd")
Cleanup hint: schtasks /Delete /TN "OpenClaw Gateway" /F
Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).
Iām checking what that config anomaly warning means and what usually makes the Windows task exit immediately.
That size-drop-vs-last-good warning is probably just because the file got much smaller after you replaced it. Annoying, but not necessarily the real problem.
The real issue is this part:
service stayed stopped
exited immediately
So the next step is logs + doctor, not more config guessing.
Please run these next:
openclaw doctor
openclaw logs --follow
Then in another terminal/window:
openclaw gateway restart
and paste the first real error/fatal lines from the log after it tries to start.
If you want, also paste your current openclaw.json again, because a small copy/paste issue can make the Windows task exit instantly even when the JSON ālooksā fine.
Docs:
- https://docs.openclaw.ai/help/troubleshooting
- https://docs.openclaw.ai/help/faq
- https://docs.openclaw.ai/cli/doctor
If this fixed it later, please right-click the solution message ā Apps ā ā Mark Solution so Answer Overflow can index it.
(openclaw) PS C:\Users\Salih Furkan> openclaw logs --follow
š¦ OpenClaw 2026.4.15 (041266a) ā I'm not magicāI'm just extremely persistent with retries and coping strategies.
Gateway not reachable. Is it running and accessible?
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: C:\Users\Salih Furkan.openclaw\openclaw.json
Bind: loopback
Hint: run openclaw doctor.
i run openclaw doctor and nothing works i still have the same errors
Yep, that means openclaw logs --follow canāt help yet, because it talks to the running gateway over RPC, and your gateway is down.
So we need the file log directly now.
Please run these:
openclaw doctor
Get-Content \tmp\openclaw\openclaw-2026-04-21.log -Tail 120
If that file path fails, try:
Get-Content C:\tmp\openclaw\openclaw-2026-04-21.log -Tail 120
Paste:
- the full
openclaw doctoroutput - the last ~120 lines of that log file
That should show the real crash reason. Right now we only know āservice exited immediately,ā not why.
I believe you, but I canāt diagnose āsame errorsā blind, I need the exact crash text.
Please paste these exact outputs, no summary:
Get-Content C:\tmp\openclaw\openclaw-2026-04-21.log -Tail 150
and
Get-Content C:\Users\Salih Furkan\.openclaw\openclaw.json
If the first path errors, paste that error too.
Right now the key missing piece is the file log, because openclaw logs --follow only works when the gateway is already up. The file log is what tells us why it exits immediately.
(openclaw) PS C:\Users\Salih Furkan> openclaw doctor Get-Content \tmp\openclaw\openclaw-2026-04-21.log -Tail 120
error: unknown option '-Tail'
Ah, you pasted them as one command. PowerShell sent -Tail to openclaw, not to Get-Content.
Run them as two separate commands:
openclaw doctor
then after that finishes:
Get-Content \tmp\openclaw\openclaw-2026-04-21.log -Tail 120
If -Tail still acts weird, use this instead:
Get-Content \tmp\openclaw\openclaw-2026-04-21.log | Select-Object -Last 120
Then paste the output here. Weāre close, we just need the actual crash lines.
since the output is too long, I have uploaded it to a website: https://paste.code-solutions.dev/ovegafexaj.wren
give answer
hey???????????
Yep, Iām here, sorry about the lag.
Please run this now and paste whatever it prints:
Get-Content \tmp\openclaw\openclaw-2026-04-21.log -Tail 120
If that fails, paste the exact error and run:
Get-Content C:\tmp\openclaw\openclaw-2026-04-21.log | Select-Object -Last 120
If you already ran it, just dump the output here and Iāll read it.
the result is on this website: since the output is too long, I have uploaded it to a website: https://paste.code-solutions.dev/ovegafexaj.wren
Iāve got it, pulling the paste now.
I can already see one clue, but I want the end of that log too so I donāt jump the gun.
Okay, I found the clue.
Your log shows three important things:
- The gateway did actually start successfully at one point
ready (5 plugins...)
- It was still using xAI/grok-4, not Groq
agent model: xai/grok-4
- After that, your config got overwritten again and OpenClaw flagged:
gateway-mode-missing-vs-last-good
So the problem is very likely the current openclaw.json is not the same config we intended, and it may now be missing gateway.mode or still pointing at xAI.
Please paste these exact outputs next:
openclaw config get gateway.mode
openclaw config get agents.defaults.model.primary
Get-Content C:\Users\Salih Furkan\.openclaw\openclaw.json
Good news: the log also shows a backup exists:
C:\Users\Salih Furkan\.openclaw\openclaw.json.bak
So we probably have a recovery path, I just want to see the current file before telling you the safest fix.
Also, from the log, the only model error I can see is xAI credits:
Your newly created team doesn't have any credits or licenses yet
So right now this still looks more like wrong config / overwritten config than a Groq problem.
(openclaw) PS C:\Users\Salih Furkan> openclaw config get gateway.mode
š¦ OpenClaw 2026.4.15 (041266a) ā I'm basically a Swiss Army knife, but with more opinions and fewer sharp edges.
local
(openclaw) PS C:\Users\Salih Furkan> openclaw config get agents.defaults.model.primary
š¦ OpenClaw 2026.4.15 (041266a) ā Like having a senior engineer on call, except I don't bill hourly or sigh audibly.
groq/llama-3.3-70b-versatile
(openclaw) PS C:\Users\Salih Furkan> Get-Content C:\Users\Salih Furkan.openclaw\openclaw.json
Get-Content : A positional parameter cannot be found that accepts argument 'Furkan.openclaw\openclaw.json'.
At line:1 char:1
- Get-Content C:\Users\Salih Furkan.openclaw\openclaw.json
-
+ CategoryInfo : InvalidArgument: (:) [Get-Content], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand
Nice, that helps. gateway.mode and the Groq model are both set correctly now.
The Get-Content error is just because your Windows path has a space in Salih Furkan. Use quotes:
Get-Content "C:\Users\Salih Furkan\.openclaw\openclaw.json" -Raw
Then do one fresh restart and grab the latest crash lines right after:
openclaw gateway restart
Get-Content "\tmp\openclaw\openclaw-2026-04-21.log" -Tail 80
Paste both outputs.
So at this point:
- config key = good
- Groq model ref = good
- remaining problem = why the Windows gateway process dies after launch
I checked your config, and honestly it looks mostly sane. Iām pulling the Windows docs now because this is starting to smell like a native-Windows runtime issue, not a Groq config issue.
Okay, this helps a lot.
Your config looks basically sane now. I do not see an obvious Groq config mistake that would explain the crash.
So this is now most likely a native Windows Scheduled Task / service issue, not a Groq issue.
Best next step
Skip the Scheduled Task for a moment and run the gateway directly in the foreground:
openclaw gateway run
Then:
- if it stays up, open
http://127.0.0.1:18789/and test normally - if it crashes, paste the last lines printed in that terminal
That should give us the real error much faster than fighting the service wrapper.
Recommendation
Docs are pretty clear that WSL2 is the more stable Windows path. Native Windows can work, but itās rougher, especially around managed startup:
https://docs.openclaw.ai/platforms/windows
One important security note
You pasted what looks like your real gateway token in public. If that token is real, please rotate it after this.
If you want, after you run openclaw gateway run, paste whatever shows up and Iāll keep going.
(openclaw) PS C:\Users\Salih Furkan> openclaw gateway run
13:41:24 [gateway] loading configurationā¦
13:41:24 [gateway] resolving authenticationā¦
13:41:24 [gateway] starting...
13:42:00 [gateway] starting HTTP server...
13:42:00 [canvas] host mounted at http://127.0.0.1:18789/__openclaw__/canvas/ (root C:\Users\Salih Furkan.openclaw\canvas)
13:42:00 [health-monitor] started (interval: 300s, startup-grace: 60s, channel-connect-grace: 120s)
13:42:00 [gateway] agent model: groq/llama-3.3-70b-versatile
13:42:00 [gateway] ready (5 plugins: acpx, browser, device-pair, phone-control, talk-voice; 36.4s)
13:42:00 [gateway] log file: \tmp\openclaw\openclaw-2026-04-21.log
13:42:00 [gateway] security warning: dangerous config flags enabled: gateway.controlUi.allowInsecureAuth=true. Run openclaw security audit.
13:42:00 [gateway] starting channels and sidecars...
13:42:01 [hooks] loaded 4 internal hook handlers
13:42:16 [bonjour] watchdog detected non-announced service; attempting re-advertise (gateway fqdn=LAPTOP-6K0JG87U (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=probing)
13:42:16 [model-pricing] pricing bootstrap failed: TimeoutError: The operation was aborted due to timeout
13:42:20 [plugins] embedded acpx runtime backend registered (cwd: C:\Users\Salih Furkan.openclaw\workspace)
13:42:20 (node:10744) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use node --trace-deprecation ... to show where the warning was created)
13:42:20 [browser/server] Browser control listening on http://127.0.0.1:18791/ (auth=token)
13:42:22 [heartbeat] started
13:42:27 [plugins] embedded acpx runtime backend ready
Nice, thatās the breakthrough. š
Your Groq config is working. The gateway starts cleanly in foreground:
agent model: groq/llama-3.3-70b-versatileready- browser/control server started
So the real problem is not Groq. Itās the native Windows managed service / Scheduled Task path.
What to do right now
For immediate use, just keep this terminal open:
openclaw gateway run
Then open:
http://127.0.0.1:18789/
and test your bot again.
What those warnings mean
These are not your blocker:
model-pricing ... timeoutā annoying, but non-fatalDEP0190warning ā non-fatalallowInsecureAuth=trueā security warning, not a startup failure
Recommended next step
Youāve got 2 good options:
- Use
openclaw gateway runfor now
Fastest, works today.
- Move to WSL2 later
Best long-term path on Windows, and the docs recommend it:
https://docs.openclaw.ai/platforms/windows
Important
You pasted your real gateway token earlier. Please rotate it after youāre stable.
If you test it now and Groq replies, please right-click the solution message ā Apps ā ā Mark Solution so Answer Overflow can index it.
13:45:44 [agent/embedded] embedded run agent end: runId=4ab6cd12-2086-46bf-90f3-f688cc493c3a isError=true model=gemini-3.1-pro-preview provider=google error=ā ļø API rate limit reached. Please try again later. rawError={"error":{"message":"{\n "error": {\n "code": 429,\n "message": "You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https:ā¦
13:45:44 [agent/embedded] auth profile failure state updated: runId=4ab6cd12-2086-46bf-90f3-f688cc493c3a profile=sha256:a94403a4f9d0 provider=google reason=rate_limit window=cooldown reused=false
13:45:44 [agent/embedded] embedded run failover decision: runId=4ab6cd12-2086-46bf-90f3-f688cc493c3a stage=assistant decision=fallback_model reason=rate_limit from=google/gemini-3.1-pro-preview profile=sha256:a94403a4f9d0
13:45:44 [diagnostic] lane task error: lane=main durationMs=17997 error="FailoverError: ā ļø API rate limit reached. Please try again later."
13:45:44 [diagnostic] lane task error: lane=session:agent:main:main durationMs=17999 error="FailoverError: ā ļø API rate limit reached. Please try again later."
13:45:44 [model-fallback/decision] model fallback decision: decision=candidate_failed requested=groq/llama-3.3-70b-versatile candidate=google/gemini-3.1-pro-preview reason=rate_limit next=none detail=ā ļø API rate limit reached. Please try again later.
13:45:44 Embedded agent failed before reply: All models failed (2): groq/llama-3.3-70b-versatile: HTTP 401: Invalid API Key (auth) | google/gemini-3.1-pro-preview: ā ļø API rate limit reached. Please try again later. (rate_limit) | ā ļø API rate limit reached. Please try again later.
Perfect, weāve got the real issue now.
This is not a gateway problem anymore. Itās provider auth/quota:
- Groq ā
HTTP 401: Invalid API Key - Google/Gemini ā
429 quota exceeded
So OpenClaw is working, but both model providers are rejecting the request.
What this means
- OpenClaw tries Groq first
- Groq rejects the key
- then it falls back to Gemini
- Gemini rejects it because your quota/billing is exhausted
Best fix, recommended
If you want Groq, fix Groq first and remove the Gemini fallback for now.
Use a real Groq key from:
Your config should look like:
{
"env": {
"GROQ_API_KEY": "gsk_your_real_groq_key_here"
},
"agents": {
"defaults": {
"workspace": "C:\\Users\\Salih Furkan\\.openclaw\\workspace",
"model": {
"primary": "groq/llama-3.3-70b-versatile"
}
}
}
}
If you want to keep Gemini as fallback later, thatās fine, but youāll need to fix its quota/billing too.
In plain English
Right now:
- gateway ā
- Groq config path ā
- Groq API key ā
- Gemini quota ā
Docs:
If you want, I can give you the exact final openclaw.json for Groq only next.
gives same error even though i set groq api. I wanted to restart it but stil lgives error
If itās still a 401 Invalid API Key, restarting wonāt fix it.
That error means:
- OpenClaw is reaching Groq
- Groq is seeing a key
- Groq says that key is not valid
So the next step is not restart, itās verify the actual Groq key.
Check this first
A real Groq key should look like:
gsk_...
If it doesnāt look like that, or if you copied the wrong token, Groq will keep returning 401.
Best next move
-
Create a fresh Groq API key here:
https://console.groq.com/keys -
Put that fresh key in
GROQ_API_KEY -
For testing, remove the Gemini fallback so only Groq is being tried
-
Stop the running gateway and start it again:
Ctrl+C
openclaw gateway run
Then run this and paste it
openclaw models status
That will tell us exactly what OpenClaw thinks about your Groq auth.
So, bluntly: this is still pointing to a bad Groq key, not a restart problem.
same error even though i followed your instructions
I think I know whatās happening.
OpenClaw does not override existing environment variables. So if your PowerShell session already has an old/bad GROQ_API_KEY, the value in openclaw.json gets ignored.
Docs: https://docs.openclaw.ai/help/environment
Check this in PowerShell
$env:GROQ_API_KEY
$env:GEMINI_API_KEY
Donāt paste the full keys here, just check whether GROQ_API_KEY is set and whether itās the new one.
Clean test in the current shell only
Remove-Item Env:GROQ_API_KEY -ErrorAction SilentlyContinue
Remove-Item Env:GEMINI_API_KEY -ErrorAction SilentlyContinue
openclaw gateway run
That only clears them for this PowerShell window, not your whole system.
Then run:
openclaw models status
and paste that output.
If Iām right, youāve been updating openclaw.json, but PowerShell is still feeding OpenClaw an older bad Groq key from the shell env.
$env:GROQ_API_KEY
not same token with the one in config
Yep, thatās the culprit.
Your shell env is overriding your config. OpenClaw is using the old GROQ_API_KEY from PowerShell, not the one in openclaw.json.
Fix it in this PowerShell window
Remove-Item Env:GROQ_API_KEY -ErrorAction SilentlyContinue
Remove-Item Env:GEMINI_API_KEY -ErrorAction SilentlyContinue
Then start OpenClaw again:
openclaw gateway run
Then verify:
openclaw models status
If that works
Youāll want to remove or update the old Windows environment variable permanently, otherwise itāll keep overriding your config in future shells.
So the important bit is:
- config key = good
- PowerShell env key = bad
- env wins over config
You found the bug. š¦
If openclaw models status looks good after clearing the env vars, paste it and Iāll confirm.
It still prints the invalid API key error
are you going to answer or should i delete openclaw?
Donāt delete it yet.
From everything you pasted, OpenClaw itself is running. The blocker is provider auth on native Windows, not āOpenClaw is brokenā.
My honest recommendation
If you want the fastest path to a working setup, switch to WSL2 and do a fresh Groq-only onboarding there:
https://docs.openclaw.ai/platforms/windows
Native Windows can work, but you got stuck in exactly the kind of env/service mess itās still rough at.
If you want to stay on native Windows
Do this exact cleanup:
- In Windows Environment Variables, remove any old:
GROQ_API_KEYGEMINI_API_KEY
-
Check and clean these files if they exist:
C:\Users\Salih Furkan\.envC:\Users\Salih Furkan\.openclaw\.env
-
Keep a minimal Groq-only config:
{
"env": {
"GROQ_API_KEY": "gsk_your_real_groq_key_here"
},
"agents": {
"defaults": {
"workspace": "C:\\Users\\Salih Furkan\\.openclaw\\workspace",
"model": {
"primary": "groq/llama-3.3-70b-versatile"
}
}
},
"gateway": {
"mode": "local",
"auth": {
"mode": "token",
"token": "your-gateway-token"
},
"port": 18789,
"bind": "loopback"
}
}
- Run it in foreground:
openclaw gateway run
Bottom line
- Donāt delete it
- WSL2 is my recommendation
- if you stay native, do a full env cleanup and use Groq only
If you want, I can give you a copy-paste WSL2 install path next so you can stop burning time on Windows weirdness.
these dont exist:
C:\Users\Salih Furkan.env
C:\Users\Salih Furkan.openclaw.env
but there are .json.bak files should i delete them
No, donāt delete the .json.bak files.
Theyāre just backups, and right now theyāre more helpful than harmful. They are not whatās causing the invalid API key error.
At this point the next likely culprit is a Windows user/system environment variable, not a .env file.
Please check these in PowerShell:
[Environment]::GetEnvironmentVariable("GROQ_API_KEY", "User")
[Environment]::GetEnvironmentVariable("GROQ_API_KEY", "Machine")
[Environment]::GetEnvironmentVariable("GEMINI_API_KEY", "User")
[Environment]::GetEnvironmentVariable("GEMINI_API_KEY", "Machine")
If any of those return a value, that can still override your config depending on how you launched things.
So:
.json.bakfiles ā leave them alone.envfiles ā not the issue- next check ā Windows Environment Variables
And if those all come back empty, then weāre back to the simplest answer: the Groq key itself is invalid on Groqās side.
(openclaw) C:\Users\Salih Furkan>[Environment]::GetEnvironmentVariable("GROQ_API_KEY", "User")
Dosya adı, dizin adı veya birim etiketi sƶzdizimi hatalı.
(openclaw) C:\Users\Salih Furkan>[Environment]::GetEnvironmentVariable("GROQ_API_KEY", "Machine")
Dosya adı, dizin adı veya birim etiketi sƶzdizimi hatalı.
(openclaw) C:\Users\Salih Furkan>[Environment]::GetEnvironmentVariable("GEMINI_API_KEY", "User")
Dosya adı, dizin adı veya birim etiketi sƶzdizimi hatalı.
(openclaw) C:\Users\Salih Furkan>[Environment]::GetEnvironmentVariable("GEMINI_API_KEY", "Machine")
Dosya adı, dizin adı veya birim etiketi sƶzdizimi hatalı.
(openclaw) C:\Users\Salih Furkan>
That oneās on me, those were PowerShell commands, but youāre in Command Prompt (cmd) there.
In cmd, run these instead:
echo %GROQ_API_KEY%
echo %GEMINI_API_KEY%
If either one prints a real value, that env var is set in the current shell and can still override your config.
You can also check more explicitly with:
set GROQ_API_KEY
set GEMINI_API_KEY
So:
PowerShellsyntax =[Environment]::...cmdsyntax =%GROQ_API_KEY%
Paste what echo %GROQ_API_KEY% does, or just tell me whether it prints a value or literally %GROQ_API_KEY%.
(openclaw) C:\Users\Salih Furkan>echo %GROQ_API_KEY%
<this shows an old api key>
(openclaw) C:\Users\Salih Furkan>echo %GEMINI_API_KEY%
%GEMINI_API_KEY%
Yep, thatās it. That old GROQ_API_KEY in your shell is the problem.
GEMINI_API_KEY is fine, itās unset in cmd.
But GROQ_API_KEY is still set to the old key, so it keeps overriding your config.
Fix it in this cmd window
set GROQ_API_KEY=
Then start OpenClaw again:
openclaw gateway run
At that point, OpenClaw should fall back to the GROQ_API_KEY in your openclaw.json.
Permanent fix
Later, remove or update that old Windows env var, otherwise new terminals will keep picking it up.
So the root cause was:
- config key = new
- cmd env key = old
- cmd env wins
Thatās the smoking gun. š¦
If it works now, please right-click the solution message ā Apps ā ā Mark Solution so Answer Overflow can index it.
20:35:58 [agent/embedded] embedded run agent end: runId=d0611bf3-eb9e-4f13-9403-5807f9cb81c7 isError=true model=llama-3.3-70b-versatile provider=groq error=ā ļø API rate limit reached. Please try again later. rawError=413 Request too large for model llama-3.3-70b-versatile in organization org_01j9hma37gen8bjnf1ztd27wk4 service tier on_demand on tokens per minute (TPM): Limit 12000, Requested 41496, please redā¦
20:35:58 [agent/embedded] embedded run failover decision: runId=d0611bf3-eb9e-4f13-9403-5807f9cb81c7 stage=assistant decision=surface_error reason=rate_limit from=groq/llama-3.3-70b-versatile profile=-
Good news: your Groq key works now. This is a different problem.
Groq is rejecting the request because of TPM limits:
- Limit: 12,000 TPM
- Requested: 41,496 tokens
So this is not āinvalid API keyā anymore.
Itās basically: this OpenClaw request is too large for your current Groq on-demand limit.
Important detail
This is not a āwait 1 minuteā fix.
That single request is already bigger than your limit.
Best next step
Try in a fresh conversation / fresh session, not this long troubleshooting thread.
This thread now has a lot of history, and OpenClaw includes conversation context, tools, system prompt, etc., so the request got huge.
Also keep the config as light as possible:
- Groq only
tools.profile: "messaging"or evenminimal
If a fresh session still fails
Then your Groq orgās current TPM limit is just too low for OpenClaw agent prompts on that model/tier.
At that point you have 2 real options:
- Use another provider for the main model
- Upgrade / change your Groq tier/limits
More on context size here:
So the state now is:
- Groq auth ā
- Gateway ā
- Native Windows service is flaky, but foreground run works ā
- Groq plan/token limit for this request ā
If this helped, please right-click the solution message ā Apps ā ā Mark Solution so Answer Overflow can index it.
i dont have any other option. I better delete openclaw.
I get it, thatās frustrating.
Before you nuke it, Iād try one last low-context test, because you actually fixed the hard parts already:
- gateway works
- Groq auth works
- the remaining problem is just your Groq TPM cap
One last shot
Use the smallest possible OpenClaw prompt:
"tools": {
"profile": "minimal"
}
Also:
- Groq only (no Gemini fallback)
- start a brand-new thread / fresh session
- keep running with:
openclaw gateway run
The key point is: donāt test again in this long troubleshooting thread.
This thread itself is bloating the prompt.
If that still fails
Then Iād say, honestly, your current Groq limit just isnāt enough for OpenClaw, and deleting it or pausing is understandable.
So my recommendation is:
- try
tools.profile: "minimal" - test in a fresh thread
- if it still hits Groq TPM, then stop there, itās not you, itās the provider limit
If you want, I can give you the exact smallest possible config for that final test.