OpenAPI 3.1从代码自动生成api/httpapi/v2/openapi.yaml

httpapi v2 OpenAPI 端点全表(40 个)

直接从 api/httpapi/v2/openapi.yaml 自动生成的全部 40 个 HTTP 与 SSE 接口参考。

本文档由 scripts/sync-docs.mjs 直接解析 orquelo-v2/api/httpapi/v2/openapi.yaml 及分模块路径文件自动生成(OpenAPI 3.1.0 · 共 40 个端点 · 20 个 Schema 定义)。

基础信息与认证

  • ◆官方网关域名:https://orquelo.dev(本机默认监听 http://127.0.0.1:8787)
  • ◆认证头:Authorization: Bearer <token>(支持实例静态 Token、配对设备 Token orq_dev_… 或本机客户端 Token orq_loc_…)
  • ◆实时流:GET /v1/stream 输出 text/event-stream,以 Host 事实序号作为 id,支持 Last-Event-ID 断线重放。

核心端点:健康检查、配对、消息、Run、问题与 SSE

方法路径认证响应码说明
GET/v1/healthPublic200Handshake; needs no token.
POST/v1/auth/pair/startBearer200, 400A single-use pairing code, valid 5 minutes.
POST/v1/auth/pair/exchangePublic200, 401, 429Redeem a code for a device token; needs no token.
GET/v1/auth/devicesBearer200The caller's devices, or every device for an admin.
DELETE/v1/auth/devices/{id}Bearer204, 404Revoke a device; its token and open streams end at once.
GET/v1/conversationsBearer200, 400The person's conversations on every connection, by their newest run.
POST/v1/messagesBearer202, 400, 404, 503Send a message; idempotent by id. A message to a running conversation steers it (ADR 0006).
GET/v1/conversations/{id}/messagesBearer200A conversation's messages; after_seq adds the user's own, v1's after lists replies only.
GET/v1/events/{id}Bearer200, 202, 404The run an event started.
GET/v1/runs/{id}Bearer200, 404A run of the person.
POST/v1/runs/{id}/cancelBearer200, 202, 404Ask a run to stop; idempotent.
GET/v1/questionsBearer200Open questions of the person's runs and those the person may answer.
POST/v1/questions/{id}/answerBearer200, 400, 403, 409Answer with the version read; a lost race is 409 with the current question.
GET/v1/streamBearer200Server-sent events: hello, stream.resync_required, run.started, run.finished, question.opened, question.updated, question.resolved, tool.started, tool.finished, subagent.updated, delivery.updated, message.created, message.progress and run.activity (no id; the data of run.activity is a RunActivity).

文件、工作区、轨迹、Diff、评分与投递

方法路径认证响应码说明
POST/v1/uploadsBearer200, 201, 400, 409, 413Upload a file for a later message in one request (multipart), or open a resumable upload (JSON); the sender's for 24 hours once complete.
GET/v1/uploads/{id}Bearer200, 404How much of a resumable upload has arrived; another user's is 404.
PATCH/v1/uploads/{id}Bearer200, 400, 404, 409, 413Send a chunk at Upload-Offset. A chunk within the bytes received changes nothing; one overlapping their end adds its tail.
POST/v1/uploads/{id}/completeBearer200, 404, 409Complete a resumable upload that has all its bytes; its upload_id is then attached like a one-shot upload's.
GET/v1/artifacts/{id}Bearer200, 206, 304, 404, 416An artifact of the person's runs; any other id is 404.
GET/v1/catalogBearer200Directives, runtimes and workspaces the person can pick here.
GET/v1/workspacesBearer200The named workspaces open to the person.
GET/v1/runs/{id}/diffBearer200, 404The changes of the task worktree a run works in.
GET/v1/runs/{id}/traceBearer200, 404The trace of a run of the person, as /trace shows it in a direct chat (TUI design G2): its spans (model calls, tool calls with their times, results and approvals), findings and scores.
POST/v1/runs/{id}/ratingBearer200, 400, 404, 409Rate a finished run of the person, up or down (TUI design G4); the same checks as a rating from its own channel.
GET/v1/runs/{id}/activityBearer200, 404The latest structured progress of a run of the person (TUI design G1); an empty view when the run reports none or is not running.
GET/v1/runs/{id}/deliveriesBearer200, 404Each destination's delivery of a run.
POST/v1/deliveries/{id}/retryBearer202, 404, 409Queue one failed delivery again; the runtime does not run again.

管理端点:记忆、技能草稿、插件、出口代理与推送

方法路径认证响应码说明
GET/v1/memoryBearer200, 501The memories the person's own context may read.
PATCH/v1/memory/{id}Bearer200, 400, 403, 404Write the next version of a memory; shared ones need an admin.
DELETE/v1/memory/{id}Bearer204, 404Forget a memory and its earlier versions.
GET/v1/skills/draftsBearer200The person's skill drafts, or every draft for an admin.
POST/v1/skills/drafts/{id}/publishBearer200, 403, 404, 409, 501Admin. Publish a draft with the digest read from the list.
POST/v1/skills/drafts/{id}/discardBearer200, 403, 404Admin. Reject a draft.
GET/v1/pluginsBearer200The configured instances, without options or secrets.
PATCH/v1/plugins/{id}Bearer200, 400, 403, 501Admin, manage grant. Turn an instance on or off.
PUT/v1/plugins/{id}/secrets/{key}Bearer204, 403, 501Admin, manage grant. Set a sensitive option; write-only.
GET/v1/egress/rulesBearer200, 403Admin. The egress routes.
PUT/v1/egress/rulesBearer200, 403, 409Admin. Replace every route, checked as proxy_route_set.
POST/v1/push/registerBearer201, 400Register an APNs or FCM token; a question the person may answer is relayed to it.
DELETE/v1/push/register/{id}Bearer204, 404Remove a push registration of the caller.

数据模型(schemas.yaml)

以下 Schema 均定义于 api/httpapi/v2/schemas.yaml:

  • ◆Error
  • ◆Failed
  • ◆Id
  • ◆OpenUpload
  • ◆UploadState
  • ◆QuestionView
  • ◆QuestionItem
  • ◆RunView
  • ◆RunDetail
  • ◆ArtifactRef
  • ◆Conversation
  • ◆Message
  • ◆Delivery
  • ◆Record
  • ◆Plugin
  • ◆Catalog
  • ◆Workspace
  • ◆Diff
  • ◆RunActivity
  • ◆Device