My API bill hit 400,000 won in a month

I was shocked when I saw the LLM API bill for my personal project.

The cause was that I wasn't caching anything and was sending the entire long prompt with every request. How do you all manage costs?

by 스타트업러749

6 answers

Always cache the fixed front part of the prompt, and log the token counts in your request logs and view them on a dashboard. I only figured out where it was leaking after I saw that. And make sure to set max_tokens.

by 초보개발자705 · ▲0

Wow, 400,000 KRW is a lot for a personal project... Just adding caching would've cut it in half—what a waste ㅠㅠ

by 지나가던행인332 · ▲0