Repository navigation
Export Formats
Chat Export writes the current chat (not a full account dump). Formats: Markdown, YAML, JSON, HTML, PDF. Multi-select can pack into a folder or zip. Filenames: {platform}-{title}-{date}.{ext}.
Schemas (name/version) control how that text is shaped. Default: chat-export/1. Alternative: sharegpt/1. Pick default + per-format overrides in the extension popup (Advanced → Export schemas); the on-page bar still only toggles formats. MCP: optional schema on chats_export (server settings.exportSchema).
This page is the semantic contract for the default schema — how roles, metadata, sources, and bodies are laid out so you can parse or feed vaults / distill pipelines.
Each turn is roughly:
| Field | Meaning |
|---|---|
role |
Logical role: user, assistant, or a provider-specific slug |
role_tag / role marker |
Display/tag used in MD fences and JSON (role_tag) — e.g. user, assistant, chatgpt, grok, claude, … |
text |
Message body as Markdown-ish plain text (from DOM → htmlToMarkdown) |
links |
Optional [{ text, href }]
|
sources |
Optional citations [{ title, url }] (search / grounding cards) |
Meta (when available): platform, url, title, exported / exported_at, chat_id, model, user_name, user_handle, user_email.
Designed so a dumb splitter can cut on fenced ```md blocks.
-
One system fence — language tag
md, first line labelsys, thenkey: valuelines. -
Each message — empty fence whose inner label is the role with a trailing colon (
user:,assistant:,chatgpt:, …), then a blank line, then the body. -
Optional sources fence — label
sources, numbered Markdown links.
Example:
```md
sys
platform: chatgpt
url: https://chatgpt.com/c/…
title: Bake-off notes
exported: 2026-11-12T05:00:00.000Z
chat_id: …
model: gpt-5
```
```md
user:
```
What is the capital of France?
```md
assistant:
```
Paris.
```md
sources
1. [Wikipedia](https://en.wikipedia.org/wiki/Paris)
```How to parse MD
- Find fenced blocks with info string
md. - First line inside the fence = label (
sys,user:,sources, …). - Remaining lines = payload (
sys/sources) or empty for role markers. - Non-fence text between a role marker and the next fence = message body.
Code fences inside the body use normal ```lang (from the chat HTML), not the md role markers.
Stable machine format. Pretty-printed, trailing newline.
{
"schema": "chat-export/1",
"platform": "chatgpt",
"url": "https://chatgpt.com/c/…",
"title": "Bake-off notes",
"exported_at": "2026-11-12T05:00:00.000Z",
"chat_id": "…",
"model": "gpt-5",
"messages": [
{
"role": "user",
"role_tag": "user",
"text": "What is the capital of France?"
},
{
"role": "assistant",
"role_tag": "assistant",
"text": "Paris.",
"sources": [
{ "title": "Wikipedia", "url": "https://en.wikipedia.org/wiki/Paris" }
]
}
]
}- Always start parsers with
schema === "chat-export/1". - Prefer
role_tagfor display;rolefor coarse filtering. - Missing optional fields are omitted (not
null).
Same meta keys as JSON (without schema). Then a messages: list:
platform: chatgpt
url: https://chatgpt.com/c/…
title: Bake-off notes
exported_at: 2026-11-12T05:00:00.000Z
messages:
- role: user
text: |
What is the capital of France?
- role: assistant
text: |
Paris.
sources:
- title: Wikipedia
url: https://en.wikipedia.org/wiki/ParisMultiline bodies use YAML block scalars (text: |).
Standalone document: <article> with <header> + <dl> of meta, then <section data-role="…"> per message (<h2> role heading, body HTML from Markdown, optional Sources <ol>). Print-friendly CSS included.
Selectable text (including Cyrillic), laid out from the same message stream — not a screenshot. Good for sharing; worse for automated parsing than JSON/MD.
| Id | Page |
|---|---|
chat-export/1 (default) |
Export-Schema-chat-export-1 |
sharegpt/1 |
Export-Schema-sharegpt-1 |
- Not OpenAI’s bulk “download all chats” ZIP / Conversations.json shape.
- Not Alpaca JSONL (open an issue if you need another schema pack).
- Not a guarantee that every provider fills every meta field (DOM/API variance).
If you want a different layout, open an issue or add a schema pack (see extension schemas/README.md / CONTRIBUTING). Default remains chat-export/1.