← ChatGPT Export Viewer
Your token

ChatGPT Export Viewer API

Reading the export, the chat view, search and every download run free in the browser and need no API. The API is for the one metered step: send a sample of a person's own messages, each with an id, and get back short first-person points about them in nine areas. Each point cites message ids and quotes words from one of them, so your code can check it.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "profile".

taskWhat it doesReply
profileWrites up to items_max first-person points about the person in nine areas (writing_style, work_context, recurring_problems, goals, preferences, pet_peeves, expertise, people, decisions), each citing the messages it rests on.One JSON object

Input fields

Every field is a string; facts and limits hold JSON text. All three are required.

FieldMeaning
task"profile"
factsJSON object: source ("ChatGPT" or "Claude"); scope ("all chats" or "one chat"); messages, up to 60 of the person's own messages, oldest first, each {id, chat, text, date?} with ids m1, m2... and text up to 500 characters; yours, sent, chats and shortened.
limits{items_max, per_kind_max, words_max, ids_max, quote_words}: items_max is 6, 10 or 15 (a ceiling), per_kind_max 3, words_max 30, ids_max 3, quote_words [3, 15].

The reply

job.output.output is text holding one JSON object: items, an array of {"kind", "text", "ids", "quote"}. text starts with "I" or "My"; quote is 3 to 15 words copied from one of the cited messages. The page checks that every kind is one of the nine, every id was sent, the quote is really in a cited message, and the limits hold; do the same checks in your code.

Worked example

Input (input.json), from the page's "Team lead on Claude" example, reading only the chat "Review: TS rate limiter middleware", with up to 10 points:

{
  "task": "profile",
  "facts": "{\"source\":\"Claude\",\"scope\":\"one chat\",\"messages\":[{\"id\":\"m1\",\"chat\":\"Review: TS rate limiter middleware\",\"text\":\"third time asking this across chats: diffs only, no full-file rewrites. review: ```ts const hits = new Map<string, number[]>(); export function rateLimit(limit: number, windowMs: number) { return (req: Request, res: Response, next: NextFunction) => { const key = req.ip; const now = Date.now(); const arr = (hits.get(key) || []).filter(t => now - t < windowMs); arr.push(now); hits.set(key, arr); if (arr.length > limit) return res.status(429).send(\\\"slow down\\\"); next(); }; } ```\",\"date\":\"2025-06\"},{\"id\":\"m2\",\"chat\":\"Review: TS rate limiter middleware\",\"text\":\"3 replicas is the real issue. we have postgres, no redis. good enough options?\",\"date\":\"2025-06\"},{\"id\":\"m3\",\"chat\":\"Review: TS rate limiter middleware\",\"text\":\"divide by 3, document it. simplest thing that works.\",\"date\":\"2025-06\"}],\"yours\":3,\"sent\":3,\"chats\":1,\"shortened\":0}",
  "limits": "{\"items_max\":10,\"per_kind_max\":3,\"words_max\":30,\"ids_max\":3,\"quote_words\":[3,15]}"
}

Reply:

{"items":[{"kind":"writing_style","text":"I write in short, lowercase, clipped fragments with minimal punctuation.","ids":["m2","m3"],"quote":"divide by 3, document it. simplest thing that works."},{"kind":"work_context","text":"I run a service on three replicas with postgres and no redis.","ids":["m2"],"quote":"we have postgres, no redis."},{"kind":"preferences","text":"I want code reviews as diffs only, never full-file rewrites.","ids":["m1"],"quote":"diffs only, no full-file rewrites."},{"kind":"decisions","text":"I choose the simplest option that works and document its limits.","ids":["m3"],"quote":"divide by 3, document it. simplest thing that works."}]}

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above, or a required field is missing or empty.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://chatgpt-export-viewer.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"chatgpt-export-viewer"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "profile", "facts": "{\"source\":\"Claude\",\"scope\":\"one chat\",\"messages\":[{\"id\":\"m1\",\"chat\":\"Review: TS rate limiter middleware\",\"text\":\"third time asking this across chats: diffs only, no full-file rewrites. review: ```ts const hits = new Map<string, number[]>(); export function rateLimit(limit: number, windowMs: number) { return (req: Request, res: Response, next: NextFunction) => { const key = req.ip; const now = Date.now(); const arr = (hits.get(key) || []).filter(t => now - t < windowMs); arr.push(now); hits.set(key, arr); if (arr.length > limit) return res.status(429).send(\\\"slow down\\\"); next(); }; } ```\",\"date\":\"2025-06\"},{\"id\":\"m2\",\"chat\":\"Review: TS rate limiter middleware\",\"text\":\"3 replicas is the real issue. we have postgres, no redis. good enough options?\",\"date\":\"2025-06\"},{\"id\":\"m3\",\"chat\":\"Review: TS rate limiter middleware\",\"text\":\"divide by 3, document it. simplest thing that works.\",\"date\":\"2025-06\"}],\"yours\":3,\"sent\":3,\"chats\":1,\"shortened\":0}", "limits": "{\"items_max\":10,\"per_kind_max\":3,\"words_max\":30,\"ids_max\":3,\"quote_words\":[3,15]}"}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="chatgpt-export-viewer:profile:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object: items
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: chatgpt-export-viewer:profile:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json