Logo Chatgpt Chat Export

Chatgpt Chat Export

Cộng đồng
vicnaum
chatgpt-chat-export

Export a chatgpt.com (ChatGPT web) conversation to disk with full fidelity: raw backend-api JSON, all attachments (user-uploaded images, PDFs), and a readable Markdown transcript. Use when the user wants to: (1) grab/download/archive a ChatGPT talk locally, (2) pull a chatgpt.com conversation's JSON via the API route, (3) download the images/PDFs attached to a ChatGPT chat, (4) convert a ChatGPT conversation to Markdown, or (5) feed a ChatGPT conversation into another tool/agent. Triggers on chatgpt.com URLs (/c/<uuid>), 'grab this talk', 'export this ChatGPT chat', 'ChatGPT conversation JSON', or ChatGPT attachment downloads.

Add to TypingMind

Tổng quan

Nhà phát hànhvicnaum
Kho mãvics-agent-skills
Tên kỹ năngchatgpt-chat-export
Sao
53
Bản fork
5
Tệp đi kèm
3
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 3 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được vicnaum công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Chatgpt Chat Export trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/vicnaum/vics-agent-skills/tree/main/skills/chatgpt-chat-export
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/vicnaum/vics-agent-skills.git /tmp/vics-agent-skills
mkdir -p .claude/skills
cp -r /tmp/vics-agent-skills/skills/chatgpt-chat-export .claude/skills/chatgpt-chat-export
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Chatgpt Chat Export trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Chatgpt Chat Export ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Chatgpt Chat Export với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

chatgpt-chat-export

ChatGPT's web UI has no full-fidelity export (Settings → Export mails a zip of everything, hours later). But the page itself talks to /backend-api/conversation/{id}, which returns the complete conversation as JSON — including edit branches, tool calls, reasoning scaffolding, and attachment references. This skill grabs that JSON plus every attachment from an authenticated Chrome session, and converts it to Markdown.

Output convention (one folder per conversation, named by UUID):

<project>/chat-exports/<conversation-uuid>/
├── conversation.json   ← raw /backend-api/conversation response, full fidelity
├── conversation.md     ← readable transcript (chatgpt2md.py)
├── FILES.md            ← attachment index: file id → name → local path
└── files/              ← binaries, by original filename

Workflow

