← 回到研究筆記首頁
Compliance API · Field-by-field Reference

從訊息到檔案,逐欄對照OpenAI 2.5.17 × Claude · Skills / Message / Session / Files

108 組欄位與行為對照,標示路徑、型別、null語意與不等價處。另補上Skills使用統計。重點是資料實際存在於哪個物件,以及能還原到什麼程度

查核:2026-09-08 · OpenAI OpenAPI 2.5.17 · Claude官方Compliance API reference · 未使用租戶資料
FIELD REFERENCE / MAP

先對齊物件,再對齊欄位

本頁的「實際欄位」指官方公開 response 契約。未呼叫租戶 API,因此不把文件型別當作實測 payload,也不以一般模型推論 API 代替 Compliance API。

OPENAI

訊息與 session 主要在事件裡

ChatGPT 用 CONVERSATION_MESSAGE;Codex 用 CODEX_LOG。檔案 metadata、binary 與 Canvas 版本另有端點。

CLAUDE

Chat 與 local/remote session 是不同物件

claude.ai chat、用戶端 local session、雲端 remote Cowork 各有不同 response。不能把某一類的欄位與保證套到另外兩類。

讀表方式:string | null 代表明列可為 null;「可省略」只用在明文 optional;「未列」代表該來源沒有定義,不能推成產品全面不支援。[] 代表陣列元素。OpenAI 部分 schema 沒有 required 清單,以下不自行補成必填。[O][CM][CS]
四組應比較的資料面[O][CM][CS]
欄位/概念OpenAIClaude對應判讀
一般聊天conversation + message(事件內)chat + chat_messages[]兩者皆有對話與訊息 identity;版本與取得方式不同。
程式/代理 sessionCODEX_LOG.event_details.session_idsession.iddata[]可對照工作階段,但 session ID、message ID、event ID 不可混用。
任務物件CodexTask.iddenormalized_metadataremote session(Cowork)非一對一產品等價;OpenAI 未保證 task.id 等於事件 session_id。
文件/圖片message.files[]、Library/Project/GPT filesfiles[]generated_files[]、project attachments參照、metadata、可下載 binary 需要分開。
FIELD REFERENCE / SKILLS-USAGE

Skills · 能知道每個人用了哪些嗎?

可以做使用統計,但兩家資料面不同。OpenAI 2.5.17的訊息/agent事件可直接攜帶skill資訊;Claude另有Enterprise Analytics,並非只有transcript文字可推測。

本次改用2.5.17:來源為使用者提供的檔案,已核對message、Codex、Workspace Agents及本報告引用的檔案/Canvas schemas。skills_used_names已列入;原始檔案與版本差異见更新紀錄(本篇未附)[O]
Skill識別、使用者與證據顆粒度[O][SA][SD][AF]
欄位/概念OpenAIClaude對應判讀
訊息層skillmessage.author.skills_used[] / skills_used_names[]optional string arrays;Skill IDs / namesCompliance chat/session未列同構清單;不能據此推論無採用統計。OpenAI欄位when available;文件未保證兩個陣列可用相同index配對。
Agent使用事件CUSTOM_AGENTS_LOG → SKILL_USEDevent_details.agent_id/version_id/run_id/skill_id/skill_name/skill_typeAnalytics回傳彙總,非逐message/agent-run的SkillUsed事件。OpenAI skill_type為uploaded_skill/chatgpt_skill_ref;這是Workspace Agents,不能套到CODEX_LOG。
生命週期vs使用Skills inventory與SKILL_USED事件分開。Activity Feed有claude_skill_created/enabled/disabled/replaced/deleted等事件,欄位可有skill_id/skill_name。建立或啟用不等於已使用;本次enum未找到skill_used/invoked/activated。nullable生命周期名稱也不保證補齊所有私人skills。
誰用了哪些由訊息或agent事件的actor與關聯物件彙整;須分清人類觸發與自動agent。GET /v1/organizations/analytics/skillsgroup_by[]=user_id;可再group_by[]=productClaude按日期或期間取per-user × skill資料;不是即時訊息清單。
名稱可見性2.5.17提供可選ID/name;不承諾每筆都有。skill_name / skill_display_name名稱有privacy限制;skill_name可能opaque ID私人自訂skills、個人plugin skills的display_name不披露;不能承諾知道所有私人skill的可讀名稱。
指標自行定義訊息關聯次數/事件次數,不冒充官方invocation_count。invocation_count; distinct_user_count; chat_metrics / claude_code_metrics / cowork_metricsinvocation_count optional number | nullinvocation reporting未啟用可為null;distinct conversation/session數不等於啟動次數。
什麼算使用保存來源的message關聯或SKILL_USED語意,不以讀檔推成執行。Analytics以明確啟用(模型或slash command)計;preloaded、hook注入或純讀SKILL.md不計。因定義不同,兩家的skill次數不宜直接橫比;0也不保證從未受skill內容影響。
可回溯到哪裡message events有message/conversation/time;agent事件有run/version。Analytics usage rows無逐次message/session IDs或每次啟用timestamp;skill版本不在該row schema。Claude可做採用Dashboard,不能僅靠此表還原每次完整執行證據。

