TokenLab

Gemini Files & Cache

Upload Gemini file

Uploads bytes or starts a resumable upload.

POSThttps://api.tokenlab.sh/upload/v1beta/files
Uploads bytes or starts a resumable upload. For resumable start, send metadata and read X-Goog-Upload-URL. Continue only at that returned URL.
curl -X POST "https://example.com/upload/v1beta/files" \  -H "Content-Type: application/json" \  -d '{}'
{  "file": {    "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.

X-Goog-Upload-Protocol?string

Upload protocol such as resumable.

X-Goog-Upload-Command?string

Upload command such as start or upload, finalize.

X-Goog-Upload-Header-Content-Length?string

Expected file byte length when starting a resumable upload.

X-Goog-Upload-Header-Content-Type?string

File MIME type when starting a resumable upload.

Request Body

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