# API Gradio Spaces error API request failed: 404 {"detail":"Not Found"}

**URL:** <https://discuss.huggingface.co/t/api-gradio-spaces-error-api-request-failed-404-detail-not-found/147053>\
**Category:** Beginners\
**Created:** [March 23, 2025, 2:41pm UTC](https://discuss.huggingface.co/t/api-gradio-spaces-error-api-request-failed-404-detail-not-found/147053 "2025-03-23T14:41:07Z")\
**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:** [March 23, 2025, 3:33pm UTC](https://discuss.huggingface.co/t/api-gradio-spaces-error-api-request-failed-404-detail-not-found/147053/2 "2025-03-23T15:33:07Z")

</div>

> status: 405,  
> text: ‘Method Not Allowed’

405 errors are very rare. 404 errors are common, though…

> <https://github.com/gradio-app/gradio/issues/4884>
>
> \### Describe the bug
> 
> Originally reported \[here\](https://huggingface.co/spaces/h…ysts/Shap-E/discussions/18).
> 
> If a Space had a method with \`api\_name=False\`, the following error occurs when calling it with \`Client\`:
> \`\`\`
> TypeError: can only concatenate str (not "bool") to str
> \`\`\`
> 
> I think this error occurs when calling a Space with \`gr.Examples\`.
> 
> \### Have you searched existing issues? 🔎
> 
> \- \[X\] I have searched and found no existing issues
> 
> \### Reproduction
> 
> When I use \`Client\` to call \[this Space\](https://huggingface.co/spaces/hysts-debug/client-bool-api-name-error)
> \`\`\`python
> import gradio as gr
> 
> with gr.Blocks() as demo:
> text = gr.Text()
> out = gr.Text()
> btn = gr.Button()
> text.submit(fn=lambda x: x, inputs=text, outputs=out, api\_name=False)
> btn.click(fn=lambda x: x, inputs=text, outputs=out, api\_name='run')
> demo.queue().launch()
> \`\`\`
> with the following code
> \`\`\`python
> from gradio\_client import Client
> 
> client = Client('hysts-debug/client-bool-api-name-error')
> out = client.predict('aaa', api\_name='/run')
> \`\`\`
> I get the following error.
> \`\`\`
> Traceback (most recent call last):
> File "/tmp/temp/run.py", line 4, in \<module\>
> out = client.predict('aaa', api\_name='/run')
> File "/home/ubuntu/.virtualenvs/py31011/lib/python3.10/site-packages/gradio\_client/client.py", line 285, in predict
> return self.submit(\*args, api\_name=api\_name, fn\_index=fn\_index).result()
> File "/home/ubuntu/.virtualenvs/py31011/lib/python3.10/site-packages/gradio\_client/client.py", line 313, in submit
> inferred\_fn\_index = self.\_infer\_fn\_index(api\_name, fn\_index)
> File "/home/ubuntu/.virtualenvs/py31011/lib/python3.10/site-packages/gradio\_client/client.py", line 555, in \_infer\_fn\_index
> if "/" + config\_api\_name == api\_name:
> TypeError: can only concatenate str (not "bool") to str
> \`\`\`
> 
> If I remove the method with \`api\_name=False\`, the error doesn't occur.
> 
> In the case of the \[Shap-E Space\](https://huggingface.co/spaces/hysts/Shap-E), it doesn't have methods with \`api\_name=False\` explicitly, but as it has \`gr.Examples\`, I guess its method has \`api\_name=False\` implicitly and causing this error.
> 
> If I change the code of the Space to the following, the same error occurs.
> \`\`\`python
> import gradio as gr
> 
> with gr.Blocks() as demo:
> text = gr.Text()
> out = gr.Text()
> btn = gr.Button()
> gr.Examples(examples=\['aaa', 'bbb'\], inputs=text)
> btn.click(fn=lambda x: x, inputs=text, outputs=out, api\_name='run')
> demo.queue().launch()
> \`\`\`
> 
> \### Screenshot
> 
> \_No response\_
> 
> \### Logs
> 
> \_No response\_
> 
> \### System Info
> 
> \`\`\`shell
> gradio==3.36.1
> gradio\_client==0.2.8
> \`\`\`
> 
> 
> \### Severity
> 
> Blocking usage of gradio

> <https://github.com/gradio-app/gradio/issues/4591>
>
> \### Describe the bug
> 
> gr.Interface(fn=generate\_answer, inputs=inputs, outputs=ou…tputs, title=title, description=description, examples=examples).launch(share=True,server\_name="172.16.1.88",server\_port=7877,)
> 
> 
> \### Have you searched existing issues? 🔎
> 
> \- \[X\] I have searched and found no existing issues
> 
> \### Reproduction
> 
> I wanted to request the URL using the API, but it failed
> 
> \### Screenshot
> 
> \_No response\_
> 
> \### Logs
> 
> \_No response\_
> 
> \### System Info
> 
> \`\`\`shell
> Name: gradio
> Version: 3.28.3
> Summary: Python library for easily interacting with trained machine learning models
> Home-page: 
> Author: 
> Author-email: Abubakar Abid \<team@gradio.app\>, Ali Abid \<team@gradio.app\>, Ali Abdalla \<team@gradio.app\>, Dawood Khan \<team@gradio.app\>, Ahsen Khaliq \<team@gradio.app\>, Pete Allen \<team@gradio.app\>, Ömer Faruk Özdemir \<team@gradio.app\>
> License: 
> Location: /home/wangchenpeng/miniconda3/envs/glm/lib/python3.9/site-packages
> Requires: aiofiles, aiohttp, altair, fastapi, ffmpy, gradio-client, httpx, huggingface-hub, jinja2, markdown-it-py, markupsafe, matplotlib, mdit-py-plugins, numpy, orjson, pandas, pillow, pydantic, pydub, pygments, python-multipart, pyyaml, requests, semantic-version, typing-extensions, uvicorn, websockets
> Required-by:
> \`\`\`
> 
> 
> \### Severity
> 
> I can work around it

> [@Gradio JS Client Predict Error on Private Space](https://discuss.huggingface.co/t/gradio-js-client-predict-error-on-private-space/114456):
>
> Gradio JS Client raises error when use Private Space. (Python Client works.) connect and view\_api APIs work without any issue. When call predict API, following error happens. (If make space public, no error.) Any help would be appreciated. Response { status: 404, statusText: 'Not Found', headers: Headers { date: 'Tue, 29 Oct 2024 01:06:13 GMT', 'content-type': 'text/html; charset=utf-8', 'content-length': '3020', connection: 'keep-alive', 'x-request-id': 'Sb9C2M', …

---

_[View the full topic](https://discuss.huggingface.co/t/api-gradio-spaces-error-api-request-failed-404-detail-not-found/147053)._
