Provider & subscription
panto-codex
Codex subscription defaults for panto. Mark named tables; the extension fills the boilerplate.
Setup
Requires panto's configure(config) extension hook (before auth/provider validation).
[extensions]
rocks = ["panto-codex"]
[auth.codex]
panto_codex_extension = true
[providers.codex]
auth = "codex"
panto_codex_extension = truepanto auth login codex
panto models sync
panto models list codex:Defaults
| Setting | Value |
|---|---|
| Auth | Codex device OAuth; credentials and refresh stay in panto |
| Provider | Responses API with the Codex dialect; openai model catalog |
| Endpoint | https://chatgpt.com/backend-api/codex |
| Headers | OpenAI-Beta: responses=experimental, originator: codex_cli_rs, session-id: ${session:id} |
Rules
- Only
panto_codex_extension = trueopts in; auth/provider names are arbitrary. - Keep
providers.<name>.authexplicit; the extension never guesses linkage. - Explicit values win, including nested endpoints and case-insensitive headers.
- Defaults are independent per table and per load; no config files are rewritten.
- Credentials stay native; env and session placeholders stay raw for panto, which expands
${session:id}to the conversation's stable session ID. - Rigs inherit user connection settings after this hook runs, so they need not include this extension unless their own config uses its markers.
--no-extensionsskips the hook.
Flat and endpoint-table provider configurations are supported. Overrides must remain valid panto configuration.
Quota footer
Quota polling requires panto's http_request API and the render_footer event. It runs only when this extension is permitted and at least one marked auth or provider subscription is configured.
- It queries every distinct named auth, not only the current model.
- Polls start at
session_ready, repeat about every 60 seconds whenluvis available, and are throttled after turns. - Failed snapshots are retained and marked stale, with bounded retry backoff.
- Session end cancels the timer and any in-flight request.
- One shared logical usage row wraps to the terminal width.
The monitor uses Codex's internal https://chatgpt.com/backend-api/wham/usage endpoint, which is undocumented and subject to change. It calls through panto's named-auth HTTP API with the configured OAuth access token; panto derives ChatGPT-Account-Id from the auth account claim. It never logs in interactively and never reads token files.
The footer uses lowercase provider and window labels, highlighted headings, and green/yellow/red percentages at 33% and 66%:
codex 5h 42% reset in 2h 14m 7d 18% reset in 3d 4hA shared, unreferenced minute timer keeps countdowns current while idle; it does not fetch usage. Claude stays absent until its model is first used.
Packaging / checks
panto lua _selfcheck.lua
panto lua _footer-selfcheck.lua
luarocks lint panto-codex-0.2.0-1.rockspecThe rockspec maps require("panto-codex") to init.lua, the quota poller and shared footer helper to their modules; no dependencies beyond Lua.