查詢形狀(未執行): GET /v1/organizations/analytics/skills?date=2026-09-01&group_by[]=user_id&group_by[]=product

需Claude Enterprise與Analytics API key(read:analytics,由primary owner於claude.ai建立);不是Compliance key或一般Console Admin key。使用統計通常約次日17:00 UTC可用,需以query回報的最新可用日為準;最早2026-01-01。[AG]

Skills清单、已啟用數與實際使用數不同。Bedrock等第三方工作負載不能自動視為此Enterprise統計涵蓋;關鍵名稱可能因隱私遮蔽。查核詳見Claude skills使用研究(本篇未附)

FIELD REFERENCE / MESSAGES

01 · Message:身分、文字、時間與關聯

OpenAI 欄位起點為單筆 CONVERSATION_MESSAGE;Claude 起點為 Get chat messages 的回應。Claude session 訊息另見第三節。

一般聊天訊息逐欄對照[O][CM][CC]
欄位/概念OpenAIClaude對應判讀
訊息 IDmessage.idstringchat_messages[].idstring都是訊息 identity;跨供應商、租戶、產品面須保留原始 namespace。
事件 IDevent_idstable identifierChat response 未列事件 ID;Activity Feed 是另一資料面。OpenAI 同 message.id 可有多筆事件;event_id 與 message.id 不能互換。
角色message.author.typeuser | assistantchat_messages[].roleuser | assistant可對照角色。人類/模型角色與工具內容種類是兩個欄位維度。
使用者身分actor.user_id / actor.user_emailACCOUNT_USER actor 分支user.id / user.email_addresschat 層 user 可 nullOpenAI 是事件 actor;Claude 是 chat 所屬 user,不能直接當逐訊息作者。
內容容器message.contentoptional object;text / user_instructions / quotationchat_messages[].content[]text / tool_use / tool_result block array一個物件 vs 多個區塊;不能只換欄位名稱。
一般文字message.content.valuetext 分支;可省略,也可能 nullchat_messages[].content[].texttext 分支 string空文字、內容未提供、被截斷應分別保存。
模型message.author.modelassistant 分支 string;明文 always presentmodelchat 層 string | nullClaude 這裡是聊天選定模型,不能當每則訊息的實際 serving model;local session 另有逐訊息 model。
訊息建立時間message.created_atISO 8601 string;when availablechat_messages[].created_atdate-time stringClaude user 為送出時間;assistant 為最後內容區塊生成完成時間。
變更/事件時間timestampISO 8601 UTC;action completedupdated_atchat 層 date-time string不可把 chat updated_at 複製成每則訊息 updated_at;Claude message query 可按 updated_at 過濾,但列出的 message schema 未列該欄位。
順序/前一則previous_message_id首則省略;指向上一 message.id未列 predecessor 欄位;chat_messages 按時間與 order 返回。OpenAI 有明文串接欄位;Claude 不應憑相同時間推造前後關聯。
套用的自訂指示message.author.applied_custom_instructionsoptional string;2.5.17chat schema未列同構欄位。OpenAI為該assistant回應套用的原始user custom instructions,不等於完整system prompt。
使用者指示message.content.type = user_instructionsvalue: stringChat content union 未列同名分支。不是 system prompt 匯出保證;local 的 CLAUDE.md 可能以一般 user text 出現。
引用片段message.content.type = quotationfile_id? / file_name? / quote?;file fields 可 nullChat union 未列同構 quotation block。引用是內容片段與來源參照,不是原始檔本體。
來源註記message.content.annotations[]url_citation.urls[];file_citation.files[].id/name;custom_action.action_domain/action_name此 chat content schema 未列 citation annotation 欄位。不能把工具回傳的文字 URL 當成同等結構化 citation。
工具/skill 清單message.author.tools_used[] / skills_used[] / skills_used_names[]optional string arrayschat_messages[].content[]工具呼叫/結果區塊;無同構 skills_usedOpenAI一般訊息可列工具名稱、Skill IDs與Skill names;欄位缺少不等於未使用。Claude另有Analytics統計,見Skills節。
內容移除標記此 tag 未列同構 thinking_redacted/truncated 欄位。content[].thinking_redacted / truncatedtext 分支 booleanthinking_redacted 是移除標記,不是可取得內部推理;工具 truncation 另見工具表。
逐訊息用量CONVERSATION_MESSAGE 未列 token_usage。chat_messages[] 未列 token usage。不能套入模型推論 API 的 usage 結構;Codex事件另有欄位。
FIELD REFERENCE / CHATS

