userBalance

Retrieves the current user's available API balance.

Returns a snapshot of whether the account has sufficient funds for further API calls and a per-currency breakdown (granted vs. topped-up balance).

Example:

val balance = client.userBalance()
if (!balance.isAvailable) {
println("Top up at https://platform.deepseek.com/top_up")
}
balance.balanceInfos.forEach { info ->
println("${info.currency}: total=${info.totalBalance}, granted=${info.grantedBalance}")
}

Return

A UserBalance object describing the user's account balance

Throws

if the API returns a non-2xx status