ClaudeFile

@Serializable
data class ClaudeFile(val createdAt: Instant? = null, val downloadable: Boolean? = null, val expiresAt: Instant? = null, val filename: String? = null, val id: String? = null, val mimeType: String? = null, val sizeBytes: Int? = null, val type: String? = null)

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.

Constructors

Link copied to clipboard
constructor(createdAt: Instant? = null, downloadable: Boolean? = null, expiresAt: Instant? = null, filename: String? = null, id: String? = null, mimeType: String? = null, sizeBytes: Int? = null, type: String? = null)

Properties

Link copied to clipboard
@Serializable(with = InstantSerializer::class)
val createdAt: Instant? = null

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

Link copied to clipboard
val downloadable: Boolean? = null

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

Link copied to clipboard
@Serializable(with = InstantSerializer::class)
val expiresAt: Instant? = null

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.

Link copied to clipboard
val filename: String? = null

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.

Link copied to clipboard
val id: String? = null

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

Link copied to clipboard
val mimeType: String? = null

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

Link copied to clipboard
val sizeBytes: Int? = null

Output only. The size of the file in bytes.

Link copied to clipboard
val type: String? = null

Output only. The object type. Always file.