02 · Conversation/Chat:容器中繼資料

先看一般聊天容器。OpenAI 的 conversation 是事件當時快照;Claude 的 chat metadata 是查詢取得的物件。

聊天容器欄位[O][CM][CC]
欄位/概念OpenAIClaude對應判讀
ID/名稱conversation.id / conversation.titlestringid / namestring一般 chat 的概念映射;不與 code session ID 混合。
外部觸發者actor.type = EXTERNAL_COLLABORATION_USERprovider/provider_tenant_id/provider_user_idClaude需依actor/source自己的identity欄位解析。2.5.17此actor可識別Slack/Teams等外部invoker;不要強迫每筆actor都有ChatGPT user_id。
租戶principal.id / principal.type事件 envelopeorganization_uuidstringClaude organization_id 已 deprecated;使用文件指定的 organization_uuid。
建立時間conversation.created_atISO 8601 string | nullcreated_atdate-time string與事件 timestamp、message.created_at 分開。
更新/刪除conversation 子物件未列 updated_at/deleted_at。updated_at / deleted_atdate-time string / string | nullOpenAI不可用讀取時間補成官方update time;Claude user刪除後可能仍回metadata。
專案conversation.project_id / project_name存在專案時提供;name when availableproject_idstring | nullClaude response未列同構project_name,須另查project。
聊天模式conversation.modechat | work;when available未列同構mode。2.5.17提供Chat/Work模式;不可用Claude產品面名稱直接替代。
自訂 GPTconversation.gpt_id / gpt_name自訂 GPT 情境;name when available未列同構 gpt_id。Claude Project不等同OpenAI custom GPT。
狀態旗標conversation.is_pinned / is_temporary_chat事件當時的旗標chat schema未列同構旗標。不填false冒稱已確認。
網頁連結conversation tag未列 href。hrefstring勿以拼接URL冒稱API返回。
Logs新鮮度2.5.17新增Freshness端點:每event type的最大retained event timestamp。此chat response沒有同構freshness欄位。最大timestamp不是此前全部事件已到齊;不能當完整性watermark。
回應分頁logs list為檔案單位;不是chat message page。first_id / last_id / has_morestring | null / string | null / booleanClaude cursors是opaque值,不應當message ID解析。
FIELD REFERENCE / SESSIONS

03 · Session:Codex 事件 vs Claude local/remote

這裡對照的是程式/代理工作階段。OpenAI CodexTask 是額外的 stateful task 物件;Claude local 與 remote 的欄位差異也必須保留。

