Proxy Codex model discovery through CodeRouter
Merged
LA
3mo ago+121+121+012345678901234567890123456789-0-0-0123456789
Summary
- add authenticated
/v1/modelssupport for Codex model discovery - forward through the selected Stack-vault account
- preserve account cooldown/failover behavior
- prevent Codex startup from logging a Next.js HTML 404
Test plan
- focused CodeRouter suite: 12 passed
bun run typecheck
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Expose an authenticated /v1/models endpoint in CodeRouter that proxies Codex model discovery through the selected vault-backed Codex account. Preserves cooldown/failover behavior and stops the Codex startup 404 log.
-
New Features
- Proxies to https://chatgpt.com/backend-api/codex/models, forwarding query params and using the account’s
accessToken. - Retries on 429s and marks account cooldown before failing over to the next account.
- Adds a focused test for the models proxy.
- Proxies to https://chatgpt.com/backend-api/codex/models, forwarding query params and using the account’s
-
Bug Fixes
- Serve the models route dynamically to prevent a Next.js HTML 404 during Codex startup.