Switching Between Your Personal ChatGPT Account and Amazon Bedrock A developer built an open-source account switcher, techwithmatheus/codex-account-switcher, that lets users toggle the ChatGPT desktop app between a personal ChatGPT account and Amazon Bedrock by swapping only the Bedrock-specific model-provider configuration in ~/.codex/config.toml. The tool ships with an installer, uninstaller and two commands, codex-personal and codex-bedrock, and preserves shared Codex local state — sessions, thread history, files and personal authentication — rather than maintaining two separate Codex homes. The author verified the behavior on macOS with the ChatGPT desktop app. In the previous post in this series https://dev.to/aws/how-to-set-up-the-chatgpt-desktop-app-with-amazon-bedrock-ggp , I walked through how to configure the ChatGPT desktop app to use OpenAI models through Amazon Bedrock. That works great if Bedrock is the only environment you want to use. But what if you want to use both your personal ChatGPT account and Amazon Bedrock? That's when it gets awkward. I found that out the hard way after setting up my Bedrock configuration, because my intention was always to keep using my personal ChatGPT account as well and switch between the two on demand to help me manage my token limits. I also didn't want two completely separate Codex environments. I wanted to keep the same local conversations, files and working state, and simply change which provider was handling the model requests. So I built a small account switcher to make that easier. If you just want the solution, you can grab it here: techwithmatheus/codex-account-switcher It includes an installer, uninstaller and two simple commands: codex-personal codex-bedrock If you'd rather understand what it's doing before installing it, keep reading. That's what the rest of this post is about. When you're using the normal ChatGPT experience, switching accounts is something you generally think about at the application level. Bedrock is different. In the setup from the previous post, Codex is configured locally with something like: model = "openai.gpt-6-astra" model provider = "amazon-bedrock" model providers.amazon-bedrock.aws profile = "codex-bedrock" region = "us-west-2" wire api = "responses" That tells Codex to send model requests through Amazon Bedrock using the AWS profile and Region you've configured. So Bedrock isn't another ChatGPT account that can simply appear in the normal account switcher. It's a different model-provider configuration. My first thought was therefore to maintain two separate Codex environments: one for my personal account and another for Bedrock. That would work, but there's a downside. Codex stores its local state under: ~/.codex And there's considerably more in there than config.toml . On my machine, that directory contains authentication state, sessions, thread history, memories, plugins, skills, model caches, trusted-project settings and several local databases used by the desktop experience. If I gave my personal and Bedrock setups completely separate Codex homes, I would also be separating much of that useful state. That wasn't really what I wanted. My use case was closer to this: same Codex workspace same conversations same local state different model provider So I tried something simpler. I completely quit the ChatGPT app, removed only the Bedrock-specific configuration from ~/.codex/config.toml , and launched it again. The desktop app returned to my personal ChatGPT-backed Codex environment. More importantly, a test conversation that I had originally created while using Bedrock was still there. It contained a small .NET console application, and I could still open the generated files in the desktop preview. I then quit the app, restored the Bedrock configuration and launched it again. The same conversation and files were still there. So that's the model we'll use here: keep the Codex state shared and switch only the part of the configuration that selects Amazon Bedrock. There was another nice surprise when I later tested the full uninstall flow. When I switched back to my personal ChatGPT environment, I expected to have to sign in again. I didn't. My existing personal authentication was still part of the shared Codex state. Bedrock had changed which provider handled the model requests, but it hadn't logged me out of my personal ChatGPT account. This is behaviour I've personally verified on macOS with the ChatGPT desktop app. I haven't tested every piece of desktop state, so I'm deliberately not claiming that every feature behaves identically across providers. Before changing anything, make a backup of your existing Codex configuration. I like using the date and time in the filename so old backups remain meaningful: cp ~/.codex/config.toml ~/.codex/config.toml.backup.$ date +%F-%H%M%S I'd also back up your .zshrc , since the installer will add a small block to it: cp ~/.zshrc ~/.zshrc.backup.$ date +%F-%H%M%S You don't need to copy the whole ~/.codex directory for this. The switcher doesn't touch your sessions, memories, authentication databases or other Codex state. We'll also make the switcher maintain a rolling safety backup before it modifies config.toml , but that's different from this manual checkpoint. I've put the maintained version of the switcher on GitHub: Clone the repository: git clone https://github.com/techwithmatheus/codex-account-switcher.git cd codex-account-switcher Then run the installer: bash install.sh I'm deliberately using bash install.sh rather than ./install.sh . That means you don't have to change executable permissions on the downloaded script first. The installer puts the switcher under: ~/.config/codex-switcher/ ├── codex-switcher.zsh └── config and adds a small marked block to ~/.zshrc so zsh loads it whenever you open a shell. The actual switching code lives in its own file rather than dumping a large shell function directly into your .zshrc . That makes it much easier to inspect, maintain or replace later. After installation, reload your shell: source ~/.zshrc The switcher's Bedrock-specific settings live in: ~/.config/codex-switcher/config The defaults used throughout this series are: CODEX BEDROCK MODEL="openai.gpt-6-astra" CODEX BEDROCK PROFILE="codex-bedrock" CODEX BEDROCK REGION="us-west-2" If you used different values when configuring Bedrock, update them there. For example, if your AWS profile is called work-bedrock : CODEX BEDROCK PROFILE="work-bedrock" The model and Region should likewise match the Bedrock setup you've already verified. If you've just followed the first article, you may already have Amazon Bedrock active when you install the switcher. The installer handles that case too. If it finds the standard Bedrock configuration already active, it shows the values it discovered: Existing Amazon Bedrock configuration found. Model: openai.gpt-6-astra AWS profile: codex-bedrock Region: us-west-2 These provider settings will be adopted by the switcher and will not be replaced. Continue? Y/n It then adopts the existing settings rather than creating a duplicate Bedrock provider configuration. If you're starting from your normal personal ChatGPT environment instead, your current Codex configuration is left alone and the switcher starts from there. When Bedrock is active, the tool owns one clearly marked block inside ~/.codex/config.toml : codex-bedrock-switcher model = "openai.gpt-6-astra" model provider = "amazon-bedrock" model providers.amazon-bedrock.aws profile = "codex-bedrock" region = "us-west-2" wire api = "responses" <<< codex-bedrock-switcher <<< The values come from the separate switcher configuration file we just looked at. Everything outside those markers belongs to Codex, or to you, and the switcher leaves it alone. That's important because the desktop-generated config.toml can contain much more than provider configuration: desktop preferences, plugins, MCP servers, trusted projects and other settings may all live in the same file. Replacing the entire file whenever you switch would be unnecessarily risky. Before each automated change, the current configuration is also copied to: ~/.codex/config.toml.switcher-backup That's a rolling safety backup. It contains the state immediately before the most recent switch and is intentionally overwritten on later switches. Once everything is installed and your configuration looks right, run: codex-bedrock The switcher will: config.toml ; The rest of your Codex state remains where it was. To go back: codex-personal The switcher removes only the Bedrock block it owns. It does not insert some handcrafted OpenAI provider configuration in its place. That's deliberate. During testing, removing the Bedrock override was enough for the desktop app to return naturally to my personal ChatGPT-backed environment using its existing authentication and defaults. So rather than trying to reproduce configuration that Codex already knows how to manage, the switcher simply gets out of the way. In my tests, I didn't need to authenticate again either. My personal ChatGPT login was still available because we had never replaced or deleted the shared Codex authentication state. I didn't want the switcher modifying config.toml underneath a running desktop application. So if ChatGPT is still open when you run either command, you'll get: Answer y and the switcher asks macOS to quit ChatGPT normally, waits until the application has exited, performs the switch and launches it again. Anything else cancels the operation. The important part here is that it uses the application's normal quit behaviour rather than abruptly killing the process. If you already know you want it to close ChatGPT, use -f or --force : codex-bedrock -f or: codex-personal --force That closes the app automatically and continues with the switch. This was the part I cared about most. I created a test conversation while Codex was configured through Amazon Bedrock. In that conversation I had it create a small .NET console application that displayed the date. I then switched the desktop app back to my personal ChatGPT environment. The conversation was still in the app. I could open it and inspect the generated files in the preview panel. I switched back to Bedrock and it remained there as well. So at least for the local conversation and generated-file workflow I tested, this gives me what I wanted: Personal ChatGPT │ ▼ same local Codex workspace ▲ │ Amazon Bedrock The conversations aren't being recreated each time you switch providers. We're keeping the same local Codex state and changing which provider handles model requests. That doesn't mean the underlying services suddenly share billing, authentication or infrastructure. They don't. What we're preserving is the local working environment around them. Codex can contain definitions for multiple model providers in the same configuration, and the switcher leaves unrelated provider definitions alone. However, this utility is not intended to be a universal provider manager . It specifically manages: Personal ChatGPT / OpenAI ⇅ Amazon Bedrock If you also use another custom provider, you can continue switching to it using whatever method you already use. There is one important behaviour to understand. Running: codex-bedrock deliberately makes Bedrock active. codex-personal removes the Bedrock override and returns Codex to its normal personal ChatGPT/OpenAI behaviour. It does not remember that you previously happened to be using some third provider and restore that provider instead. Because of that, if the automatic installer finds an unrelated custom provider currently active, it stops instead of trying to guess what your configuration means. You can still install the switcher manually alongside a more complex provider setup. The repository README contains the manual installation steps. And if there's another provider you'd like the switcher to support directly, feel free to open an issue https://github.com/techwithmatheus/codex-account-switcher/issues . Pull requests are welcome too. Run: bash uninstall.sh The slightly interesting part of uninstalling isn't removing the shell files. It's deciding which provider should remain configured afterward. The uninstaller therefore asks: Removing the switcher means ChatGPT will be left configured for a single provider. Which provider would you like to keep? 1 Personal ChatGPT / OpenAI 2 Amazon Bedrock 3 Cancel If you choose Personal ChatGPT / OpenAI , the switcher-managed Bedrock block is removed. If you choose Amazon Bedrock , the Bedrock settings stay in config.toml , but the switcher's marker comments are removed. What remains is simply a normal Codex Bedrock configuration like the one from the first article. And if you choose Cancel , nothing changes. One thing the uninstaller deliberately does not do is restore some snapshot of config.toml from the day you installed the switcher. Your Codex configuration may have legitimately evolved since then with new desktop settings, project permissions, plugins or other configuration. Restoring an old snapshot could wipe changes that have nothing to do with this tool. ~/.config ? You'll notice the utility lives under: ~/.config/codex-switcher/ rather than inside the Codex directory itself. ~/.config is a common convention in Unix-style command-line environments for user-specific configuration. macOS doesn't guarantee that the directory already exists, so the installer creates it when necessary. I also deliberately keep the utility outside ~/.codex . The switcher isn't part of Codex. It's a small shell tool that modifies one well-defined part of Codex configuration, and keeping its own code and settings separate makes that boundary clearer. There's one distinction worth finishing on. This doesn't turn Amazon Bedrock into another ChatGPT account. Your personal ChatGPT environment and your Bedrock environment are still separate in the ways that matter: authentication, billing and the infrastructure processing the model requests are different. What we've done is take advantage of the fact that Codex's local workspace doesn't need to be discarded just because the active model provider changes. For my workflow, that's considerably more useful than maintaining two completely isolated desktop environments. I can keep working in the same Codex setup and choose whether the next part of that work should run through my personal ChatGPT environment or through Amazon Bedrock. Until the desktop app has a first-class way to handle that scenario, two shell commands are doing the job nicely. The switcher, installer and uninstaller used in this article are available here: The repository also contains manual installation instructions, configuration details and notes for people already using other custom providers. If Codex changes in a way that affects the switching mechanism, I'll maintain the implementation there rather than expecting readers to keep copying an old shell snippet.