Grodmir Optimize

How to start with Grodmir Optimize

Grodmir Optimize shows how much you overpay for AI model APIs (Anthropic, OpenAI, Google, Azure OpenAI, AWS Bedrock). You start with a free preliminary scan from 7 days of request metadata. If the scan finds enough, the paid audit costs 10% of your monthly API spend, minimum $500, and gives amounts for specific changes in your traffic.

No content leaves your company. The scan needs only metadata, which the TokenMind exporter writes on your own machine: no prompts, answers, tool arguments, file paths, project names or e-mail addresses.

What you get

The audit does not save money by itself. It is an analysis and a list of concrete changes; the saving appears when you make them. It changes nothing in your traffic and never sees the content of your requests.

How it works: we price every request with the provider's current price list, split your bill by route (a feature of your application) and model, and look for known patterns of overpaying. Each finding comes with a monthly amount, a confidence and the change to make.

Free preliminary scanPaid audit
Data7 days of metadata30 days of metadata, or the TokenMind proxy in your infrastructure
You receiveyour spend by route and model; the waste we found with a monthly amount and a confidence; what we would not recommendthe same, plus a list of concrete changes ordered by amount: what to change, where, and how much it saves a month
Price$010% of monthly API spend, minimum $500
Timewithin 2 business daysagreed with the order

The report shows three separate amounts, so you know what each change risks:

AmountWhat it coversEffect on answers
No change to answerscache that breaks or expires too early, work that can wait sent to the Batch API, paying for a fast tier nobody waits for, discounts requested where they do not existnone: the same model and the same request, only the price changes
Answers may changereasoning effort set higher than the task needs, answers longer than needed, agents repeating the same call, context crossing a dearer price tiercheck on your own quality test before you switch
Cheaper modelan expensive model on simple tasks such as classification or field extractionyou test it yourself; we never count it as certain

Typical findings, with the provider facts behind them:

FindingWhy it costs moneyThe change
A cache that breaksthe request starts with something that changes every time (a date, a random id), so the provider charges full input price instead of the cached price (2.5–10% of the input price depending on the model, Anthropic and OpenAI price lists, November 2026)move the changing part to the end of the request
A cache that expires too earlyrequests come every 10 minutes and a 5-minute cache is written again each timea longer cache lifetime
Work nobody waits fornightly reports and extraction sent to the normal APIthe Batch API: half the price (Anthropic, OpenAI and Google price lists, November 2026)
Paying for speeda fast or priority tier (about 2× the price) on background workthe standard tier
An expensive model on a simple taskclassification on a top modela test with a cheaper model of the same provider

How much it saves depends on your traffic. Teams without caching and with background work on the normal API usually find a lot; traffic that is already optimised may show very little. That is why the scan comes first and is free: we propose the paid audit only when the scan shows it pays off. The amounts are estimates from your own data, not a guarantee.

1. What the exporter writes, and what it never writes

One line per model request, with exactly these fields and nothing else:

FieldMeaning
tstime of the request (UTC)
source, provider, modelwhere the log came from, the provider, the model id
tierstandard, batch or flex
status, latency_msHTTP status, duration
input_tokens, cache_write_5m_tokens, cache_write_1h_tokens, cache_read_tokens, output_tokens, reasoning_tokenstoken counts by billing category
flagsdata-quality notes, for example cache writes not reported by the provider
route, session, run, prefix, toolssalted hashes, computed on your machine

Never written: prompts, answers, system prompts, tool arguments and results, file paths, project or repository names, user names, e-mail addresses, API keys.

The hashes let the scan group requests (the same instruction prefix, the same agent run, a repeated tool call) without knowing what they contain. The salt is created on your machine on the first run (~/.tokenmind/export-salt) and is never sent. If several people export, give them the same salt file so the same projects group together.

At the end the exporter prints the number of records, the fields it wrote and the line "Content was not exported". You can open the output file and check every line before sending it.

