import GetimgAI from "getimg-ai";
const client = new GetimgAI();
const costs = await client.billing.listCosts({
start: "2026-09-01T00:00:00Z",
end: "2026-09-05T00:00:00Z",
});from getimg import GetimgAI
client = GetimgAI()
costs = client.billing.list_costs(
start="2026-09-01T00:00:00Z",
end="2026-09-05T00:00:00Z",
)
curl --request GET \
--url https://api.getimg.ai/v2/billing/costs \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getimg.ai/v2/billing/costs",
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.getimg.ai/v2/billing/costs"
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.getimg.ai/v2/billing/costs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getimg.ai/v2/billing/costs")
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{
"currency": "USD",
"data": [
{
"date": "2026-09-01",
"cost": 0.84
},
{
"date": "2026-09-02",
"cost": 1.26
},
{
"date": "2026-09-03",
"cost": 0
},
{
"date": "2026-09-04",
"cost": 0.42
},
{
"date": "2026-09-05",
"cost": 0.93
}
],
"total_cost": 3.45,
"start": "2026-09-01T00:00:00Z",
"end": "2026-09-05T00:00:00Z"
}Get daily costs
Retrieve daily API costs and the range total for your developer project.
import GetimgAI from "getimg-ai";
const client = new GetimgAI();
const costs = await client.billing.listCosts({
start: "2026-09-01T00:00:00Z",
end: "2026-09-05T00:00:00Z",
});from getimg import GetimgAI
client = GetimgAI()
costs = client.billing.list_costs(
start="2026-09-01T00:00:00Z",
end="2026-09-05T00:00:00Z",
)
curl --request GET \
--url https://api.getimg.ai/v2/billing/costs \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getimg.ai/v2/billing/costs",
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.getimg.ai/v2/billing/costs"
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.getimg.ai/v2/billing/costs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getimg.ai/v2/billing/costs")
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{
"currency": "USD",
"data": [
{
"date": "2026-09-01",
"cost": 0.84
},
{
"date": "2026-09-02",
"cost": 1.26
},
{
"date": "2026-09-03",
"cost": 0
},
{
"date": "2026-09-04",
"cost": 0.42
},
{
"date": "2026-09-05",
"cost": 0.93
}
],
"total_cost": 3.45,
"start": "2026-09-01T00:00:00Z",
"end": "2026-09-05T00:00:00Z"
}Authorizations
Send your API key as a bearer token:
Authorization: Bearer sk_<secret>.
Query Parameters
Inclusive ISO 8601 start timestamp. Must include a time zone.
Inclusive ISO 8601 end timestamp. Must include a time zone, fall after start, and sit within 180 days of it.
Response
Daily costs across every API key in the project, bucketed by UTC calendar date in ascending order. Buckets cover zero-cost days and the end date, and the first and last bucket can each cover a partial day. Costs are reported in USD and can lag recent charges, so read them as usage telemetry rather than an authoritative billing ledger. Responses are sent with Cache-Control: no-store.
USD One bucket per UTC calendar date in the range.
Show child attributes
Show child attributes
Total cost for the range in USD.
3.45
Start of the requested range.
End of the requested range.