Read the usage statement
curl --request GET \
--url https://api.zelto.ai/v1/usage/statement \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zelto.ai/v1/usage/statement"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zelto.ai/v1/usage/statement', 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.zelto.ai/v1/usage/statement",
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.zelto.ai/v1/usage/statement"
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.zelto.ai/v1/usage/statement")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zelto.ai/v1/usage/statement")
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{
"statement": {
"month": "2023-12-25",
"currency": "USD",
"unit": "micros",
"contract": "payg",
"plan": "<string>",
"tier": {
"slug": "payg",
"discountBps": 123,
"commitMicros": 123,
"placeholder": true
},
"dueMicros": 123,
"lines": [
{
"item": "<string>",
"quantity": 123,
"unitMicros": 123,
"valueMicros": 123,
"includedMicros": 123,
"creditMicros": 123,
"chargedMicros": 123
}
],
"rates": [
{
"item": "<string>",
"kind": "per_unit",
"unit": "<string>",
"per": 123,
"prices": {}
}
],
"tiers": [
{
"slug": "<string>",
"discountBps": 123,
"commitMicros": 123,
"thisMonthTotalMicros": 123,
"savingsVersusCurrentMicros": 123
}
],
"usageValueMicros": 123,
"includedMicros": 123,
"freeCreditMicros": 123,
"commitCreditMicros": 123,
"forecast": {
"confidence": "none",
"projectedDueMicros": 123
},
"aiSpendCap": {
"capMicros": 123,
"usedMicros": 123,
"state": "none",
"source": "owner",
"approvalThresholdMicros": 123
},
"agreement": {
"calls": 123,
"callsIncluded": 123,
"callOverage": 123,
"callOverageRateMicros": 123,
"callOverageMicros": 123,
"meteredMicros": 123
}
}
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"hint": "<string>",
"parameter": "<string>",
"unknown": [
"<string>"
],
"valid": [
"<string>"
],
"details": {},
"feedback": {
"endpoint": "<string>",
"method": "POST",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Usage
Read the usage statement
The authenticated organization’s usage statement for a UTC month, in USD micros: what is charged, each item as quantity times unit price, the volume tier, free credit, month-end forecast, AI spend cap, and the price of every unit at every volume tier. Mirrors the Usage page and the get_usage_statement MCP tool.
GET
/
v1
/
usage
/
statement
Read the usage statement
curl --request GET \
--url https://api.zelto.ai/v1/usage/statement \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zelto.ai/v1/usage/statement"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zelto.ai/v1/usage/statement', 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.zelto.ai/v1/usage/statement",
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.zelto.ai/v1/usage/statement"
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.zelto.ai/v1/usage/statement")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zelto.ai/v1/usage/statement")
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{
"statement": {
"month": "2023-12-25",
"currency": "USD",
"unit": "micros",
"contract": "payg",
"plan": "<string>",
"tier": {
"slug": "payg",
"discountBps": 123,
"commitMicros": 123,
"placeholder": true
},
"dueMicros": 123,
"lines": [
{
"item": "<string>",
"quantity": 123,
"unitMicros": 123,
"valueMicros": 123,
"includedMicros": 123,
"creditMicros": 123,
"chargedMicros": 123
}
],
"rates": [
{
"item": "<string>",
"kind": "per_unit",
"unit": "<string>",
"per": 123,
"prices": {}
}
],
"tiers": [
{
"slug": "<string>",
"discountBps": 123,
"commitMicros": 123,
"thisMonthTotalMicros": 123,
"savingsVersusCurrentMicros": 123
}
],
"usageValueMicros": 123,
"includedMicros": 123,
"freeCreditMicros": 123,
"commitCreditMicros": 123,
"forecast": {
"confidence": "none",
"projectedDueMicros": 123
},
"aiSpendCap": {
"capMicros": 123,
"usedMicros": 123,
"state": "none",
"source": "owner",
"approvalThresholdMicros": 123
},
"agreement": {
"calls": 123,
"callsIncluded": 123,
"callOverage": 123,
"callOverageRateMicros": 123,
"callOverageMicros": 123,
"meteredMicros": 123
}
}
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"hint": "<string>",
"parameter": "<string>",
"unknown": [
"<string>"
],
"valid": [
"<string>"
],
"details": {},
"feedback": {
"endpoint": "<string>",
"method": "POST",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
