Skip to main content

aitc

AITC — AI Token Counter. A CLI tool for counting tokens in text/files and estimating API costs across popular LLM models. Supports a diff mode comparing two files.

Features

  • Count tokens in inline text, files, or piped stdin
  • Estimate API costs for GPT-4o, GPT-4o mini, Claude Sonnet 4.5, Claude Haiku 4.5, Gemini 1.5 Pro, and Gemini 1.5 Flash
  • Live pricing via OpenRouter API (--live-prices)
  • Diff mode to compare token counts between two files (--diff)

Installation

Via pip

pip install aitc

Via uv

uv tool install aitc

From source

# Clone the repository
git clone https://github.com/arian24b/aitc.git
cd aitc

# Sync dependencies with uv
uv sync

# Run directly
uv run aitc --text "Hello, world!"

# Or install in development mode
uv tool install -e .

Usage

Count tokens from inline text

aitc --text "Your text here"

Count tokens from a file

aitc --file README.md

Pipe text via stdin

echo "Your text here" | aitc
cat somefile.txt | aitc

Compare two files (diff mode)

aitc --diff file1.txt file2.txt

Fetch live pricing

aitc --text "Hello" --live-prices

Development

# Clone
git clone https://github.com/arian24b/aitc.git
cd aitc

# Set up environment with uv
uv sync

# Run linting
uv run ruff check .

# Build
uv build

License

MIT

Metadata

Release files for aitc 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aitc 1.0.0
File Size Uploaded
aitc-1.0.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aitc 1.0.0
File Interpreter ABI Platform
aitc-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / aitc-1.0.0.tar.gz

Download URL aitc-1.0.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
99a043d576179ea564aaa590ea5b76e08af9448375b4823ab41dc0b02995ebce
BLAKE2b-256 checksum
How to use checksums
11e0e6e3eacbac78c44abdb13cedff182c4d40c09d2c0a7adc36a8bdb9ed5004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Release files / aitc-1.0.0-py3-none-any.whl

Download URL aitc-1.0.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d017c850a21ab8441fdc03f8ca0397422e6005a5975a866966149a24f49b780
BLAKE2b-256 checksum
How to use checksums
f2baecb1f24f916070fba50c89f52bc1551dc79037d29f5f4654b601671362fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page