Skip to content

feat: support new OpenAI file library APIs (selectFiles, uploadFile library option) #605

@qchuchu

Description

@qchuchu

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

  1. Types — Update AppsSdkOpenAI interface to add selectFiles() and the new uploadFile options parameter
  2. Adaptor — Update AppsSdkAdaptor to support selectFiles() and forward the library option on uploadFile
  3. Hook — Extend useFiles() to expose selectFiles alongside upload and getDownloadUrl
  4. Adaptor interface — Update the shared Adaptor interface with the new method + updated signature
  5. MCP adaptor — Add selectFiles stub that throws (not supported in MCP Apps)
  6. Docs — Update docs/api-reference/use-files.mdx
  7. Skills — Update chatgpt-app-builder skill if it references file APIs

Source

Diff from alpic-ai/openai-apps-sdk-docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions