You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Codex cannot resume a section after switching login methods (Plus → API Key) #3942
Log back in using an OpenAI API key (different auth method).
Attempt to resume the same section (continue run/stream).
What is the expected behavior?
Section resumes/streams normally after re-authentication, regardless of login method.
What do you see instead?
Streaming fails with HTTP 400 Bad Request and an encryption verification error.
⚠️ stream error: unexpected status 400 Bad Request: {
"error": {
"message": "The encrypted content gAAA...dQ== could not be verified.",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
Additional information
No response
Reacted by darren angle, Igor Armus, Erik Závodský, Bram Hammer, hoz666, Andreu Huguet, wbdb, Daniel Nguyen, drafie, charanduggina and 20 more
I can nonfirm same behavior on:
codex-cli 0.38.0 with WSL(Ubuntu 24.x)
Also i have been using chat gpt plus account with codex-cli and have reached limit. Than I have switched to API key and after trying to resume session i got the same error as damtt.
For me it is switching from API key to chatGPT Plus.
After upgrading to 0.40 I could finally login using chatGPT Plus. Was able to complete a code review without problem. Then this issue happened when asking a follow-up regarding the CR.
I did start with 'codex resume' and picked a session ended few days back.
Suggestion for Plus users:
If your limit is reached while using the Codex extension, you can still continue using the Codex web version without quota issues.
It seems the problem comes from sharing the same conversation between different accounts or between the API and an account. If I start a new session from API key, that won't be a problem. Please fix this. I wanna sharing the same conversation.
@alc1986, I haven't marked this as "fixed". I've closed other bug reports as duplicates of this one.
Codex was not designed to allow switching between model providers or login methods within the same session. Supporting this presents some difficult technical hurdles.
We are considering whether to disallow this completely (that is, emit an error if you attempt to resume a session with a different model, model provider, or login method). Alternatively, we may be able to support this in certain limited situations.
We recommend that you avoid using a session across model providers or login methods. If you switch login methods, start a new session.
Switching from subscription to API always used to work flawlessly. Blocking users from being able to do this doesn't seem like the most sensible fix for the issue. It means that when users hit usage limits they are no longer able to continue working - and spending more money with OpenAI via the API. Instead, it forces them to stop working or switch to Claude or Gemini.
@alc1986, we recently add the ability to purchase more credits for your subscription. You can use these credits to extend your usage without upgrading to a more expensive subscription plan or switching to a different login method. Does that meet your needs?
@etraut-openai Please combine the credits and API topics. It can't be right that you have API credit with OpenAI, that you have credit balance, and both pots expire after 12 months, but you can't use them for similar scenarios. That's just not well thought out.
Alternatively, it should be possible to switch smoothly from login to API method or to activate this fallback automatically.
@alc1986, we recently add the ability to purchase more credits for your subscription. You can use these credits to extend your usage without upgrading to a more expensive subscription plan or switching to a different login method. Does that meet your needs?
@etraut-openai No, unfortunately not. I still have ongoing sessions I paid for using the API, which I am now not able to transfer over to my subscription. Why on earth are you locking people out of their own work? I pay for the usage regardless. This was reported as a bug in December and marked as fixed. It clearly isn't fixed, and now you're saying it's an intended feature. I see no good reason to stop users switching between the API and subscription model at will.
I'm still getting this error with the latest codex-cli0.101.0 when switching from ChatGPT login -> API key auth and then trying to resume a session.
■ Error running remote compact task: {
"error": {
"message": "The encrypted content gAAA...BA== could not be verified. Reason: Encrypted content
organization_id did not match the target organization.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_encrypted_content"
}
}
When I reach the rate limit on my ChatGPT subscription, I use Azure OpenAI API instead.
Although no errors occur, the mutual sessions are not displayed at all via /resume in the first place.
Encrypted content organization_id did not match the target organization.", "type": "invalid_request_error", "param": null, "code": "invalid_encrypted_content"
Activity
xylik commentedon Sep 21, 2025
I can nonfirm same behavior on:
codex-cli 0.38.0 with WSL(Ubuntu 24.x)
Also i have been using chat gpt plus account with codex-cli and have reached limit. Than I have switched to API key and after trying to resume session i got the same error as damtt.
dissorial commentedon Sep 21, 2025
Same exact setup and issue here as @xylik
wbdb commentedon Sep 22, 2025
I can confirm this with Windows 11 Pro / Ubuntu 24 WSL2 and Codex CLI 0.39.0.
tm65 commentedon Sep 24, 2025
For me it is switching from API key to chatGPT Plus.
After upgrading to 0.40 I could finally login using chatGPT Plus. Was able to complete a code review without problem. Then this issue happened when asking a follow-up regarding the CR.
I did start with 'codex resume' and picked a session ended few days back.
Windows 11 Pro / Ubuntu 24 WSL2 / Codex CLI 0.40
charanduggina commentedon Sep 24, 2025
I had the same issue on MacBook Air M1, using the VSCode Codex extension (version 0.4.14).
Initially, I was using GPT Plus.
When the weekly limit was reached, I tried logging in using an API Key and also using a different Plus account.
Both attempts resulted in the same error:
stream error: stream disconnected before completion:
You exceeded your current quota, please check your plan and billing details.
For more information on this error, read the docs:
https://platform.openai.com/docs/guides/error-codes/api-errors
Suggestion for Plus users:
If your limit is reached while using the Codex extension, you can still continue using the Codex web version without quota issues.
Hucent commentedon Sep 26, 2025
It seems the problem comes from sharing the same conversation between different accounts or between the API and an account. If I start a new session from API key, that won't be a problem. Please fix this. I wanna sharing the same conversation.
Hucent commentedon Sep 28, 2025
It works fine on 0.42
paulpv commentedon Oct 9, 2025
I am seeing this problem in 0.45
stef4ik commentedon Oct 10, 2025
Problem still exists in 0.46.0
Nacho-Larreta commentedon Oct 28, 2025
+1 It's really frustrating this issue
RW21 commentedon Oct 28, 2025
It also happens when I switch between API keys.
realtebo commentedon Dec 9, 2025
today happening when switching FROM api key to normal account
30 remaining items
etraut-openai commentedon Jan 18, 2026
@alc1986, I haven't marked this as "fixed". I've closed other bug reports as duplicates of this one.
Codex was not designed to allow switching between model providers or login methods within the same session. Supporting this presents some difficult technical hurdles.
We are considering whether to disallow this completely (that is, emit an error if you attempt to resume a session with a different model, model provider, or login method). Alternatively, we may be able to support this in certain limited situations.
We recommend that you avoid using a session across model providers or login methods. If you switch login methods, start a new session.
alc1986 commentedon Jan 18, 2026
@etraut-openai It has been marked as resolved numerous times:
Switching from subscription to API always used to work flawlessly. Blocking users from being able to do this doesn't seem like the most sensible fix for the issue. It means that when users hit usage limits they are no longer able to continue working - and spending more money with OpenAI via the API. Instead, it forces them to stop working or switch to Claude or Gemini.
etraut-openai commentedon Jan 18, 2026
@alc1986, we recently add the ability to purchase more credits for your subscription. You can use these credits to extend your usage without upgrading to a more expensive subscription plan or switching to a different login method. Does that meet your needs?
wbdb commentedon Jan 18, 2026
@etraut-openai Please combine the credits and API topics. It can't be right that you have API credit with OpenAI, that you have credit balance, and both pots expire after 12 months, but you can't use them for similar scenarios. That's just not well thought out.
Alternatively, it should be possible to switch smoothly from login to API method or to activate this fallback automatically.
alc1986 commentedon Jan 20, 2026
@etraut-openai No, unfortunately not. I still have ongoing sessions I paid for using the API, which I am now not able to transfer over to my subscription. Why on earth are you locking people out of their own work? I pay for the usage regardless. This was reported as a bug in December and marked as fixed. It clearly isn't fixed, and now you're saying it's an intended feature. I see no good reason to stop users switching between the API and subscription model at will.
arjun810 commentedon Jan 22, 2026
I just got the same error when switching from API -> plan.
diogovalada commentedon Jan 31, 2026
What is the status of this?
alc1986 commentedon Feb 1, 2026
It seems to have been silently fixed.
pirate commentedon Feb 12, 2026
I'm still getting this error with the latest
codex-cli0.101.0when switching fromChatGPT login->API key authand then trying to resume a session.nuitsjp commentedon Feb 21, 2026
When I reach the rate limit on my ChatGPT subscription, I use Azure OpenAI API instead.
Although no errors occur, the mutual sessions are not displayed at all via /resume in the first place.
mytradetrust commentedon Mar 12, 2026
Any update on this?
Encrypted content organization_id did not match the target organization.", "type": "invalid_request_error", "param": null, "code": "invalid_encrypted_content"charley-oai commentedon Mar 13, 2026
This should be fixed in the next Responses API deploy! 🎉