Claude Platform Docs

Файлы

Загрузить файл
$client->beta->files->upload(string file, ?int expiresInSeconds, ?list<AnthropicBeta> betas, ?string workspaceID): BetaFileMetadata
POST/v1/files
Список файлов
$client->beta->files->list(?list<string> ids, ?int limit, ?string page, ?string scopeID, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<BetaFileMetadata>
GET/v1/files
Скачать файл
$client->beta->files->download(string fileID, ?list<AnthropicBeta> betas, ?string workspaceID): download
GET/v1/files/{file_id}/content
Получить метаданные файла
$client->beta->files->retrieveMetadata(string fileID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaFileMetadata
GET/v1/files/{file_id}
Удалить файл
$client->beta->files->delete(string fileID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaDeletedFile
DELETE/v1/files/{file_id}
Models
class BetaDeletedFile { $type; $id; }
?Type type

Deleted object type.

For file deletion, this is always "file_deleted".

string id

ID of the deleted file.

class BetaFileMetadata { $type = 'file'; $id; $createdAt; /* 6 more */ }
"file" type

Object type.

For files, this is always "file".

string id

Unique object identifier.

The format and length of IDs may change over time.

\Datetime createdAt

RFC 3339 datetime string representing when the file was created.

string filename

Original filename of the uploaded file.

string mimeType

MIME type of the file.

int sizeBytes

Size of the file in bytes.

?bool downloadable

Whether the file can be downloaded.

?\Datetime 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.

?BetaFileScope scope

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

class BetaFileScope { $type = 'session'; $id; }
"session" type

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

string id

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