The deepgram.billing object provides access to the balances endpoints of the Deepgram API. Each request is project based and will require a project_id.

List Balances

You can retrieve all balances on a given project using the billing.listBalances function.

List Balances Parameters

ParameterTypeDescription
project_idStringA unique identifier for the project you wish to see the balance info of

List Balances Example Request

const response = await deepgram.billing.listBalances(PROJECT_ID);

List Balances Response

{
  balances: [
      {
      balance_id: string
      amount: number
      units: string
      purchase: string
    }
  ]
}

Get Specific Balance

You can retrieve all balances on a given project using the billing.getBalance function.

Get Specific Balance Parameters

ParameterTypeDescription
project_idStringA unique identifier for the project you wish to see the balance info of
balance_idStringA unique identifier for the balance you wish to see the balance info of

Get Specific Balance Example Request

const response = await deepgram.billing.getBalance(PROJECT_ID, BALANCE_ID);

Get Specific Balance Response

{
	balance: {
		balance_id: string;
		amount: number;
		units: string;
		purchase: string;
	}
}