Closeli Open Device List Query
/install api-device-list1
Device List Query API
POST /api/device/list is used to query all devices bound to the currently authenticated user. This API does not require a request body. The device list is automatically associated through the api_key.
⚠️ Display Rules (MUST Be Strictly Followed)
The script outputs structured data in JSON format, which is the expected behavior. The following display rules are formatting instructions for the agent: the agent MUST parse the JSON output from the script and convert it into a user-friendly format according to the rules below before displaying it, and MUST NOT display the raw JSON directly.
- When
code == 0anddatais not empty, display it as a table:
| MAC Address | Device Name |
|---|---|
| aabbccddeeff | Living Room Camera |
Key rule: device_id MUST remove the xxxxS_ prefix before being displayed as the MAC address. The table header MUST be written as "MAC Address" and MUST NOT be written as "Device ID".
- When
datais an empty array, reply: "There are no devices bound under the current account." - When
code != 0, reply: "API call failed, error code {code}, reason: {message}"
Prerequisites
The script depends on httpx. If it is not installed, the script will prompt python3 -m pip install httpx.
Configuration Declaration
This skill depends on the following configuration items. The agent and user MUST confirm that they are correctly configured before running.
Required Configuration
| Configuration Item | Delivery Method | Description |
|---|---|---|
| AI_GATEWAY_API_KEY | Environment variable (recommended), ~/.openclaw/.env (fallback), command line --api-key |
API key used for API authentication. The script automatically retrieves it according to this priority order |
Optional Configuration
| Configuration Item | Delivery Method | Default Value | Description |
|---|---|---|---|
| AI_GATEWAY_HOST | Environment variable, ~/.openclaw/.env |
https://ai-open.icloseli.com |
Gateway address |
| AI_GATEWAY_VERIFY_SSL | Environment variable | true | Set to false to disable TLS certificate verification (development environments only) |
| AI_GATEWAY_NO_ENV_FILE | Environment variable | false | Set to true to disable fallback loading from ~/.openclaw/.env (recommended for production environments) |
Fallback Configuration Path
By default, the script reads the ~/.openclaw/.env file as the fallback configuration source. This file is shared by all skills and uses the format KEY=VALUE (one entry per line). In production environments, you MUST set AI_GATEWAY_NO_ENV_FILE=true to disable this fallback and instead pass all configuration directly through environment variables.
Security Notes
- The shared credential file
~/.openclaw/.envcan be read by all skills under the same user. In production environments, you MUST pass the API_KEY through environment variables and MUST NOT rely on the shared credential file - TLS certificate verification is enabled by default and MUST NOT be disabled in production environments (disabling it introduces man-in-the-middle attack risks, allowing attackers to intercept the API_KEY and device data)
- Before use, you MUST confirm that AI_GATEWAY_HOST points to a trusted domain
- You MUST use a least-privilege API_KEY and avoid reusing high-privilege credentials. This skill only requires device list query permission
Network Access Declaration
This skill only accesses the following endpoints (all are paths under AI_GATEWAY_HOST):
| Endpoint | Method | Purpose |
|---|---|---|
| /api/device/list | POST | Query the list of devices bound to the user |
The script does not access any other network resources.
Quick Start
python3 list_devices.py
Authentication Method
Bearer Token authentication is used. The script automatically carries Authorization: Bearer \x3Capi_key> in the request header.
Request Format
Request Headers
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| Content-Type | string | Yes | application/json |
| Authorization | string | Yes | Bearer \x3Capi_key>, a 32-character hexadecimal string |
Request Body
No request body is required.
Response Format
{
"code": 0,
"message": "success",
"request_id": "\x3C32-character request trace ID>",
"data": [
{
"device_id": "xxxxS_aabbccddeeff",
"device_name": "Living Room Camera"
}
]
}
data Field (Device Array)
| Parameter Name | Type | Description |
|---|---|---|
| device_id | string | Device ID, format: xxxxS_\x3Cmac_address>. All subsequent device APIs use this format |
| device_name | string | Device name, a user-defined device alias |
Error Codes
| Error Code | HTTP Status Code | Description |
|---|---|---|
| 1001 | 401 | api_key not provided (missing Authorization header or incorrect format) |
| 1002 | 401 | api_key is invalid or disabled |
| 3001 | 502 | Internal gateway service call failed |
| 3004 | 502 | Internal gateway service call failed |
| 5000 | 500 | Internal error |
Notes
- The
device_idformat isxxxxS_\x3Cmac>, which is the identifier used by all subsequent device-related APIs - IMPORTANT:
device_idis case-sensitive. The prefix MUST be lowercasexxxxS_, NOT uppercaseXXXXS_. The script will auto-correct the case, but the agent SHOULD always pass the correct lowercase format - The global request timeout is 120 seconds
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install api-device-list1 - 安装完成后,直接呼叫该 Skill 的名称或使用
/api-device-list1触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Closeli Open Device List Query 是什么?
Closeli Device List Query API. Used to retrieve the device list under the current account and return basic information such as device name, MAC, and IMEI. Us... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 148 次。
如何安装 Closeli Open Device List Query?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install api-device-list1」即可一键安装,无需额外配置。
Closeli Open Device List Query 是免费的吗?
是的,Closeli Open Device List Query 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Closeli Open Device List Query 支持哪些平台?
Closeli Open Device List Query 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Closeli Open Device List Query?
由 CloseliOpenTeam(@closeli-open)开发并维护,当前版本 v1.0.2。