Interface ClaudeFile

A file that can be referenced by ID from subsequent Claude model requests. The JSON representation of this message matches the Claude Files API File object field-for-field, so that code written against that API parses these responses unchanged. This data type is not supported in Gemini API.

interface ClaudeFile {
    createdAt?: string;
    downloadable?: boolean;
    expiresAt?: string;
    filename?: string;
    id?: string;
    mimeType?: string;
    sizeBytes?: number;
    type?: string;
}

Properties

createdAt?: string

Output only. The time at which the file was created.

downloadable?: boolean

Output only. Whether the contents of this file can be retrieved with DownloadFile. False for user-uploaded files, true for tool-generated ones.

expiresAt?: string

Output only. The time at which the file expires and is deleted, set from the expires_in_seconds upload form field. Unset for files that do not expire, which is serialised as null.

filename?: string

Output only. The original name of the uploaded file, taken from the Content-Disposition header on upload. Between 1 and 255 characters. Control characters and the characters <>:"|?*/ are not accepted.

id?: string

Output only. The server-assigned identifier of the file, for example file_abc123. This is the ID to pass in subsequent model requests.

mimeType?: string

Output only. The media type of the file, taken from the Content-Type header of the file part on upload.

sizeBytes?: number

Output only. The size of the file in bytes.

type?: string

Output only. The object type. Always file.