Hook

Their other posts in the index, biggest breakout first.
I was losing money on every API call to OpenAI until I learned about prompt caching. Let me show you how I fixed it and how you can too. Let's use my app as an example. It's a cover letter generator and I'm hitting the API of course we're sending this uh system prompt and the user's resume on every request and that never changes. Changing is the job title. If the beginning of your prompt is always staying the same, it caches that information so it doesn't have to run and compute. In my case, that is the system prompt, the instructions and then the user's resume, all the stuff like the job description at the very prompt on top. The docs say that adding a stable identifier for your end users, the user parameter here, boosts cache hit rates and a great way to provide a stable identifier is to take a hash of your user's email for example and send that every time that user makes a request. OpenAI will add that hash to the beginning and make it easier to cache it for you. My bio has these code examples on how you can implement this strategy for prompt caching or you can check it out. I've built its open source. It's called Cover Letter GPT dot xyz. Bye bye.