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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aitc-1.0.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aitc-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file aitc-1.0.0.tar.gz.

File metadata

  • Download URL: aitc-1.0.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aitc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 99a043d576179ea564aaa590ea5b76e08af9448375b4823ab41dc0b02995ebce
MD5 ffb46dc50497e978f87fc0271fe09e4d
BLAKE2b-256 11e0e6e3eacbac78c44abdb13cedff182c4d40c09d2c0a7adc36a8bdb9ed5004

See more details on using hashes here.

Provenance

The following attestation bundles were made for aitc-1.0.0.tar.gz:

Publisher: release.yml on arian24b/aitc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aitc-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: aitc-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aitc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d017c850a21ab8441fdc03f8ca0397422e6005a5975a866966149a24f49b780
MD5 f6e1cff2aed4f7eac7e4d4ff879af1eb
BLAKE2b-256 f2baecb1f24f916070fba50c89f52bc1551dc79037d29f5f4654b601671362fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for aitc-1.0.0-py3-none-any.whl:

Publisher: release.yml on arian24b/aitc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page