What is OpenClaw Model API?
OpenClaw Model API is a set of interfaces provided by OpenClaw that allows users to call various LLMs (such as ChatGPT, Claude, etc.) within OpenClaw to process natural language tasks. By configuring the Model API, users can make OpenClaw interact with these LLMs to achieve intelligent dialogue, text generation, data analysis, and other functions.
How to Configure OpenClaw Model API?
To configure OpenClaw Model API, users need to follow these steps:
- Select a model provider: First, users need to select an LLM provider, such as OpenAI, Anthropic, etc., and register to obtain an API key.
- Get API key: On the model provider's official website, users need to create an account and obtain an API key. This key will be used for communication between OpenClaw and the LLM.
- Configure OpenClaw: In OpenClaw's settings interface, users need to enter the model provider's API key and select the model type to use (such as GPT-4, Claude 2, etc.).
- Test connection: After configuration, users can verify the API connection through OpenClaw's test function and ensure that OpenClaw can correctly call the LLM for task processing.
Note
In this demonstration, I use the MiniMax model as an example to show how to connect to an LLM. The process for connecting other models is similar.
MiniMax Model API Configuration Example
You need to obtain the MiniMax model API key in advance and ensure normal network connection so that OpenClaw can successfully call the MiniMax model for task processing.
Obtain MiniMax Model API Key
Go to the MiniMax Open Platform, register and log in, open the following URL:
https://platform.minimaxi.com/user-center/basic-informationGo to the API key interface:
Click create, enter a name, and we will get an API key (be sure to save it):
At this point, we have successfully obtained the key!
Configure OpenClaw Model API
We use the following command to enter the OpenClaw settings interface:
openclaw configureUse Up/Down keys to select Local and press Enter:
◆ Where will the Gateway run?
│ ● Local (this machine) (Gateway reachable (ws://127.0.0.1:18789))
│ ○ Remote (info-only)
└2
3
4
Use Up/Down keys to select the Model option and press Enter:
◆ Select sections to configure
│ ○ Workspace
│ ● Model (Pick provider + credentials)
│ ○ Web tools
│ ○ Gateway
│ ○ Daemon
│ ○ Channels
│ ○ Skills
│ ○ Health check
│ ○ Continue
└2
3
4
5
6
7
8
9
10
11
Use Up/Down keys to select the MiniMax option and press Enter:
Because we selected the
MiniMaxmodel, we chooseMiniMaxfrom the model provider options. If it were another model, we would select the corresponding model provider.
◆ Model/auth provider
...
│ ● MiniMax (M2.5 (recommended))
...
└2
3
4
5
Use Up/Down keys to select MiniMax M2.5 (CN) and press Enter:
This step is to select the model version.
MiniMax M2.5is a relatively new version with better performance and results, so we select this version.
◆ MiniMax auth method
│ ○ MiniMax OAuth # This option will use OAuth 2.0 authorization to connect to MiniMax service.
│ ○ MiniMax M2.5 # Standard version
│ ● MiniMax M2.5 (CN) (China endpoint (api.minimaxi.com)) # Domestic API endpoint
│ ○ MiniMax M2.5 Lightning # Lightweight variant with faster response
│ ○ Back # Return to previous menu
└2
3
4
5
6
7
Then enter the API key we obtained earlier and press Enter to confirm:
◆ Enter MiniMax China API key
│ sk-api-_3o3***************************skE_ZM
└2
3
We will enter a multi-select page. Just press Enter directly, and finally select Continue to exit configuration:
At this point, our Model API configuration is complete. Subsequently, we can use OpenClaw to call the MiniMax model for various intelligent task processing.
Test Model API Configuration
We enter OpenClaw's chat interface and send a message to OpenClaw:
Hi, what model are you? What can you do?