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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"usage": "<usage>",
"model": "<model>"
},
"name": "estimate_from_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| usage | Yes | ||
| region | No | ||
| include_embodied | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||