OpenClaw setup
Use Batchwell in OpenClaw by adding a custom provider to ~/.openclaw/openclaw.json with baseUrl set to the Batchwell base URL.
To use Batchwell in OpenClaw, add a custom provider to ~/.openclaw/openclaw.json with baseUrl set to
https://api.batchwell.ai/v1, api: "openai-completions", your Batchwell API key read from BATCHWELL_API_KEY as apiKey, and a
Batchwell model id in its models list. This is OpenClaw's documented setup for an OpenAI-compatible provider.
Create a key as described in the Quickstart and Authentication, then run:
It writes ~/.openclaw/openclaw.json and ~/.openclaw/.env through OpenClaw's own CLI, and keeps your other providers and settings. It reads your key from BATCHWELL_API_KEY, or asks for it on the
terminal with the input hidden, and checks it with GET /v1/models before it writes anything. Then start the agent with
openclaw chat. Every file it changes is first copied to <file>.; to undo
it, copy that backup back over the file, or delete a file the command created. The command runs on macOS, Linux and WSL;
see Connect an agent for every option.
Paste this prompt into the agent, or into any coding agent, and it sets itself up the same way. It names the variable that holds the key, never the key itself, and tells the agent to back up each file before it changes it.
The snippet is made for batchwell/kimi-k3.1-pro-uncensored, a model Batchwell serves today. The key comes from the BATCHWELL_API_KEY
environment variable, so no key is written into the file. Create a key as described in the Quickstart and
Authentication.
OpenClaw reads openclaw. as JSON5 and validates it strictly: an unknown key stops the Gateway from starting. The
Gateway watches the file and applies changes automatically.
mode: "merge"is the mode OpenClaw's custom provider documentation uses.providersholds the provider, under the key the model reference uses before the slash.baseUrlis the address OpenClaw sends requests to. Set it to the Batchwell base URL, which ends in/v1.apiKeyis the bearer key OpenClaw sends.${BATCHWELL_API_KEY}reads it from the environment. The key starts withbw_live_orbw_test_.api: "openai-completions"selects the OpenAI Chat Completions API, the one Batchwell serves.modelslists the model:idis the model id fromGET /v1/models(see models),nameis the label OpenClaw shows, andinput: ["text"]says the model takes text only, as Batchwell does.primaryunderagents.picks the model as the provider key, a slash, and the model id.defaults. model
OpenClaw also accepts contextWindow and maxTokens on each model. When they are not set, it assumes 200,000 tokens of
context and 32,768 output tokens. Set them to the model's limits from models if they are lower.
That model lists these supported parameters: temperature, top_p, max_tokens, max_completion_tokens, stop, stream_options, tools, tool_choice, reasoning_effort. These are the model's tunable
parameters, not the whole request: Batchwell accepts only the fields listed under
accepted fields, including stream and stream_options. Any other field fails
with 400 unsupported_parameter, and the error message names the field.
Batchwell rejects n greater than 1, logprobs and top_logprobs with 400 unsupported_parameter, and accepts text content only (parts of
type image_url, input_audio or file get 400 unsupported_content). The full list is on
chat completions.
- Connect an agent compares the five agents and every option of the connect command.
- Routing covers fallback models and routing preferences.
- Errors lists every error code and what to do about it.
- Hermes Agent setup shows the same model in Hermes Agent's
config..yaml - Claude Code setup and Codex setup show it in the two coding agents.