Four stages: grab JSON → grab attachments → organize → convert. Two transport paths for the "grab" stages, depending on who drives the browser:

  • DevTools console (user runs snippets manually): Blob + <a download> clicks land in ~/Downloads. Simple, but Chrome blocks the 2nd+ programmatic download per tab — use a fresh tab per download, or bundle everything into one zip.
  • claude-in-chrome MCP (agent drives): a.click() downloads don't land on disk, javascript_tool results truncate at ~1000 chars, and the extension's DLP filter replaces JWT-shaped / base64 / query-string / long-uniform output with [BLOCKED: …]. Transport out via clipboard (primary — needs no network) or the bundled scripts/relay_server.py (blocked by uBlock's LAN-protection on some setups; see below).

Iron rule for the MCP path: never return the access token or a payload from javascript_tool. Stash everything in window.* and return only metadata (status, length, count).

1. Grab the conversation JSON

Conversation UUID comes from the URL: chatgpt.com/c/<uuid>. Open that page (logged in), then:

js
// In-page: token + conversation -> window.__conv. Returns only metadata.
const sess = await fetch('/api/auth/session').then(r => r.json());
window.__tok = sess.accessToken;
const CONV = '<conversation-uuid>';
window.__conv = await fetch('/backend-api/conversation/' + CONV,
  {headers: {Authorization: 'Bearer ' + window.__tok}}).then(r => r.json());
JSON.stringify({title: window.__conv.title, nodes: Object.keys(window.__conv.mapping || {}).length});

Transport — clipboard (MCP path). navigator.clipboard.writeText requires document focus and a user gesture, which javascript_tool doesn't have. Inject a full-page button and click it with the computer tool:

js
document.body.innerHTML = '<button id="copybtn" style="position:fixed;inset:0;width:100vw;height:100vh;font-size:40px">COPY</button><div id="st" style="position:fixed;bottom:0;left:0;background:#000;color:#0f0;padding:8px;z-index:9">waiting</div>';
window.__payload = JSON.stringify(window.__conv);
document.getElementById('copybtn').addEventListener('click', async () => {
  try { await navigator.clipboard.writeText(window.__payload);
        document.getElementById('st').textContent = 'COPIED ' + window.__payload.length; }
  catch (e) { document.getElementById('st').textContent = 'ERR ' + e.message; }
});
'ready';

Then: computer left_click anywhere on the page → verify via document.getElementById('st').textContent → on the shell side:

bash
pbpaste > chat-exports/<uuid>/conversation.json
python3 -c "import json; d=json.load(open('chat-exports/<uuid>/conversation.json')); print(d['title'], len(d['mapping']))"

Clipboard handles ~10 MB fine. Clear it afterwards (printf '' | pbcopy) — and warn the user their clipboard was overwritten.

Transport — console download (manual path):

js
const blob = new Blob([JSON.stringify(window.__conv)], {type: 'application/json'});
const a = document.createElement('a'); a.href = URL.createObjectURL(blob);
a.download = 'conversation.json'; a.click();

2. Grab the attachments

Attachment references live in two places in the JSON:

  • mapping[*].message.metadata.attachments[] → {id, name, mime_type, size} (user uploads: images, PDFs)
  • image parts' content.parts[*].asset_pointer → sediment://file_… (same files, by pointer)

Resolve each id to a download URL in-page:

GET /backend-api/conversation/{conv-id}/attachment/{file-id}/download   (Bearer auth)
→ {download_url, file_name, mime_type, file_size_bytes}

The download_url is NOT a signed CDN link — it's chatgpt.com/backend-api/estuary/content?id=…, which needs the browser's auth. curl from outside fails (exit 56). So fetch the bytes in-page and bundle them:

js
// window.__files = [{id, name}] built from window.__conv (dedupe by id first)
const toB64 = (blob) => new Promise((res, rej) => {
  const fr = new FileReader();
  fr.onload = () => res(fr.result.split(',')[1]); fr.onerror = rej;
  fr.readAsDataURL(blob);
});
const CONV = '<conversation-uuid>';
const bundle = {};
for (const f of window.__files) {
  const meta = await fetch('/backend-api/conversation/' + CONV + '/attachment/' + f.id + '/download',
    {headers: {Authorization: 'Bearer ' + window.__tok}}).then(r => r.json());
  const blob = await fetch(meta.download_url, {headers: {Authorization: 'Bearer ' + window.__tok}}).then(r => r.blob());
  bundle[f.name || f.id] = await toB64(blob);
}
window.__payload = JSON.stringify(bundle);
'bundled ' + Object.keys(bundle).length + ' files, ' + window.__payload.length + ' chars';

Then reuse the same copy button (it copies window.__payload), click, and unpack:

bash
python3 <skill-dir>/scripts/unpack_clipboard.py chat-exports/<uuid>/files/

On the manual console path, zip the bundle client-side instead (JSZip from CDN, one <a download> click for the whole zip — sidesteps the multi-download block; see the sibling claude-desktop-chat-export skill for the JSZip snippet).

Known 403: PDF page-preview pointers of the form sediment://<hash>#file_…#p_N.jpg (tool-rendered page images) are not downloadable — skip them; the source PDF itself downloads fine via its plain file_… id.

3. Convert to Markdown

bash
python3 <skill-dir>/scripts/chatgpt2md.py chat-exports/<uuid>/conversation.json
# → conversation.md + FILES.md next to the JSON; images/PDFs linked into files/

The converter walks the canonical branch only (current_node → .parent → root — the mapping is a tree with edit branches, not a list), keeps only visible turns (user × text|multimodal_text, assistant × text with recipient == 'all'), and drops internal scaffolding (thoughts, code/web.run tool calls, reasoning_recap, hidden system messages). ChatGPT embeds citation markers as private-use-area Unicode (… around citeturn0search1-style tokens) — these are stripped, as are leftover products{…} carousel blobs. Flags: --user-name, --files-dir, --out, --no-files-md.

Note: the generic ai-conversation-extractor skill does not handle this mapping-tree format — use this converter for chatgpt.com JSON.

Gotchas (hard-won)

  • MCP output filter: results truncate ~1000 chars; JWT/base64/query-string/long-uniform text → [BLOCKED: …]. Even 'x'.repeat(30000) triggers the base64 heuristic. Route data through window.* + clipboard/relay/download, never through tool results.
  • uBlock Origin (Lite) LAN-block: page fetches from chatgpt.com to http://127.0.0.1:* throw Failed to fetch (stack shows uBlock's fetch wrapper). This kills the relay transport — clipboard is the reliable default. (scripts/relay_server.py is bundled for setups without uBlock.)
  • Clipboard needs focus + gesture: writeText from bare javascript_tool fails with NotAllowedError: Document is not focused — hence the injected button + real computer click.
  • Chrome multi-download guard (manual path): the 2nd+ programmatic a.click() download in a tab silently does nothing. Fresh tab per download (reload is NOT enough), or one zip.
  • get_page_text fallback for text-only payloads: inject <pre> chunks (~45k chars each) into the DOM and read them back — works, but costs one round-trip per chunk and floods agent context; last resort.
  • Wiping the DOM is safe: document.body.innerHTML = … on the conversation page doesn't touch window.__conv / window.__tok, and auth cookies keep working for in-page fetches.

Requirements

  • Chrome logged into chatgpt.com; for the MCP path, the claude-in-chrome extension.
  • No external Python dependencies — stdlib only (Python 3.9+).
  • Clipboard shell access: pbpaste/pbcopy (macOS) or xclip/wl-paste (Linux, use --stdin on the unpacker).

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Chatgpt Chat Export làm được gì?

Export a chatgpt.com (ChatGPT web) conversation to disk with full fidelity: raw backend-api JSON, all attachments (user-uploaded images, PDFs), and a readable Markdown transcript. Use when the user wants to: (1) grab/download/archive a ChatGPT talk locally, (2) pull a chatgpt.com conversation's JSON via the API route, (3) download the images/PDFs attached to a ChatGPT chat, (4) convert a ChatGPT conversation to Markdown, or (5) feed a ChatGPT conversation into another tool/agent. Triggers on chatgpt.com URLs (/c/<uuid>), 'grab this talk', 'export this ChatGPT chat', 'ChatGPT conversation JS...

Vì sao nên dùng Chatgpt Chat Export trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Chatgpt Chat Export là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Chatgpt Chat Export trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/vicnaum/vics-agent-skills/tree/main/skills/chatgpt-chat-export. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Chatgpt Chat Export?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Chatgpt Chat Export với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Chatgpt Chat Export với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Chatgpt Chat Export có miễn phí không?

Kỹ năng này được vicnaum phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