Credit usage events attributed to this project
GET
/projects/{projectId}/billing/usage
const url = 'https://zkao.io/api/v1/projects/example/billing/usage';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://zkao.io/api/v1/projects/example/billing/usage \ --header 'Authorization: Bearer <token>'Requires scope: read. Signed credit delta per ledger event attributed to this project; organization-wide movements such as a top-up made outside any project are not included. Defaults to the last 30 days; newest first; max 1000 rows.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”projectId
required
string
Query Parameters
Section titled “Query Parameters”from
string format: date-time
to
string format: date-time
limit
integer
Responses
Section titled “ Responses ”OK
Media typeapplication/json
object
from
required
string format: date-time
to
required
string format: date-time
events
required
Array<object>
object
id
required
string
at
required
string format: date-time
type
required
string
credits
required
Signed credit delta: negative = spent/clawed back, positive = added/refunded.
integer
scanId
required
string | null
description
required
string
Example
{ "events": [ { "type": "SCAN_DEDUCTION" } ]}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}Missing, malformed, expired, or revoked token
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}The token lacks the required scope
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}Resource not in this token’s project or repo allowlist
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}
