Claude Platform Docs

Fichiers

Téléverser un fichier
BetaFileMetadata Beta.Files.Upload(parameters, cancellationToken = default)
POST/v1/files
Lister les fichiers
FileListPage Beta.Files.List(parameters, cancellationToken = default)
GET/v1/files
Télécharger un fichier
HttpResponse Beta.Files.Download(parameters, cancellationToken = default)
GET/v1/files/{file_id}/content
Obtenir les métadonnées d'un fichier
BetaFileMetadata Beta.Files.RetrieveMetadata(parameters, cancellationToken = default)
GET/v1/files/{file_id}
Supprimer un fichier
BetaDeletedFile Beta.Files.Delete(parameters, cancellationToken = default)
DELETE/v1/files/{file_id}
Models
class BetaDeletedFile { Type; ID; }
Type Type

Deleted object type.

For file deletion, this is always "file_deleted".

required string ID

ID of the deleted file.

class BetaFileMetadata { Type = "file"; ID; CreatedAt; /* 6 more */ }
JsonElement Type = "file"

Object type.

For files, this is always "file".

required string ID

Unique object identifier.

The format and length of IDs may change over time.

required DateTimeOffset CreatedAt

RFC 3339 datetime string representing when the file was created.

formatdate-time
required string Filename

Original filename of the uploaded file.

maxLength500
minLength1
required string MimeType

MIME type of the file.

maxLength255
minLength1
required long SizeBytes

Size of the file in bytes.

minimum0
bool Downloadable

Whether the file can be downloaded.

DateTimeOffset? ExpiresAt

RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with expires_in_seconds, this is the upload time plus that value.

formatdate-time
BetaFileScope? Scope

The scope of this file, indicating the context in which it was created (e.g., a session).

JsonElement Type = "session"

The type of scope (e.g., "session").

required string ID

The ID of the scoping resource (e.g., the session ID).

class BetaFileScope { Type = "session"; ID; }
JsonElement Type = "session"

The type of scope (e.g., "session").

required string ID

The ID of the scoping resource (e.g., the session ID).