全部產品
Search
文件中心

Qoder CN 系列:歸檔 Dream

更新時間:Jul 15, 2026

歸檔一個已完成的 Dream。

POST /api/v1/cloud/dreams/{id}/archive

歸檔指定的 Dream。只有終態(completedfailedcanceled)的 Dream 可以歸檔。已歸檔的 Dream 再次調用此介面是等冪的。返回更新後的 Dream 對象

歸檔後的 Dream 預設不出現在列表介面中,除非傳入 include_archived=true

要求標頭

頭部

必選

說明

Authorization

Bearer <PAT>

路徑參數

參數

類型

說明

id

string

Dream ID(drm_ 首碼)。

樣本請求

curl -s -X POST 'https://api.qoder.com.cn/api/v1/cloud/dreams/drm_019e86b4a8f070a3b6c5d4e3f2a1b0c9/archive' \
  -H "Authorization: Bearer $QODER_PAT"

樣本響應

HTTP 200 OK

{
  "id": "drm_019e86b4a8f070a3b6c5d4e3f2a1b0c9",
  "type": "dream",
  "status": "completed",
  "inputs": [{ "type": "memory_store", "memory_store_id": "memstore_019e5cdb9c3f71c3b6505eba937a40b4" }],
  "outputs": [{ "type": "memory_store", "memory_store_id": "memstore_019e86b4b10578059435632bb357c5ed", "files_touched": ["preferences.md"] }],
  "model": { "id": "auto" },
  "instructions": "",
  "session_id": "sess_019e86b4b10578059435632bb357c5ed",
  "usage": { "input_tokens": 12500, "output_tokens": 3200, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 8000 },
  "error": null,
  "created_at": "2026-06-15T10:00:00Z",
  "ended_at": "2026-06-15T10:03:42Z",
  "archived_at": "2026-06-15T12:00:00Z"
}

錯誤碼

HTTP

Type

觸發條件

400

invalid_request_error

Dream 處於 pendingrunning 狀態(需先取消)。

401

authentication_error

缺少或無效的認證令牌。

404

not_found_error

Dream 不存在。

完整錯誤信封說明詳見錯誤參考