Summary
It looks like the JS SDK modal 0.9.0's bindings for WorkspaceBillingSummaryResponse are stale - a revision behind the Python SDK bindings - and so the response is incorrectly decoded.
| Field |
Python (correct) |
JS (incorrect) |
| 1 |
start_timestamp |
startTimestamp |
| 2 |
end_timestamp |
endTimestamp |
| 3 |
metered_cost |
meteredCost |
| 4 |
billed_cost (string) |
planCost (string) |
| 5 |
metered_cost_breakdown (map) |
creditsApplied (string) |
| 6 |
adjustments (map) |
reservationsDiscount (string) |
| 7 |
- |
volumesDiscount (string) |
| 8 |
- |
billedCost (string) |
| 9 |
- |
meteredCostBreakdown (map) |
...so when the server sends something like:
{
"metered_cost": "100.00000000",
"billed_cost": "40.00000000",
"metered_cost_breakdown": {
"Ephemeral Apps": "75.00000000", "Volumes": "20.00000000", "LLM Tokens": "5.00000000"
},
"adjustments": {
"Credits": "-50.00000000", "Free Storage": "-10.00000000", "Plan Cost": "0.00000000", "Reservation Adjustment": "0.00000000"
}
}
it's decoded by modal@0.9.0 as: (can vary based on the maps' serialization order)
{
"meteredCost": "100.00000000",
"planCost": "40.00000000",
"creditsApplied": "\n\nLLM Tokens\u0012\n5.00000000",
"reservationDiscount": "\n\u0016Reservation Adjustment\u0012\n0.00000000",
"volumesDiscount": "",
"billedCost": "",
"meteredCostBreakdown": {}
}
Version
modal@0.9.0
App ID
No response
Summary
It looks like the JS SDK
modal 0.9.0's bindings forWorkspaceBillingSummaryResponseare stale - a revision behind the Python SDK bindings - and so the response is incorrectly decoded....so when the server sends something like:
{ "metered_cost": "100.00000000", "billed_cost": "40.00000000", "metered_cost_breakdown": { "Ephemeral Apps": "75.00000000", "Volumes": "20.00000000", "LLM Tokens": "5.00000000" }, "adjustments": { "Credits": "-50.00000000", "Free Storage": "-10.00000000", "Plan Cost": "0.00000000", "Reservation Adjustment": "0.00000000" } }it's decoded by
modal@0.9.0as: (can vary based on the maps' serialization order){ "meteredCost": "100.00000000", "planCost": "40.00000000", "creditsApplied": "\n\nLLM Tokens\u0012\n5.00000000", "reservationDiscount": "\n\u0016Reservation Adjustment\u0012\n0.00000000", "volumesDiscount": "", "billedCost": "", "meteredCostBreakdown": {} }Version
modal@0.9.0
App ID
No response