pudu-openapi-skill
Call the cloud OpenAPI of Pudu robots, supporting operations such as robot task distribution, status query, delivery, cruise, call, and statistical data analysis. When using, first check the credentials and cluster environment variables; if missing, prompt the user to supplement them, then call the corresponding interface according to the user's intention and display the results. Trigger scenarios: Use this skill when the user mentions keywords such as "Pudu robot", "pudu", "robot task distribution", "query robot status", "delivery task", "cruise task", "call robot", "lifting task", "errand", "Flash Cabinet", "advertisement playback", "advertisement configuration", "cabinet task", "cabinet SKU", "product SKU", "hatch door photo", "traffic control zone", "map list", "statistical data", "risk avoidance", "dashboard overview", "OpenAPI".
NPX Install
npx skill4agent add pudu-robotics/skills pudu-openapi-skillTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Pudu OpenAPI Skill
Workflow
1. Check Credentials → Read / Prompt for ApiAppKey & ApiAppSecret
2. Confirm Cluster → Read PUDU_API_CLUSTER; if missing, must ask user to select, prohibit defaulting to any cluster → Determine BASE_URL
3. Understand User Intent → Locate functional group → Read corresponding assets/*.json
4. Normalize Parameter Names → Map user input fields to real field names specified in the interface specification
5. Build and Execute Request → Execute scripts according to environment priority (js -> py -> go -> java -> cs)
6. Display Results → Beautify output if status code is 200 and message=SUCCESS, otherwise output error causeStep 1: Check Credentials
| Variable Name | Description |
|---|---|
| ApiAppKey |
| ApiAppSecret |
The following credentials are missing. Please provide them via one of the following methods:Method 1 (Recommended): Set environment variablesbashexport PUDU_API_APP_KEY="your-key" export PUDU_API_APP_SECRET="your-secret"Method 2: Tell me directly Please enter your ApiAppKey and ApiAppSecret.If you don't have credentials yet Please visit Pudu Open Platform Quick Start and follow the tutorial to apply.
Sensitive Credential Handling Rules
- Prioritize suggesting users to provide credentials via environment variables instead of pasting directly in the conversation
- If the user provides directly, do not echo the full value in replies, logs, error messages, or sample code
ApiAppSecret - Do not write the user-provided /
ApiAppKeyinto repository files, script constants, or sample codeApiAppSecret - When troubleshooting, only display the desensitized form, e.g.,
abc***xyz
Step 2: Confirm Cluster
PUDU_API_CLUSTER| Environment Variable Value | Cluster | hostname |
|---|---|---|
| Domestic Production Node | |
| Overseas (Japan, Korea, Singapore) Production Node | |
| Germany Production Node | |
| US Production Node | |
cnexport PUDU_API_CLUSTER="cn" # cn / sea / de / ushttps://{hostname}/pudu-entry{path}Step 3: Understand Intent → Locate Interface
| Functional Group | Specification File | Typical Scenarios |
|---|---|---|
| Robot Status and Information Query | | Query status, location, task status |
| Delivery and Transport Tasks | | Issue delivery tasks, multi-point transport |
| Errand Tasks | | Errand mode tasks |
| Lifting and Tray Tasks | | Lifting robot tasks, tray orders |
| Cruise Tasks | | Issue cruise tasks, query cruise routes |
| Call Tasks | | Custom call robot |
| Flash Cabinet Exclusive Functions | | Hatch door status/control, hatch door photo tasks, elevator internal screenshots |
| Content, Voice and Media | | Screen display, voice broadcast, volume |
| Basic Control and Data Reporting | | Charging, map switching, location reporting, traffic control zone reporting and query |
| Cleaning Statistical Analysis | | Charts and paginated data for cleaning modes like floor mopping, sweeping |
| General Statistical Analysis | | Machine overview, store overview and operation analysis data |
| Delivery Statistical Analysis | | Details and chart data for modes like delivery, call, cruise |
| Industry Statistical Analysis | | Statistical details and chart data for industry tasks like lifting |
| Briefing Data | | Core operation dashboard data for stores and machines |
| Logs and Reporting Records | | List query for self-test on startup, battery charging, fault events, etc. |
| Task Scheduling and History | | Execution details and timeline of destinations for tasks like call, delivery |
| Store and Basic Data | | Store list query, machine list query |
| Map Services | | Get map list, map list under store, map details, current map, point information, point grouping, map base map |
| Advertisement Playback and Configuration | | Advertisement list, details, creation, update, deletion, scenario menu |
| Cabinet Tasks and Cabinet SKU | | Product SKU synchronization, SKU query, cabinet list, cabinet delivery order placement |
| Machine Risk Avoidance | | Initiate risk avoidance task, cancel risk avoidance task |
references/capabilities.mdStep 4: Parameter Name Normalization
paramsparametersrequestBody- /
shopId/shop_id→ Convert toshop-idorshopIdaccording to the current interface specificationshop_id - /
groupId/group_id→ Convert togroup-idorgroupIdaccording to the current interface specificationgroup_id - /
payload.startPoint/payload.start_point→ Convert to real nested field names according to the schemapayload.start-point
- Build a whitelist of field names using the current interface specification; do not decide the final field names based on common sense
- Ignore case, and
_when matching, but the final output must retain the original field name format in the specification- - Apply the same rules recursively to objects and array objects in the request body
- Only convert field names, do not change field values
- If the same input field can match multiple specification fields, or the field is not in the specification, confirm with the user first; do not send unknown fields directly to the interface
Step 5: Build and Execute Request
scripts/pudu-request.jsscripts/pudu-request.pyscripts/pudu-request.goscripts/pudu-request.javascripts/pudu-request.cs
pudu-request.jsconst { request } = require("./scripts/pudu-request");
const result = await request({
cluster: process.env.PUDU_API_CLUSTER, // Or explicitly pass "cn" / "sea" / "de" / "us"
path: "/pudu-entry<path read from specification file>",
method: "<GET or POST>",
params: { /* Parameters extracted from user prompt and specification file */ },
apiAppKey: process.env.PUDU_API_APP_KEY,
apiAppSecret: process.env.PUDU_API_APP_SECRET,
});
if (result.ok) {
console.log(result.json);
} else {
console.error(result.errorMessage);
}- will first read
request(),PUDU_API_APP_KEY,PUDU_API_APP_SECRETfrom environment variablesPUDU_API_CLUSTER - If /
apiAppKey/apiAppSecret/clusterare explicitly passed, the explicit parameters will take precedencehostname - must include the
pathprefix, e.g.,/pudu-entry(if the interface is a statistical interface for/pudu-entry/open-platform-service/v2/status/get_by_sn, the path will be similar to/data-board, etc., subject to the specification file)/pudu-entry/data-board/v1/analysis/run - needs to be built based on both the user prompt and the OpenAPI specification file; do not guess fields only by natural language; must complete parameter name normalization before sending the request to ensure all field names are completely consistent with the specification
params - When the interface requires , if the value passed by the user is in the format of
sn, it should be judged as a MAC address instead of SN, and the user should be actively reminded to provide the real robot SN14:80:CC:89:27:A6
Step 6: Display Results
Success Judgment Rules
- HTTP status code is
200 - in the returned result
message === "SUCCESS"
{
"data": {
"count": 110,
"list": [
{
"company_id": "13947",
"company_name": "chixzdls_internal02二级代理商",
"shop_id": "324100000",
"shop_name": "【10月08日】出尘门店"
},
{
"company_id": "13947",
"company_name": "chixzdls_internal02二级代理商",
"shop_id": "325300001",
"shop_name": "闪电匣和很多葫芦"
}
]
},
"message": "SUCCESS",
"trace_id": "YourApiAppKey_405eb004-7f09-4d86-bff1-4657cdec2717"
}Display Method When Successful
body✅ Call Successful
Interface: GET /open-platform-service/v2/status/get_by_sn
Cluster: Domestic Production Node
{
"message": "SUCCESS",
"data": {
"sn": "robot-001",
"runState": "IDLE",
"battery": 85,
...
}
}Display Method When Failed
- HTTP status code is not
200 - HTTP status code is , but
200message !== "SUCCESS"
❌ Call Failed (HTTP 401)
Interface: GET /open-platform-service/v2/status/get_by_sn
Error Cause: Unauthorized — ApiAppKey or signature verification failed, please check if the credentials are correct.| HTTP Status Code | Meaning | Handling Suggestion |
|---|---|---|
| 401 | Signature verification failed | Check if ApiAppKey / ApiAppSecret are correct |
| 403 | No permission | Confirm whether the interface has been activated |
| 404 | Interface path does not exist | Check if path and cluster match |
| 500 | Server error | Retry or contact Pudu technical support |
Quick Reference for Common Interfaces
# Query Robot Status (v2 recommended)
GET /open-platform-service/v2/status/get_by_sn?sn={sn}
GET /open-platform-service/v1/status/get_by_group_id?groupId={groupId}
# Issue Tasks
POST /open-platform-service/v1/delivery_task
POST /open-platform-service/v1/transport_task
# One-click Recharge (v2 recommended)
GET /open-platform-service/v2/recharge?sn={sn}
# Call Robot
POST /open-platform-service/v1/custom_call
# Maps and Traffic Control Zones
GET /data-open-platform-service/v1/api/maps?shop_id={shop_id}
POST /map-service/v1/open/traffic_control/list
# Query Machine Operation Overview and Analysis
GET /data-board/v1/brief/run?shopId={shopId}
GET /data-board/v1/analysis/run?shopId={shopId}
# Advertisement Playback and Configuration
POST /biz-service/openPlatform/api/v1/gg/list
GET /biz-service/openPlatform/api/v1/gg/get?id={id}&shop_id={shop_id}
POST /biz-service/openPlatform/api/v1/gg/create
# Cabinet Tasks and Cabinet SKU
POST /community-open-service/api/product_sku/v2/upsert
GET /community-open-service/api/cabinet/v1/list?shop_id={shop_id}
POST /community-open-service/api/cabinet/send_task
# Flash Cabinet Hatch Door Photo
POST /biz-open-service/v1/robotDoor/task_listNotes
- v2 interfaces take precedence over older versions (e.g., ), please use v2 for
status/get_by_snas the status fields are more conciserecharge - Interfaces marked with are only applicable to robot models with cabinets
(Flash Cabinet) - is the robot serial number,
snis the store ID, which are the most commonly used identification fieldsshopId - MAC addresses are commonly in the format of ; if the interface requires
14:80:CC:89:27:A6, do not directly use a MAC address insteadsn - Tasks such as delivery, transport, errand, lifting have corresponding interfaces for pause/resume/cancel
*_action - If the user intends to write an Open API request SDK, according to the programming language specified by the user, refer to and output a standard implementation example in the corresponding language.
references/request-sdk.md