estimate_from_usage
Estimate water consumption in milliliters from OpenAI or Anthropic API usage data. Accepts both chat and responses formats, handling reasoning and cached tokens accurately without double counting.
Instructions
Estimate water (mL) from a real API usage object — the accurate path.
usage accepts OpenAI Chat Completions shape (prompt_tokens /
completion_tokens, with completion_tokens_details.reasoning_tokens and
prompt_tokens_details.cached_tokens), OpenAI Responses shape, or
Anthropic Messages shape (input_tokens / output_tokens,
cache_read_input_tokens, cache_creation_input_tokens). Reasoning and
cached tokens are handled without double counting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| usage | Yes | ||
| region | No | ||
| include_embodied | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||