Device OTA
Use a personal security key and device MAC address to retrieve your approved community firmware. Stable builds need no extra header. Test builds require X-OTA-Channel: test.
POSTPOST only. Opening this URL in a browser, or sending GET, does not return firmware.
| Header | Required / Optional | Description |
|---|---|---|
| X-OTA-Key | Required | OTA security key from Settings. It can download only firmware published by that key's owner. |
| Device-Id | Required | Device MAC, for example AA:BB:CC:DD:EE:FF. |
| X-OTA-Channel | Required for test builds | Omit it, or send latest, to receive stable builds only. Send test to include test builds. An explicit application.version matches that version whether it is stable or test. |
| Client-Id | Optional | Client identifier. It is not used to select firmware. |
| Field | Required / Optional | Description |
|---|---|---|
| board.type | Required | Board name from the left sidebar, such as Metalio E-Ink4 or Metalio Claw4. Spaces and letter case are ignored, so MetalioE-Ink4 matches too. |
| chip_model_name | Required | The chip the device actually runs, such as esp32s3 or bk7258. Letter case and hyphens are ignored, so ESP32-S3 and esp32s3 are the same chip. This is what tells same-named boards apart. |
| application.name | Required | Firmware title, exactly as shown in My Firmware, such as ai. |
| application.version | Optional | Omit it to get the highest available version in the selected channel. Provide it to download that exact version string. |
Do not send X-OTA-Channel or application.version. Only an approved stable build is returned.
{
"chip_model_name": "esp32s3",
"board": {
"type": "Metalio E-Ink4"
},
"application": {
"name": "Metalio-WhiteAI"
}
}Add the request header X-OTA-Channel: test. Stable and test builds are both considered, and the highest available one is returned.
X-OTA-Channel: test
{
"chip_model_name": "esp32s3",
"board": {
"type": "Metalio E-Ink4"
},
"application": {
"name": "Metalio-WhiteAI"
}
}Send application.version. Matching is exact. That version can be either stable or test.
{
"chip_model_name": "esp32s3",
"board": {
"type": "Metalio E-Ink4"
},
"application": {
"name": "Metalio-WhiteAI",
"version": "1.2.0"
}
}Do not send X-OTA-Channel or application.version. Only an approved stable build is returned.
curl -X POST 'https://admin.metalio.world/xiaozhi/api/firmware-ota/check' \
-H 'Device-Id: AA:BB:CC:DD:EE:FF' \
-H 'X-OTA-Key: fw_ota_u1024_your_random_secret' \
--json '{"chip_model_name": "esp32s3","board": {"type": "Metalio E-Ink4"},"application": {"name": "Metalio-WhiteAI"}}'Add the request header X-OTA-Channel: test. Stable and test builds are both considered, and the highest available one is returned.
curl -X POST 'https://admin.metalio.world/xiaozhi/api/firmware-ota/check' \
-H 'Device-Id: AA:BB:CC:DD:EE:FF' \
-H 'X-OTA-Key: fw_ota_u1024_your_random_secret' \
-H 'X-OTA-Channel: test' \
--json '{"chip_model_name": "esp32s3","board": {"type": "Metalio E-Ink4"},"application": {"name": "Metalio-WhiteAI"}}'Devices normally only need firmware.version and firmware.url.
{
"has_update": true,
"firmware": {
"version": "1.2.0",
"url": "https://admin.metalio.world/OTA/example.bin",
"size": 1488978,
"version_status": "latest",
"firmware_name": "Metalio-WhiteAI"
}
}| HTTP | error | Description |
|---|---|---|
| 401 | X-OTA-Key is required | The key header is missing. |
| 401 | invalid OTA access key | The key does not exist or was revoked. Generating a new key revokes the old one immediately. |
| 400 | Device-Id is required and must be a MAC address | Device-Id is missing or is not a MAC such as AA:BB:CC:DD:EE:FF. |
| 400 | board.type is required | The body has no board name. |
| 400 | application.name is required | The body has no firmware name. |
| 400 | chip_model_name is required | The body has no chip model. |
| 404 | no board matches board.type and chip_model_name | Several boards share this name, but none of them uses the reported chip. Check the chip you report, or which board the firmware is attached to. |
| 404 | firmware not found | This key's owner has no firmware with that name on this board. |
| 404 | available firmware version not found | No version was requested, and the selected channel has nothing to deliver. A test build without X-OTA-Channel: test also returns this. |
| 404 | requested firmware version not found | application.version was sent, but no approved version with a firmware file matches it exactly. |
| 409 | firmware OTA is disabled | OTA is switched off for this firmware. Taking the firmware or a version offline does not cause this error. |
| 409 | firmware download URL is unavailable | The version exists, but a download URL could not be built. |
| 409 | firmware name matches more than one firmware on this board | The same owner has more than one firmware with this name on this board. |