## The problem
Issue googleapis/python-genai#1590 (closed, 28 comments): Hi team, thank you for the great Gemini SDK! I just wanted to report that the JSONL upload example from the official Batch API docs currently fails with a `KeyError: 'file'` when using `client.files.upload()`. When following the official Gemini Batch API documentation, uploading a `.jsonl` file via `client.files.upload()` fails with `KeyError: 'file'`. This happens when using the example code from the docs verbatim. The API call succeeds (HTTP 200), but the SDK throws a `KeyError` because the JSON response

## What fixed it
[dget, orhansonmeztr, alexerhardt, prathapbelli (reporters)]: The docs example passed mime_type='jsonl', which the backend rejects with 'Unsupported MIME type: application/jsonl'. The SDK does not check the upload response for errors, so that backend 400 surfaces as a confusing KeyError: 'file' instead of the real error. Workaround confirmed by several reporters on the thread: upload the .jsonl file with mime_type='application/json'. If you hit a bare KeyError after files.upload, print the raw response first, the real API error is hiding behind it.