Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build LLM-powered apps with the Anthropic Claude API or SDK across Python, TypeScript, Java, Go, Ruby, C#, and PHP.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
csharp/claude-api/files-api.md
1# Files API — C#23## Files API (Beta)45Files live under `client.Beta.Files` (namespace `Anthropic.Models.Beta.Files`). `BinaryContent` implicit-converts from `Stream` and `byte[]`.67```csharp8using Anthropic.Models.Beta.Files;9using Anthropic.Models.Beta.Messages;1011FileMetadata meta = await client.Beta.Files.Upload(12new FileUploadParams { File = File.OpenRead("doc.pdf") });1314// Referencing the uploaded file requires Beta message types:15new BetaRequestDocumentBlock {16Source = new BetaFileDocumentSource { FileID = meta.ID },17}18```1920The non-beta `DocumentBlockParamSource` union has no file-ID variant — file references need `client.Beta.Messages.Create()`.2122---2324