# ChatGPT2API-Pro Hermes Integration — Session 2026-07-04 ## Project State - **Repo:** `nikita4a/chatgpt2api-pro` (fork of `lanqian528/chat2api`) - **Local path:** `C:\Users\User\AppData\Local\hermes\chatgpt2api-pro\` - **Port:** `:5005` - **Token:** K12 account `[REDACTED-NAME]@gmail.com` (planType: k12, workspace) - **PoW:** `POW_DIFFICULTY=000001` (critical fix from `999999`) ## Files Created/Modified - `api/function_calling.py` — prompt-engineering tool use (173 lines) - `api/mcp.py` — JSON-RPC 2.0 MCP endpoint (151 lines) - `api/chat2api.py` — modified pipeline with tool injection - `app.py` — MCP endpoint registration - `.env` — POW_DIFFICULTY=000001, SCHEDULED_REFRESH=true - `READ.md` — documentation ## Hermes Integration Files - `C:\Users\User\.hermes\mcp-servers\chatgpt2api_mcp_bridge.py` — stdio→HTTP MCP bridge - `C:\Users\User\AppData\Local\hermes\config.yaml` — custom_provider `chatgpt-web` + mcp_server `chatgpt2api` ## Models Tested - GPT-4o: ✅ (conversation_id, content) - GPT-5.5: ✅ (thinking:true, response "4" for "2+2=?") - O3-mini: ✅ - O1: ❌ (anti-abuse block on K12) ## POW_DIFFICULTY Debug - `999999` → error "difficulty too high: 07a120" (hex string comparison trap) - `000001` → works (minimal hex, only blocks '000000'/'000001') - Root cause: `ChatService.py:255` — `proofofwork_diff <= pow_difficulty` (lexicographic) ## Port Conflict Debug - PID 36876 held port 5005 after previous crash - `taskkill //F //PID 36876` + `sleep 5` → resolved - Multiple failed starts due to TIME_WAIT ## MCP Bridge Test ```bash echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | \ CHATGPT_TOKEN="" python chatgpt2api_mcp_bridge.py # → {"jsonrpc":"2.0","id":1,"result":{"tools":[...]}} ``` ## Token Expiry Event (2026-07-04 17:00) - Token `[REDACTED-NAME]@gmail.com` K12 revoked with `token_revoked` error - `refresh_all_tokens` useless — only refreshes live tokens, can't recover revoked - Browser tool blocked by Cloudflare challenge on chatgpt.com - Comet CDP not running on :9222 - **Resolution pending**: need user to provide fresh token from live browser session ## Server Start Command ```bash cd "C:/Users/User/AppData/Local/hermes/chatgpt2api-pro" PYTHONPATH="C:/Users/User/AppData/Local/hermes/chatgpt2api-pro;$PYTHONPATH" \ .venv/Scripts/python -u app.py ```