预算 API
管理工作空间和组织级别的预算跟踪。
查询工作空间预算
http
GET /api/v1/workspaces/{workspace_id}/budget
Authorization: Bearer <token>响应 200 OK
json
{
"budget_monthly_limit_usd": 1000.0,
"budget_used_usd": 423.50,
"budget_alert_threshold": 0.80,
"usage_percent": 42.35
}重置工作空间预算
需要工作空间 workspace:settings 权限。
http
POST /api/v1/workspaces/{workspace_id}/budget/reset
Authorization: Bearer <token>查询项目预算
http
GET /api/v1/projects/{project_id}/budget
Authorization: Bearer <token>重置项目预算
需要项目所属工作空间的 workspace:settings 权限。
http
POST /api/v1/projects/{project_id}/budget/reset
Authorization: Bearer <token>预算告警
当使用量超过阈值时,系统自动:
- 发送通知给工作空间管理员
- 超过 100% 时阻断新的执行调度