Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I find it really weird that Anthropic uses only a five minute cache on the API.

You can set 5 minute or 1 hour with API requests. It's the user's choice, not something they force on you. You get the cheapest option (5 minutes) if you don't specify the time.

https://platform.claude.com/docs/en/build-with-claude/prompt...

 help



> You get the cheapest option (5 minutes) if you don't specify the time.

Okay, but isn't it weird that the default is a giant footgun?


The API is used for a lot more than agentic coding. I would not be surprised if 5 minute was preferred on average across all types of usage.

If Anthropic set it to the more expensive option by default, we'd be reading articles about people complaining how evil they were for defaulting to the more expensive option.


But why not have a 30 minute option by default then allow users to opt-in to either more or less as needed?

But why not have a 5 minute option by default then allow users to opt-in to more as needed?

Why not have no default and make it explicit?

You break backward compatibility

True! Every single option have no default! Your curl should look like a book every invocation.

No, just that one.

mine usually does...

beautiful

because it's a footgun, pls follow thread you're answering to, it was already discussed

It's not any more of a footgun than setting a default to a more expensive option.

You're advocating for a change therefore it's your burden to provide a positive argument which you're presupposing.


Isn’t the shorter cache time more expensive for the user?

Depends on the usecase.

I have to wonder if you have even coded with any of these APIs before. I have been using them far before caching was even an option and for a lot of workflows you build you don’t necessarily want to use any caching. These APIs are not that complex and I am kind of shocked people would even think it’s a footgun. There are a handful of configurable items and if this a footgun I fear for engineering.

Because 5min is cheaper for users. Look at API costs

Because that doesn't minimise their costs?

Because that's more expensive for any single request.

API users who care could opt-in to less caching though.

The default is already NO CACHING. You have to enable caching explicitly in the first place!

API users who care can opt-in to more caching though.

yeah, not sure why you're downvoted, but the API is clearly for using Claude in your products that you serve to your users. It's also why it's priced higher since it's assumed to be close to where you make money. It's the same with cloud computing, where clouds could charge 1000x the involved compute for some per-access DB, but you wouldn't run a nuclear reactor simulation on Firebase.

> you wouldn't run a nuclear reactor simulation on Firebase.

I mean... you say I wouldn't, but im all up for trying.


naturally on a single instruction move-only VM in real time database that works via database trigger cloud functions!

More often than not, they’ve come out looking disingenuous. Maybe they need to hire a better customer relations leader - someone that gets ahead of the problem.

Their API customers should know about changes affecting them well ahead of time. They should have a zero surprise policy around any change that influences cost (cache is one such thing, price difference between a cache hit/miss is 2x-5x input cost per request).


There's so much hysteria around Anthropic that there's no point in them hiring a customer relations person, HN has totally lost the plot when it comes to them

> The API is used for a lot more than agentic coding. I would not be surprised if 5 minute was preferred on average across all types of usage

These vendors are interchangeable, the business models and sectors are largely the same, I doubt there’s a purely business reason behind that decision, likely a technical leadership decision

The more opinionated a vendor is within a category that’s merging, the worse the user experience

And about your second point, Anthropic is not exactly a friend. It’s dubious to be knocking open models the way they do, while simultaneously restricting free use for others. That’s not a normal thing to do


> I would not be surprised if 5 minute was preferred on average across all types of usage.

Why would anyone prefer something they don't notice unless it's more expensive?


When the alternative is paying more and never noticing it could possibly be lower?

Because it is more expensive and I think that is true for most/all api providers.

It's highly workload dependent whether the (cheaper to write) 5 min cache or 60 min cache ends up being cheaper. For my co's workforce we went with 60 min, but it's basically a wash

It's not. I've done the analysis on my usage and 5m is cheaper. From talking with others, this seems to be typical. The default is what's cheapest for most users.

The root comment mentions commands that take over five minutes to complete. How often is the agent doing that, versus something quicker? Usage tends to be, the agent does a ton of quick back and forth actions with directory listings and edits and file reads, and then after many quick rounds it eventually kicks off some slower compile/test/run stage which might exceed five minutes. If you use the 1h cache then that slower stage might be cheaper, but all of those quick rounds leading up to it are definitely more expensive. For 1h to work out in your favor, you need a substantial proportion of your work to wait between 5-60 minutes between rounds, including all those little back and forth rounds that happen while the agent is working and barely appear in the UI. This isn't very likely.


No, it's the correct default. Most API calls are not coding agents.

This is a place where it'd probably good if there wasn't a default set. I think we leap too readily to providing defaults for settings without thinking through whether the value is something the user should be intentional about declaring or leaving as-is.

If it was the other way people would complain they’re gouging

Giant footgun? Are we all imbeciles? I am truly confused what folks like yourself are arguing. These APIs have a handful of items you can tune. You have to opt into caching via API already. Why is this a footgun? Are we saying an engineer who has made the decision that their work benefits from caching (which costs more) can not understand that it defaults to the lower cache limit?

Par for the course

You know that memory isn't free, right?

It's what their business model tells them to do: maximize profit per token.

Making you spend tokens without noticing it is a free meal to them.

There are various other possibilities to clandestinely extract tokens from you. People just haven't thought about it yet.


Given the massive opacity around tokens and how they're used in closed systems we interact with I'm often surprised when discussions around them just assume there is no underhandedness involved in inflation or controlled deflation to maximize revenue.

> footgun

What a load-bearing observation. Good instinct!


Why not 15 minutes and 1 hour?

Why not 30 minutes and 1 hour?

Because 5 minutes is probably good only for uninterrupted agentic work, if I have to pause and read anything, it's expired.


except API requests are billed separately from your paid plan, so...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: