api-config.json 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {
  2. "name": "test-billing",
  3. "displayName": "计费流程测试",
  4. "description": "测试技能:验证 OpenClaw 能否识别 API 错误并触发充值页面。调用即梦API但不传token,故意触发错误响应。",
  5. "category": "test",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getImgV4",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": ["prompt"],
  17. "properties": {
  18. "prompt": {
  19. "type": "string",
  20. "description": "图片描述文本"
  21. },
  22. "token": {
  23. "type": "string",
  24. "description": "认证token(首次测试故意不传,用户支付后传入)"
  25. }
  26. }
  27. },
  28. "requestTransform": {
  29. "body": {
  30. "prompt": "{{prompt}}",
  31. "token": "{{token}}",
  32. "sizeDate": { "width": 512, "height": 512 },
  33. "scale": 0.6,
  34. "force_single": true
  35. }
  36. },
  37. "response": {
  38. "type": "object",
  39. "properties": {
  40. "code": { "type": "integer" },
  41. "data": { "type": "object" },
  42. "error": { "type": "object" }
  43. }
  44. },
  45. "timeout": 30000,
  46. "usageExamples": [
  47. {
  48. "name": "测试计费流程(不传token)",
  49. "input": {
  50. "prompt": "测试"
  51. },
  52. "description": "故意不传token触发API错误,验证Agent能否正确识别并引导用户充值"
  53. },
  54. {
  55. "name": "携带token重试",
  56. "input": {
  57. "prompt": "测试",
  58. "token": "Bearer r:xxxxxxxxxxxx"
  59. },
  60. "description": "用户支付后提供token,验证重试是否成功"
  61. }
  62. ]
  63. }