28
15 Comments

Claude just slashed the cost of building AI applications
IH+ Subscribers Only

Claude, one of the top three AI providers, recently introduced a feature called Prompt Caching. It significantly reduces the cost of using the API.

Chatbots receiving inputs and sending outputs

Imagine you're creating an AI SaaS/app.

You're heavily dependent on OpenAI, Claude, or Google's API, and one of your key competitive advantages is your advanced prompt.

However, your advanced prompt is quite lengthy and includes many examples, which help the AI generate a useful output.

This can quickly drive up your API costs since you're constantly sending the same long input. Providers like OpenAI charge you based on input tokens, meaning the more words you send for the AI to process, the more it costs.

Things can get expensive fast.

Welcome to the world of prompt caching

ClaudeAI, one of the top three AI providers in the world (alongside Google and OpenAI), has recently introduced a feature called Prompt Caching.

This feature essentially allows you to "reuse text" across multiple prompts.

Imagine you have a large prompt with numerous examples, and the examples make up 90% of the prompt's length.

With this feature, you can "cache" the examples and only send the remaining 10% as the actual prompt.

The impact of this is dramatic. Up to 90% reduction in input API costs.

This also means that, as a developer, you can either lower your pricing or increase your profit margins for your SaaS/app.

What is prompt caching useful for?

According to the creators of Claude, this is useful if you provide:

  • AI assistants, where you expect multiple users to enter the same prompt.

  • Code generation where you need to reuse the same prompt or have multiple users working with the same template.

  • Code reviews: When asking AI to review long chunks of code, you don't have to send the same code over and over again. This can save both time and money

  • Processing large documents: For instance, if you feed the AI a novel and want to ask questions about it,.

  • Any search tool: You can input data from files and ask questions, etc.

  • Any prompt with plenty of examples: You no longer need to worry about optimizing your prompt for length. You can focus on being thorough and getting the best results possible.

Will OpenAI follow suit and release a similar feature soon?

Photo of Darko Gjorgjievski Darko Gjorgjievski

Darko is a journalist for Indie Hackers and an entrepreneur. He writes about AI and acquisition channels that work for founders. He runs a newsletter called Growth Trends where he curates news items focused on user acquisition and new product ideas.

  1. 1

    "Claude just made AI development more accessible—this is a game-changer! Lowering the cost of building AI applications opens up endless possibilities for innovation. Excited to see how this will drive the next wave of AI breakthroughs!"

  2. 1

    Claude AI’s Prompt Caching feature could be a real game-changer in AI development! Not only does it dramatically reduce costs for developers, but it also enhances the efficiency of AI SaaS/apps. What’s exciting is that this technology could improve AI accessibility as well. Now, it’ll be interesting to see how OpenAI and Google respond to this. Exciting times ahead for AI developers!"

    Let me know if you need any adjustments!

  3. 1

    the prompt caching is really useful, as i give various examples and corrections in a prompt and i would also sometimes have to use in different chats and scenarios.

  4. 1

    This seems useful. Was building a article translation app. To increase translation quality, we tried to send the whole article, which costed a lot and slow. This caching thing seems to be a good solution.

  5. 1

    "Claude just made AI development more accessible—this is a game-changer! Lowering the cost of building AI applications opens up endless possibilities for innovation. Excited to see how this will drive the next wave of AI breakthroughs!"

  6. 1

    Using Claude in my Cursor editor right now -- very cool!

  7. 1

    It is just like another form of making different AI chat bot for everyone.

  8. 1

    hmm I just added LLM in my ai sdk, I only implemented features extraction and text completion, I did not know this is wanted feature to implement, actually it is trivia to implement, what other things you guys want?

  9. 1

    I would love them to bring out a model that competes with gpt-4o-mini . Though I have lots of credits with OpenAI I find Claude 3.5's quality much superior for my use case.

  10. 1

    This is another form of making different AI chat bot for everyone.

  11. 1

    Great examples. Just remember Claude only has 5 min cache, which limits the use cases based on your traffic

    1. 1

      You can send keep-alive requests every 4 minutes to extend it. Will cost you 10% each time though.

  12. -1

    THE BEST CRYPTO RECOVERY TEAM EVER GEO COORDINATES RECOVERY HACKER GET IN TOUCH WITH THEM VIA
    WhatsApp ( +1 (512) 550 1646 )
    What to do if You’ve Been a Victim of a Cryptocurrency Scam.  I am writing to extend my profound gratitude and utmost appreciation to GEO COORDINATES RECOVERY HACKER for their exceptional assistance in recovering my stolen funds. I lost $785,000 worth of cryptocurrency. I found myself in a challenging situation, I was inconsolable and believed I had reached my lowest point, I had no hope of getting my money back. All that changed when I discovered  a hacker called GEO COORDINATES RECOVERY HACKER and everything was transformed. The company intervened and helped me get all my money back within a short period of time. Their services are well recommended and they ensure maximum satisfaction to their clients. I am deeply grateful for their assistance and highly recommend their services to anyone in need of cybersecurity and recovery solutions.

Create a free account
to read this article.

Already have an account? Sign in.