Get Chat Endpoint
Overview
The Get Chat endpoint helps to get all conversation for a perticular chat_id
.
Request
--request POST 'https://modelslab.com/api/v1/enterprise/llm/get_chat' \
Make a POST
request to https://modelslab.com/api/v1/enterprise/llm/get_chat endpoint and pass the required parameters in the request body.
Body Attributes
Parameter | Description |
---|---|
key | Your API Key used for request authorization |
chat_id | ID of the chat you want to retrieve. All metadata of your chat will be returned. |
temp | Whether or not to send proxy links. Should be true or false . Defaults to false . |
Example
Body
Body
{
"key": "",
"chat_id" : "49afc793-803b-4b4a-bac9-d2f9318c2b8f",
"temp" : false
}
Request
- JS
- PHP
- NODE
- PYTHON
- JAVA
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"key": "",
"chat_id" : "49afc793-803b-4b4a-bac9-d2f9318c2b8f",
"temp" : false
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://modelslab.com/api/v1/enterprise/llm/get_chat", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
<?php
$payload = [
"key" => "",
"chat_id" => "49afc793-803b-4b4a-bac9-d2f9318c2b8f",
"temp" => false
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://modelslab.com/api/v1/enterprise/llm/get_chat',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://modelslab.com/api/v1/enterprise/llm/get_chat',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"key": "",
"chat_id" : "49afc793-803b-4b4a-bac9-d2f9318c2b8f",
"temp" : false
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "https://modelslab.com/api/v1/enterprise/llm/get_chat"
payload = json.dumps({
"key": "",
"chat_id" : "49afc793-803b-4b4a-bac9-d2f9318c2b8f",
"temp" : None
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"key\": \"\",\n \"init_image\" : \"https://d1okzptojspljx.cloudfront.net/generations/b3341a09-082e-474e-989f-72ec3f3bf7aa-0.png\",\n \"prompt\" : \"give him glasses\"\n}");
Request request = new Request.Builder()
.url("https://modelslab.com/api/v1/enterprise/llm/get_chat")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Response
Example Response
{
"status": "success",
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/chats/49afc793-803b-4b4a-bac9-d2f9318c2b8f.json"
],
"message": "",
"chat_id": "49afc793-803b-4b4a-bac9-d2f9318c2b8f",
"meta": {
"chat_id": "49afc793-803b-4b4a-bac9-d2f9318c2b8f",
"temp": "no"
}
}