# Gradio ChatInterface REST API

**URL:** <https://discuss.huggingface.co/t/gradio-chatinterface-rest-api/78035>\
**Category:** Spaces\
**Created:** [March 19, 2024, 6:09am UTC](https://discuss.huggingface.co/t/gradio-chatinterface-rest-api/78035 "2024-03-19T06:09:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikhilkomakula](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nikhilkomakula/32/24995_2.png) [@nikhilkomakula](https://discuss.huggingface.co/u/nikhilkomakula)\
**Post date:** [March 19, 2024, 6:09am UTC](https://discuss.huggingface.co/t/gradio-chatinterface-rest-api/78035/1 "2024-03-19T06:09:00Z")

</div>

Hello,

I have deployed a RAG Chatbot using Gradio ChatInterface. The Gradio API documentation suggests to use the Gradio Client to run the below:

```auto
from gradio_client import Client

client = Client("https://username-spacename.hf.space/")
result = client.predict(
		"Hello!!",	# str in 'parameter_0' Textbox component
		api_name="/chat"
)
print(result)

```

Instead I am trying to invoke it using REST API (below) but it fails. Any suggestions please?

URL: [https://username-spacename.hf.space/run/predict](https://username-spacename.hf.space/run/predict)  
METHOD: POST  
PAYLOAD: `{ "detail": ["What is a Trigger?"] }`

Thanks.
