支持 /v1/files 与向量存储端点以启用 Responses API 文件检索功能
Road to Create / 创建前须知
- [x] I have confirmed there are no similar issues currently. / 我已经确认目前没有类似问题。
- [x] I have confirmed I have investigated the available workarounds and existing issues. / 我已经确认检查了已有的解决办法和问题。
- [x] I have browsed/read the project README to make sure my concern is not covered by the current version or release branch. / 我已阅读项目 README,确定我的关注点未在当前版本或发布分支中覆盖。
- [x] I have described my concept in this issue in a way that developers or maintainers can understand. / 我已经以开发者或维护者能理解的方式描述了我的想法。
- [x] I understand and accept that issues without sufficient detail may be ignored or closed directly. / 我理解并接受缺乏足够细节的问题可能会被忽略或直接关闭。
Feature Description / 功能描述
Currently, new-api exposes the /v1/responses relay but does not proxy the OpenAI Files API or vector store management endpoints. The Responses API includes a built‑in file_search tool that requires developers to upload documents via /v1/files and create vector stores before querying. Without support for these endpoints, users must leave new-api to call OpenAI directly, breaking the unified gateway experience, complicating authentication and billing, and making file search unavailable through new-api.
当前,new-api 提供了 /v1/responses 的转发功能,但并未代理 OpenAI 的 Files API 和向量存储管理接口。Responses API 中内置的 file_search 工具要求开发者先通过 /v1/files 上传文档并创建向量存储后才能查询。如果缺少这些端点,用户必须离开 new-api 直接调用 OpenAI,断止了统一的网关体验,增加了身份验证和计费的复杂性,并使得文件检索无法通过 new-api 使用。
New Feature / 新功能
Please implement support for the OpenAI Files API (/v1/files create, list, retrieve, delete, get content) and vector store management (create, add file, delete, list) within new‑api. These endpoints should proxy requests to the underlying providers, handle multipart uploads, and return responses transparently. By adding these endpoints, developers will be able to upload documents, build vector stores, and reference the resulting file_id or vector_store_id in /v1/responses calls to enable the file_search tool.
请在 new-api 中实现对 OpenAI Files API(/v1/files 创建、列出、获取、删除、获取内容)以及向量存储管理(创建、添加文件、删除、列出)的支持。这些端点应将请求透明地代理到底层服务提供者,处理多部件上传,并返回响应。通过增加这些端点,开发者将能够上传文档、构建向量存储,并在 /v1/responses 调用中引用生成的 file_id 或 vector_store_id 以启用 file_search 工具。
Additional Note / 额外说明
Because the Files API requires a corresponding token, please invoke the API through the appropriate channel specified with -x so that the file ID and the API account match. This avoids inconsistencies when using file-based tools in the Responses API.
由于文件 API 需要对应的 token,请通过使用 -x 指定的对应渠道调用 API,以确保文件 ID 与所用的 API 账号相匹配,避免在 Responses API 的文件工具中出现不一致的情况。
+1 但工作量有些大
+1 很需要