Skip to main content

OpenClaw

If OpenClaw provides a custom API Provider, MuskAI can be filled in as an independent Provider.

Configuration items​

  • Provider name: MuskAI
  • Base URL: After logging in to the official website, view and copy it on the User Center - [API Key] page
  • API Key:MuskAI API Key
  • Model: models available in the console

Configuration file​

Edit ~/.openclaw/openclaw.json and add authentication configuration:

"auth": {
"profiles": {
"muskai:default": {
"provider": "muskai",
"mode": "api_key"
}
}
}

Add MuskAI Provider in models.providers and keep the model you actually want to use if needed:

"models": {
"mode": "merge",
"providers": {
"muskai": {
"baseUrl": "Copy the Base URL from User Center > API Keys",
"apiKey": "Enter your API Key here",
"api": "anthropic-messages",
"authHeader": true,
"models": [
{
"id": "glm-4.7",
"name": "glm-4.7",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 262144,
"maxTokens": 65536
},
{
"id": "glm-4.5-Air",
"name": "glm-4.5-Air",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 1000000,
"maxTokens": 65536
},
{
"id": "glm-5",
"name": "glm-5",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 202752,
"maxTokens": 16384
}
]
}
}
}

Set the default model in agents.defaults.model:

"agents": {
"defaults": {
"model": {
"primary": "muskai/glm-4.7"
},
"models": {
"muskai/glm-5": {},
"muskai/glm-4.7": {},
"muskai/glm-4.5-Air": {}
}
}
}

verify​

After saving, restart the gateway and check the status:

openclaw gateway restart
openclaw status

Commonly used commands:

/model <model>
Temporarily switch models

/new
Start a new session

/compact
Compress the context

/think high
Enable reasoning mode

Finally, perform a short request and confirm that the corresponding Key can be seen in the MuskAI console usage record.