Skip to content
Get started

Files

List files
client.files.list(FileListParams { after, limit } query?, RequestOptionsoptions?): CursorIDPage<File { id, content_type, created_at, 3 more } >
GET/v1/files
Upload a file
client.files.upload(FileUploadParams { file } body, RequestOptionsoptions?): File { id, content_type, created_at, 3 more }
POST/v1/files
Delete a file
client.files.delete(stringfileID, RequestOptionsoptions?): void
DELETE/v1/files/{file_id}
Get file metadata
client.files.retrieve(stringfileID, RequestOptionsoptions?): File { id, content_type, created_at, 3 more }
GET/v1/files/{file_id}
ModelsExpand Collapse
File { id, content_type, created_at, 3 more }

Response representing an uploaded file.

This is returned from POST (upload), GET (retrieve), and list endpoints.

id: string

The unique identifier for this file.

content_type: string

The MIME type of the file.

maxLength255
created_at: string

The timestamp when the file was uploaded.

formatdate-time
file_name: string

The original filename of the uploaded file.

maxLength255
size: number

The size of the file in bytes.

minimum0
object?: "file"

The object type, which is always 'file'.