[How To] Retrieve API keys in OpenClaw
Agent and CLI tools often save the API credentials you sign in with to a hidden folder in your home directory. If you have been using the openclaw tool and need to find the Anthropic API key or Bearer token it stored, for example to reuse it elsewhere or to rotate it, you can locate it in a few seconds with grep . This short tutorial shows how. Note: "spi keys" in the URL is a typo for "api keys". Step 1: Go to the config directory openclaw keeps its per-agent configuration under a hidden .openclaw folder in your home directory: cd ~/.openclaw/ Step 2: List what is there List the contents, including hidden files, so you can see the agent folders: ls -loa Each agent typically has its own subfolder under agents/ , and the credentials live in an auth-profiles.json file inside it. Step 3: Search for the keys Rather than opening each file by hand, recursively grep the whole directory for the two token formats. Anthropic keys begin with sk-ant- , and OAuth-st...