Session metadata 與逐訊息欄位[O][LS][LM][RS][RM][CS]
欄位/概念OpenAIClaude對應判讀
容器 identityevent_details.session_idCodex prompt/response/tool事件session.idlocal / remote stringOpenAI task.id 與 session_id 沒有已確認的等值契約;Claude chat.id 也不是 session.id。
種類/產品面type = CODEX_LOG; event_type; client_idclient_id例 CODEX_CLI / CODEX_WEB / CODEX_DESKTOP_APPsession.product_surfacestring | null;local 另有 type=compliance_local_session不同分類粒度;Claude product_surface 不應實作成封閉enum。
組織/工作區principal.id / workspace_id事件 envelope/Codex top-levelsession.organization_uuid; session.workspace_idworkspace_id只有local,string | nulllocal workspace_id是服務端identity,不是本機目錄路徑;remote未列同欄位。
擁有人與觸發者actor.user_id / user_emailACCOUNT_USER actor;CodexTask另有created_by_idsession.user; session.agent_id; session.started_by_userlocal user永有;remote user與agent_id互斥remote區分agent owner及啟動人;不能把actor、owner、initiator壓成一欄。
Email 可用性actor.user_emailACCOUNT_USER事件欄位session.user.email_addresslocal/remote messages envelope永null;local list/retrieve、remote list可解析Claude messages裡的null不表示使用者已刪除;需join metadata。
專案/環境event_details.environment_idoptional;Codex environment與task另查session.claude_project_idremote string | null;messages envelope永nullenvironment與project用途不同;local未列project_id。
Session建立時間CodexTask.created_atUnix number;CODEX_LOG本身為timestamp事件時間session.created_atlocal:最早仍保留call;remote:session建立Claude local的created_at會隨retention前進,不能當永久固定起點。
更新時間CodexTask.updated_atUnix numbersession.updated_atdate-time stringlocal為最後保留call;列表可能暫時落後,messages反映最新保留call。
狀態event_details.statusresponse事件有;tool事件optional;是事件狀態session.status僅remote string;local無statusremote例pending/active/paused/archived/failed,應容忍新值;不是工具執行狀態。
標題/任務附加資料CodexTask.title / denormalized_metadatastring / open objectlocal/remote session schema未列title/href。denormalized_metadata未定義固定transcript子欄位,不能自行從名稱推導。
訊息/事件 identityevent_id; event_details.turn_id / call_idevent_id穩定;turn_id/call_id optionaldata[].idlocal / remote message IDevent、turn、call、message是不同層級;不要用時間戳取代identity。
逐訊息模型event_details.modelresponse為模型名;prompt/tool optionaldata[].model僅local string | nulllocal user或provenance非null時model為null;remote message未列model。
訊息時間/排序timestampaction完成;另以session/turn/call關聯data[].created_atlocal為call時間;remote為commit時間local多則可同時;remote可同時或略倒序。Claude session以回傳位置保序,不能只按created_at重排。
內容來源CODEX_LOG文字契約未列同構provenance。data[].provenancelocal object | nullnull為API捕獲驗證內容;type可為content_unavailable/client_asserted/synthetic_marker,content_unavailable分支有reason:string。
內容不可用此Codex tag未列統一content_unavailable。data[].content_unavailableremote boolean;local用provenance.typeremote true時content為空;local provenance.type=content_unavailable時content必為空陣列。不能把空陣列當「沒有任何互動」。
逐turn送出的人actor是事件觸發者。data[].sent_by_user_id僅remote string | null;assistant為null補充agent-owned session的人類送出者,與session.user不同。
用量/推理設定event_details.token_usageresponse:input_tokens/output_tokens/cached_input_tokens/reasoning_output_tokenslocal/remote message未列token usage或cost。OpenAI response另有optional service_tier/reasoning_effort;reasoning token數不等於推理內容。
分頁回應CODEX_LOG以log檔案收集;CodexTask另有列表。data[] / next_pagelocal/remote;messages另有sessionsession端點無has_more;直到next_page=null。不要套用chat的last_id分頁。
局部 response 也有語意:Claude remote 的 messages envelope 會把 started_by_userclaude_project_id 與使用者email設為null;應用list metadata補足,不以後一次null覆寫先前可用資料。[RM][RS]
FIELD REFERENCE / TOOLS

04 · Tool call/result:能看到輸入、輸出到哪裡?

OpenAI 這一表主要指 CODEX_LOG。一般 ChatGPT message.author.tools_used 只是一份名稱清單,不能直接替代工具事件。

