Estimate the USD cost of an LLM API call for a given model and token counts. Returns input/output/total cost, plus reseller markup vs. the upstream model when applicable.
AI agents call estimate_cost to retrieve information from Modelmeter without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model id in provider/model form, e.g. anthropic/claude-opus-4-8. Use list_models to discover ids. |
input_tokens | integer | Yes | Number of input (prompt) tokens. |
output_tokens | integer | Yes | Number of output (completion) tokens. |
Parameters from the server's own tool schema.
This tool queries pricing data and performs calculations to return cost estimates. It has no side effects: it does not create, modify, delete, or execute operations. No financial transactions occur; it only reads pricing information and produces an estimate.
From the tool's definition Tool description indicates it 'estimate[s]' and 'returns' cost information. The verb 'estimate' and the focus on returning calculated values—'input/output/total cost'—show this is a retrieval operation that performs a read-only calculation without modifying,…
Attacks that exploit this kind of access
Estimate the USD cost of an LLM API call for a given model and token counts. Returns input/output/total cost, plus reseller markup vs. the upstream model when applicable. It is categorised as a Read tool in the Modelmeter MCP Server, which means it retrieves data without modifying state.
estimate_cost accepts 3 parameters: model, input_tokens, output_tokens. Required: model, input_tokens, output_tokens. The full parameter table on this page comes from the server's own tool schema.
Register the Modelmeter MCP server in PolicyLayer and add a rule for estimate_cost: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Modelmeter. Nothing to install.
estimate_cost is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the estimate_cost rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for estimate_cost. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
estimate_cost is provided by the Modelmeter MCP server (https://modelmeter.xyz/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
estimate_cost is one line of Modelmeter's registry record.
The record carries the whole server: verified identity, auth posture, risk grade, every tool classified, recommended policy — re-checked continuously.
Teams ship this data inside their own products. See what a licence covers →