Skip to content

v4.3.0

Choose a tag to compare

@justhyped justhyped released this 29 Oct 17:11
· 2 commits to master since this release
0484c3f

Minor release, no API changes for callers.

go get github.com/Hyper-Solutions/hyper-sdk-go/v4@v4.3.0

New

  • Session.GetUsage: returns the API key's pay-as-you-go balance (BalanceEuro) and one UsagePlan per product with RequestsUsed, RequestsQuota, RequestsRemaining and ExpiresAt. Request counts are int64. The request goes to GET https://api.hypersolutions.co/usage, carries the session's JWT and organization signatures, and is not counted as usage.
usage, err := session.GetUsage(ctx)
if err != nil {
    // Handle error
}
for _, plan := range usage.Plans {
    fmt.Printf("%s: %d of %d left\n", plan.Product, plan.RequestsRemaining, plan.RequestsQuota)
}

Docs: https://docs.hypersolutions.co/api-reference/usage-statistics