/ai/token/usage


GET https://api.sitehost.nz/1.5/ai/token/usage.json

Returns AI usage for all of a client's tokens for one NZ calendar month, broken down by token and by model. Only successful requests are counted, and costs are in NZD (excl. GST). The current month is updated live, and future months cannot be requested.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1
monthintegerYesThe month to return, from 1 to 12.Example: 9
yearintegerYesThe year to return, from 2026 onwards.Example: 2026

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.5/ai/token/usage.json?apikey=your_key_here&client_id=1&month=9&year=2026", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.5/ai/token/usage.json?apikey=your_key_here&client_id=1&month=9&year=2026");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.sitehost.nz/1.5/ai/token/usage.json?apikey=your_key_here&client_id=1&month=9&year=2026")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

response = http.request(request)
import requests

uri = 'https://api.sitehost.nz/1.5/ai/token/usage.json?apikey=your_key_here&client_id=1&month=9&year=2026'

response = requests.get(uri)

Response

200:

application/json
{
    "return": {
        "period": "2026-9",
        "totals": {
            "requests": 1520,
            "prompt_tokens": 2850000,
            "completion_tokens": 410000,
            "cached_tokens": 600000,
            "estimated_cost_nzd": 2.2305
        },
        "by_key": [
            {
                "key_id": "3f6c2a9e-8b14-4d7a-9c5e-1a2b3c4d5e6f",
                "label": "Production app",
                "revoked": false,
                "requests": 1200,
                "prompt_tokens": 2400000,
                "completion_tokens": 410000,
                "cached_tokens": 600000,
                "estimated_cost_nzd": 2.217,
                "models": {
                    "Qwen/Qwen3.6-27B": 1.575,
                    "Qwen/Qwen3.8-27B": 0.642
                }
            },
            {
                "key_id": "9b1d4e7f-2c3a-4f5b-8e6d-7a8b9c0d1e2f",
                "label": "Search indexer",
                "revoked": false,
                "requests": 320,
                "prompt_tokens": 450000,
                "completion_tokens": 0,
                "cached_tokens": 0,
                "estimated_cost_nzd": 0.0135,
                "models": {
                    "Qwen/Qwen3-VL-Embedding-8B": 0.0135
                }
            }
        ],
        "by_model": [
            {
                "model": "Qwen/Qwen3.6-27B",
                "endpoint": "/v1/chat/completions",
                "requests": 900,
                "prompt_tokens": 1900000,
                "completion_tokens": 350000,
                "cached_tokens": 500000,
                "estimated_cost_nzd": 1.575
            },
            {
                "model": "Qwen/Qwen3.8-27B",
                "endpoint": "/v1/chat/completions",
                "requests": 300,
                "prompt_tokens": 500000,
                "completion_tokens": 60000,
                "cached_tokens": 100000,
                "estimated_cost_nzd": 0.642
            },
            {
                "model": "Qwen/Qwen3-VL-Embedding-8B",
                "endpoint": "/v1/embeddings",
                "requests": 320,
                "prompt_tokens": 450000,
                "completion_tokens": 0,
                "cached_tokens": 0,
                "estimated_cost_nzd": 0.0135
            }
        ]
    },
    "msg": "Successful",
    "status": true
}