Context
OpenAI has added new file-related APIs to the Apps SDK:
New API
window.openai.selectFiles() — opens ChatGPT's file library picker (feature-detect before using) and returns app-authorized files as [{ fileId, fileName, mimeType }].
Modified APIs
window.openai.uploadFile(file, { library?: boolean }) — now accepts an options object; pass { library: true } to also save the upload into the user's ChatGPT file library when that library is available.
window.openai.getFileDownloadUrl({ fileId }) — now works for files uploaded by the widget, files selected via selectFiles(), or files provided via tool/file params (previously only uploads or file params).
State management update
imageIds may include file IDs selected via selectFiles() in addition to uploaded file IDs or file params.
What needs to change in Skybridge
- Types — Update
AppsSdkOpenAI interface to add selectFiles() and the new uploadFile options parameter
- Adaptor — Update
AppsSdkAdaptor to support selectFiles() and forward the library option on uploadFile
- Hook — Extend
useFiles() to expose selectFiles alongside upload and getDownloadUrl
- Adaptor interface — Update the shared
Adaptor interface with the new method + updated signature
- MCP adaptor — Add
selectFiles stub that throws (not supported in MCP Apps)
- Docs — Update
docs/api-reference/use-files.mdx
- Skills — Update chatgpt-app-builder skill if it references file APIs
Source
Diff from alpic-ai/openai-apps-sdk-docs
Context
OpenAI has added new file-related APIs to the Apps SDK:
New API
window.openai.selectFiles()— opens ChatGPT's file library picker (feature-detect before using) and returns app-authorized files as[{ fileId, fileName, mimeType }].Modified APIs
window.openai.uploadFile(file, { library?: boolean })— now accepts an options object; pass{ library: true }to also save the upload into the user's ChatGPT file library when that library is available.window.openai.getFileDownloadUrl({ fileId })— now works for files uploaded by the widget, files selected viaselectFiles(), or files provided via tool/file params (previously only uploads or file params).State management update
imageIdsmay include file IDs selected viaselectFiles()in addition to uploaded file IDs or file params.What needs to change in Skybridge
AppsSdkOpenAIinterface to addselectFiles()and the newuploadFileoptions parameterAppsSdkAdaptorto supportselectFiles()and forward thelibraryoption onuploadFileuseFiles()to exposeselectFilesalongsideuploadandgetDownloadUrlAdaptorinterface with the new method + updated signatureselectFilesstub that throws (not supported in MCP Apps)docs/api-reference/use-files.mdxSource
Diff from
alpic-ai/openai-apps-sdk-docs