工具內容、關聯與截斷[O][CM][LM][RM][CS]
欄位/概念OpenAIClaude對應判讀
呼叫名稱/類別event_details.tool_name / tool_typeTOOL_CALL_*content[].name / typetool_use / tool_resultClaude內容區塊放在chat_messages[]或session data[];兩者前綴不同。
輸入event_details.tool_inputserialized input;非固定JSON object schemacontent[].inputtool_use:JSON-encoded stringClaude input即使未截斷也是字串;截斷後可能不是合法JSON。
呼叫/結果關聯event_details.tool_call_id / call_id / turn_idoptional;另有session_idcontent[].id / tool_use_idstring | nullClaude tool_result.tool_use_id對應tool_use.id;null時不能猜配對。
工具執行結果TOOL_CALL_COMPLETED文字契約未列通用tool_output。content[].content[].texttool_result:文字結果完成事件不代表回傳完整stdout;Claude結果仍有截斷及非文字省略。
MCP 結果event_details.result_previewAPP_MCP_RESULT;optional truncated previewcontent[].integration_name / mcp_server_url僅chat工具block;string | nullOpenAI APP_MCP_CALL另有name/arguments/tool_meta;Claude session block未列這兩個整合欄位。
核准與派送事件event_type = TOOL_DECISION / EXECUTION_REQUESTED2.5.17 CODEX_LOG此session content union未列同構事件。TOOL_DECISION有decision/source;EXECUTION_REQUESTED有launch_trace_id/launch_span_id。核准與派送皆不證明執行成功,也不是skill-used事件。
錯誤/完成event_type; event_details.statusTOOL_CALL_FAILED等;APP_MCP_RESULT另可有error_code/error_messagecontent[].is_errortool_result boolean不是同一套status enum;保留供應商原值。
截斷標記一般tool_input未列統一truncated旗標;MCP preview明文可能截斷。content[].truncatedtool_use / tool_result booleanlocal truncated也可能指圖片/citation被省略,不只長度。chat text的truncated明文永false。
截斷參數此tag未定義同構max_chars/max_bytes query。tool_use_input_max_chars / tool_result_max_chars:chat預設10,000字元。
tool_use_input_max_bytes / tool_result_max_bytes:session預設10,000 bytes。
chat -1取消該字元限制;session -1仍受約1MiB server bound。不要跨端點換算或混用。
推理與系統提示此Codex事件契約沒有完整thinking/system prompt欄位。chat text有thinking_redacted;local系統提示為synthetic marker;session不輸出thinking。標記只解釋內容缺漏,不能推成取得完整模型上下文。
FIELD REFERENCE / FILES

05 · 文件/附件:reference、metadata、binary 三層

比較時把 OpenAI message.files[] 與 Library 檔案分列,並把 Claude uploads、generated files、artifacts 分開;檔案ID在不同類別有不同下載路由。

上傳與生成檔案的實際欄位[O][CM][FM][GM][FD]
欄位/概念OpenAIClaude對應判讀
附件參照 identitymessage.files[].id / nameoptional array;元素id/namechat_messages[].files[].id / filenamefiles array | null;元素string同為訊息附件參照;OpenAI此元素沒有Claude的全部metadata。
Library identitydata[].id / file_idLibrary list;stable Library ID / current backing file reference沒有已確認的同構Library物件;使用Claude對應file ID。OpenAI Library.id不能當file_id;兩套download端點路由不同。
檔名Library.data[].name; BaseFile.namestringfiles[].filename; generated_files[].filenamemessage reference:stringClaude uploaded file metadata endpoint filename可null;不能沿用reference非null假設。
MIMELibrary.data[].mime_typestring | null;message.files未列files[].mime_type / generated_files[].mime_typestring | nullOpenAI有MIME,位於另一物件;不要靠副檔名補成官方MIME。
大小Library.data[].file_size_bytesinteger | null;message.files未列files[].size_bytes / generated_files[].size_bytesnumber | nullClaude uploads是preferred downloadable variant大小;generation過期也可能null。
Checksummessage.files/Library/BaseFile未列內容MD5/SHA欄位。files[].md5 / generated_files[].md5string | null;lowercase hexOpenAI log-file的sha256是log容器hash,不能當附件hash。Claude md5也不能證明是原始上傳bytes。
建立時間Library.data[].created_at; BaseFile.created_atUnix number;BaseFile到期null敘述有矛盾files[].created_atdate-time;generated reference未列created_atClaude generated metadata另有created_at: string | null;不得用message timestamp冒充檔案時間。
擁有者/反向關聯Library.data[].user_idowner;下載User File亦需owner user_idfile metadata.message_ids[] / claude_chat_ids[]string arraysClaude generated metadata只有claude_chat_id;一般file可關聯多chat/message。
處理狀態Library.data[].statecreated | indexing | ready | failed上述Claude file metadata未列相同state。未列不等於ready;download能否成功仍需實際取得。
移至垃圾桶/到期Library.data[].trashed_at / expires_atUnix number | nullfile reference未列同構欄位;chat另有deleted_at。chat刪除與file過期不是相同層級。
專案來源旗標Library.data[].is_projectboolean | nullClaude project attachments另有type分支。OpenAI is_project不等於完整project_id關聯;Claude project_file/project_doc不是同一旗標。
上傳 vs 生成message.files[]未列同構generated_files陣列或來源kind。files[] / generated_files[]uploads / tool-created downloads;兩者皆可nullClaude來源分類較直接;OpenAI不要只靠檔名猜是模型生成。
下載網址BaseFile.download_urlstring | null;GPT/Project url模式;約1hfile reference未列download_url;呼叫固定/content路由。OpenAI direct-content route走307,短效Location與檔案保存期限不同。
GPT/Project模式file_format=urlid/name/created_at/download_url/objectid模式 → id/name/objectClaude Project附件用project_file/project_doc分支,見下表。OpenAI BaseFile只適用該schema;不能把download_url灌入message.files。
OpenAI 文件內部差異:BaseFile.created_at 的schema引用Unix number,但 download_url 的敘述說檔案過期時created_at與download_url可null。這是文件不一致,不能將其中一邊當已驗證的唯一回應。[O]
FIELD REFERENCE / IMAGES

