files
List files
Returns a paginated list of your uploaded files.
Use cursor-based pagination: pass last_id from the response as the after parameter to fetch the next page.
get/files
Query parameters
Pagination parameters
orderstring
Sort order by created_at (asc or desc, default desc)
purposestring nullable
Only return files with the given purpose
searchstring nullable
Search query to filter files by filename (case-insensitive substring match)
ownboolean
If true, only return files uploaded by the current user (even if the user has ReadAll permission)
member_idstring uuid nullable
Filter by member user ID (resolves to api_key_id). Available in org context for any member, or in personal context for platform managers.
Response
List of files. Check has_more to determine if additional pages exist.
Example response
{
"data": [
{
"bytes": 12045,
"created_at": 1703187200,
"filename": "batch_requests.jsonl",
"id": "file-abc123",
"object": "file",
"purpose": "batch"
}
],
"first_id": "file-abc123",
"has_more": false,
"last_id": "file-abc123",
"object": "list"
}