Skip to content

Compare AI API costs across OpenAI, Anthropic, Google, Azure & more - Free web tool to estimate LLM costs instantly

License

Notifications You must be signed in to change notification settings

Turtles-AI-Lab/llm-cost-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° LLM Cost Calculator

Compare AI API costs across providers instantly - A free, open-source web tool to estimate and compare LLM costs from OpenAI, Anthropic, Google, Azure, Mistral, and local models.

Live Demo License: MIT

✨ Features

  • πŸš€ Instant Calculations - Real-time cost estimates as you adjust parameters
  • 🏒 Multiple Providers - Compare OpenAI, Anthropic, Google, Azure, Mistral, and local models
  • πŸ“Š Use Case Templates - Quick-start templates for common scenarios
  • πŸ’Έ Savings Analysis - See potential savings by switching providers
  • πŸ“ˆ Detailed Breakdown - Input, output, and total costs
  • 🎯 No Installation - Runs entirely in your browser
  • πŸ“± Mobile Friendly - Works on all devices
  • πŸ”’ Privacy First - All calculations happen client-side

🎯 Supported Providers

Provider Models Included Notes
OpenAI GPT-4o, GPT-4o Mini, GPT-4 Turbo, GPT-4, GPT-3.5 Turbo Industry standard
Anthropic Claude 3.5 Sonnet, Claude 3 Opus/Sonnet/Haiku Best for long context
Google Gemini 1.5 Pro/Flash, Gemini Pro 2M token context!
Azure OpenAI GPT-4o, GPT-4 Turbo, GPT-3.5 Turbo Enterprise features
Mistral AI Large, Medium, Small, Tiny European provider
Local/Self-Hosted Llama 3, Mixtral, Custom $0 API costs

πŸš€ Quick Start

Option 1: Use Online (Recommended)

Visit the live demo: https://turtles-ai-lab.github.io/llm-cost-calculator

Option 2: Run Locally

# Clone the repository
git clone https://github.com/Turtles-AI-Lab/llm-cost-calculator.git
cd llm-cost-calculator

# Open in browser
open index.html
# or double-click index.html

No dependencies, no build step, no servers - just open and use!

πŸ“– How to Use

1. Choose a Use Case Template (Optional)

Select from pre-configured scenarios:

  • Customer Support Chatbot - 500 input / 200 output tokens
  • Document Analysis - 3000 input / 500 output tokens
  • Code Generation - 800 input / 600 output tokens
  • Ticket Classification - 300 input / 100 output tokens
  • Content Generation - 500 input / 1000 output tokens

2. Configure Your Parameters

  • Input Tokens: Average tokens sent to the LLM per request (~100 tokens β‰ˆ 75 words)
  • Output Tokens: Average tokens generated by the LLM per request
  • Requests per Day: How many API calls you'll make daily
  • Time Period: Calculate costs for 1 day, 1 week, 1 month, 3 months, or 1 year

3. Select Providers

Check/uncheck providers to customize your comparison

4. View Results

  • Cost Summary: Best value, price range, potential savings, annual cost
  • Detailed Table: Full breakdown sorted by cost (cheapest first)
  • Per-Request Cost: See exactly what each API call costs you

πŸ’‘ Use Cases

For Startups

  • Evaluate provider costs before building your product
  • Find the most cost-effective model for your use case
  • Budget for API costs in your financial projections

For Developers

  • Compare costs when integrating LLMs
  • Decide between cloud APIs vs. local hosting
  • Optimize token usage to reduce costs

For Enterprises

  • Estimate annual LLM infrastructure costs
  • Compare Azure vs. other providers for enterprise features
  • Calculate ROI on local LLM deployment

For MSPs/Agencies

  • Price AI services for clients
  • Calculate margin on LLM-powered offerings
  • Compare multi-tenant costs

πŸ“Š Example Calculations

Customer Support Bot

  • Input: 500 tokens (customer inquiry)
  • Output: 200 tokens (AI response)
  • Volume: 1,000 requests/day
  • Result: GPT-4o Mini costs $45/month vs. GPT-4 at $18,000/month

Document Analysis

  • Input: 3,000 tokens (document)
  • Output: 500 tokens (summary)
  • Volume: 100 requests/day
  • Result: Claude 3 Haiku costs $11.25/month vs. Claude 3 Opus at $562.50/month

πŸ”§ Customization

Add Your Own Models

Edit js/providers.js:

const LLM_PROVIDERS = {
    // Add your provider
    myProvider: {
        name: "My Provider",
        models: {
            "my-model": {
                name: "My Model",
                inputPrice: 1.00,  // per 1M tokens
                outputPrice: 3.00, // per 1M tokens
                contextWindow: 8192
            }
        }
    }
};

Add Use Case Templates

Edit js/providers.js:

const USE_CASE_TEMPLATES = {
    myUseCase: {
        name: "My Use Case",
        avgInputTokens: 500,
        avgOutputTokens: 500,
        requestsPerDay: 1000
    }
};

🎨 Screenshots

Calculator Interface

🀝 Contributing

Contributions welcome! Ways to help:

  • πŸ”„ Update pricing data
  • βž• Add new providers or models
  • πŸ› Report bugs or issues
  • πŸ’‘ Suggest features
  • πŸ“– Improve documentation
  • 🌍 Add translations

See CONTRIBUTING.md for guidelines.

πŸ“Š Pricing Data Sources

Pricing updated September 2025 from official sources:

Note: Pricing may change. Always verify with official provider documentation before making decisions.

πŸ“„ License

MIT License - see LICENSE file

Free to use, modify, and distribute. Attribution appreciated!

🏒 About

Built by Turtles AI Lab - We build AI-powered business solutions.

Related Projects

Commercial Services

Need help with AI integration?

  • Custom LLM solution development
  • Cost optimization consulting
  • Integration support

πŸ“§ Contact: jgreenia@jandraisolutions.com

⭐ Support

If you find this tool useful:

  • ⭐ Star this repository
  • πŸ› Report bugs or request features
  • πŸ’¬ Share with your network
  • πŸ“– Improve documentation

Made with ❀️ by Turtles AI Lab

Helping businesses make informed decisions about AI costs.

About

Compare AI API costs across OpenAI, Anthropic, Google, Azure & more - Free web tool to estimate LLM costs instantly

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published