06 · 圖片與原始文件:拿到的到底是什麼?

「附件出現在JSON」不等於「含原始圖片」;「hash驗證成功」也只表示所下載變體一致。

圖片、PDF與文字抽取的能力邊界[O][FD][CC][LM][RM]
欄位/概念OpenAIClaude對應判讀
聊天上傳圖片若以file ID出現在訊息參照/Library中,可走對應User File或Library內容路由;JSON不內嵌binary。Chat files可走file content下載;可能是處理後圖片副本。需核對實際bytes;OpenAI此契約沒有逐格式的原圖保真保證。
Word/PPT/PDFContent路由提供file下載;這些schema未定義OCR文字、頁碼、縮圖或轉檔變體欄位。部分文件可能只剩抽出的文字,原binary無法取回;檔名/MIME可能仍反映原格式。Claude不要只看filename或mime_type判定拿到.docx/.pptx/.pdf原檔。
開發工具sessionCodex prompt_text/response_text可因非文字內容為空;此tag未列image URL/base64或image附件schema。local:圖片/PDF → text placeholder+truncated;remote:非文字內容省略。不能將Claude chat附件能力套到session;也不能將Codex tag未列推成全部OpenAI無圖片。
工具返回圖片TOOL_CALL_*無通用tool_output;MCP只有可能截斷preview。chat tool_result非文字image/link省略,generated files另取;local非文字項目數量marker;remote直接省略。工具輸出文字、生成檔案、影像binary應分開計算覆蓋。
寬高/OCR/頁數所查message/BaseFile/Library schema未列width/height/pages/OCR。所查file reference/metadata亦未列width/height/pages/OCR。如需這些欄位,屬下載後自行分析的derived資料,不冒稱vendor原生欄位。
下載校驗User/GPT/Project/Library direct route:307 Location;契約未固定回傳檔案checksum header。File metadata.md5為hex;download Content-MD5是base64,必要時以實際served bytes header為準。應解碼後比較hash值;不能直接比兩個字串,也不能把檢核變體等同原始上傳。
FIELD REFERENCE / ARTIFACTS

07 · 生成文件、Canvas 與 Project 文件

這些物件比一般file多出版本或文字內容語意。OpenAI Canvas與Claude artifact僅為概念近似;沒有ID或生命週期的一對一等價。

