Skip to main content
GET
Read the organization's API usage, grouped by action or day
Agrège les transactions de credits attribuées à l’API de ton organisation dans des buckets d’utilisation. Renvoie total_credits, total_requests et une liste de buckets (key, credits, requests). Restreins la fenêtre avec from/to, choisis le regroupement avec group_by (par action ou par jour) et limite à une seule clé avec api_key_id. Nécessite le scope usage.read.

Autorisations

Authorization
string
header
requis

Organization API key as a bearer token: Authorization: Bearer samsa_sk_....

Paramètres de requête

from
string | null

ISO-8601 date or datetime lower bound (inclusive). Defaults to the current billing period's start when both bounds are omitted.

Exemple:

"2026-07-01"

to
string | null

ISO-8601 date or datetime upper bound (inclusive; a bare date covers the whole day). Defaults to the current billing period's end when both bounds are omitted.

Exemple:

"2026-07-31"

group_by
enum<string>
défaut:day

Bucket dimension: action (action type) or day (calendar date).

Options disponibles:
action,
day
api_key_id
string<uuid> | null

Restrict to one of the organization's API keys (404 if not yours).

Réponse

Successful Response

GET /usage body — org usage over API-attributed transactions.

total_credits
integer
requis

Net credits across all buckets.

Exemple:

45

total_requests
integer
requis

Billed requests across all buckets.

Exemple:

9

buckets
PublicUsageBucket · object[]
requis