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

afterstring nullable

A cursor for use in pagination. after is an object ID that defines your place in the list.

limitinteger nullable

Maximum number of items to return (default: 20, max: 100)

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.

first_idstring nullable
has_moreboolean required
last_idstring nullable
object'list' required

Object type for lists - always "list"

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"
}

Changes