openai/codex · error · anyhow::Error

ChatGPT auth not available

Error message

ChatGPT auth not available

What it means

Error "ChatGPT auth not available" thrown in openai/codex.

Source

Thrown at codex-rs/chatgpt/src/chatgpt_client.rs:73

pub(crate) async fn chatgpt_get_request<T: DeserializeOwned>(
    config: &Config,
    path: String,
) -> anyhow::Result<T> {
    chatgpt_get_request_with_timeout(config, path, /*timeout*/ None).await
}

pub(crate) async fn chatgpt_get_request_with_timeout<T: DeserializeOwned>(
    config: &Config,
    path: String,
    timeout: Option<Duration>,
) -> anyhow::Result<T> {
    let chatgpt_base_url = &config.chatgpt_base_url;
    let auth_manager =
        AuthManager::shared_from_config(config, /*enable_codex_api_key_env*/ false).await?;
    let auth = auth_manager
        .auth()
        .await
        .ok_or_else(|| anyhow::anyhow!("ChatGPT auth not available"))?;
    anyhow::ensure!(
        auth.uses_codex_backend(),
        "ChatGPT backend requests require Codex backend auth"
    );
    anyhow::ensure!(
        auth.get_account_id().is_some(),
        "ChatGPT account ID not available, please re-run `codex login`"
    );

    let url = format!(
        "{}/{}",
        chatgpt_base_url.trim_end_matches('/'),
        path.trim_start_matches('/')
    );

    let http_client_factory = config.http_client_factory();
    let client = if http_client_factory.has_chatgpt_cookies() {
        psp_chatgpt_client(http_client_factory)

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/chatgpt/src/chatgpt_client.rs:73 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/a0b7bb0318ceedda. Report an issue: GitHub.