Gemini Cost Simulator

v1.0.0
io.github.gowinder/geminicost Checked 2 hours ago Published 14 days ago

Gemini 4 agent-run cost simulator over MCP: true per-turn totals vs naive estimates.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

estimate_agent_run Estimate the cost of one Gemini 4 agent run

Turn-by-turn cost of a Gemini 4 agent run: every turn re-sends the growing context as input, thinking tokens are billed at the output rate. Returns the rates in force on the chosen date, the simulated total, the naive first-turn × turns estimate and their multiplier. Before the 2026-12-01 price change it also returns afterIncrease: the same run priced at the announced 2026-12-01 rates.

ParameterTypeDescription
contextGrowthPerTurn *numberNet history added after each completed turn; billed from turn 2 onward.
initialContextTokens *numberSystem prompt, tool definitions and documents sent on turn 1.
modelId *stringGemini 4 model to price.
outputTokensPerTurn *numberVisible answer tokens per turn, excluding thinking.
thinkingLevel *stringThinking budget. Thinking tokens are billed at the output price: off = 0×, low ≈0.5×, medium ≈1.5×, high ≈3× the visible output tokens.
turns *numberNumber of turns (separate API calls) in the run.
userToolInputTokensPerTurn *numberNew user/tool content billed on top of the context each turn.
datestringISO date (YYYY-MM-DD) that selects the price segment in force that day. Defaults to today (UTC).

get_gemini_pricing Get Gemini 4 list prices for a date

Price segment in force on a date for every recorded Gemini 4 model, or for one model: input and output USD per 1,000,000 tokens, the segment start and end dates and its status. Segments marked announced-unpriced have no published values and are reported as such.

ParameterTypeDescription
datestringISO date (YYYY-MM-DD) that selects the price segment in force that day. Defaults to today (UTC).
modelIdstringRestrict the answer to one model. Omit for all recorded models.