Anthropic’s new Files API vs. pasting: It will save you time, but it won’t save you money.
Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.
Practical API comparison for AI agent file handling, directly actionable for developers using Anthropic.
Anthropic's Files API, now out of beta, lets developers upload a document once and reference it by ID, avoiding pasting content into every prompt. Testing against a 1,200-word API reference with five nuanced questions showed all three approaches (pasting, Files API, and prompt caching) produced identical correct answers, but the Files API actually cost 125 more input tokens across five requests due to overhead. Prompt caching, which bills the document once as a cache write at a 25% premium and subsequent reads at one-tenth the rate, was the only method that reduced token costs, though it requires requests within a five-minute cache window.