2026-11-27 16:21 UTC

Open-source CLI maps AI-provider bills to FinOps FOCUS

state: expiredheat: lowuncertainty: mediumrelevance: mediumai-billing finops

What is this?

Mandar V. Shinde’s MIT-licensed `ai-bill-to-focus` is a local CLI and browser tool for converting AI-provider billing exports to FinOps FOCUS 1.4 CSV and checking CSVs against selected FOCUS 1.2–1.4 rules. The creator announced it in a Show HN post dated October 31, 2026; the linked GitHub documentation describes the implementation and its limits. Anthropic conversion is reported tested on real Console exports. OpenAI and Together AI support is based on their documented formats and has not yet been tested on real exports. The checker ports rule models from the FinOps Foundation validator, but explicitly does not cover every rule; the project says to use the official validator for certification.

Why it matters

This is a practical bridge between AI API bills and the common billing format already used by major cloud providers, potentially making AI spend easier to analyze alongside infrastructure costs in existing FinOps workflows. Its local operation and CI-compatible checks may help teams integrate cost data without uploading billing files. Impact is currently limited by the small project’s unverified OpenAI and Together AI converters and incomplete validation; this is a useful workflow tool, not evidence of broad adoption or a change in AI economics.

Current assessment

New: Shinde’s open-source tool converts Anthropic, OpenAI and Together AI billing exports into FOCUS 1.4 and can check CSVs against selected FOCUS 1.2–1.4 rules. The project says FOCUS is an open billing schema already exported by AWS, GCP and Azure, while official converters do not yet cover AI providers. The converter produces rows by day, model and token type, preserves provider-reported billed dollars, and handles provider-specific cached-token accounting. For Anthropic, it combines Cost and Usage exports; the creator reports testing this on real Console exports. OpenAI and Together AI implementations are documented but not tested on real files, so their reliability remains uncertain. The checker supports selected rule models ported from the Foundation’s validator; its own example reports 0 errors and warnings, but also says 168 of 398 rules were not checked and recommends the official validator for certification. CLI checks can return a non-zero exit code for CI use. The project says files stay local; Anthropic/OpenAI conversion may fetch a public model-price list, while `--offline` or a supplied price list can avoid that request. The creator also links a browser version. These capabilities could reduce friction in comparing AI API costs with cloud spending, but the supplied evidence establishes a release and documented features, not independent validation, adoption, or production impact.

Measured heat

no measured readings yet — the hourly heat pass fills this in

How the heat travelled

10-30 16:29 (minted)⭐ origin echo-reconstructedThe project provides a local converter and checker for AI-provider billing exports, with provider-specific support and documented limits on
Mandar V. Shinde on github (echo) · attributed from hn.story.50304915 · published time unknown
—
10-30 15:03first on hacker news · published · lag ?Show HN: Convert Anthropic and OpenAI bill exports to FinOps FOCUS (open source)
manvshinde
—
10-30 15:03amplified on hacker news 👑hn.story.50304915
manvshinde
peak 1 · 0 comments · 104% of case engagement
10-30 16:22our radar first saw it · lag ?discovery anchor: hn.story.50304915—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnShow HN: Convert Anthropic and OpenAI bill exports to FinOps FOCUS (open source)
Retrieved article excerpt

Open article · Retrieved 2026-10-30T16:28:34.102486+00:00

# ai-bill-to-focus

