GET
/filesList files
Lists uploaded files available to the authenticated user. Use purpose, order, and the cursor in after to filter, sort, and paginate the results.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
purposestringoptional
Filters the list to files with the specified purpose.
limitintegeroptional
Maximum number of files to return, from 1 to 10,000. Defaults to 10,000 when omitted.
orderstringoptional
Sort order by creation time: `asc` or `desc`. Defaults to `desc` when omitted.
afterstringoptional
Cursor identifying the last file from the previous page; omit it to start from the beginning.
200Returns a paginated list containing file objects, the first and last file identifiers, and a flag indicating whether more files are available.
objectstringrequired
dataarray<OpenAIFile>required
first_idstringrequired
last_idstringrequired
has_morebooleanrequired
Error handling
limit must be between 1 and 10,000 and defaults to 10,000 when omitted. order must be asc or desc, and after must identify a position in the file list when supplied.