Get Items
curl --request GET \
--url https://api.justpaid.io/api/v1/usage/items \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.justpaid.io/api/v1/usage/items"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.justpaid.io/api/v1/usage/items', 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.justpaid.io/api/v1/usage/items",
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.justpaid.io/api/v1/usage/items"
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.justpaid.io/api/v1/usage/items")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justpaid.io/api/v1/usage/items")
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[
{
"customer_id": "9f8b47e4-1aad-4f08-b1e3-d9e4b4b85e8f",
"external_customer_id": "ext789",
"customer_name": "John Doe",
"customer_email": "john.doe@example.com",
"items": [
{
"item_id": "123e4567-e89b-12d3-a456-426614174000",
"item_name": "gpt4o_input_tokens_used",
"billing_alias": "gpt4o_input_tokens_used"
}
]
}
]Usage
Get Items
Retrieve Usage-Based Billable Items
Fetch a list of usage-based billable items, optionally filtered by a specific customer ID or external customer ID.
Overview
This endpoint allows you to retrieve billable items along with associated customer details from the database. You can filter the results by either a customer ID or external customer ID. If no filter is provided, the endpoint returns billable items for all customers.
Parameters
- customer_id (optional): The unique identifier of the customer to filter events by.
- external_customer_id (optional): The external identifier of the customer to filter events by.
GET
/
api
/
v1
/
usage
/
items
Get Items
curl --request GET \
--url https://api.justpaid.io/api/v1/usage/items \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.justpaid.io/api/v1/usage/items"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.justpaid.io/api/v1/usage/items', 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.justpaid.io/api/v1/usage/items",
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.justpaid.io/api/v1/usage/items"
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.justpaid.io/api/v1/usage/items")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justpaid.io/api/v1/usage/items")
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[
{
"customer_id": "9f8b47e4-1aad-4f08-b1e3-d9e4b4b85e8f",
"external_customer_id": "ext789",
"customer_name": "John Doe",
"customer_email": "john.doe@example.com",
"items": [
{
"item_id": "123e4567-e89b-12d3-a456-426614174000",
"item_name": "gpt4o_input_tokens_used",
"billing_alias": "gpt4o_input_tokens_used"
}
]
}
]Authorizations
Response
200 - application/json
A list of customers with their associated events
Was this page helpful?
