# 檔案與憑證端點

檔案、已存金鑰與即時語音的端點。

| Method | 路徑 | 說明 |
|---|---|---|
| `GET` `PUT` | `/v1/file` | **local** — 讀 / 寫檔案 |
| `GET` | `/v1/file/open` | **local** — 以作業系統預設程式開啟檔案或 URL |
| `GET` | `/v1/file/locate` | **local** — 依裸檔名尋找候選路徑（`name`，另可加 `dir=1`、`child`、`size`、`mtime` 過濾） |
| `GET` | `/v1/workdir` | **local** — 解析並驗證工作目錄（`?path=`），回傳絕對路徑 |
| `DELETE` | `/v1/key` | **local** — 刪除 keychain 中的單一憑證。回傳已存值的 `GET` 已於 v1.0.23 移除 |
| `GET` `POST` | `/v1/keys` | **local** — 列出 / 設定憑證 |
| `GET` | `/v1/voice/live` | **local** — v1.1.1 新增。WebSocket upgrade，以 keychain 中的 `GEMINI_API_KEY` 將儀表板的語音模式中繼到 Gemini Live（`gemini-3.8-live`）。setup 由 daemon 自行送出 —— 依設定回覆語言產生的語音 system prompt、`send_to_chat` / `read_history` / `read_task` 三個 function declaration、輸入與輸出逐字稿 —— 之後雙向轉送 frame。缺少 key 時以 close code `4401` 關閉，上游連線或 setup 失敗時以 `1011` 關閉 |
