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、配对设备 Tokenorq_dev_…或本机客户端 Tokenorq_loc_…) - ◆实时流:
GET /v1/stream输出text/event-stream,以 Host 事实序号作为id,支持Last-Event-ID断线重放。
核心端点:健康检查、配对、消息、Run、问题与 SSE
| 方法 | 路径 | 认证 | 响应码 | 说明 |
|---|---|---|---|---|
GET | /v1/health | Public | 200 | Handshake; needs no token. |
POST | /v1/auth/pair/start | Bearer | 200, 400 | A single-use pairing code, valid 5 minutes. |
POST | /v1/auth/pair/exchange | Public | 200, 401, 429 | Redeem a code for a device token; needs no token. |
GET | /v1/auth/devices | Bearer | 200 | The caller's devices, or every device for an admin. |
DELETE | /v1/auth/devices/{id} | Bearer | 204, 404 | Revoke a device; its token and open streams end at once. |
GET | /v1/conversations | Bearer | 200, 400 | The person's conversations on every connection, by their newest run. |
POST | /v1/messages | Bearer | 202, 400, 404, 503 | Send a message; idempotent by id. A message to a running conversation steers it (ADR 0006). |
GET | /v1/conversations/{id}/messages | Bearer | 200 | A conversation's messages; after_seq adds the user's own, v1's after lists replies only. |
GET | /v1/events/{id} | Bearer | 200, 202, 404 | The run an event started. |
GET | /v1/runs/{id} | Bearer | 200, 404 | A run of the person. |
POST | /v1/runs/{id}/cancel | Bearer | 200, 202, 404 | Ask a run to stop; idempotent. |
GET | /v1/questions | Bearer | 200 | Open questions of the person's runs and those the person may answer. |
POST | /v1/questions/{id}/answer | Bearer | 200, 400, 403, 409 | Answer with the version read; a lost race is 409 with the current question. |
GET | /v1/stream | Bearer | 200 | Server-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/uploads | Bearer | 200, 201, 400, 409, 413 | Upload 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} | Bearer | 200, 404 | How much of a resumable upload has arrived; another user's is 404. |
PATCH | /v1/uploads/{id} | Bearer | 200, 400, 404, 409, 413 | Send a chunk at Upload-Offset. A chunk within the bytes received changes nothing; one overlapping their end adds its tail. |
POST | /v1/uploads/{id}/complete | Bearer | 200, 404, 409 | Complete a resumable upload that has all its bytes; its upload_id is then attached like a one-shot upload's. |
GET | /v1/artifacts/{id} | Bearer | 200, 206, 304, 404, 416 | An artifact of the person's runs; any other id is 404. |
GET | /v1/catalog | Bearer | 200 | Directives, runtimes and workspaces the person can pick here. |
GET | /v1/workspaces | Bearer | 200 | The named workspaces open to the person. |
GET | /v1/runs/{id}/diff | Bearer | 200, 404 | The changes of the task worktree a run works in. |
GET | /v1/runs/{id}/trace | Bearer | 200, 404 | The 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}/rating | Bearer | 200, 400, 404, 409 | Rate 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}/activity | Bearer | 200, 404 | The 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}/deliveries | Bearer | 200, 404 | Each destination's delivery of a run. |
POST | /v1/deliveries/{id}/retry | Bearer | 202, 404, 409 | Queue one failed delivery again; the runtime does not run again. |
管理端点:记忆、技能草稿、插件、出口代理与推送
| 方法 | 路径 | 认证 | 响应码 | 说明 |
|---|---|---|---|---|
GET | /v1/memory | Bearer | 200, 501 | The memories the person's own context may read. |
PATCH | /v1/memory/{id} | Bearer | 200, 400, 403, 404 | Write the next version of a memory; shared ones need an admin. |
DELETE | /v1/memory/{id} | Bearer | 204, 404 | Forget a memory and its earlier versions. |
GET | /v1/skills/drafts | Bearer | 200 | The person's skill drafts, or every draft for an admin. |
POST | /v1/skills/drafts/{id}/publish | Bearer | 200, 403, 404, 409, 501 | Admin. Publish a draft with the digest read from the list. |
POST | /v1/skills/drafts/{id}/discard | Bearer | 200, 403, 404 | Admin. Reject a draft. |
GET | /v1/plugins | Bearer | 200 | The configured instances, without options or secrets. |
PATCH | /v1/plugins/{id} | Bearer | 200, 400, 403, 501 | Admin, manage grant. Turn an instance on or off. |
PUT | /v1/plugins/{id}/secrets/{key} | Bearer | 204, 403, 501 | Admin, manage grant. Set a sensitive option; write-only. |
GET | /v1/egress/rules | Bearer | 200, 403 | Admin. The egress routes. |
PUT | /v1/egress/rules | Bearer | 200, 403, 409 | Admin. Replace every route, checked as proxy_route_set. |
POST | /v1/push/register | Bearer | 201, 400 | Register an APNs or FCM token; a question the person may answer is relayed to it. |
DELETE | /v1/push/register/{id} | Bearer | 204, 404 | Remove 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