Account
Get Usage
The Get Usage API retrieves a detailed breakdown of your MoltSets API credit usage for a chosen time period: today, the past week, the past month, or the current billing cycle.
It returns a day-by-day log of API calls made, credits consumed, successful lookups, empty results, and failed requests, along with period totals.
Use this endpoint to:
- Track consumption trends over time
- Audit usage day by day
- Build internal usage dashboards
POST
/
get_usage
Get Usage
curl --request POST \
--url https://api.moltsets.com/api/v1/tools/get_usage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period": "month"
}
'import requests
url = "https://api.moltsets.com/api/v1/tools/get_usage"
payload = { "period": "month" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({period: 'month'})
};
fetch('https://api.moltsets.com/api/v1/tools/get_usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moltsets.com/api/v1/tools/get_usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'period' => 'month'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.moltsets.com/api/v1/tools/get_usage"
payload := strings.NewReader("{\n \"period\": \"month\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.moltsets.com/api/v1/tools/get_usage")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period\": \"month\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moltsets.com/api/v1/tools/get_usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"period\": \"month\"\n}"
response = http.request(request)
puts response.read_body{
"results": {
"period": "today",
"start_date": "2026-07-14",
"end_date": "2026-07-14",
"token_balance": -1,
"days": [
{
"date": "2026-07-14",
"calls": 2634,
"tokens": 1405,
"with_data": 1422,
"without_data": 1195,
"failed": 17
}
],
"totals": {
"calls": 2634,
"tokens": 1405,
"with_data": 1422,
"without_data": 1195,
"failed": 17
}
},
"status": "ok",
"metadata": {
"fair_use": {
"records_remaining_5h": 179999,
"records_reset_5h": "2026-07-15T18:53:16Z",
"records_remaining_1w": 899999,
"records_reset_1w": "2026-07-22T13:53:16Z"
}
}
}{
"error": "Bad Request",
"message": "The server cannot process the request due to a client error (400 Bad Request)."
}{
"error": "Unauthorized",
"message": "Invalid API key."
}{
"error": "Invalid Input",
"message": "Message describing the nature of the invalid input."
}{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Maximum 100 requests per second."
}{
"error": {
"code": "internal_error",
"message": "Unexpected connection error."
},
"metadata": {}
}⌘I
Get Usage
curl --request POST \
--url https://api.moltsets.com/api/v1/tools/get_usage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period": "month"
}
'import requests
url = "https://api.moltsets.com/api/v1/tools/get_usage"
payload = { "period": "month" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({period: 'month'})
};
fetch('https://api.moltsets.com/api/v1/tools/get_usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moltsets.com/api/v1/tools/get_usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'period' => 'month'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.moltsets.com/api/v1/tools/get_usage"
payload := strings.NewReader("{\n \"period\": \"month\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.moltsets.com/api/v1/tools/get_usage")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period\": \"month\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moltsets.com/api/v1/tools/get_usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"period\": \"month\"\n}"
response = http.request(request)
puts response.read_body{
"results": {
"period": "today",
"start_date": "2026-07-14",
"end_date": "2026-07-14",
"token_balance": -1,
"days": [
{
"date": "2026-07-14",
"calls": 2634,
"tokens": 1405,
"with_data": 1422,
"without_data": 1195,
"failed": 17
}
],
"totals": {
"calls": 2634,
"tokens": 1405,
"with_data": 1422,
"without_data": 1195,
"failed": 17
}
},
"status": "ok",
"metadata": {
"fair_use": {
"records_remaining_5h": 179999,
"records_reset_5h": "2026-07-15T18:53:16Z",
"records_remaining_1w": 899999,
"records_reset_1w": "2026-07-22T13:53:16Z"
}
}
}{
"error": "Bad Request",
"message": "The server cannot process the request due to a client error (400 Bad Request)."
}{
"error": "Unauthorized",
"message": "Invalid API key."
}{
"error": "Invalid Input",
"message": "Message describing the nature of the invalid input."
}{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Maximum 100 requests per second."
}{
"error": {
"code": "internal_error",
"message": "Unexpected connection error."
},
"metadata": {}
}