FileObject

@Serializable
class FileObject(val id: String, val object: String, val bytes: Long, val createdAt: Long, val filename: String, val purpose: FilePurpose, val expiresAt: Long? = null)

A file stored by the DeepSeek Files API.

Feed id to a FilePart — or to the imageFile(...) step of the user { } DSL — to let a vision model read the file:

val uploaded = client.uploadFile(imageBytes, "cat.jpg")
client.chatCompletion {
params { model = ChatModel.DEEPSEEK_FLASH }
messages {
user {
text("What is in this image?")
imageFile(uploaded.id)
}
}
}

See also

Constructors

Link copied to clipboard
constructor(id: String, object: String, bytes: Long, createdAt: Long, filename: String, purpose: FilePurpose, expiresAt: Long? = null)

Properties

Link copied to clipboard
val bytes: Long

Size of the file in bytes.

Link copied to clipboard

Unix timestamp, in seconds, of when the file was created.

Link copied to clipboard

Unix timestamp, in seconds, of when the file expires. null for a file uploaded without an expiry, which the API keeps indefinitely.

Link copied to clipboard

Name the file was uploaded under.

Link copied to clipboard
val id: String

File identifier, of the form file-api-....

Link copied to clipboard

Object type discriminator; always file.

Link copied to clipboard

What the file may be used for; currently always FilePurpose.USER_DATA.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String