Returns a list of files.

GET /files

Query parameters

  • purpose string

    Only return files with the given purpose.

  • limit integer

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

    Default value is 10000.

  • order string

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

    Values are asc or desc. Default value is desc.

  • after string

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

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • object string Required
    • data array[object] Required

      The File object represents a document that has been uploaded to OpenAI.

      Hide data attributes Show data attributes object
      • id string Required

        The file identifier, which can be referenced in the API endpoints.

      • bytes integer Required

        The size of the file, in bytes.

      • created_at integer Required

        The Unix timestamp (in seconds) for when the file was created.

      • expires_at integer

        The Unix timestamp (in seconds) for when the file will expire.

      • filename string Required

        The name of the file.

      • object string Required

        The object type, which is always file.

        Value is file.

      • purpose string Required

        The intended purpose of the file. Supported values are assistants, assistants_output, batch, batch_output, fine-tune, fine-tune-results and vision.

        Values are assistants, assistants_output, batch, batch_output, fine-tune, fine-tune-results, or vision.

      • status string Required Deprecated

        Deprecated. The current status of the file, which can be either uploaded, processed, or error.

        Values are uploaded, processed, or error.

      • status_details string Deprecated

        Deprecated. For details on why a fine-tuning training file failed validation, see the error field on fine_tuning.job.

    • first_id string Required
    • last_id string Required
    • has_more boolean Required
GET /files
curl \
 --request GET 'https://api.openai.com/v1/files' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "object": "list",
  "data": [
    {
      "id": "string",
      "bytes": 42,
      "created_at": 42,
      "expires_at": 42,
      "filename": "string",
      "object": "file",
      "purpose": "assistants",
      "status": "uploaded",
      "status_details": "string"
    }
  ],
  "first_id": "file-abc123",
  "last_id": "file-abc456",
  "has_more": false
}