List tenant charges
curl --request GET \
--url https://api.agentsfleet.net/v1/tenants/me/billing/charges \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.agentsfleet.net/v1/tenants/me/billing/charges"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.agentsfleet.net/v1/tenants/me/billing/charges', 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.agentsfleet.net/v1/tenants/me/billing/charges",
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.agentsfleet.net/v1/tenants/me/billing/charges"
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.agentsfleet.net/v1/tenants/me/billing/charges")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsfleet.net/v1/tenants/me/billing/charges")
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{
"next_cursor": "<string>",
"items": [
{
"id": "<string>",
"tenant_id": "<string>",
"workspace_id": "<string>",
"fleet_id": "<string>",
"event_id": "<string>",
"model": "<string>",
"credit_deducted_nanos": 123,
"recorded_at": 123,
"token_count_input": 123,
"token_count_output": 123,
"wall_ms": 123
}
]
}{
"docs_uri": "https://docs.agentsfleet.net/api-reference/error-codes#UZ-AGT-009",
"title": "Fleet not found",
"detail": "No fleet with id 'abc123' in this workspace.",
"error_code": "UZ-AGT-009",
"request_id": "<string>",
"current_state": "paused",
"user_message": "We couldn't find that Fleet. It may have been deleted, or the ID doesn't match one in this workspace.",
"etag": "<string>"
}Tenant balance
List tenant charges
Returns charge records with the newest record first. Use limit and cursor to read more records.
GET
/
v1
/
tenants
/
me
/
billing
/
charges
List tenant charges
curl --request GET \
--url https://api.agentsfleet.net/v1/tenants/me/billing/charges \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.agentsfleet.net/v1/tenants/me/billing/charges"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.agentsfleet.net/v1/tenants/me/billing/charges', 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.agentsfleet.net/v1/tenants/me/billing/charges",
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.agentsfleet.net/v1/tenants/me/billing/charges"
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.agentsfleet.net/v1/tenants/me/billing/charges")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsfleet.net/v1/tenants/me/billing/charges")
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{
"next_cursor": "<string>",
"items": [
{
"id": "<string>",
"tenant_id": "<string>",
"workspace_id": "<string>",
"fleet_id": "<string>",
"event_id": "<string>",
"model": "<string>",
"credit_deducted_nanos": 123,
"recorded_at": 123,
"token_count_input": 123,
"token_count_output": 123,
"wall_ms": 123
}
]
}{
"docs_uri": "https://docs.agentsfleet.net/api-reference/error-codes#UZ-AGT-009",
"title": "Fleet not found",
"detail": "No fleet with id 'abc123' in this workspace.",
"error_code": "UZ-AGT-009",
"request_id": "<string>",
"current_state": "paused",
"user_message": "We couldn't find that Fleet. It may have been deleted, or the ID doesn't match one in this workspace.",
"etag": "<string>"
}Authorizations
Obtain a token via the CLI auth flow (POST /v1/auth/sessions) or GitHub OAuth
Query Parameters
Number of records to return. The default is 50. Valid values are 1 through 200.
Required range:
1 <= x <= 200Token from next_cursor in the previous response. Omit it for the first page.
⌘I