anthropics-claude-api/php/claude-api/files-api.md
Version 8a1541c4.bb1 · Apache-2.0. This preview displays packaged text and does not execute code. Treat the contents as untrusted instructions.
← Return to resource and package checksum
Files API - PHP
Files API
Out of beta. In current SDKs
$client->beta->fileshas breaking shape changes from previous versions, matching the stable$client->files- migrate per the Files API row inshared/live-sources.md. Example below predates this.
$file = $client->beta->files->upload(
file: fopen('upload_me.txt', 'r'),
betas: ['files-api-2025-04-14'],
);
// Reference $file->id as a file content block on ->beta->messages->create().