Skip to main content

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

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);

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": ""
}