Get Balance
curl --request GET \
--url https://api.modelhunter.ai/api/v1/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.modelhunter.ai/api/v1/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.modelhunter.ai/api/v1/balance', 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.modelhunter.ai/api/v1/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.modelhunter.ai/api/v1/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.modelhunter.ai/api/v1/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.modelhunter.ai/api/v1/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"balance": 45.00,
"billingMode": "prepaid",
"monthlySpendLimit": null,
"autoTopUpEnabled": false,
"autoTopUpThreshold": null,
"autoTopUpAmount": null
}
}
Billing API
Get Balance
Retrieve your current account balance and billing details.
GET
/
api
/
v1
/
balance
Get Balance
curl --request GET \
--url https://api.modelhunter.ai/api/v1/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.modelhunter.ai/api/v1/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.modelhunter.ai/api/v1/balance', 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.modelhunter.ai/api/v1/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.modelhunter.ai/api/v1/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.modelhunter.ai/api/v1/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.modelhunter.ai/api/v1/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"balance": 45.00,
"billingMode": "prepaid",
"monthlySpendLimit": null,
"autoTopUpEnabled": false,
"autoTopUpThreshold": null,
"autoTopUpAmount": null
}
}
Response Fields
boolean
Whether the request was successful.
object
Account balance details.
Show data properties
Show data properties
number
Current available balance in USD (e.g.
45.00).string
Billing mode. One of:
prepaid (top-up balance), postpaid (card on file, invoiced monthly).number | null
Monthly spending limit.
null if not set.boolean
Whether automatic top-up is enabled.
number | null
Balance threshold that triggers auto top-up.
null if not configured.number | null
Amount to add when auto top-up is triggered.
null if not configured.{
"success": true,
"data": {
"balance": 45.00,
"billingMode": "prepaid",
"monthlySpendLimit": null,
"autoTopUpEnabled": false,
"autoTopUpThreshold": null,
"autoTopUpAmount": null
}
}
⌘I