Skip to main content
POST
Create Gemini upload session

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
filename
string
required

Use a portable ASCII basename containing letters, numbers, dots, hyphens, or underscores. Avoid spaces and non-ASCII punctuation because the filename becomes part of the Gemini file URI.

Example:

"sample.mp4"

mime_type
string
required
Example:

"video/mp4"

size_bytes
integer<int64>
required

Exact file size in bytes.

Required range: x >= 1
Example:

35077

md5sum
string
required

Lowercase hexadecimal MD5 checksum of the complete file.

Example:

"4c7576b35abc9bde1a09a6a257937eb3"

purpose
enum<string>
required
Available options:
vision
Example:

"vision"

Response

Upload session and pre-signed object-storage instruction.

code
enum<integer>
required
Available options:
0
Example:

0

data
object
required