Skip to main content
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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

customer_id
string
external_customer_id
string

Response

200 - application/json

A list of customers with their associated events

customer_id
string
required

The unique identifier for the customer.

Example:

"9f8b47e4-1aad-4f08-b1e3-d9e4b4b85e8f"

external_customer_id
string | null

An external identifier for the customer mapped by external systems.

Example:

"ext789"

customer_name
string | null

The name of the customer. This field is optional and can be used for display purposes.

Example:

"John Doe"

customer_email
string | null

The email address of the customer. Optional and can be used for communication.

Example:

"john.doe@example.com"

items
ItemSchema · object[]

A list of events associated with the customer. Each event is represented by an event_id and event_name.