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 Key。

位置: 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