Skip to main content
GET
Read the organization's API usage, grouped by action or day
Aggregiert die der API zugerechneten Credit-Transaktionen deiner Organisation in Nutzungs-Buckets. Gibt total_credits, total_requests und eine Liste von buckets (key, credits, requests) zurück. Grenze das Zeitfenster mit from/to ein, wähle die Gruppierung mit group_by (nach Aktion oder nach Tag) und beschränke auf einen einzelnen Key mit api_key_id. Erfordert den usage.read Scope.

Autorisierungen

Authorization
string
header
erforderlich

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

Abfrageparameter

from
string | null

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

Beispiel:

"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.

Beispiel:

"2026-07-31"

group_by
enum<string>
Standard:day

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

Verfügbare Optionen:
action,
day
api_key_id
string<uuid> | null

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

Antwort

Successful Response

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

total_credits
integer
erforderlich

Net credits across all buckets.

Beispiel:

45

total_requests
integer
erforderlich

Billed requests across all buckets.

Beispiel:

9

buckets
PublicUsageBucket · object[]
erforderlich