File API Unexpected 400 error in response stream

I am trying to upload a jsonl file for batch processing in the File API. Unfortunately, the file is never returned in the API response. Instead I get the following response:
{‘headers’: {‘content-type’: ‘application/json; charset=UTF-8’, ‘x-guploader-uploadid’: ‘XXX’, ‘x-goog-upload-status’: ‘final’, ‘vary’: ‘Origin, X-Origin, Referer’, ‘content-length’: ‘118’, ‘date’: ‘Sun, 09 Nov 2025 11:30:44 GMT’, ‘server’: ‘UploadServer’, ‘alt-svc’: ‘h3=“:443”; ma=2592000,h3-29=“:443”; ma=2592000’}, ‘status_code’: 200, ‘response_stream’: [‘{\n “error”: {\n “code”: 400,\n “message”: “Unsupported MIME type: jsonl”,\n “status”: “INVALID_ARGUMENT”\n }\n}\n’], ‘byte_stream’: None}

I couldn’t find any invalid arguments in my jsonl and uploading it as json gave the same error. I also tried the example code from the documentation which also didn’t work. Is this an issue on Google’s part?

Hi @Michiel_Pronk
Welcome to Google AI Forum!!

Thank you for bringing this to our attention. Could you please share the full payload details along with a sample of the code that you are using? We would like to reproduce the issue.

Was there a solution to this??

I’m having the same issue.

index):123 Uncaught TypeError: Cannot read properties of undefined (reading ‘register’)
at (index):123:28
generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent:1 Failed to load resource: the server responded with a status of 400 ()
geminiService.ts:147 Valuation Assessment Error: ApiError: {“error”:{“code”:400,“message”:“API key not valid. Please pass a valid API key.”,“status”:“INVALID_ARGUMENT”,“details”:[{“@type”:“type.googleapis.com/google.rpc.ErrorInfo",“reason”:“API_KEY_INVALID”,“domain”:“googleapis.com”,“metadata”:{“service”:“generativelanguage.googleapis.com”}},{“@type”:“type.googleapis.com/google.rpc.LocalizedMessage”,“locale”:“en-US”,“message”:"API key not valid. Please pass a valid API key.”}]}}
at throwErrorIfNotOK (_api_client.ts:860:24)
at async _api_client.ts:493:9
at async Models.generateContent (models.ts:69:14)
at async geminiService.ts:96:28
at async geminiService.ts:21:36
at async SearchQueue.process (geminiService.ts:49:17)
(anonymous) @ geminiService.ts:147
(index):47 [SearchQueue]

The API key works just fine as long as I am within the Google AI Studio environment. As soon as I exit that environment, I get 400 and 409 errors.