Connect
OpenClaw
OpenClaw is an always-on personal AI assistant that connects to chat apps such as Telegram, Discord, Feishu and QQ. Add CoreCode under its models.providers and it can use CoreCode's Claude, GPT, Grok and Gemini. The settings come from OpenClaw's custom provider documentation.
Install
npm install -g openclaw
Run openclaw --version afterwards; a version number means it is installed. On first use, follow openclaw onboard to set it up.
Create a key
Create a key on the API Keys page in the auto group. OpenClaw is not Claude Code, so the 仅限CC group rejects its requests. Give OpenClaw a key of its own with a quota: it runs all the time, and every chat message makes requests.
Configure
Claude uses the Anthropic API and GPT, Grok and Gemini the OpenAI API, so add two providers. In a terminal, run:
openclaw config set models.providers.corecode '{"baseUrl":"https://corecode.live","apiKey":"${CORECODE_API_KEY}","api":"anthropic-messages","models":[{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5"},{"id":"claude-opus-5-5","name":"Claude Opus 5.5"}]}' --strict-json --merge
openclaw config set models.providers.corecode-openai '{"baseUrl":"https://corecode.live/v1","apiKey":"${CORECODE_API_KEY}","api":"openai-completions","models":[{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol"},{"id":"grok-4.7","name":"Grok 4.7"},{"id":"gemini-3.8-flash-high","name":"Gemini 3.8 Flash"}]}' --strict-json --merge
openclaw models set corecode/claude-sonnet-5-5
The first two write to ~/.openclaw/openclaw.json; the last makes CoreCode's Sonnet the default model. The Anthropic URL has no /v1; the OpenAI URL does.
Then put the key in the CORECODE_API_KEY environment variable where OpenClaw runs:
export CORECODE_API_KEY=sk-your-key
$env:CORECODE_API_KEY = "sk-your-key"
If the OpenClaw gateway already runs in the background, run openclaw gateway restart to apply the change.
Check that it works
openclaw agent --local --model corecode/claude-sonnet-5-5 -m "reply ok"
A reply means you are connected; change --model to corecode-openai/gpt-6.1-sol to try GPT. The requests appear in the console's usage logs.
FAQ
It says missing env var "CORECODE_API_KEY"
That appears when the terminal writing the configuration lacks the variable; the configuration is still saved. Set the variable where OpenClaw runs.
It costs more than expected
OpenClaw runs all the time, and chats, scheduled tasks and heartbeats all call the model. Set a quota on its key on the API Keys page, and use Sonnet or a cheaper model for everyday tasks.