Prudai Developer API: gebruik
Het gebruik van je organisatie per periode.
Basis-URL https://api.prudai.com/v1. Inloggen staat in Inloggen, scopes in Scopes en rechten, fouten in Fouten. Overzicht.
| Methode | Pad | Wat het doet | Stand |
|---|---|---|---|
GET | /v1/usage | Gebruik opvragen | Op productie |
Gebruik opvragen
GET /v1/usage
Aggregated usage.
Usage of all keys of your organisation in the same environment as the calling key
(live keys see live usage, test keys see test usage), aggregated per UTC day, key,
model and/or operation. Contains metadata only, never content.
Credit amounts are null until credit accounting is enabled; free operations then cost 0.
Source grouping and filtering are reserved and return 422 unsupported_parameter
until source metadata is recorded. Personal credentials require an Owner or Admin role.
- Stand: op productie.
- Scope:
account:usage:read - Goedkeuring:
none, geen extra stap.
Parameters
start_dateverplicht
First UTC day (inclusive).end_date
Last UTC day (inclusive). Defaults to today. The range is at most 366 days.group_by
Dimensions to group by, comma-separated. Defaultday. The reservedsourcedimension returns 422unsupported_parameter. Een van:day,key,model,operation,sourcekey_id
Only usage of this key. Public id of an API key (not the secret). patroon^key_[A-Za-z0-9]{20}$model
Only usage of this model (product or product/specialisation). A product, optionally followed by/and a specialisation slug (e.g.leo/arbeidsrecht). max. lengte 80 · patroon^(leo|leo-fiscaal|zia|vera|bever|maia)(/[a-z0-9]+(-[a-z0-9]+)*)?$operation
Only usage of this operation. The metered manifest operation identifier. Legacy dotted operation names are accepted as filters. patroon^[A-Za-z][A-Za-z0-9_.-]{0,99}$source_id
Reserved source filter. Currently returns 422unsupported_parameter. Public source id from the Prudai source catalogue. max. lengte 80 · patroon^[a-z0-9]+(-[a-z0-9]+)*$
Antwoorden
| Status | Betekenis |
|---|---|
200 | The usage report. |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
422 | Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
500 | Unexpected error on Prudai’s side. Not charged, except work that completed before the failure (reported in details.charged_credits). |
Velden in data (200)
object
usage.reportstart_dateend_dategroup_by
Een van:day,key,model,operation,sourcedatadata[].date
Set when grouped byday. kannullzijndata[].key_id
Set when grouped bykey. kannullzijndata[].key_name
kannullzijndata[].model
Set when grouped bymodel(null for operations without a model, such as search). kannullzijndata[].operation
Set when grouped byoperation. kannullzijndata[].source_id
Set when grouped bysource. kannullzijndata[].requests
min. 0data[].failed_requests
min. 0data[].input_tokens
min. 0data[].cached_input_tokens
min. 0data[].output_tokens
min. 0data[].reasoning_tokens
min. 0data[].priced_tool_calls
min. 0data[].source_requests
min. 0data[].credits
Null while credit accounting is disabled or the metered amount is unavailable. kannullzijntotalstotals.requests
min. 0totals.failed_requests
Requests that ended in an error (not charged unless partial work was charged). min. 0totals.input_tokens
min. 0totals.cached_input_tokens
min. 0totals.output_tokens
min. 0totals.reasoning_tokens
min. 0totals.priced_tool_calls
min. 0totals.source_requests
/sources/*and/citations/verifyrequests (free at launch, counted here). min. 0totals.credits
Null while credit accounting is disabled or the metered amount is unavailable. kannullzijn
curl -s "https://api.prudai.com/v1/usage?start_date=%3Cstart_date%3E" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo usage{ "object": "usage.report", "start_date": "2026-11-05", "end_date": "2026-11-05", "group_by": [ "day" ], "data": [ { "date": "2026-11-05", "key_id": "string", "key_name": "string", "model": "leo", "operation": "listModels", "source_id": "string", "requests": 1, "failed_requests": 1, "input_tokens": 1, "cached_input_tokens": 1, "output_tokens": 1, "reasoning_tokens": 1, "priced_tool_calls": 1, "source_requests": 1, "credits": 1 } ], "totals": { "requests": 1, "failed_requests": 1, "input_tokens": 1, "cached_input_tokens": 1, "output_tokens": 1, "reasoning_tokens": 1, "priced_tool_calls": 1, "source_requests": 1, "credits": 1 }}