Skip to content

Cannot sign in with BYO api key #12934

Closed as not planned
Closed as not planned

Description

@smileBeda

What version of Codex CLI is running?

codex-cli 0.105.0

What subscription do you have?

PRO

Which model were you using?

gpt-5.3-codex xhigh

What platform is your computer?

Darwin 25.3.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Terminal

What issue are you seeing?

I want to sign in with my own API key.
When I do so I am offered to input my api key I do that and the prompt window opens but when I send prompt then:

■ {
  "error": {
    "message": "The encrypted content gAAA...0A== 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"
  }
}

The most crazy.. this is what it used for that failure:
Token usage: total=235,912 input=201,455 (+ 1,319,424 cached) output=34,457 (reasoning 26,892)

Further - even if the footer says I am on 5.3 codex (it was a resumed session), the model is not actually available from /model selector.

What steps can reproduce the bug?

  • codex
  • option 3 "add your own api key"
  • insert api key
  • hit enter
  • send prompt

What is the expected behavior?

No error and working codex

Additional information

No response

Activity

  1. added
    CLIIssues related to the Codex CLI
    authIssues related to authentication and accounts
    on Feb 26, 2026
  2. github-actions commented on Feb 26, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. smileBeda commented on Feb 26, 2026

    @smileBeda
    Author

    Not a duplicate.
    That ticket is for azure, and the error is intermittent, and the model is not even mentioned missing.

  4. smileBeda commented on Feb 26, 2026

    @smileBeda
    Author

    Further detail:
    The error seems to happen only on /resume'd chat (the actual error)
    The model is not available in any case, even if

    RUST_LOG='codex_api::sse::responses=trace' codex exec --sandbox read-only --model gpt-5.3-codex 'ping' 2>&1 \
        | grep -m1 'SSE event: {"type":"response.created"' \
        | sed 's/^.*SSE event: //' \
        | jq -r '.response.model'
    

    responds with
    gpt-5.3-codex

  5. etraut-openai commented on Feb 27, 2026

    @etraut-openai
    Contributor

    If you create a thread on one account, you cannot resume it using another account. The CoT state is encrypted based on an account-specific key.

  6. smileBeda commented on Feb 27, 2026

    @smileBeda
    Author

    Ok thanks.

    And what about the missing model in the selector?
    Is this being resolved in some or other ticket already?

  7. smileBeda commented on Feb 27, 2026

    @smileBeda
    Author

    I think #12808 solves that.
    Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIauthIssues related to authentication and accountsbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions