Credit Usage
The app.neoagent.co API provides functionality to retrieve information about message credit usage by sending a POST request to the /chat/Chatbot/GetMessageCreditsUsage endpoint.
Endpoint
Request URL: https://app.neoagent.co/chat/Chatbot/GetMessageCreditsUsage
Method: POST
Required Headers
Authorization: <Your-Secret-Key>- string, mandatory - The secret key to authenticate the API request.
Request Examples
- JavaScript (Fetch API)
- Python (Requests)
- cURL
- HTTP Raw
const res = await fetch('https://app.neoagent.co/chat/Chatbot/GetMessageCreditsUsage', {
method: 'POST',
headers: {
"Authorization": "<Your-Session-Key>"
},
body: JSON.stringify({})
});
const data = await res.json();
console.log(data);
import requests
import json
url = 'https://app.neoagent.co/chat/Chatbot/GetMessageCreditsUsage'
headers = {
"Authorization": "<Your-Session-Key>"
}
data = {}
response = requests.post(url, headers=headers, json=data)
data = response.json()
print(data)
curl 'https://app.neoagent.co/chat/Chatbot/GetMessageCreditsUsage' \
-X POST \
-H 'Authorization: <Your-Session-Key>' \
-d '{}'
POST /chat/Chatbot/GetMessageCreditsUsage HTTP/1.1
Host: app.neoagent.co
Authorization: <Your-Session-Key>
{}
Response
The API response will be a JSON object with the following structure:
{
// object - Message credits usage information
"Data": {
"Total": -1,
"Used": 243,
"Remain": -1
},
// string - API version
"Version": "1.0.0",
// boolean - Operation success status
"Success": true,
// integer - HTTP status code
"Code": 200,
// string - Error message if any
"Message": ""
}