Files
sdk/docs/BillingApi.md
zeekayandHanzo Dev b55332704a feat: Hanzo Cloud SDK for Kotlin (generated from OpenAPI v8.0.0)
Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and
Android. Generated with openapi-generator kotlin (library=jvm-okhttp4,
useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-25 07:10:32 -07:00

11 KiB

BillingApi

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
billingBillingBalance GET /v1/billing/balance Prepaid credit balance
billingBillingGpuCharge POST /v1/billing/gpu-charge Prepay-only GPU charge
billingBillingGpuEligibility GET /v1/billing/gpu-eligibility GPU launch eligibility gate
billingBillingPaymentMethods GET /v1/billing/payment-methods Saved payment methods (masked)
billingBillingUsage GET /v1/billing/usage Per-request usage ledger
platformBillingGetBalance GET /v1/platform/billing/getBalance Get account balance
platformBillingGetPlans GET /v1/platform/billing/getPlans List subscription plans

billingBillingBalance

BillingBalance billingBillingBalance(currency)

Prepaid credit balance

The org's prepaid credit balance in USD cents — the same wallet the gateway debits.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = BillingApi()
val currency : kotlin.String = currency_example // kotlin.String | Optional currency filter (default usd)
try {
    val result : BillingBalance = apiInstance.billingBillingBalance(currency)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling BillingApi#billingBillingBalance")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling BillingApi#billingBillingBalance")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
currency kotlin.String Optional currency filter (default usd) [optional]

Return type

BillingBalance

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

billingBillingGpuCharge

kotlin.collections.Map<kotlin.String, kotlin.Any> billingBillingGpuCharge(billingGpuChargeRequest)

Prepay-only GPU charge

The prepay-only, card-required GPU debit against the caller's own org wallet. Commerce enforces both gates server-side; the subject is pinned server-side, so only the charge params ride the body. Commerce's status is forwarded verbatim.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = BillingApi()
val billingGpuChargeRequest : BillingGpuChargeRequest =  // BillingGpuChargeRequest | 
try {
    val result : kotlin.collections.Map<kotlin.String, kotlin.Any> = apiInstance.billingBillingGpuCharge(billingGpuChargeRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling BillingApi#billingBillingGpuCharge")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling BillingApi#billingBillingGpuCharge")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
billingGpuChargeRequest BillingGpuChargeRequest

Return type

kotlin.collections.Map<kotlin.String, kotlin.Any>

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

billingBillingGpuEligibility

BillingGpuEligibility billingBillingGpuEligibility(amountCents, minPrepaidCents, currency)

GPU launch eligibility gate

Read-only launch gate — reports prepaid availability and card-on-file so the launch UI can show the exact remedy.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = BillingApi()
val amountCents : kotlin.Long = 789 // kotlin.Long | Immediate charge to test against
val minPrepaidCents : kotlin.Long = 789 // kotlin.Long | 24h-minimum prepaid floor
val currency : kotlin.String = currency_example // kotlin.String | 
try {
    val result : BillingGpuEligibility = apiInstance.billingBillingGpuEligibility(amountCents, minPrepaidCents, currency)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling BillingApi#billingBillingGpuEligibility")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling BillingApi#billingBillingGpuEligibility")
    e.printStackTrace()
}

Parameters

| amountCents | kotlin.Long| Immediate charge to test against | [optional] | | minPrepaidCents | kotlin.Long| 24h-minimum prepaid floor | [optional] |

Name Type Description Notes
currency kotlin.String [optional]

Return type

BillingGpuEligibility

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

billingBillingPaymentMethods

BillingPaymentMethods billingBillingPaymentMethods()

Saved payment methods (masked)

The org's saved cards as commerce's masked descriptor (brand + last4 + expiry) — never a PAN/CVV/token.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = BillingApi()
try {
    val result : BillingPaymentMethods = apiInstance.billingBillingPaymentMethods()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling BillingApi#billingBillingPaymentMethods")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling BillingApi#billingBillingPaymentMethods")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

BillingPaymentMethods

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

billingBillingUsage

BillingUsageLedger billingBillingUsage(start, end)

Per-request usage ledger

The raw per-request billing ledger (one row per billed call) for the caller's own org.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = BillingApi()
val start : kotlin.String = start_example // kotlin.String | Optional server-side window start
val end : kotlin.String = end_example // kotlin.String | Optional server-side window end
try {
    val result : BillingUsageLedger = apiInstance.billingBillingUsage(start, end)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling BillingApi#billingBillingUsage")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling BillingApi#billingBillingUsage")
    e.printStackTrace()
}

Parameters

| start | kotlin.String| Optional server-side window start | [optional] |

Name Type Description Notes
end kotlin.String Optional server-side window end [optional]

Return type

BillingUsageLedger

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

platformBillingGetBalance

PlatformTRPCResult platformBillingGetBalance()

Get account balance

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = BillingApi()
try {
    val result : PlatformTRPCResult = apiInstance.platformBillingGetBalance()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling BillingApi#platformBillingGetBalance")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling BillingApi#platformBillingGetBalance")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

PlatformTRPCResult

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

platformBillingGetPlans

PlatformTRPCResult platformBillingGetPlans()

List subscription plans

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = BillingApi()
try {
    val result : PlatformTRPCResult = apiInstance.platformBillingGetPlans()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling BillingApi#platformBillingGetPlans")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling BillingApi#platformBillingGetPlans")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

PlatformTRPCResult

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json