# Use authentication in huggingface Gradio API!(hosting on ZeroGPU)

**URL:** <https://discuss.huggingface.co/t/use-authentication-in-huggingface-gradio-api-hosting-on-zerogpu/115565>\
**Category:** Spaces\
**Created:** [November 4, 2024, 7:01am UTC](https://discuss.huggingface.co/t/use-authentication-in-huggingface-gradio-api-hosting-on-zerogpu/115565 "2024-11-04T07:01:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nerva1228](https://avatars.discourse-cdn.com/v4/letter/n/8c91f0/32.png) [@Nerva1228](https://discuss.huggingface.co/u/Nerva1228)\
**Post date:** [November 4, 2024, 7:01am UTC](https://discuss.huggingface.co/t/use-authentication-in-huggingface-gradio-api-hosting-on-zerogpu/115565/1 "2024-11-04T07:01:03Z")

</div>

Guys.

**I have already hosted my code on ZeroGPU(for that i subscribe the PRO)**

When I visited him on the webpage (logged in as my PRO user), I did receive 5x usage quota compared to free users.

But when I use it in Python code, I use the `gradio_client`, and I can indeed post requests to the Gradio API that I host on HF Space using ZeroGPU.I found that my quota is when I am not logged in.

By the way, why i know the quota is when i am not logged in?

I do some test, finally i get some information:

**NOT LOGIN: the quota is about 180s**  
**LOGIN: the quota is 300s**  
**PRO USER: the quota is 1500s…**

So i just want find some way to solve this problem, i want use my PRO user in my code!!!

I have tried carrying HF tokens or headers (including cookies), but they have not worked and I am still logged in.

**The error just like:**  
`gradio_client.exceptions.AppError: The upstream Gradio app has raised an exception: You have exceeded your GPU quota (150s requested vs. 149s left). <a style="white-space: nowrap;text-underline-offset: 2px;color: var(--body-text-color)" href="https://huggingface.co/join">Create a free account</a> to get more usage quota.`

---

<div class="post-metadata">

**Author:** ![vagodin](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/vagodin/32/37374_2.png) [@vagodin](https://discuss.huggingface.co/u/vagodin)\
**Post date:** [December 11, 2024, 8:37pm UTC](https://discuss.huggingface.co/t/use-authentication-in-huggingface-gradio-api-hosting-on-zerogpu/115565/2 "2024-12-11T20:37:21Z")

</div>

Did you ever resolve this? I am also using a ZeroGPU space via API and would like my Pro quota to be applied. I occasionally get an error prompting me to create a free account – so evidently even though I’m supplying my hf\_token to the gradio client, it is not recognising me as logged in.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [December 12, 2024, 1:10am UTC](https://discuss.huggingface.co/t/use-authentication-in-huggingface-gradio-api-hosting-on-zerogpu/115565/3 "2024-12-12T01:10:50Z")

</div>

If you have any bugs or suggestions regarding Zero GPU space, you can send them to the author using the following.

> **[zero-gpu-explorers/README · Discussions](https://huggingface.co/spaces/zero-gpu-explorers/README/discussions)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

Edit:  
Perhaps related?

> **[BestWishYsh/ConsisID-preview-Space · Apply for community grant: Personal...](https://huggingface.co/spaces/BestWishYsh/ConsisID-preview-Space/discussions/1#674969a022b99c122af5d407)**
>
> Apply for community grant: Academic project (gpu). We develop an identity-preserving text-to-video generation model, ConsisID, which can keep human-identity consistent in the generated video.

---

<div class="post-metadata">

**Author:** ![scott12355](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/scott12355/32/43743_2.png) [@scott12355](https://discuss.huggingface.co/u/scott12355)\
**Post date:** [March 20, 2025, 10:31pm UTC](https://discuss.huggingface.co/t/use-authentication-in-huggingface-gradio-api-hosting-on-zerogpu/115565/4 "2025-03-20T22:31:04Z")

</div>

Hey, did you ever find a solution for this?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [March 21, 2025, 4:29am UTC](https://discuss.huggingface.co/t/use-authentication-in-huggingface-gradio-api-hosting-on-zerogpu/115565/5 "2025-03-21T04:29:03Z")

</div>

Maybe this? Gradio 5.12.0 or later.

> **[@RudeBoi on Hugging Face: "Can someone please explain to me why I am getting...](https://huggingface.co/posts/RudeBoi/909027081025413)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.
