The chat that got expensive
Your AI tutor costs about a cent per message for new users. One student's 400-message chat now costs 30 cents per message, and replies take ages.
This answers: Why do long AI chats cost so much? No coding needed. 3 quick decisions.
- Costs and abuse
- Supervising your AI
Checking your access…
Why do long AI chats cost so much?
Chat models don't remember between requests, so apps resend the conversation each time, and you pay for every token sent. Message 400 carries the 399 before it, so cost and wait time grow with every turn. Send recent messages in full with a summary of older ones, use prompt , cap tokens per request and track spend per user.
Breaks at Your server: Whole history resent with every message
Why AI tools write this bug
The simplest chat code loads all past messages and sends them, which is fine for ten messages and costly for four hundred.
How to fix it
- Limit history to recent messages plus a summary.
- Use prompt for fixed instructions.
- Cap input and output tokens per request.
- Track AI spend per user and alert on outliers.
Check your own app
Paste this into Lovable, Cursor or Claude Code:
Without changing anything, show me what this project sends to the AI model on each chat message. How many past messages are included, is there any limit, summary or prompt caching, and is AI spend tracked per user? Estimate the input size of message 200 in a long chat.
Common questions
- What happens when a chat exceeds the context window?
- The request fails with an error. Trimming or summarising history keeps long chats working.