I am receiving a lot of gateway timeout messages with gemini-2.5-pro API since Sunday evening (28-Sep) IST. This is for the same set of prompts for which it was working fine previously. It is timing out in exactly 5 minutes from the time API call is being made. I am accessing gemini-2.5-pro through a custom API endpoint in my organization. Are others facing this issue as well?
504 None. {‘fault’: {‘faultstring’: ‘Gateway Timeout’, ‘detail’: {‘errorcode’: ‘messaging.adaptors.http.flow.GatewayTimeout’, ‘reason’: ‘TARGET_READ_TIMEOUT’}}}
Hi @Amit_Goel
Could you please share a sample of the prompt you’re using? In the meantime, please consider increasing the timeout setting in your client request, as this issue may occur when the prompt or context is too large to be processed within the current time limit.
Thank you!
Hi @Shivam_Singh2 , I tried setting 10 mins timeout in my client request but the request is still timing out in 5 mins. I am using latest version of Google GenAI SDK (google-genai-sdk/1.39.1). Is this 5 mins timeout being set somewhere in the SDK?
gemini_pro_client = genai.Client(
api_key=api_key,
http_options=types.HttpOptions(base_url=gemini_pro_api_endpoint, api_version=‘v1’, timeout=600000)
)
Could you please share the full payload details along with the prompt you are using? We would like to reproduce the issue, as everything appears to be working correctly on our end.
I also encountered this issue while using the GenAI SDK. It returns the error “504 Gateway Timeout. {‘message’: ‘stream timeout’, ‘status’: ‘Gateway Timeout’}” when the prompt content is large.
Hi @xiaos_lin
Apologies for the delayed response.
Could you please try once more and let me know if you are still experiencing the same issue?