Passer aux chiffres

← Tous les articles

Gemini CLI: A Quick Script, an Itemized Receipt

01 / Put a Price Ceiling on One CSV Script

Suppose you need a Python utility that removes duplicate CSV rows, preserves the header, and writes a separate output file. That is the whole assignment—not a repository cleanup, dependency migration, or architecture review. My suggested spending rule: budget $0.01 for the first attempt, inspect the receipt, and approve another attempt only when you understand the failure.

The numbers below are a worked estimate, not a measured Gemini CLI session or a CheapRelay quote. For a public reference, Google's standard paid Gemini 2.5 Flash rates are $0.30 per million text input tokens and $2.50 per million output tokens, including thinking tokens. Substitute your actual provider rates before budgeting. ([ai.google.dev](https://ai.google.dev/gemini-api/docs/pricing))

02 / Receipt: One Draft Costs $0.00395

Assume the first request consumes 4,000 uncached input tokens and 1,100 billable output tokens. Those are planning quantities, not a promise about what your prompt will consume.

  • ■ Input: 4,000 ÷ 1,000,000 × $0.30 = $0.00120.
  • ■ Output: 1,100 ÷ 1,000,000 × $2.50 = $0.00275.
  • ■ Estimated token subtotal: $0.00395, or 0.395 cents.
  • ■ Remaining room under the proposed $0.01 budget: $0.00605.

This subtotal excludes taxes, external tools, hosting, and any separately billed services. It also assumes no caching. Keep fractional cents in your calculation; rounding each request to a cent makes small jobs look much more expensive than the underlying arithmetic.

03 / Receipt: One Repair Raises the Total to $0.00745

Now suppose a test reveals that blank lines need explicit handling. Budget a repair request at 5,000 input tokens and 800 billable output tokens, using the same reference rates.

  • ■ Repair input: 5,000 ÷ 1,000,000 × $0.30 = $0.00150.
  • ■ Repair output: 800 ÷ 1,000,000 × $2.50 = $0.00200.
  • ■ Repair subtotal: $0.00350.
  • ■ Draft plus repair: $0.00745, or 0.745 cents.
  • ■ One hundred identical two-request jobs: $0.745.

These totals are arithmetic scenarios, not throughput benchmarks. Also, do not equate the visible script with all billable output: Google's published output rate includes thinking tokens. Reconcile your estimate against reported usage rather than counting the words you can see. ([ai.google.dev](https://ai.google.dev/gemini-api/docs/pricing))

04 / Give Gemini CLI a Narrow Purchase Order

Try this assignment: “Write one standard-library Python script that deduplicates CSV rows by all columns. Preserve the header and first occurrence. Accept input and output paths. Never overwrite the input. Include three small tests. Do not inspect unrelated files.”

Provide a tiny synthetic CSV and expected output. Run the tests locally, then send only the failing case and relevant error if a repair is needed. Treat this as scope control, not a guaranteed token reduction. Before allowing writes to valuable data, test on a disposable copy and review the proposed changes.

For API-key authentication, Gemini CLI documents GEMINI_API_KEY and supports overriding its API destination with GOOGLE_GEMINI_BASE_URL. Use the relay's documented configuration, and keep credentials outside version control. ([geminicli.com](https://geminicli.com/docs/reference/configuration/))

05 / Keep CheapRelay Charges on Their Own Receipt

CheapRelay offers pay-as-you-go access with one key, no monthly fee, and no subscription. Its billing follows real tokens, including cache reads and writes. That makes the useful comparison your actual completed-job charge—not an assumed discount against Google's reference price.

Record uncached input, cache reads, cache writes, and output separately wherever the billing record distinguishes them. Multiply each category by its applicable rate. Do not silently price cached traffic as free, and do not assume this article's Google rates are CheapRelay's rates.

Before paying anywhere, check whether Google's limited free API tier fits your task; its pricing page lists free input and output for this model, subject to applicable limits. ([ai.google.dev](https://ai.google.dev/gemini-api/docs/pricing))

Sign up for CheapRelay if its pay-as-you-go setup fits your workflow, then start with one small script and inspect the actual receipt. Keep the working script afterward: rerunning local code should be your default, not purchasing another generation of the same utility.

S'inscrire Testez les prix, crédit d’inscription inclus.

Pour continuer

DateRayonLangueTitre
2026-10-25Agents de code à petit prixENCoding Assistant Habits That Double Your Bill
A receipt-style breakdown shows how oversized prompts and verbose answers turn a $0.60 coding session into $1.20, before retries.
2026-10-25Agents de code à petit prixENThree AI CLIs, One Desktop, a $30 Budget
A receipt-style plan for running Claude Code, Codex and Gemini CLI together, with a $30 usage budget and no invented token prices.
2026-10-25Agents de code à petit prixENCoding Agents in CI: A $0.50 Pipeline Budget
Build a receipt for every coding-agent run, reserve spend before requests, and stop retries before they turn a small fix into a large bill.
2026-10-25Agents de code à petit prixENClaude Code on Windows: A PowerShell Cost Receipt
Configure Claude Code with PowerShell environment variables, then audit a four-line token receipt without confusing example rates with real prices.
2026-10-25Agents de code à petit prixENGemini CLI vs Claude Code: The Shell Chore Receipt
A concrete token-cost comparison for shell chores, with itemized receipts, retry math, cache caveats, and practical spending controls.
2026-10-25Agents de code à petit prixENCheap First, Escalate Later: A Coding Cost Receipt
A worked token receipt shows how cheaper-first pair programming can cut API spending, with clear rules for escalating without wasting developer time.