返回Wiki

平台API参考

完成 CenterOS 的 REST API 参考. 在 9 个类别中进行 39 项操作, JWT 和 PAT 认证,卷轴示例,错误代码.

在这个页面上

  • 根据"本文"的规定,
  • 证实证件
  • 医疗检查
  • T84)
  • 其他数据集
  • T86)
  • 其他类型:
  • 注释 (4)
  • [组织 (3) ]T90)
  • 国家 (2)
  • 错误代码:
  • T93)
  • ,,,

代理和开发人员访问

  • 其他类型的服务:
  • [平台API参考]
  • 其他类型的产品
  • [MCP集成]
  • ,,,

查看

  • [←所有维基文章]
  • 快速启动的SDK

应用程序引用 REST + JSON

完成 CenterOS 的 REST API 参考. 在 9 个类别中, 39 个操作,所有操作都可通过一个终端点发现.

更新2026年4月39项行动JWT+PAT auth

基础URL

所有API终端点与生产后端相对:

https://fearless-backend-533466225971.us-central1.run.app

对于本地开发,Vite dev服务器自动地代理T0T1.您还可以使用T2环境变量来覆盖CLI和MCP服务器中的基 URL.

证实

API支持两个身份验证方法.所有身份验证的终端需要在T4标题中设置一个T3代币.

JWT (会议标志)

通过用户名和密码登录获取. 短暂,适合互动会议.

子复制

登录,得到一个JWT 子 -X POST T106 \ -H "内容类型:应用/json" \ -d '{"用户名": "jerry", "密码": "***"}"

答案包括: {"访问符号": "eyJ...", "用户": {...}}

个人访问代码 (PAT)

长期使用的CI/CD管道,脚本和代理工作流的代币.PAT代币以T5开始.通过CLI或平台仪表板创建一个.

子复制

通过CLI创建PAT 创建一个"我的代理"的"镜头" ,我在着.

在API调用中使用PAT T107 \ 发送者: 发送者:

** 扩展标记:** PAT 可以扩展到特定的权限 (例如 T6). 充分访问使用 T7. API 根据您的标记的扩展范围来过可见的行动.

卫生检查

子复制

根据"数据库"的规定,

没有需要验证. 返回T8当后端健康.

行动层

行动层是平台UI,CLI,MCP服务器和AI代理共享的统一API表面.所有39项操作都可通过两个终端点发现:

Method Endpoint Description
GET /api/actions List all available actions with input schemas. Optionally filter by ?category=datasets.
POST /api/actions/{name} Execute an action by name. Body: {"params": {...}}. Requires Bearer token.

发现行动

子复制

列出所有行动 (公开 没有需要发现的作者)

按类别过 T110

执行一个行动

子复制

子 -X POST T111 \ 据悉,在此次发行中, -H "内容类型:应用/json" \ -d "{"参数": {"限量": 10}}"

现在,我们要做什么?

数据集

管理机器人数据集 列表,获取详细信息,上传和删除.

Action Description Required Params Scope
list_datasets List datasets with optional search, file type, and pagination filters. None datasets:read
get_dataset Get detailed information about a single dataset. dataset_id datasets:read
delete_dataset Delete a dataset and its associated file from storage. dataset_id datasets:write
upload_dataset Create a dataset record (metadata). For file upload, use get_upload_signed_url. name datasets:write
get_upload_signed_url Generate a GCS signed URL for direct-to-cloud dataset upload. filename, file_size datasets:write
confirm_upload Confirm that a signed-URL upload completed. Marks the dataset as ready. dataset_id datasets:write

子复制

列出数据集,使用搜索过缩 -X POST .../api/actions/list_datasets \ 据悉,在此次发行中, -H "内容类型:应用/json" \ -d '{"参数": {"搜索": "抓取", "文件_类型": "hdf5", "限制": 20}}"

输入流程:获取签署的URL,输入文件,确认 缩 -X 发布.../api/actions/get_upload_signed_url \ 据悉,在此次发行中, -H "内容类型:应用/json" \ -d '{"参数": {"文件名": "剧情_001.hdf5", "文件_大小": 52428800}}"

培训

创建和管理培训和调整工作.

Action Description Required Params Scope
list_training_jobs List training jobs with optional status and model type filters. None training:read
create_training_job Create a new training or fine-tuning job from one or more datasets. dataset_ids training:write
get_training_status Get the current status and details of a training job. job_id training:read
launch_training Launch a pending training job (transition to running). job_id training:write
get_finetune_catalog List all supported fine-tuning base model providers and models. None training:read
estimate_cost Estimate the cost of a training run based on datasets and infra. None training:read

子复制

创建一个培训工作 子 -X 发布.../api/行动/创建工作 据悉,在此次发行中, -H "内容类型:应用/json" \ -d '{"参数": {"名称": "dp-v1", "模型_类型": "传播_政策", "数据集_ids": [1, 2], "模式": "finetune"}}"

启动一个待定的工作 子 -X 发布.../api/行动/发射 据悉,在此次发行中, -H "内容类型:应用/json" \ -d "{"参数": {"工作_id": "abc123def456"}}"

模型

模型注册表与生命周期管理. 范围:模型:阅读模型:写

Action Description Required Params Scope
list_models List model versions with optional status and name filters. None models:read
register_model Register a new model version in the model registry. name models:write
promote_model Promote a model through lifecycle stages: draft → validated → deployed → retired. model_id, target_status models:write
get_model_lineage Get full lineage: training job, datasets, deployments, evaluations. model_id models:read

