# How to call Space via API

**URL:** <https://discuss.huggingface.co/t/how-to-call-space-via-api/143810>\
**Category:** Beginners\
**Created:** [March 3, 2025, 11:03am UTC](https://discuss.huggingface.co/t/how-to-call-space-via-api/143810 "2025-03-03T11:03:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mypiper](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mypiper/32/42393_2.png) [@mypiper](https://discuss.huggingface.co/u/mypiper)\
**Post date:** [March 3, 2025, 11:03am UTC](https://discuss.huggingface.co/t/how-to-call-space-via-api/143810/1 "2025-03-03T11:03:53Z")

</div>

Dear community, please, help with using Spaces vi API.

1. I paid PRO subscription.
2. I generated API token: xyzXYZ
3. I want to use space `/spaces/yanze/PuLID-FLUX`

I see 401 when call:

```auto
curl --location 'https://huggingface.co/spaces/yanze/PuLID-FLUX' \
--header 'Authorization: Bearer xyzXYZ'

```

How to solve it and be sure what I call Space with my subscription and limits.

Thanks a lot!

---

<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 3, 2025, 1:17pm UTC](https://discuss.huggingface.co/t/how-to-call-space-via-api/143810/2 "2025-03-03T13:17:15Z")

</div>

This is basically OK.

> **[Querying Gradio Apps With Curl](https://www.gradio.app/main/guides/querying-gradio-apps-with-curl)**
>
> A Step-by-Step Gradio Tutorial

> How to solve it and be sure what I call Space with my subscription and limits.

I think it’s more reliable to use a newer version of Gradio 5, as there are bugs.

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