# Are failed or pending requests using OpenAI-compatible Gemini API endpoints billed?

**URL:** <https://discuss.ai.google.dev/t/are-failed-or-pending-requests-using-openai-compatible-gemini-api-endpoints-billed/85472>\
**Category:** Gemini API\
**Tags:** openai\_compatibility, api, billing\
**Created:** [May 27, 2025, 3:36am UTC](https://discuss.ai.google.dev/t/are-failed-or-pending-requests-using-openai-compatible-gemini-api-endpoints-billed/85472 "2025-05-27T03:36:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ngyn\_An](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/ngyn_an/32/33380_2.png) [@Ngyn\_An](https://discuss.ai.google.dev/u/Ngyn_An)\
**Post date:** [May 27, 2025, 3:36am UTC](https://discuss.ai.google.dev/t/are-failed-or-pending-requests-using-openai-compatible-gemini-api-endpoints-billed/85472/1 "2025-05-27T03:36:29Z")

</div>

Hi there,

I’m using Gemini via the OpenAI-compatible API endpoint:  
`https://generativelanguage.googleapis.com/v1beta/openai/...`  
with the `openai` Python client library.

I’d like to better understand the billing and failure behavior in this context:

1. If a request fails (e.g., invalid prompt, rate limit, quota error), does it still incur **cost** or **token usage**?
2. Are requests that hang or time out (i.e., pending) also billed?
3. What are the typical **failure cases** I should account for (timeouts, 429s, malformed inputs)?
4. Does Google provide billing visibility for these failed/pending calls when using the OpenAI-compatible endpoint?

I’m trying to prevent unnecessary charges and improve my retry/error-handling logic. If anyone has experience using Gemini this way (via `openai` library), your insights would be super helpful!

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![krish\_cloudarchitect](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/krish_cloudarchitect/32/39181_2.png) [@krish\_cloudarchitect](https://discuss.ai.google.dev/u/krish_cloudarchitect)\
**Post date:** [May 27, 2025, 8:37pm UTC](https://discuss.ai.google.dev/t/are-failed-or-pending-requests-using-openai-compatible-gemini-api-endpoints-billed/85472/3 "2025-05-27T20:37:51Z")

</div>

Hi Ngyn\_An,

Here’s what I know:

1. **Failed Requests** : If a request fails due to an invalid prompt, rate limit, or quota error, it typically does **not** incur charges. However, if the request is successfully received and processed by the server (even if it fails during execution), it may still count towards your usage.

2. **Pending Requests** : Requests that hang or time out due to network issues or server delays generally **do not** incur charges.

3. **Typical Failure Cases** : Common failure scenarios include:

- Invalid or malformed inputs
- Rate limiting (HTTP 429)
- Quota errors
- Timeouts
- Server errors (HTTP 500 series)

1. **Billing Visibility** : Google provides billing visibility through the Google Cloud Console ([https://console.cloud.google.com/](https://console.cloud.google.com/)), where you can monitor your usage and costs. However, detailed logs of failed or pending requests may not be explicitly listed.

Pro Tips:  
To prevent unnecessary charges, consider implementing retry logic with exponential backoff and validating inputs before sending requests. Also, keep an eye on your usage in the Cloud Console to ensure you’re within your budget.

---

<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:22pm UTC](https://discuss.ai.google.dev/t/are-failed-or-pending-requests-using-openai-compatible-gemini-api-endpoints-billed/85472/5 "2026-11-05T18:22:28Z")

</div>

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

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