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

interface FileObject {
    bytes: number;
    created_at: number;
    filename: string;
    id: string;
    object: "file";
    purpose:
        | "batch"
        | "assistants"
        | "assistants_output"
        | "batch_output"
        | "fine-tune"
        | "fine-tune-results"
        | "vision";
    status: "error" | "uploaded" | "processed";
    status_details?: string;
}

Properties

bytes: number

The size of the file, in bytes.

created_at: number

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

filename: string

The name of the file.

id: string

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

object: "file"

The object type, which is always file.

purpose:
    | "batch"
    | "assistants"
    | "assistants_output"
    | "batch_output"
    | "fine-tune"
    | "fine-tune-results"
    | "vision"

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

status: "error" | "uploaded" | "processed"

@deprecated: Deprecated. The current status of the file, which can be either 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.