Environment:
-
Model:
all supported model that can use flex/priority/standard -
Endpoint: REST (
generateContent) and Streaming (streamGenerateContent) -
Context: Calling the Gemini API directly from a Client-Side React Application.
Issue 1: Missing from CORS (access-control-expose-headers) When calling the standard generateContent REST endpoint from a browser, the network tab shows that the x-gemini-service-tier header is successfully returned by Google’s server. However, the access-control-expose-headers list does not include x-gemini-service-tier. Because it is not whitelisted, browsers strip the header out, making it impossible to read response.headers.get("x-gemini-service-tier") via client-side JavaScript fetch.
Issue 2: Missing from Streaming (streamGenerateContent) When calling the streamGenerateContent endpoint, the x-gemini-service-tier header is completely missing from the initial HTTP response headers, even in raw curl tests.
Expected Behavior:
-
x-gemini-service-tiershould be added to theaccess-control-expose-headersCORS whitelist so frontend applications can read their fulfilled billing tier. -
The routing tier header should be attached to the initial response headers when establishing an SSE connection via
streamGenerateContent.