# Gemini types.HttpRetryOptions error

**URL:** <https://discuss.ai.google.dev/t/gemini-types-httpretryoptions-error/107128>\
**Category:** Gemini API\
**Tags:** api, genai\
**Created:** [October 7, 2025, 11:19pm UTC](https://discuss.ai.google.dev/t/gemini-types-httpretryoptions-error/107128 "2025-10-07T23:19:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![swamooo](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/swamooo/32/32327_2.png) [@swamooo](https://discuss.ai.google.dev/u/swamooo)\
**Post date:** [October 7, 2025, 11:19pm UTC](https://discuss.ai.google.dev/t/gemini-types-httpretryoptions-error/107128/1 "2025-10-07T23:19:55Z")

</div>

```python
Hi, I wanted retries to happen if my call to the Gemini API failed and so I added HttpRetryOptions as below:

_gemini_client = genai.Client(
            api_key=os.getenv("GEMINI_API_KEY"),
            http_options=types.HttpOptions(
                timeout=int(GEMINI_VERIFICATION_TIMEOUT_SECONDS * 1000),
                retry_options=types.HttpRetryOptions(
                    attempts=3, 
                    initial_delay=1.0, 
                    max_delay=5.0,  
                    exp_base=2.0,  
                    jitter=0.3,  
                    http_status_codes=[408, 429, 500, 502, 503, 504]
                )
            )
        )

```

But I keep getting an error like:

```auto
Error: module 'google.genai.types' has no attribute 'HttpRetryOptions'

```

I check the Gemini python SDK and it says it has these retry options so not sure why I get this error. I looked at the docs:

> **[Submodules - Google Gen AI SDK documentation](https://googleapis.github.io/python-genai/genai.html#genai.types.HttpOptions)**

 ![image](https://d3qe71uytubmmx.cloudfront.net/original/3X/4/d/4d93bfae1d7be70a3abff0c5a08d6c2279137302.png)

---

<div class="post-metadata">

**Author:** ![Lalit\_Kumar](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/lalit_kumar/32/37058_2.png) [@Lalit\_Kumar](https://discuss.ai.google.dev/u/Lalit_Kumar)\
**Post date:** [October 8, 2025, 5:25am UTC](https://discuss.ai.google.dev/t/gemini-types-httpretryoptions-error/107128/3 "2025-10-08T05:25:55Z")

</div>

Hello,

Welcome to the Forum!

Could you please try running your code again and check if it works now? I ran the same code in Colab and did not encounter any errors. You might also want to try running it in Colab yourself to see if the issue persists. Additionally, please ensure that you are using the latest version of the genai library.

---

<div class="post-metadata">

**Author:** ![system](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/system/32/1_2.png) [@system](https://discuss.ai.google.dev/u/system)\
**Post date:** [November 5, 2026, 6:27pm UTC](https://discuss.ai.google.dev/t/gemini-types-httpretryoptions-error/107128/5 "2026-11-05T18:27:53Z")

</div>

Closed on November 5, 2026, 6:27pm UTC

This thread was automatically closed 60 days after the last reply. If you are running into an issue, please create a new post.
