List files

GET /files

Returns a list of files that belong to the user's organization.

Query parameters

  • purpose string

    Only return files with the given purpose.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • 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.

      • 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.

    • object string Required

      Value is list.

GET /files
curl \
 -X GET https://api.openai.com/v1/files \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": [
    {
      "id": "string",
      "bytes": 42,
      "created_at": 42,
      "filename": "string",
      "object": "file",
      "purpose": "assistants",
      "status": "uploaded",
      "status_details": "string"
    }
  ],
  "object": "list"
}