版本化與Project文件[O][AM][AD][PA][PD][PM]
欄位/概念OpenAIClaude對應判讀
文件/版本identityCanvasContent.textdoc_id; version_contents.data[].versionstring / integerartifacts[].id / version_idstable artifact ID / version ID stringsCanvas版本號與artifact_version_id不同;下載Claude artifact需version_id。
文件類型/標題textdoc_type; version_contents.data[].namestring / string | nullartifact_type / titlestring | null;reference與metadataartifact_type為MIME-like值;不應無條件當實際binary Content-Type。
版本內容version_contents.data[].content / updated_atstring / date-timeartifact version /content完整版本文字;metadata另有created_atOpenAI JSON直接含多版本文字;Claude另取版本內容。未杜撰Claude download JSON envelope。
版本大小/校驗Canvas version schema未列內容hash/size。artifact metadata.md5 / size_bytesstring / number;UTF-8內容不是file metadata可null的同一契約。
版本評論version_contents.data[].comments[]type/comment ID/start/end/contentartifact schema未列同構comments。不能假設Canvas評論與Claude chat訊息等價。
Project附件unionProjectConfig.files.data[]ProjectFile / ProjectFileInfo;受file_format影響attachments.data[].typeproject_file | project_docClaude binary與文字document由type明確區分。OpenAI connector file另有獨立schema,不混入一般file。
Project binaryProjectFileBaseFile + object;id/name/created_at/download_urlproject_fileid/created_at/filename/mime_type/md5/size_bytes/typeClaude MIME string;未知用application/octet-stream;md5/size可null。
Project文字文件ProjectFile schema未列同構內嵌content文字欄位。project_doc; document GET.contentid/created_at/filename/mime_type=text/plain/type;GET為content:stringproject_doc可來自上傳後轉換文字;updated_at目前永null(reserved),不可拿它追蹤修改。
文字metadataBaseFile未列同構UTF-8文字hash欄位。document metadataid/claude_project_id/created_at/filename/md5/size_bytes/mime_type/userhash/size基於UTF-8文字;user整體可null。
版本/附件分頁version_contents.has_more / last_versionCanvas;after用版本數字;limit最高30attachments.has_more / next_pageClaude project attachments附件page token不能當chat last_id,也不能当Canvas數字version。
FIELD REFERENCE / ENDPOINTS

08 · 取得方式與HTTP契約

下列是路由,不是可直接執行的租戶請求。OpenAI的workspace/user ID與Claude帶型別前綴的ID須從各自來源取得。

常用GET路由與回應形狀[O][CM][LM][RM][FD][GD][AD][PD]
欄位/概念OpenAIClaude對應判讀
聊天訊息/compliance/workspaces/{workspace_id}/logs → 列檔;/logs/{log_file_id}(同workspace前綴)→ 307下載JSONL/v1/compliance/apps/chats/{claude_chat_id}/messages → chat metadata + chat_messages + cursorsOpenAI指定event_type=CONVERSATION_MESSAGE。Claude不先列全部users也可列chat。
程式session相同OpenAI logs路由,event_type=CODEX_LOG/v1/compliance/apps/sessions/local/{session_id}/messages/v1/compliance/apps/sessions/remote/{session_id}/messagesClaude返回session/data/next_page;不是Activity Feed內容。
任務metadata/compliance/workspaces/{workspace_id}/codex_tasks/{task_id}Claude local可GET /v1/compliance/apps/sessions/local/{session_id};remote由list取得。不是相同物件,不假設一組路由可互換。
User附件binary/compliance/workspaces/{workspace_id}/users/{user_id}/files/{file_id} → 307 Location/v1/compliance/apps/chats/files/{claude_file_id}/content → bytesOpenAI conversation_id query對audio/video必要。404/410有不同不可用意義。
Library binary/compliance/workspaces/{workspace_id}/users/{user_id}/library_files/{library_file_id} → 307本次Claude未確認同構Library route。OpenAI先逐user list library_files,包含trashed及存在Library的project來源檔。
生成檔binaryUser-owned生成檔由User File content route;message reference未獨立generated_files分類。/v1/compliance/apps/chats/generated-files/{claude_gen_file_id}/content → bytesClaude generated ID不應送進uploaded-file route。
Project/GPT binary/compliance/workspaces/{workspace_id}/project_files/{file_id}/compliance/workspaces/{workspace_id}/gpt_files/{file_id} → 307Claude project_file共用 /v1/compliance/apps/chats/files/{claude_file_id}/content取得ID來源不同,不能遍歷猜ID或擁有人。
Canvas/artifact/compliance/workspaces/{workspace_id}/users/{user_id}/canvas/{textdoc_id} → CanvasContent/v1/compliance/apps/artifacts/{artifact_version_id}/content → 版本文字Claude metadata路由不帶/content;版本ID而非artifact ID。
Project文字此OpenAI schema未定義同構project_doc JSON content物件。/v1/compliance/apps/projects/documents/{document_id} → id/content/created_at/filename/userClaude文字與metadata(/metadata)分開;附件list先判type。
FIELD REFERENCE / EXAMPLES

09 · 縮減範例:相同一段文字,外層結構不同

