curl --request GET \
--url https://api.recoupable.dev/api/accounts/{id}/usage \
--header 'x-api-key: <api-key>'import requests
url = "https://api.recoupable.dev/api/accounts/{id}/usage"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.recoupable.dev/api/accounts/{id}/usage', 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.recoupable.dev/api/accounts/{id}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.recoupable.dev/api/accounts/{id}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.recoupable.dev/api/accounts/{id}/usage")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/accounts/{id}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"period": {
"from": "2026-08-01T00:00:00.000Z",
"to": "2026-08-27T12:00:00.000Z"
},
"total_credits_deducted": 70000,
"total_usd": "$0.07",
"events": [
{
"id": "3AANn3Ij9uF-zZIlW_zlP",
"created_at": "2026-08-27T11:56:58.000Z",
"source": "api",
"agent_type": "main",
"provider": "fal",
"model_id": "POST /api/artist/socials/scrape",
"input_tokens": 0,
"cached_input_tokens": 0,
"output_tokens": 0,
"tool_call_count": 0,
"credits_deducted": 20000,
"usd": "$0.02",
"resource_url": "/music/0c35429f-deb8-48f0-b0f2-fd5145de2583"
}
],
"next_cursor": "2026-08-27T11:56:58.000Z",
"series_bucket": "day",
"series": [
{
"start": "2026-08-11T00:00:00.000Z",
"credits_deducted": 56080000,
"usd": "$56.08",
"events": 727
},
{
"start": "2026-08-12T00:00:00.000Z",
"credits_deducted": 221090000,
"usd": "$221.09",
"events": 2462
},
{
"start": "2026-08-13T00:00:00.000Z",
"credits_deducted": 440930000,
"usd": "$440.93",
"events": 5479
}
]
}{
"error": "limit must be between 1 and 100"
}{
"error": "Unauthorized"
}{
"error": "Account not found"
}Get Account Usage
List the charges that consumed an account’s credits: one line item per deduction from usage_events, newest first, over a period. Each item carries the amount as the raw ledger integer (credits_deducted, micro-dollars: 1,000,000 = $1.00) and the same amount formatted as a dollar string (usd), and the response carries the total for the whole period, not just the page. Access is the same as GET /api/accounts/{id}/credits: the authenticated account itself, or another account reachable through organization membership.
curl --request GET \
--url https://api.recoupable.dev/api/accounts/{id}/usage \
--header 'x-api-key: <api-key>'import requests
url = "https://api.recoupable.dev/api/accounts/{id}/usage"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.recoupable.dev/api/accounts/{id}/usage', 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.recoupable.dev/api/accounts/{id}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.recoupable.dev/api/accounts/{id}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.recoupable.dev/api/accounts/{id}/usage")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/accounts/{id}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"period": {
"from": "2026-08-01T00:00:00.000Z",
"to": "2026-08-27T12:00:00.000Z"
},
"total_credits_deducted": 70000,
"total_usd": "$0.07",
"events": [
{
"id": "3AANn3Ij9uF-zZIlW_zlP",
"created_at": "2026-08-27T11:56:58.000Z",
"source": "api",
"agent_type": "main",
"provider": "fal",
"model_id": "POST /api/artist/socials/scrape",
"input_tokens": 0,
"cached_input_tokens": 0,
"output_tokens": 0,
"tool_call_count": 0,
"credits_deducted": 20000,
"usd": "$0.02",
"resource_url": "/music/0c35429f-deb8-48f0-b0f2-fd5145de2583"
}
],
"next_cursor": "2026-08-27T11:56:58.000Z",
"series_bucket": "day",
"series": [
{
"start": "2026-08-11T00:00:00.000Z",
"credits_deducted": 56080000,
"usd": "$56.08",
"events": 727
},
{
"start": "2026-08-12T00:00:00.000Z",
"credits_deducted": 221090000,
"usd": "$221.09",
"events": 2462
},
{
"start": "2026-08-13T00:00:00.000Z",
"credits_deducted": 440930000,
"usd": "$440.93",
"events": 5479
}
]
}{
"error": "limit must be between 1 and 100"
}{
"error": "Unauthorized"
}{
"error": "Account not found"
}Authorizations
Your Recoup API key. Learn more.
Path Parameters
The unique identifier (UUID) of the account. Must be the authenticated account or another accessible via organization membership.
Query Parameters
Maximum number of line items to return per page.
1 <= x <= 100Order of the line items, both descending: created_at (newest first, the default) or cost (largest credits_deducted first, ties by newest).
created_at, cost Opaque paging token: pass the next_cursor value from the previous page, with the same sort, from and to. With sort=created_at it is the last item's created_at; with sort=cost it encodes the last item's amount and id. Returns the items that follow it.
Start of the period (inclusive), ISO 8601. Defaults to the start of the current UTC month.
End of the period (exclusive), ISO 8601. Defaults to now.
Response
Usage line items retrieved successfully
The account whose charges are listed.
"550e8400-e29b-41d4-a716-446655440000"
The period the totals cover.
Show child attributes
Show child attributes
Sum of credits_deducted over every charge in the period, in micro-dollars. Covers the whole period, not only this page.
70000
total_credits_deducted formatted as US dollars.
"$0.07"
Charges in the period in the requested sort order (newest first by default).
Show child attributes
Show child attributes
Opaque; pass as cursor (with the same sort, from and to) to fetch the next page. Null when the page was the last one in the period.
"2026-08-27T11:56:58.000Z"
Granularity of series, derived from the span of the period: hour up to 2 days, day up to 90 days, week up to 12 months, month beyond. Present only on a first page (no cursor).
hour, day, week, month "day"
Spend over the period, one entry per series_bucket that had at least one charge, ascending by start, in UTC. The sum of credits_deducted across the entries equals total_credits_deducted. Present only on a first page (no cursor); omitted on cursor pages so paging never recomputes it.
Show child attributes
Show child attributes
[
{
"start": "2026-08-11T00:00:00.000Z",
"credits_deducted": 56080000,
"usd": "$56.08",
"events": 727
},
{
"start": "2026-08-12T00:00:00.000Z",
"credits_deducted": 221090000,
"usd": "$221.09",
"events": 2462
},
{
"start": "2026-08-13T00:00:00.000Z",
"credits_deducted": 440930000,
"usd": "$440.93",
"events": 5479
}
]
Was this page helpful?
