TokenLab

Gemini Files 與快取

註冊 Gemini 檔案

使用 Gemini JSON 從支援的來源註冊檔案。

POST
/v1beta/files:register
使用 Gemini JSON 從支援的來源註冊檔案。服務會驗證來源與請求欄位。資源僅能在其所屬的工作區中進行讀取、參照、變更或刪除。
curl -X POST "https://example.com/v1beta/files:register" \  -H "Content-Type: application/json" \  -d '{}'
{  "name": "string",  "displayName": "string",  "mimeType": "string",  "sizeBytes": "string",  "uri": "string",  "state": "string",  "createTime": "2019-08-24T14:15:22Z",  "updateTime": "2019-08-24T14:15:22Z",  "expirationTime": "2019-08-24T14:15:22Z",  "error": {}}

授權

AuthorizationBearer <token>

API Key 驗證。請在 Dashboard > API > API Keys 建立或管理 API 金鑰。

位置: header

查詢參數

key?string

作為 Bearer 或 x-goog-api-key 的 API key 替代方案。

請求標頭

Idempotency-Key?string

在復原建立回應時重複使用相同的 key 與請求主體。若使用不同的主體但相同的 key,將會回傳衝突。

請求主體

application/json

Gemini 檔案註冊請求。僅使用服務接受的來源與欄位;註冊不會上傳本機位元組。

回應

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json