The values for GrossQuantity, DiscountQuantity, and NetQuantity can be floats. The current struct in v82 for PremiumRequestUsageItem in github/billing.go has them defined as ints.
e.g.
{
"product": "Copilot",
"sku": "Copilot Premium Request",
"model": "GPT-5.2",
"unitType": "requests",
"pricePerUnit": 0.04,
"grossQuantity": 5054.0,
"grossAmount": 202.16,
"discountQuantity": 4974.0,
"discountAmount": 198.96,
"netQuantity": 80.0,
"netAmount": 3.2
}
This leads to an error in unmarshalling the json data:
json: cannot unmarshal number 5054.0 into Go struct field PremiumRequestUsageItem.usageItems.grossQuantity of type int
The values for GrossQuantity, DiscountQuantity, and NetQuantity can be floats. The current struct in v82 for PremiumRequestUsageItem in github/billing.go has them defined as ints.
e.g.
{
"product": "Copilot",
"sku": "Copilot Premium Request",
"model": "GPT-5.2",
"unitType": "requests",
"pricePerUnit": 0.04,
"grossQuantity": 5054.0,
"grossAmount": 202.16,
"discountQuantity": 4974.0,
"discountAmount": 198.96,
"netQuantity": 80.0,
"netAmount": 3.2
}
This leads to an error in unmarshalling the json data:
json: cannot unmarshal number 5054.0 into Go struct field PremiumRequestUsageItem.usageItems.grossQuantity of type int