Skip to main content
GET
Core - List project files
Related guide: Files guide. See the Files guide for a walkthrough with examples.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

limit
integer<int32>

Page size, 1-200. Unset uses the server default.

starting_after
string

Cursor for forward pagination. Set to the file_id of the last item from the previous page. Mutually exclusive with ending_before.

ending_before
string

Cursor for backward pagination. Set to the file_id of the first item from the previous page. Mutually exclusive with starting_after.

project_id
string
purpose
string

Restrict results to files declared with this purpose. Accepts a purpose alias (retrieval, knowledge_datasource, batch, code_interpreter) or canonical FILE_PURPOSE_* name case-insensitively. Omit to list files of every purpose.

order
string

Sort order by creation. Defaults to ascending (oldest first).

Response

OK

object
string
required

Object discriminator for list responses; always list.

data
object[]
required

Page of files.

has_more
boolean
required

Whether more files are available in the selected pagination direction.