Edit the configuration file ~/.openclaw/openclaw.json, and replace apiKey with the actual API Key:
{
"models": {
"providers": {
"ailink": {
"baseUrl": "https://ailink.nativex.com/v1",
"apiKey": "<Your API Key>",
"api": "anthropic-messages",
"models": [
{
"id": "<The model name can be found on the system model pricing page>",
"name": "<Custom model name>"
}
]
}
}
}
}
Example:
{
"models": {
"mode": "merge",
"providers": {
"ailink": {
"baseUrl": "https://ailink.nativex.com/v1",
"apiKey": "sk_xxxx",
"api": "anthropic-messages",
"models": [
{"id": "claude-opus-4.7", "name": "claude-opus-4.7", "reasoning": false, "input": ["text", "image"], "contextWindow": 200000, "maxTokens": 32768},
{"id": "gemini-2.5-pro", "name": "gemini-2.5-pro", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536},
{"id": "gpt-5.5", "name": "gpt-5.5", "reasoning": false, "input": ["text", "image"], "contextWindow": 200000, "maxTokens": 32768}
]
}
}
},
"agents": {
"defaults": {
"model": {"primary": "ailink/claude-opus-4.7"},
"models": {
"ailink/claude-opus-4.7": {},
"ailink/gemini-2.5-pro": {},
"ailink/gpt-5.5": {}
}
}
}
}
After configuration, execute openclaw gateway restart to restart the gateway for the configuration to take effect.
For detailed configuration steps, please refer to the official documentation: https://docs.openclaw.ai/providers/litellm