Claude Platform Docs

下载文件

$client->beta->files->download(string fileID, ?list<AnthropicBeta> betas, ?string workspaceID): download
GET/v1/files/{file_id}/content

下载文件

Parameters
fileID: string

ID of the File.

betas?:optional list<AnthropicBeta>

Optional header to specify the beta version(s) you want to use.

workspaceID?:optional string
Returns
mixed
下载文件
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'my-anthropic-api-key');

$response = $client->beta->files->download(
  'file_id',
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($response);