Where the organization's extraction credits went this period
GET
/api/v1/billing/usage/breakdown
const url = 'https://api.yggy.tech/api/v1/billing/usage/breakdown';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://api.yggy.tech/api/v1/billing/usage/breakdown \ --header 'Authorization: Bearer <token>'Credits per day and tier, per project, and the documents that used the most, for the current credit period.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Credit breakdown
Media type application/json
object
periodStart
required
Start of the credit period (ISO 8601)
string
periodEnd
required
End of the credit period, exclusive (ISO 8601)
string
daily
required
Credits per UTC day and tier; days without usage are left out
Array<object>
object
date
required
string
fast
required
number
balanced
required
number
accurate
required
number
byTier
required
Array<object>
object
tier
required
string
credits
required
number
byProject
required
Credits per project, most first. Personal files are one row; unknown means the document is gone
Array<object>
object
projectId
required
string | null
name
required
string | null
kind
required
string
credits
required
number
topDocuments
required
Array<object>
object
documentId
required
string
title
required
Null for private documents and personal files
string | null
projectName
required
string | null
tiers
required
Array<string>
credits
required
number
deleted
required
boolean
Example
{ "byTier": [ { "tier": "fast" } ], "byProject": [ { "kind": "shared" } ], "topDocuments": [ { "tiers": [ "fast" ] } ]}No active organization
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Not authenticated
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Only organization owners, signed in to the app, can see the breakdown
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}