# 코덱스 로그인 오류: Codex refresh token was already used 뜻과 해결

> 코덱스(Codex) 로그인 오류로, 로그인 토큰을 갱신하지 못했다는 뜻입니다. codex logout 뒤 codex login으로 다시 로그인합니다. 같은 auth.json을 여러 곳에서 쓰면 다시 뜰 수 있습니다.

- URL: https://retn.me/posts/codex-refresh-token-already-used/
- Published: 2026-11-17
- Written by: Claude Code · Reviewed by: 심규섭 (2026-11-17)
- Tool: Codex · Cause: 로그인·인증
- Last checked: 2026-11-17

## 메시지 원문

- en: `Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.`

---

## 한 줄 답

Codex가 ChatGPT 로그인 토큰을 새로 받지 못했다는 뜻입니다. 이미 쓴 갱신 토큰(refresh token)으로 다시 갱신을 시도했기 때문입니다. `codex logout`으로 로그아웃한 뒤 `codex login`으로 다시 로그인하면 됩니다.

## 이 메시지가 뜨는 이유

ChatGPT 계정으로 로그인하면 Codex는 로그인 정보를 `~/.codex/auth.json`이나 운영체제의 자격 증명 저장소에 둡니다. 토큰이 만료되기 전에 Codex가 스스로 갱신합니다. 그래서 보통은 브라우저 로그인을 다시 하지 않아도 됩니다([Codex Authentication 문서](https://learn.chatgpt.com/docs/auth)).

갱신이 거절되면 Codex는 서버가 보낸 오류 코드로 메시지를 고릅니다. 오류 코드가 `refresh_token_reused`이면 이 메시지가 뜹니다([manager.rs, rust-v0.169.0](https://github.com/openai/codex/blob/rust-v0.169.0/codex-rs/login/src/auth/manager.rs)). 같은 소스에는 이웃 메시지도 있습니다.

| 서버 오류 코드 | Codex 메시지 ([출처](https://github.com/openai/codex/blob/rust-v0.169.0/codex-rs/login/src/auth/manager.rs)) |
|---|---|
| `refresh_token_reused` | `… because your refresh token was already used. Please log out and sign in again.` |
| `refresh_token_expired` | `… because your refresh token has expired. Please log out and sign in again.` |
| `refresh_token_invalidated` | `… because your refresh token was revoked. Please log out and sign in again.` |
| 그 밖의 코드 | `Your access token could not be refreshed. Please log out and sign in again.` |

OpenAI의 CI/CD 인증 문서는 같은 `auth.json`을 여러 기기나 동시에 도는 작업에 나눠 쓰지 말라고 씁니다. 다른 기기나 동시 작업이 토큰을 먼저 바꾸면 남은 사본은 갱신하지 못한다고 씁니다([Maintain Codex account auth in CI/CD](https://learn.chatgpt.com/docs/auth/ci-cd-auth)). 이 문서는 메시지 문구를 직접 언급하지 않습니다. 이 경우가 "already used" 메시지로 이어진다는 연결은 추정입니다.

## 해결 순서

1. `codex login status`로 지금 쓰는 인증 방식을 확인합니다([Codex Authentication 문서](https://learn.chatgpt.com/docs/auth)).
2. `codex logout`을 실행해 저장된 로그인 정보를 지웁니다. IDE 확장이나 데스크톱 앱이라면 프로필 메뉴에서 `Log out`을 고릅니다([Codex Authentication 문서](https://learn.chatgpt.com/docs/auth)).
3. `codex login`을 실행하고 브라우저에서 다시 로그인합니다. CLI와 IDE 확장은 같은 로그인 정보를 함께 씁니다. 한쪽에서 로그아웃하면 다른 쪽도 다시 로그인해야 합니다([Codex Authentication 문서](https://learn.chatgpt.com/docs/auth)).
4. `auth.json`을 다른 컴퓨터, 컨테이너나 CI 러너에 복사해 썼다면 사본마다 따로 갱신하지 않게 합니다. 문서는 러너 하나나 순서대로 도는 작업 하나에 `auth.json` 하나를 쓰라고 씁니다. 갱신된 파일을 처음 사본으로 덮어쓰지 말라고도 씁니다([Maintain Codex account auth in CI/CD](https://learn.chatgpt.com/docs/auth/ci-cd-auth)).
5. CI 러너에서 이 메시지가 뜨면, 브라우저 로그인이 되는 믿을 수 있는 컴퓨터에서 `codex login`을 다시 합니다. 새 `auth.json`으로 저장된 사본을 바꿉니다([Maintain Codex account auth in CI/CD](https://learn.chatgpt.com/docs/auth/ci-cd-auth)).
6. 자동화라면 API 키 로그인을 검토합니다. OpenAI 문서는 CI/CD 작업에 API 키를 기본으로 권합니다([Maintain Codex account auth in CI/CD](https://learn.chatgpt.com/docs/auth/ci-cd-auth)).

`auth.json`에는 접근 토큰이 들어 있습니다. 문서는 이 파일을 비밀번호처럼 다루라고 씁니다. 저장소에 올리거나 채팅·티켓에 붙여 넣지 않습니다([Maintain Codex account auth in CI/CD](https://learn.chatgpt.com/docs/auth/ci-cd-auth)).

## 관련 한도와 요금제

API 키로 로그인하면 사용료는 OpenAI Platform 계정에 표준 API 요금으로 나갑니다. API 키 인증은 로컬 Codex 작업을 지원합니다. ChatGPT 워크스페이스나 클라우드 서비스에 기대는 일부 기능은 제한되거나 쓸 수 없습니다([Codex Authentication 문서](https://learn.chatgpt.com/docs/auth)).

## 출처

- [Codex Authentication (ChatGPT Learn)](https://learn.chatgpt.com/docs/auth)
- [Maintain Codex account auth in CI/CD (ChatGPT Learn)](https://learn.chatgpt.com/docs/auth/ci-cd-auth)
- [Codex rust-v0.169.0 manager.rs (메시지 문구와 분류)](https://github.com/openai/codex/blob/rust-v0.169.0/codex-rs/login/src/auth/manager.rs)
