v2-ai-model-token-ai-model.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-ai-model-token-ai-model.yaml
  2. get:
  3. summary: '取得指定 AI 模型的 user token。'
  4. tags:
  5. - ai-model-token
  6. operationId: get_api_v2_ai_model_token_ai_model_
  7. description: |-
  8. 仅模型 owner 本人可调用(设计决策:模型只挂个人 studio,不支持 group studio)。
  9. 签出的 token 有效期 30 天,可用 destroy() 提前撤销;属高敏感凭据,故记入 ops 日志。
  10. 实现:`AiModelTokenController@show`
  11. parameters:
  12. -
  13. name: ai_model
  14. in: path
  15. required: true
  16. schema:
  17. type: string
  18. responses:
  19. 200:
  20. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  21. content:
  22. application/json:
  23. schema:
  24. type: object
  25. properties:
  26. ok:
  27. type: boolean
  28. message:
  29. type: string
  30. data:
  31. type: object
  32. 401:
  33. $ref: '../../main.yaml#/components/responses/Unauthorized'
  34. 422:
  35. $ref: '../../main.yaml#/components/responses/ValidationError'
  36. delete:
  37. summary: '撤销该模型已签出的全部身份 token。'
  38. tags:
  39. - ai-model-token
  40. operationId: delete_api_v2_ai_model_token_ai_model_
  41. description: |-
  42. 版本号自增后,旧 token 里的 ver 立即对不上(见 AuthService::current())。
  43. 无法只撤销其中一张——凭据泄漏时本就该全部作废。
  44. 实现:`AiModelTokenController@destroy`
  45. parameters:
  46. -
  47. name: ai_model
  48. in: path
  49. required: true
  50. schema:
  51. type: string
  52. responses:
  53. 200:
  54. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  55. content:
  56. application/json:
  57. schema:
  58. type: object
  59. properties:
  60. ok:
  61. type: boolean
  62. message:
  63. type: string
  64. data:
  65. type: object
  66. 401:
  67. $ref: '../../main.yaml#/components/responses/Unauthorized'
  68. 422:
  69. $ref: '../../main.yaml#/components/responses/ValidationError'