以下全部為自行製作的合成片段,只展示本頁的結構差異;省略欄位不表示可省略的官方保證,也不是租戶實際資料。

OpenAI · ChatGPT message event
{
  "event_id": "evt-synthetic-1",
  "type": "CONVERSATION_MESSAGE",
  "timestamp": "2026-09-08T01:00:00Z",
  "message": {
    "id": "msg-synthetic-1",
    "author": {
      "type": "assistant",
      "model": "example-model"
    },
    "content": {
      "type": "text",
      "value": "這是合成範例。"
    },
    "files": [
      {
        "id": "file-synthetic-1",
        "name": "report.pdf"
      }
    ]
  },
  "conversation": {
    "id": "conv-synthetic-1",
    "title": "合成對話"
  }
}
Claude · Chat response
{
  "id": "claude_chat_synthetic",
  "model": "example-selected-model",
  "chat_messages": [
    {
      "id": "claude_chat_msg_synthetic",
      "role": "assistant",
      "created_at": "2026-09-08T01:00:00Z",
      "content": [
        {
          "type": "text",
          "text": "這是合成範例。",
          "thinking_redacted": false,
          "truncated": false
        }
      ],
      "generated_files": [
        {
          "id": "claude_gen_file_synthetic",
          "filename": "report.pdf",
          "mime_type": "application/pdf",
          "size_bytes": null,
          "md5": null
        }
      ]
    }
  ]
}
Claude · Local session message(工具輸入是字串)
{
  "session": {
    "id": "clls_synthetic",
    "user": {
      "id": "user_synthetic",
      "email_address": null
    }
  },
  "data": [
    {
      "id": "clsm_synthetic",
      "role": "assistant",
      "model": "example-serving-model",
      "created_at": "2026-09-08T01:00:00Z",
      "provenance": null,
      "content": [
        {
          "type": "tool_use",
          "id": "toolu_synthetic",
          "name": "Read",
          "input": "{\"file_path\":\"example.txt\"}",
          "truncated": false
        }
      ]
    }
  ],
  "next_page": null
}
OpenAI · Codex tool event(完成事件未保證tool_output)
{
  "event_id": "evt-synthetic-2",
  "type": "CODEX_LOG",
  "event_type": "TOOL_CALL_COMPLETED",
  "event_details": {
    "detail_type": "TOOL_CALL_COMPLETED",
    "session_id": "session-synthetic",
    "tool_call_id": "call-synthetic",
    "tool_name": "Read",
    "tool_type": "example",
    "tool_input": "{\"file_path\":\"example.txt\"}"
  }
}
FIELD REFERENCE / CONCLUSIONS

10 · 欄位比對後,最值得保留的結論

以下是從已核對契約導出的整合判讀,不新增本專案資料契約或變更程式。

Message的形狀不同

OpenAI一般訊息是單一content union;Claude是block array。多區塊、工具call/result與來源註記不能壓成一個text就宣稱完整匯出。

Session不是Chat的別名

Claude local、remote、chat的model、user、時間與可用性欄位都不同;OpenAI task、session、event也須各自保留identity。

檔案還原需看bytes

檔名、MIME、hash、reference存在,都不足以保證原始檔可還原。必須保留物件類別、實際取得內容、變體與不可用原因。

避免五種假資料:把Claude chat.model填到每則訊息;把local created_at當永久起點;把Library.id當file_id;把工具完成事件當完整結果;把null、未列、截斷與內容不可取得全部轉成空字串。

查核範圍:ChatGPT/claude.ai一般訊息、Codex/Claude local與remote session、附件與圖片、生成文件、Canvas/artifact、Project檔案。未延伸為所有供應商API的全量目錄;未執行live API或生產操作。

FIELD REFERENCE / FIELD-SOURCES

欄位來源與查核資料

每張表的引用代碼連到以下精確reference;O是使用者提供OpenAPI快照,Claude是查核日的線上文件。

可追溯盤點:OpenAI欄位筆記(本篇未附) · OpenAI契約擷取JSON(本篇未附) · Claude欄位筆記(本篇未附)

證據限制:OpenAI公開reference文字擷取只有頁殼,故細節採使用者提供2.5.17(不是線上最新版宣稱)。未呼叫live Compliance API。靜態結構與來源引用另作檢查;前次本機URL預覽被Browser安全政策阻擋,本次不聲稱完成瀏覽器視覺驗證。