TokenLab

Gemini Files & Cache

Create Gemini file metadata

Creates a Gemini file resource from JSON metadata.

POST
/v1beta/files
Creates a Gemini file resource from JSON metadata. Upload file bytes through /upload/v1beta/files. Resources can only be read, referenced, changed, or deleted in their owning Workspace.
curl -X POST "https://example.com/v1beta/files" \  -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": {}}

Authorization

AuthorizationBearer <token>

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

In: header

Query Parameters

key?string

API key alternative to Bearer or x-goog-api-key.

Headers

Idempotency-Key?string

Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict.

Request Body

application/json

Gemini file metadata request. Supported fields and values are validated by the service. File bytes are uploaded through /upload/v1beta/files.

Response

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json