Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 681 Bytes

data-files-api-reference-php.md

File metadata and controls

18 lines (15 loc) · 681 Bytes

Files API - PHP

Files API

Out of beta. In current SDKs $client->beta->files has breaking shape changes from previous versions, matching the stable $client->files - migrate per the Files API row in shared/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().