2. Download

Sign in to your Grodmir workspace (creating one is free and starts no payment), open Setup & access and use Grodmir Optimize — scan exporter. You get three files: the wheel aiguard_tokenmind-<version>-py3-none-any.whl, its .sha256 and its signature .bundle. Our public release key is at /optimize/aiguard-release.pub.

3. Verify and install

You need Python 3.12 and, for the signature, cosign.

shasum -a 256 -c aiguard_tokenmind-*.whl.sha256
cosign verify-blob --key aiguard-release.pub --bundle aiguard_tokenmind-*.whl.bundle aiguard_tokenmind-*.whl
python3.12 -m venv tokenmind && . tokenmind/bin/activate
pip install aiguard_tokenmind-*.whl

Install it on a machine that can read your logs. It makes no network calls while exporting.

4. Export 7 days of metadata

tokenmind export <format> <file-or-folder> --out grodmir-export.jsonl --local-map routes.csv

--local-map writes a table from route hashes (route-1a2b3c4d) to your own route or project names. Keep it: it lets you read the report; do not send it to us.

Your setupFormatWhere the logs come from
LiteLLM proxy or SDKlitellmLiteLLM's standard logging payload, one JSON object per line, for example from a logging callback that writes to a file or a bucket
OpenTelemetry (GenAI semantic conventions)otelspans with gen_ai.* attributes exported as OTLP JSON, for example the Collector's file exporter
AWS Bedrockbedrock-logsmodel invocation logging to S3; download 7 days with aws s3 cp s3://<bucket>/<prefix>/ ./bedrock-logs --recursive (gzipped files and folders are read directly)
Claude Code on an API keyclaude-code~/.claude/projects on each developer machine

The OpenAI and Anthropic dashboards are not a source: they do not export per-request records. If none of these fits, the paid audit can use the TokenMind proxy running in your own infrastructure (Docker or Helm). We never host your traffic.

5. Upload the file

In your workspace open the Optimize tab and upload grodmir-export.jsonl (or the gzipped .jsonl.gz; up to 64 MB). An owner or administrator of your organisation can upload. The file is checked on upload: anything that is not exactly what the exporter writes is refused. If several people exported, upload one file per machine.

You receive the scan report in the same tab within 2 business days: your spend by route and model, the waste we found with an amount and a confidence for each item, and what we would not recommend. Files and reports are deleted after 30 days, or earlier when you delete them. Only your organisation and the Grodmir operator preparing the report can access them.

6. The paid audit

If the scan shows that an audit pays off, we propose it: 10% of your monthly API spend, minimum $500, individual quote above $100 000 a month. Below about $600 a month of API spend we do not offer it, because it would not pay off. The audit covers 30 days of data, from the exporter or from the TokenMind proxy in your own infrastructure behind Grodmir Guard.

7. Optimize with automatic changes

Instead of making the changes yourself, you can run the TokenMind proxy in your own infrastructure (Docker or Helm, behind Grodmir Guard). Each change from the report becomes a proposal in your TokenMind dashboard: you approve it, and the proxy simulates it on your traffic, checks content changes in shadow (your users always get the original answer) and switches it on. You can roll back any change.

Optimize with automatic changes
Price20% of each change's measured net saving for 12 months from the month it goes live
Monthly cap$149 up to $4 000 of spend, $299 up to $15 000, $1 500 up to $100 000, $5 000 above
No savingno fee: months without a measured saving, without a quality result, or not reconciled with your provider invoice (±2%) are not billed
Afterwardsoptional monitoring at $49 or $99 a month
Billingeach month you upload the statement written by aiguard-tokenmind statement (amounts only) in the Optimize tab; we invoice from it

Questions before you start: reply to us by e-mail.

Optimize pricing

Free preliminary scan: $0. Paid audit: 10% of monthly API spend, minimum $500.

See pricing
Grodmir.