OpenClaw Configuration Guide
OpenClaw adds custom model providers through models.providers. ai2save uses the OpenAI Compatible interface, and Base URL must be filled in https://ai2save.com/v1.
1. Prepare OpenClaw and API Key
If OpenClaw is already installed, you can skip the installation:
npm install -g openclaw@latest
openclaw --version
- Open https://ai2save.com/keys.
- Create an API Key belonging to the OpenAI / GPT model group.
- Copy the complete
sk-...Key.
2. Edit the OpenClaw configuration file
The default configuration file for OpenClaw is:
~/.openclaw/openclaw.json
Windows usually supports JSON5 in the %USERPROFILE%\.openclaw\openclaw.json. file, which can be merged into the existing configuration according to the structure below:
{
env: {
vars: {
AI2SAVE_API_KEY: "sk-your-api-key",
},
},
agents: {
defaults: {
model: {
primary: "ai2save/gpt-5.5",
},
},
},
models: {
mode: "merge",
providers: {
ai2save: {
baseUrl: "https://ai2save.com/v1",
apiKey: "${AI2SAVE_API_KEY}",
api: "openai-completions",
timeoutSeconds: 300,
models: [
{
id: "gpt-5.5",
name: "GPT 5.5",
reasoning: true,
input: ["text"],
contextWindow: 200000,
},
],
},
},
},
}
Key Field Description:
models.providers.ai2save.baseUrl: Must include/v1.api: "openai-completions": The interface type used by OpenClaw to proxy OpenAI Compatible.models[].id: Must be exactly consistent with the model ID opened in the ai2save console.agents.defaults.model.primary: Format isprovider-id/model-id.apiKeycan directly write"sk-..."; when referenced with${AI2SAVE_API_KEY}, it must be defined inenv.vars.
If you want to add multiple models, continue appending in the models array and change primary to the ai2save/model-id you want to use by default.
3. Apply and Check Configuration
OpenClaw Gateway will listen for configuration file changes and apply them automatically. If the configuration does not take effect promptly, execute:
openclaw gateway restart
Then check whether the model has already appeared in OpenClaw:
openclaw models list --provider ai2save
Switch the default model to ai2save:
openclaw models set ai2save/gpt-5.5
If the model does not appear, run diagnostics and check for configuration errors:
openclaw doctor
4. Request Verification
- Open the chat interface or WebChat for OpenClaw.
- Start a new conversation and send "Hello, please report the current model name."
- Confirm that the model route shows as
ai2save/gpt-5.5. - For the first time, only verify with text tasks. Once successful, then enable more complex tools such as file handling, browser, and long context.
OpenClaw will automatically handle compatibility for unofficial OpenAI proxies, so there is no need to manually enable developer role. If there is an exception with tool calls, first confirm that the model ID supports tool calls, then increase the timeout.
5. Common Errors
- 401 / invalid_api_key:
AI2SAVE_API_KEYis not defined, the key is not fully copied, or the key grouping does not match. - 404 / model not found:
models[].id,primary, or the actual requested model name does not match. - Connection failed / empty response: Check whether
baseUrlishttps://ai2save.com/v1, and do not write the root address. - Model list is empty: Confirm
models.mode: "merge", and ensure thatmodels.providers.ai2save.models[]contains at least one model. - Configuration did not take effect after saving: Re-execute
openclaw doctor, and if necessary, restart OpenClaw and Gateway.