# How to use gradio client library in next.js to call API built using gradio space and the space is private?

**URL:** <https://discuss.huggingface.co/t/how-to-use-gradio-client-library-in-next-js-to-call-api-built-using-gradio-space-and-the-space-is-private/57564>\
**Category:** 🔒 Gradio\
**Created:** [October 6, 2023, 5:37am UTC](https://discuss.huggingface.co/t/how-to-use-gradio-client-library-in-next-js-to-call-api-built-using-gradio-space-and-the-space-is-private/57564 "2023-10-06T05:37:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjitaa](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@sanjitaa](https://discuss.huggingface.co/u/sanjitaa)\
**Post date:** [October 6, 2023, 5:37am UTC](https://discuss.huggingface.co/t/how-to-use-gradio-client-library-in-next-js-to-call-api-built-using-gradio-space-and-the-space-is-private/57564/1 "2023-10-06T05:37:03Z")

</div>

I am trying to use the API provided after I built space in hugging face using gradio in next.js. But the problem is that the space is a private space. I am providing the token as follows but the issue arises as it calls as space-url/jwt as header and 404 error not found arises. How to solve this issue?

 ![Screenshot 2023-10-06 at 11.21.34](https://us1.discourse-cdn.com/hellohellohello/original/3X/d/c/dcf6da3a184e64c3ef2cedabe0967a8ed36ca5d2.png)
