List Files
List the files belonging to the authenticated user.
List the files owned by the authenticated API key.
GET /v1/filesQuery parameters
purposestringoptionalOnly return files with this purpose.
Allowed values:
user_datalimitintegeroptionalDefault 10000Maximum number of files to return per page.
orderstringoptionalDefault descSort order by created_at.
Allowed values:
ascdescafterstringoptionalCursor for pagination. Pass the id of the last file from the
previous page.
Response
object'list'optionalAlways list.
dataFileObject[]optionalArray of FileObject entries.
has_morebooleanoptionaltrue when more pages exist. Use last_id as the after cursor for
the next page.
first_idstringoptionalid of the first item on this page.
last_idstringoptionalid of the last item on this page.
The response shape is compatible with the OpenAI SDK's CursorPage, so
async iteration (for await (const file of client.files.list()))
works out of the box.