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.list_balance function.

List Balances Parameters

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

List Balances Example Request

response = await deepgram.billing.list_balance(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.get_balance 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 = deepgram.billing.get_balance(PROJECT_ID, BALANCE_ID)

Get Specific Balance Response

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