Turn AI provider bills into [FinOps FOCUS](https://focus.finops.org) 1.4 CSV, and check any CSV against the FOCUS 1.2, 1.3 or 1.4 rules. Everything runs on your machine; your files are never uploaded.

```
npx ai-bill-to-focus convert cost.csv usage.csv -o focus.csv --check
```

The same converter and checker run in the browser at [cognocient.com/tools/focus-checker](https://www.cognocient.com/tools/focus-checker).

```
Anthropic -> FOCUS 1.4: 5 rows written to focus.csv
  provider total $0.82, FOCUS BilledCost total $0.82
  4 rows with quantities and unit prices (4 at Anthropic's public prices, 0 from its rounded cents), 1 with the provider's dollars only, 0 zero rows skipped

focus.csv (FOCUS 1.4): 5 rows, 40 columns, checked against FOCUS 1.4 (1.4.0.1)
0 errors, 0 warnings; 119 rules passed, 111 not applicable, 168 of 398 not checked here (need the full validator)
```

A few of the columns it writes, one row per day, model and token type:

| SkuMeter | ConsumedQuantity | ListUnitPrice ($/1M) | BilledCost |
| --- | --- | --- | --- |
| Input Tokens | 100000 | 3.00 | 0.30 |
| Cache Write Input Tokens (5 min) | 40000 | 3.75 | 0.15 |
| Cache Read Input Tokens | 200000 | 0.30 | 0.06 |
| Output Tokens | 20000 | 15.00 | 0.30 |
| Web Search |  |  | 0.01 |

## Supported exports

| Provider | Files | Status |
| --- | --- | --- |
| Anthropic | Claude Console **Cost** export (platform.claude.com/cost), plus the **Usage** export (platform.claude.com/usage) for token quantities | Tested on real Console exports |
| OpenAI | Usage → Export → **Cost data** (group by line item, 1-day interval), plus the **Completions** activity export for token quantities | Built from OpenAI's documentation; not yet tested on a real export |
| Together AI | Cost analytics → **Download CSV** | Built from Together AI's documentation; not yet tested on a real export |

Bedrock, Vertex AI, Azure OpenAI and the Gemini API bill through their cloud, and those clouds already export FOCUS. Mistral and Groq offer no usage export for most accounts.

The provider and each file's role are detected from the header rows, so the order of the files doesn't matter. If a file isn't recognised, `ai-bill-to-focus detect <file>` says what it looks like. Please open an issue with the header row (no data) so it can be supported.

## What the output contains

- One FOCUS row per day, model and token type: uncached input, cache writes, cache reads and output each get their own `SkuId`, `SkuMeter` and unit price.
- `BilledCost` is always the provider's own dollar figure.
  - **Anthropic:** with both exports, a token row is priced as tokens × Anthropic's public price (cache writes 1.25× or 2× input). The row keeps that exact figure only when it rounds to the Cost export's cents; otherwise it keeps the provider's rounded dollars. `x_PriceSource` says which.
  - **OpenAI:** `input_tokens` already includes cached tokens, so uncached input is `input_tokens - input_cached_tokens`. Token counts fill `ConsumedQuantity` and derive the unit price, but never change a dollar amount. If a joined count implies a price more than 3× away from OpenAI's public price, the count is dropped.
- Unit prices are written to 12 significant digits and dollar amounts to 10 decimal places, so there is no floating-point noise. The one exception is `ListCost`: it is the exact floating-point product of `ListUnitPrice` and `PricingQuantity` (for example `0.30000000000000004` for 3.0 × 0.1), because the FOCUS validator checks that product with exact equality.
- Provider details that FOCUS has no column for are kept as `x_` columns: workspace, API key, project, line item and so on. `Tags` is a single JSON column, as the spec requires.
- `BillingAccountId` and `BillingAccountName` come from the file when it has them; otherwise set them with `--account-id` and `--account-name`.

## Commands

```
ai-bill-to-focus convert <export.csv>... [-o focus.csv] [--account-id ID] [--account-name NAME]
                                         [--prices prices.json | --offline] [--check]
ai-bill-to-focus check <file.csv> [-v 1.4|1.3|1.2] [-c ai|all|none|LIST] [--json] [--strict]
ai-bill-to-focus check --list-criteria [-v 1.4]
ai-bill-to-focus detect <file.csv>...
```

`check` runs the rule models from the FinOps Foundation's [focus-validator](https://github.com/finopsfoundation/focus-spec-validator) (column presence, types, formats, allowed values and cross-column rules), ported to JavaScript. Rules that need the full validator, such as dynamic rules, are counted and reported, not silently passed. To certify a file, run the official validator as well.

Applicability criteria decide which conditional columns are required. The default, `ai`, declares what a direct AI API bill supports: account naming, tagging, usage measurement, unit pricing and a public price list. Use `--list-criteria` to see the rest.

Exit codes are `0` for OK, `1` for FOCUS errors or a failed conversion, and `2` for bad usage. That makes `check` usable as a CI gate.

## Network use

`convert` for Anthropic and OpenAI downloads the public model price list from `https://api.cognocient.com/api/estimate/models`. The request carries nothing about your files. Use `--offline` to skip it (Anthropic token rows then get unit prices worked out from Anthropic's rounded cents instead of its public prices), or `--prices file.json` to provide your own list in the same format. `check`, `detect` and the Together AI converter make no network requests.

## Development

```
npm install
npm test        # builds, then runs the CLI on the synthetic exports in test/fixtures
```

`src/lib` holds the checker and converters. They are developed alongside the web tool and synced into this repo, so the CLI and the web page give the same answers. The FOCUS rule JSON in `src/lib/rules-*.json` is generated from the focus-spec-validator rule models. Issues and pull requests are welcome; for a new provider, the export's header row and a few anonymised rows are the most useful thing to include.

## License

MIT. The bundled FOCUS rule data comes from the FinOps Foundation's focus-spec-validator (MIT); see THIRD\_PARTY\_NOTICES.md. FOCUS is a trademark of the FinOps Foundation; this project is not affiliated with or endorsed by it.
manvshinde10
🟧 echo.github ⭐The project provides a local converter and checker for AI-provider billing exports, with provider-specific support and documented limits on Mandar V. Shinde——

Interpretation history

Decision trace