Failed to create file. Upload URL was not returned in the create file response

I’m using the com.google.genai:google-genai:1.9.0 SDK in a Spring Boot Java project.

I’m trying to upload a file, but I keep encountering the following error:

“Failed to create file. Upload URL was not returned in the create file response.”

After debugging, I realized that this error occurs because the SDK checks for the response header 'X-Goog-Upload-URL', but the actual header returned by the GenAI API is 'x-goog-upload-url' (all lowercase). Since the Java Map is case-sensitive , the check in line#892:

.containsKey("X-Goog-Upload-URL")

fails, and the upload URL is not found, triggering the error on line #894.

4 Likes

2 weeks and library is still broken. It just shows how much google cares about this SDK

Still broken in 1.12.0 version

1 Like

Any plans to fix this? I can’t believe this issue still persists after so many releases

this is great. any ETA on fixing this utterly small but breaking change. This show’s the future of this SDK.