curl --request POST \
--url https://app.thinnest.ai/api/v1/agents/{id}/test-chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Is a 2 BHK at Sky Towers under 90 lakh?",
"session": "vr_4f1c09e2b7a84d55a1e0c3b2d9f86a71"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: 'Is a 2 BHK at Sky Towers under 90 lakh?',
session: 'vr_4f1c09e2b7a84d55a1e0c3b2d9f86a71'
})
};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/test-chat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/agents/{id}/test-chat"
payload = {
"message": "Is a 2 BHK at Sky Towers under 90 lakh?",
"session": "vr_4f1c09e2b7a84d55a1e0c3b2d9f86a71"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"session": "vr_4f1c09e2b7a84d55a1e0c3b2d9f86a71",
"mode": "chat",
"reply": "Yes — a 2 BHK at Sky Towers starts at 82 lakh. Would you like to visit the site this weekend?",
"tools": [
{
"name": "search_knowledge",
"input": {
"query": "2 BHK price Sky Towers"
},
"output": "A 2BHK starts at 82 lakh. A 3BHK starts at 1.1 crore."
}
]
}Test Chat
Talks to your real agent through its website chat — the same prompt, model, knowledge, actions, limits and billing as the console’s Playground — and answers with its reply and every tool it used. It runs as a sandbox: anything that would phone, message, email or send a code to a person, or change a calendar booking, is switched off and the agent says what it would have done instead; your own actions still run for real, and every request they make carries an X-Test-Chat: true header (and {{test.chat}} fills as true) so your endpoint can answer without writing anything. The conversation appears in your inbox; send session back to continue it. It always runs the agent as saved: there is no separate draft, so a change you save is live at once. To try a change first, create a second agent with it (Create Agent) and test that one. A reply costs what a chat reply costs: on an agent using its own language-model key, the flat ₹0.02 own-key reply price. A build key may do this.
curl --request POST \
--url https://app.thinnest.ai/api/v1/agents/{id}/test-chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Is a 2 BHK at Sky Towers under 90 lakh?",
"session": "vr_4f1c09e2b7a84d55a1e0c3b2d9f86a71"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: 'Is a 2 BHK at Sky Towers under 90 lakh?',
session: 'vr_4f1c09e2b7a84d55a1e0c3b2d9f86a71'
})
};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/test-chat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/agents/{id}/test-chat"
payload = {
"message": "Is a 2 BHK at Sky Towers under 90 lakh?",
"session": "vr_4f1c09e2b7a84d55a1e0c3b2d9f86a71"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"session": "vr_4f1c09e2b7a84d55a1e0c3b2d9f86a71",
"mode": "chat",
"reply": "Yes — a 2 BHK at Sky Towers starts at 82 lakh. Would you like to visit the site this weekend?",
"tools": [
{
"name": "search_knowledge",
"input": {
"query": "2 BHK price Sky Towers"
},
"output": "A 2BHK starts at 82 lakh. A 3BHK starts at 1.1 crore."
}
]
}Authorizations
Headers
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Path Parameters
Body
chat talks to the agent as a website visitor. call runs the turn with the agent's call prompt: its call rules (or the built-in ones), the speaking rules, the model its calls use (the Voice page's, or your own key's) and, on your own Gemini key, the thinking level a call uses, with no cards or buttons. It shows the words a caller will be given, not the audio, and not the call's own tools (transferring, hanging up). Needs calling set up on the agent (409 otherwise).
chat, call Response
The agent's reply and the tools it used.