APIMaster.ai

Codex Desktop + APIMaster.ai

Switch Codex Desktop between official subscription and APIMaster.ai with codex-provider-switcher while keeping project history.

Codex Desktop is OpenAI’s desktop coding agent. The official ChatGPT subscription works well until you hit the rolling 5-hour usage limit. During that window you can continue in the same project threads using an APIMaster.ai OpenAI-compatible API key.

Manually editing ~/.codex/config.toml often hides project sidebar history. codex-provider-switcher switches provider mode and syncs conversation metadata locally.

This guide is for Codex Desktop, not Codex CLI. Follow Codex Desktop, OpenAI, and APIMaster.ai terms of use.


When to use this

  • Official subscription shows You're out of Codex messages or Usage remaining near 0% with Resets every 5 hours.
  • You want to keep working without losing project chat history.
  • When the limit resets, switch back to official with history synced.

Rate limit banner


APIMaster.ai

Item Value
Base URL https://apimaster.ai/v1
API Key Console
Models Marketplace or GET /v1/models

No pricing or model guarantees in this doc.


What the tool does

Repo: github.com/RomaCredit/codex-provider-switcher

  • Updates local Codex config (config.toml, auth.json, SQLite, session metadata)
  • Saves APIMaster and official profiles
  • Backs up before changes under ~/.codex/provider-switcher
  • No upload, no deletion of conversation content

Codex home: ~/.codex/ (macOS) or %USERPROFILE%\.codex\ (Windows).


Windows

  1. Quit Codex Desktop completely.
  2. Double-click codex-provider-menu.bat.
  3. Choose 1 (APIMaster) or 2 (official). Enter API key on first APIMaster switch.
  4. Reopen Codex Desktop — expect Logged in with API key, apimaster provider, and your project threads still visible (e.g. Update APIMaster.ai tagline).

APIMaster mode with history synced

Menu

If sidebar history is wrong: option 6. Repair Desktop history list.

PowerShell:

.\switch-codex-provider.ps1 status
.\switch-codex-provider.ps1 apimaster
.\switch-codex-provider.ps1 official
.\switch-codex-provider.ps1 repair-history

macOS

chmod +x ./codex-provider-menu.command
./codex-provider-menu.command

Or:

python3 codex_provider_switcher.py apimaster
python3 codex_provider_switcher.py official
python3 codex_provider_switcher.py repair-history

Default path: ~/.codex/. After reopening, verify the same as Windows step 4 (see screenshot above).


Security

  • Keys and backups stay on your machine only.
  • Do not paste .codex folders into public issues.
  • Quit Codex Desktop before switching.

FAQ (short)

Question Answer
History preserved? Session files remain; tool syncs metadata for sidebar display.
Switch back to official? Yes — menu 2 or official.
Key location? Local ~/.codex/auth.json and tool profiles.
Deletes chats? No.

Related