Skip to main content

Artificial Intelligence Usage

artificial-intelligence-usage analyzes local Codex session rollouts and prints a summary of the latest session followed by daily session, turn, token, and rate-limit usage.

Behavior

  • Reads rollout files below ~/.codex/sessions.
  • Shows status details from the most recently modified session.
  • Reports sessions from the last 14 calendar days by default, including today.
  • Counts user turns and cumulative tokens for each session.
  • Shows the remaining five-hour and weekly allowance recorded in each day's last session.
  • Ignores malformed JSON lines and incomplete status events.

The tool only reads local session files and does not modify them.

Requirements

  • Python 3.10 or newer

Building

Testing

Run the unit tests from the project root:

python3 -m unittest discover -s tests -v

Package artifact

Build and validate the package artifacts:

./build-package.sh

This creates the wheel and source distribution under dist/ and checks the package metadata with Twine.

Publish artifact

Publish the generated artifacts to PyPI:

./publish-pypi.sh

The publish script checks that Twine is available, creates a local .venv for Twine when needed, verifies that dist/ contains generated artifacts, and then uploads them. If PyPI rejects a version that was already published, increment the version in pyproject.toml, rebuild, and publish again.

Install artifact

Install the package in a virtual environment:

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install artificial-intelligence-usage

Usage

After installation, run:

artificial-intelligence-usage

Choose a different reporting window with --days:

artificial-intelligence-usage --days 30

From a source checkout, ./artificial-intelligence-usage.py is the canonical launcher and ./script-sessions.py remains available for compatibility.

Help

usage: artificial-intelligence-usage [-h] [--days DAYS]

Analyze recent Codex sessions.

options:
  -h, --help   show this help message and exit
  --days DAYS  number of calendar days to analyze, including today (default: 14)

Metadata

Release files for artificial-intelligence-usage 0.0.3

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

Source distribution (sdist)

Source distribution for artificial-intelligence-usage 0.0.3
File Size Uploaded
artificial_intelligence_usage-0.0.3.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for artificial-intelligence-usage 0.0.3
File Interpreter ABI Platform
artificial_intelligence_usage-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / artificial_intelligence_usage-0.0.3.tar.gz

Download URL artificial_intelligence_usage-0.0.3.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
db9da5dd4397651e6d2490dd659d370730ed1d4b68de3ebbc69133b58859134e
BLAKE2b-256 checksum
How to use checksums
d35803e80060c1d3ec8d807424da2e2c22a8cd00ac681046c7cabe93135d6842
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / artificial_intelligence_usage-0.0.3-py3-none-any.whl

Download URL artificial_intelligence_usage-0.0.3-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
159547186c4194824c94586b11da46a5a2196b0b33dd97de40b951d8711bd2d3
BLAKE2b-256 checksum
How to use checksums
cf6ffec83174566972635e51627c5ddf04f757b7c8025535ad04e57832d2f0cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

0.0.4

2 release files

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

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