# Error Error: No API found

**URL:** <https://discuss.huggingface.co/t/error-error-no-api-found/151638>\
**Category:** Beginners\
**Created:** [April 21, 2025, 2:03pm UTC](https://discuss.huggingface.co/t/error-error-no-api-found/151638 "2025-04-21T14:03:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [April 22, 2025, 2:07am UTC](https://discuss.huggingface.co/t/error-error-no-api-found/151638/2 "2025-04-22T02:07:15Z")

</div>

In Zero GPU space, the space will not function without these descriptions.

```py
import spaces # <= this!
from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(...)
pipe.to('cuda')

@spaces.GPU # <= this!
def generate(prompt):
    return pipe(prompt).images

gr.Interface(
    fn=generate,
    inputs=gr.Text(),
    outputs=gr.Gallery(),
).launch()

```

> **[Spaces ZeroGPU: Dynamic GPU Allocation for Spaces](https://huggingface.co/docs/hub/main/spaces-zerogpu)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

Also, this is not limited to Zero GPU space, but the following error may still be unresolved.

> [@Error : No API Found](https://discuss.huggingface.co/t/error-no-api-found/146226):
>
> Hi, I have built a Gemini 2.0 flash based photo editing app with gradio ui. This app is running perfectly fine on my local system, but when I am trying to run it on spaces it is giving me Error : No API Found. I have used gemini api keys in secrects Code : [https://huggingface.co/spaces/Saurabh502/Gemini-photo/resolve/main/app.py](https://huggingface.co/spaces/Saurabh502/Gemini-photo/resolve/main/app.py) Please let me know your thoughts, on how to resolve this. Thanks

---

_[View the full topic](https://discuss.huggingface.co/t/error-error-no-api-found/151638)._
