Add your description here
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99a043d576179ea564aaa590ea5b76e08af9448375b4823ab41dc0b02995ebce
|
|
| MD5 |
ffb46dc50497e978f87fc0271fe09e4d
|
|
| BLAKE2b-256 |
11e0e6e3eacbac78c44abdb13cedff182c4d40c09d2c0a7adc36a8bdb9ed5004
|
Provenance
The following attestation bundles were made for aitc-1.0.0.tar.gz:
Publisher:
release.yml on arian24b/aitc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aitc-1.0.0.tar.gz -
Subject digest:
99a043d576179ea564aaa590ea5b76e08af9448375b4823ab41dc0b02995ebce - Sigstore transparency entry: 1807995096
- Sigstore integration time:
-
Permalink:
arian24b/aitc@be560b95056d68c750860dbe71e10e08de42f4e2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/arian24b
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@be560b95056d68c750860dbe71e10e08de42f4e2 -
Trigger Event:
workflow_run
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d017c850a21ab8441fdc03f8ca0397422e6005a5975a866966149a24f49b780
|
|
| MD5 |
f6e1cff2aed4f7eac7e4d4ff879af1eb
|
|
| BLAKE2b-256 |
f2baecb1f24f916070fba50c89f52bc1551dc79037d29f5f4654b601671362fc
|
Provenance
The following attestation bundles were made for aitc-1.0.0-py3-none-any.whl:
Publisher:
release.yml on arian24b/aitc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aitc-1.0.0-py3-none-any.whl -
Subject digest:
0d017c850a21ab8441fdc03f8ca0397422e6005a5975a866966149a24f49b780 - Sigstore transparency entry: 1807995111
- Sigstore integration time:
-
Permalink:
arian24b/aitc@be560b95056d68c750860dbe71e10e08de42f4e2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/arian24b
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@be560b95056d68c750860dbe71e10e08de42f4e2 -
Trigger Event:
workflow_run
-
Statement type: