Gemini Resources

Upload Gemini file

Uploads bytes or starts a resumable upload. For resumable start, send metadata and read X-Goog-Upload-URL. Continue only at that returned URL. The upload URL grants access to that upload, expires after one hour, and must be kept private. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.

post/upload/v1beta/files

Request

  • Base URL: https://api.tokenlab.sh
  • URL: https://api.tokenlab.sh/upload/v1beta/files
  • Auth: one of:
    • HTTP bearer
    • API key in header x-goog-api-key

Query parameters

keystring

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

Headers

Idempotency-Keystring

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-Protocolstring

Upload protocol such as resumable.

X-Goog-Upload-Commandstring

Upload command such as start or upload, finalize.

X-Goog-Upload-Header-Content-Lengthstring

Expected file byte length when starting a resumable upload.

X-Goog-Upload-Header-Content-Typestring

File MIME type when starting a resumable upload.

Request body

Response

Success

Changes

No recorded changes to this operation across all 1 revision of this API.