# Chatgpt Login Session

> Log into ChatGPT web for a specific account, complete OpenAI auth and OTP if needed, and persist session.json plus storage_state.json under that account directory for later automation. Use when ChatGPT Pro delegation needs a fresh session, when asked to log in a ChatGPT account, or when saving api/auth/session locally after browser login.

- Skill: `joeeeeey/chatgpt-login-session` (Agent Skill, multi-file: 15 files)
- Install (CLI): `npx skillmds@latest add joeeeeey/chatgpt-login-session`
- Raw SKILL.md: https://api.skillmd.com/api/skills/joeeeeey/chatgpt-login-session/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: joeeeeey (https://skillmd.com/u/joeeeeey)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/joeeeeey/chatgpt-login-session

---


# ChatGPT Login Session

Use `scripts/chatgpt-login-session.ts`.

## Goal

Produce a usable account directory containing:

- `storage_state.json`
- `session.json`

for a specific ChatGPT account.

## Default workflow

1. Resolve credentials for one account.
2. Log into **ChatGPT** web ().
3. Complete OTP if required.
4. Save:
   - `data/accounts/<account>/storage_state.json`
   - `data/accounts/<account>/session.json`
5. Return the saved paths, email, plan, and debug dir.

## Command

```bash
npm run chatgpt-login:session -- \
  --account data/accounts/account-your-email@example.com \
  --otp-provider mail.com \
  --secrets-file /path/to/temp.env \
  --channel chrome \
  --verbose 1
```

## Credentials

Compatible with the existing repo manifest and OTP flow:

- `CHATGPT_EMAIL`
- `MAIL_COM_PASSWORD (if using mail.com)`
- optional `OPENAI_PASSWORD`

If the repo uses encrypted credentials in `secrets/chatgpt/accounts.yaml`, a practical pattern is:

```bash
Create a temporary dotenv file containing CHATGPT_EMAIL and provider-specific secrets, then pass it via --secrets-file.
```

## Notes

- This skill must target `chatgpt.com`, not `chatgpt.com`.
- Prefer visible Chrome for login stability.
- `chatgpt-auth:session` can still be used separately, but this skill should already persist `session.json` after a successful login.
- If session extraction cannot produce `sessionToken + user + account`, treat it as failure.

## Handoff to Pro skill

After this skill succeeds, the resulting account dir can be used directly by:

```bash
npm run chatgpt-pro:submit -- --account account-your-email@example.com --prompt-file /path/to/prompt.md --json
```

