GuideMembers

Claude Files API TypeScript examples

Files API for TypeScript is a guide in Anthropic's claude-api skill for Node and TypeScript developers who want to upload a file once and reuse it by file_id across Messages API calls. It walks through uploading a PDF with toFile and attaching it to a message as a titled document with citations.

What it does

The guide repeats the service limits: 500 MB per file, 100 GB per organization, storage until deletion, and billing only when file content enters a message as input tokens. Its upload example passes the files-api-2025-04-14 beta flag.

How to use it

Create an Anthropic client, stream the file through toFile, then reference the returned id in a document block.

Requirements and limits

The Files API is now stable and client.beta.files changed shape, so these older examples need the migration noted in the skill; it is not offered on Bedrock or Vertex AI.

More in Guides and the Claude Code library.

What it covers

  • Key Facts
  • Upload a File
  • Use a File in Messages
  • PDF / Text Document
  • Manage Files
  • List Files
  • Delete a File
  • Download a File

The full text is in the members library

Book a call and we will give you access to the full Claude Code library: every entry in full, search by meaning, copy and download.

Source and license

Source: https://github.com/anthropics/skills/blob/main/skills/claude-api/typescript/claude-api/files-api.md

Author: anthropics, Anthropic skills. License: Apache-2.0.

Related entries