子复制

登记从训练中获得的模型 子 -X 邮件.../api/actions/register_model \ 据悉,在此次发行中, -H "内容类型:应用/json" \ -d "{"参数": {"名称": "dp-v1", "文物_uri": "gs://bucket/model.pt", "培训_job_id": "abc123"}}"

推广到验证 子 -X 发布.../api/actions/promote_model \ 据悉,在此次发行中, -H "内容类型:应用/json" \ -d '{"参数": {"模型_id": 5, "目标_状态": "验证"}}"

舰队

机器人舰队管理,部署和安全指令.

Action Description Required Params Scope
get_fleet_summary High-level fleet summary: counts by status, alerts, tickets. None fleet:read
list_robots List robots with optional status, site, and search filters. None fleet:read
get_robot_state Detailed state of a single robot: heartbeat, commands, alerts. robot_id fleet:read
register_robot Register a new robot in the fleet. robot_id fleet:write
deploy_model Deploy a validated model version to a specific robot. robot_id, model_version_id fleet:write models:read
emergency_stop Send an emergency stop (e-stop) command to a robot. Highest priority. robot_id fleet:write

子复制

登记一个机器人 子 -X POST .../api/actions/register 机器人 \ 据悉,在此次发行中, -H "内容类型:应用/json" \ -d '{"参数": {"机器人_id": "arm-01", "名称": "实验室臂1", "机器人_type": "arm"}}"

让机器人使用模型 缩 -X 发布.../api/行动/部署 据悉,在此次发行中, -H "内容类型:应用/json" \ -d '{"参数": {"机器人_id": "arm-01", "模型_版本_id": 5, "战略": "即时"}}"

紧急停车 缩 -X 邮件.../api/行动/紧急情况 据悉,在此次发行中, -H "内容类型:应用/json" \ -d '{"参数": {"机器人_id": "arm-01", "原因": "安全_检查"}}"

标记

数据注释任务管理和质量指标.

Action Description Required Params Scope
list_annotation_tasks List annotation tasks with optional status, assignee, and search filters. None annotations:read
create_annotation_task Create a new annotation task, optionally linked to a dataset. None (title recommended) annotations:write
get_annotation_metrics Aggregated quality metrics: pass rate, review counts, status distribution. None annotations:read
submit_task Submit an annotation task for review (transition to in_review). task_id annotations:write

子复制

创建注释任务 缩 -X 发布.../api/actions/create_annotation_task \ 据悉,在此次发行中, -H "内容类型:应用/json" \ -d '{"参数": {"标题": "标签捕获事件", "数据集_id": 42, "数据_类型": "视频", "优先级": "高"}}"

组织

组织和团队成员管理 范围: read orgs: write

Action Description Required Params Scope
list_orgs List organizations. Superadmins see all; others see only their org. None orgs:read
list_org_members List members of an organization with their roles. None (org_id optional) orgs:read
invite_member Invite a user to an organization. Creates the user if they do not exist. org_id, email orgs:write

统计数据

平台统计和系统健康检查.

Action Description Required Params Scope
get_platform_stats Aggregated platform statistics: dataset counts, training jobs, robots, annotations. None stats:read
get_system_health Check the health of backend systems: database, storage, overall status. None stats:read

子复制

获取平台统计 缩 -X 发布.../api/actions/get_platform_stats \ 据悉,在此次发行中, -H "内容类型:应用/json" \ -d "{"params": {}}"

检查系统健康 子 -X 发布.../api/actions/get_system_health \ 据悉,在此次发行中, -H "内容类型:应用/json" \ -d "{"params": {}}"

错误代码

所有操作错误都会返回一个JSON体,包含T66和适当的HTTP状态代码.

Code Meaning Common Cause
400 Bad Request Missing required parameter or invalid value.
401 Unauthorized Missing or invalid Bearer token.
403 Forbidden Token scopes do not include the required permission, or org isolation violation.
404 Not Found Unknown action name, or resource (dataset, model, robot) does not exist.
409 Conflict Duplicate resource (e.g. robot already registered, user already a member).
413 负载 Too Large File exceeds the maximum upload size.
500 Internal Server Error Unhandled exception in the action handler.

范围 参考

域控制一个代币可以访问哪些操作. PAT 可以用特定域创建; JWT 从用户的角色中导出范围.

Scope Actions Granted
datasets:read list_datasets, get_dataset
datasets:write delete_dataset, upload_dataset, get_upload_signed_url, confirm_upload
training:read list_training_jobs, get_training_status, get_finetune_catalog, estimate_cost
training:write create_training_job, launch_training
models:read list_models, get_model_lineage
models:write register_model, promote_model
fleet:read get_fleet_summary, list_robots, get_robot_state
fleet:write register_robot, deploy_model, emergency_stop
annotations:read list_annotation_tasks, get_annotation_metrics
annotations:write create_annotation_task, submit_task
orgs:read list_orgs, list_org_members
orgs:write invite_member
stats:read get_platform_stats, get_system_health
* All actions (wildcard)

角色与范围的映射

Role Scopes
admin All scopes
operator datasets:*, training:*, models:read, fleet:*, annotations:*, stats:read
annotator datasets:read, annotations:*, stats:read
viewer All :read scopes

下一步

CLI指南 使用 CenterOS CLI 来实现基于终端的工作流程 → MCP 集成连接Claude,Cursor或Windsurf到平台 → 代理访问概述 通过程序访问平台的三个方法 → 开放平台管理数据集,培训和机队在浏览器中 →