A custom Home Assistant integration (via HACS) that exposes your Codex usage as sensors.
- 5-hour usage and remaining percentage
- Weekly usage and remaining percentage
- Reset time sensors for both windows
- Plan, credits, and limit status sensors
- Browser-based ChatGPT login (device code)
Supported setup modes:
- Sign in with ChatGPT (recommended)
- In the first step, keep
Authentication method = device_code. - Home Assistant shows:
- a browser login URL
- an OTP code
- a required checkbox (
Browser login completed)
- Open the URL, sign in, then return to Home Assistant.
- Tick the checkbox and press submit.
- Tokens are saved in the config entry and refreshed automatically.
- Paste access token manually
- In the first step, select
Authentication method = access_token. - Paste token (optional account ID if needed) and submit.
- Open HACS in Home Assistant.
- Go to
Integrations. - Open menu (
⋮) ->Custom repositories. - Add this repository URL.
- Select category
Integration. - Install Codex Usage.
- Restart Home Assistant.
- Go to
Settings->Devices & Services. - Click
Add Integration. - Search for Codex Usage.
- Complete authentication.
If setup completed correctly, a Codex Usage config entry is created and sensors appear.
After setup, open integration options to change:
Update interval (seconds)
sensor.codex_5h_usedsensor.codex_5h_remainingsensor.codex_5h_resetsensor.codex_weekly_usedsensor.codex_weekly_remainingsensor.codex_weekly_resetsensor.codex_creditssensor.codex_plansensor.codex_limit_status
- This integration relies on internal endpoints and may require updates if upstream APIs change.
- Keep tokens private.
This project is community-maintained and is not an official OpenAI or Home Assistant integration.