public interface FileApi
| Modifier and Type | Method and Description |
|---|---|
io.reactivex.rxjava3.core.Single<FileDeleted> |
deletedFile(String fileId)
Delete a file from the platform Permanently removes the file and all associated
data
|
retrofit2.Call<okhttp3.ResponseBody> |
fileContent(String fileId)
Download file content Streams the actual file content for download or processing
|
io.reactivex.rxjava3.core.Single<QueryFileResult> |
queryFileList(String after,
String purpose,
String order,
Integer limit)
Query and list files with filtering options Retrieves a paginated list of files
with optional filtering by purpose and ordering
|
io.reactivex.rxjava3.core.Single<File> |
uploadFile(okhttp3.MultipartBody multipartBody)
Upload a file to the platform Stores files for use in fine-tuning, knowledge base,
or other AI operations
|
@POST(value="files") io.reactivex.rxjava3.core.Single<File> uploadFile(@Body okhttp3.MultipartBody multipartBody)
multipartBody - File data with metadata including purpose and format@DELETE(value="files/{file_id}")
io.reactivex.rxjava3.core.Single<FileDeleted> deletedFile(@Path(value="file_id")
String fileId)
fileId - Unique identifier of the file to delete@GET(value="files") io.reactivex.rxjava3.core.Single<QueryFileResult> queryFileList(@Query(value="after") String after, @Query(value="purpose") String purpose, @Query(value="order") String order, @Query(value="limit") Integer limit)
after - Cursor for pagination to get files after this pointpurpose - Filter files by their intended purpose (e.g., fine-tune, assistants)order - Sort order for the file list (e.g., created_at)limit - Maximum number of files to return per page@Streaming
@GET(value="files/{file_id}/content")
retrofit2.Call<okhttp3.ResponseBody> fileContent(@Path(value="file_id")
String fileId)
fileId - Unique identifier of the file to downloadCopyright © 2025. All rights reserved.