| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- {
- "name": "test-billing",
- "displayName": "计费流程测试",
- "description": "测试技能:验证 OpenClaw 能否识别 API 错误并触发充值页面。调用即梦API但不传token,故意触发错误响应。",
- "category": "test",
- "version": "1.0.0",
- "endpoint": {
- "method": "POST",
- "url": "https://server.fmode.cn/api/volcengine/jimeng/getImgV4",
- "headers": {
- "Content-Type": "application/json"
- }
- },
- "parameters": {
- "type": "object",
- "required": ["prompt"],
- "properties": {
- "prompt": {
- "type": "string",
- "description": "图片描述文本"
- }
- }
- },
- "requestTransform": {
- "body": {
- "prompt": "{{prompt}}",
- "sizeDate": { "width": 512, "height": 512 },
- "scale": 0.6,
- "force_single": true
- }
- },
- "response": {
- "type": "object",
- "properties": {
- "code": { "type": "integer" },
- "data": { "type": "object" },
- "error": { "type": "object" }
- }
- },
- "timeout": 30000,
- "usageExamples": [
- {
- "name": "测试余额不足流程",
- "input": {
- "prompt": "测试"
- },
- "description": "发送任意prompt触发API调用,验证错误检测和充值弹窗"
- }
- ],
- "tokenConfig": {
- "type": "bearer",
- "tokenField": "token",
- "resolutionOrder": ["configFile"],
- "onMissing": {
- "action": "showPaymentQR",
- "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
- "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
- "pollingIntervalMs": 3000,
- "pollingTimeoutMs": 300000,
- "onPaymentSuccess": "retrySkillWithNewToken",
- "title": "请扫码开通服务",
- "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
- },
- "onBalanceInsufficient": {
- "action": "showPaymentQR",
- "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
- "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
- "pollingIntervalMs": 3000,
- "pollingTimeoutMs": 300000,
- "onPaymentSuccess": "retrySkillWithNewToken",
- "title": "余额不足,请扫码充值",
- "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
- }
- },
- "errorHandling": {
- "balanceInsufficient": {
- "conditions": [
- { "responseField": "code", "operator": "in", "value": [-2, -3, -10, 402, 429] },
- { "responseField": "msg", "operator": "contains", "value": ["余额不足", "insufficient", "balance", "quota"] },
- { "responseField": "message", "operator": "contains", "value": ["余额不足", "insufficient", "balance"] }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onBalanceInsufficient"
- },
- "unauthorized": {
- "conditions": [
- { "responseField": "code", "operator": "in", "value": [401, 403] },
- { "responseField": "msg", "operator": "contains", "value": ["unauthorized", "token", "invalid", "auth"] },
- { "responseField": "error.message", "operator": "contains", "value": ["API_KEY", "sessionToken", "用户不存在", "权限"] }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onMissing"
- }
- }
- }
|