fix(#705): add estimated_cost_usd_num (float) to usage JSON alongside string field; doc entry filed

This commit is contained in:
YeonGyu-Kim
2026-05-25 23:33:14 +09:00
parent 8f809d9a9e
commit 732007da8e
2 changed files with 5 additions and 3 deletions

View File

@@ -4110,7 +4110,7 @@ fn run_resume_command(
"cache_creation_input_tokens": usage.cache_creation_input_tokens,
"cache_read_input_tokens": usage.cache_read_input_tokens,
"total_tokens": usage.total_tokens(),
"estimated_cost_usd": format_usd(usage.estimate_cost_usd().total_cost_usd()),
"estimated_cost_usd": format_usd(usage.estimate_cost_usd().total_cost_usd()), "estimated_cost_usd_num": usage.estimate_cost_usd().total_cost_usd(),
"pricing": "estimated-default",
})),
})
@@ -4278,7 +4278,7 @@ fn run_resume_command(
"cache_creation_input_tokens": usage.cache_creation_input_tokens,
"cache_read_input_tokens": usage.cache_read_input_tokens,
"total_tokens": usage.total_tokens(),
"estimated_cost_usd": format_usd(usage.estimate_cost_usd().total_cost_usd()),
"estimated_cost_usd": format_usd(usage.estimate_cost_usd().total_cost_usd()), "estimated_cost_usd_num": usage.estimate_cost_usd().total_cost_usd(),
"pricing": "estimated-default",
})),
})
@@ -6766,7 +6766,7 @@ fn status_json_value(
"cumulative_cache_creation_input": usage.cumulative.cache_creation_input_tokens,
"cumulative_cache_read_input": usage.cumulative.cache_read_input_tokens,
"cumulative_total": usage.cumulative.total_tokens(),
"estimated_cost_usd": format_usd(usage.cumulative.estimate_cost_usd().total_cost_usd()),
"estimated_cost_usd": format_usd(usage.cumulative.estimate_cost_usd().total_cost_usd()), "estimated_cost_usd_num": usage.cumulative.estimate_cost_usd().total_cost_usd(),
"pricing": "estimated-default",
"estimated_tokens": usage.estimated_tokens,
},