Skip to main content
@tensorcost/cli runs on your machine and takes no API key. Use it to price a prompt before you ship it, or to check an invoice against a usage export before you connect anything. It needs Node.js 18 or later.
Both tensorcost and tc work as the command name.

Commands

estimate

Tokens are estimated at one per four characters, which is within about 10 percent for typical English text.

compare

--baseline and --candidate take inline text instead of files. --model is required. --expected-output-tokens and --json work as in estimate.

models

--provider filters; --json prints the whole catalogue; --include-legacy shows deprecated models.

audit

audit makes no network calls and your files go nowhere. It reads provider usage exports (any usage CSV with a cost column, GitHub Copilot, Claude Team and Enterprise, Claude Code, Cursor) and your invoice total, and prints the largest single run and its share of spend, spend with no owner, the price paid against list, the share of spend that carries a project, team or cost-centre tag, and cost per attempt. --invoice takes an amount or a text or CSV file; PDFs are not read, so pass the total. --window 30|90 records the days the export covers and does not filter the file. --json prints the full audit.

Prices

The CLI ships with a small price list and, when online, refreshes it from a public snapshot on console.tensorcost.com, cached for an hour. Set TENSORCOST_OFFLINE=1 to skip the network and use the bundled list. The prices are public list prices, so the CLI shows what a model costs at list, not what your contract charges.