Chatbot API Cost Calculator

A normal chatbot message is often cheaper than document-heavy use cases, but cost can grow when chat history or long system prompts are included.

Starting estimate

Input tokens

2,000

Output tokens

500

Preset name

small-chatbot-message

These values are only a starting point. You can adjust them on the calculator page.

What counts as input tokens?

System prompt, user message, recent chat history, tool instructions, and any extra context sent with the request.

What counts as output tokens?

The assistant reply, structured output, suggestions, or follow-up questions.

What affects the cost?

Chat history length, system prompt size, model choice, answer length, and whether tools or retrieved context are included.

FAQ

How many tokens does a chatbot message use?

For many apps, 2,000 input and 500 output is a practical baseline.

Why does chat history increase API cost?

Each prior turn sent again in the prompt contributes additional input tokens.

Are output tokens more expensive than input tokens?

Often yes, depending on provider and model pricing tables.

How can I reduce chatbot API costs?

Summarize old turns, shorten prompts, and set strict max output tokens.

Sponsored DigitalOcean

Hosting your AI app?

After comparing API costs, the next cost factor is where your app runs. DigitalOcean can be a simple option for hosting prototypes, API backends, workers, databases, and Laravel apps.

Explore DigitalOcean →

This link is an affiliate link. This means that, at zero cost to you, we earn commissions when you shop through the link.

Related use cases