Welcome to ROSMASTER M1 PRO repository
2.Configuring API-KEY
Configuring API-KEY
Configuring API-KEY1. Course Content2. Starting the Dify Service3. Configuring the Model Provider API-KEY4. Testing Whether the API-KEY Is Available5. Configuring the Visual Positioning Model6. Configuring the Online Speech Model API-KEY (Optional)7. Modifying the Dify Service API
1. Course Content
Use the API-KEY registered earlier to configure the API-KEY of the robot car.
Warning
Note: Please make sure the car is connected to the Internet, otherwise the cloud model services cannot be used.
2. Starting the Dify Service
Tip
The ROSMASTER-M1 Pro builds a multi-agent system through Dify, and Dify uniformly manages the calls of cloud models.
Start the Dify service
bringup_dify

Check the car's IP address, which can be viewed on the OLED screen or in the terminal via
ifconfig.

Enter the car's IP address directly in the browser's address bar to access the Dify management page. If the device is logging in for the first time, you need to use an account and password; you can select the language in the upper left corner.
Note
Account name:
yahboom@163.comPassword:
yahboom123All account passwords, agent applications, and RAG data are locally stored information.
The interface after entering is shown below.

3. Configuring the Model Provider API-KEY
Click Settings.

Here, take configuring the API of the Bailian account as an example. Click Model Provider —> Configure —> Add API Key.

Fill in your own Bailian platform API-KEY, then select whether it is an international site account, and click Save.

4. Testing Whether the API-KEY Is Available
Important
In subsequent lessons, when encountering a situation where the AI cannot reply normally, first test whether the API-KEY of your model provider is available.
Click the TEST_API app in the studio.

Then choose any model in the model selection for testing.

Enter any content in the chat box; if the registered API-KEY and the selected model are available, the model's reply content can be seen normally.

If it prompts that the API is unavailable, please check the KEY of your model provider.

5. Configuring the Visual Positioning Model
The visual positioning model is used to obtain the initial position of the target in the field of view when grasping and tracking the target.
The example here uses a model from the Alibaba Cloud Bailian platform; directly fill in the API-KEY and BaseURL registered in the previous chapter.
Note
If you need to use the visual positioning model of another model provider, just modify the API-KEY, BaseURL, and Model; it is compatible with the OpenAI protocol.

6. Configuring the Online Speech Model API-KEY (Optional)
xxxxxxxxxxrobot_manage gui
By default from the factory, a local offline streaming speech recognition engine and local offline speech synthesis are used (the parameters for the China region use Alibaba Cloud Bailian speech synthesis by default; for the international region, Alibaba Cloud Bailian does not yet provide speech services, so iFlytek speech recognition and synthesis are used by default).
Tip
Configuration is only needed when using online speech recognition or online speech synthesis. For Raspberry Pi 5 (4GB) version and RDK X5 mainboard users, it is recommended that in the OpenClaw chapters involving SLAM navigation comprehensive function cases, you prioritize online speech recognition and speech synthesis, which will effectively reduce the CPU and memory pressure of the mainboard; in the Dify single-instance chapter, you can still use offline speech functions to save costs.
Comparison of offline speech recognition and speech synthesis functions
| Function | Solution | Effect comparison |
|---|---|---|
| Offline speech recognition (ASR) | Local streaming speech recognition engine | No extra cost, real-time streaming recognition, but consumes a certain amount of the mainboard's CPU and memory resources |
| Online speech recognition (ASR) | Alibaba Cloud Bailian (Chinese) / iFlytek (English) | No streaming recognition, and does not occupy the mainboard's computing resources |
| Offline speech synthesis (TTS) | Local speech synthesis engine | No extra cost, but the synthesized speech is mechanical with a single timbre |
| Online speech synthesis (TTS) | Alibaba Cloud Bailian (Chinese) / iFlytek (English) | Better speech quality, does not occupy the mainboard's computing resources, with a timbre that is realistic and close to a real person, and multiple timbres to choose from |
English Online Speech Settings
The English online speech recognition and speech synthesis in the international region are provided by iFlytek. No API-KEY configuration is needed; just switch the language to English.

Offline Speech Settings
Turn off the switches of online ASR and online TTS to switch to offline speech recognition and speech synthesis.

7. Modifying the Dify Service API
Note: This is rarely used and is for reference only by users with development needs; it can generally be ignored.
If you later need to modify the API that the car uses to access the Dify application, or when Dify is deployed on another server, the address accessed by the car needs to be modified.
Find the
DIFY_API_KEYandDIFY_BASE_URLparameters, whereDIFY_BASE_URLis the address for accessing the Dify backend service.DIFY_API_KEYis the API-KEY of the AI application in Dify.
