v1

latestOpenAPI 3.0.2MIT2026-07-24141061.6 KB
Files

List files

Returns a list of files that can be optionally limited to a set of results (e.g., limit, after), ordered (e.g., order), and filtered (e.g., purpose).

get/files

Query parameters

purposestring

Only return files with the given purpose.

limitinteger

A limit on the number of objects to be returned. Limit can range between 1 and 10,000.

order'asc' | 'desc'

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

afterstring

A cursor for use in pagination. after is the file ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with file-xyz, your subsequent call can include "after": "file-xyz" in order to fetch the next page of the list.

Response

Success. A list of paginated File objects.

objectstring

The object type, which is always list.

first_idstring

The identifier of the first File object in the data array.

last_idstring

The identifier of the last File object in the data array.

has_moreboolean

Returns true if more File objects are available; otherwise, returns false.