{
  "slug": "llm-api-cost",
  "title": "LLM API Cost Calculator — Monthly Spend Estimator",
  "h1": "LLM API cost calculator",
  "shortTitle": "LLM API Cost",
  "description": "Estimate monthly LLM spend from prompt and completion tokens, input and output rates.",
  "url": "https://aieconomyhub.co/llm-api-cost",
  "apiUrl": "https://aieconomyhub.co/api/page/llm-api-cost",
  "category": {
    "id": "api-cost",
    "label": "API & Token Cost"
  },
  "kind": "calc",
  "top": true,
  "lastUpdated": "2026-06-21",
  "faqs": [
    {
      "q": "How do I calculate LLM API cost?",
      "a": "Cost = (input tokens × input rate per million) + (output tokens × output rate per million), summed across all calls in a month. The output-token half is usually 80%+ of the bill because output rates are 4-5× input rates."
    },
    {
      "q": "How much does ChatGPT API cost per month?",
      "a": "For 1M monthly calls at 1,000 input / 500 output tokens each: GPT-5 ~$15,000/month. GPT-5 mini ~$1,200/month. With prompt caching on the system prompt, those numbers drop 40-60%."
    },
    {
      "q": "Is the OpenAI batch API really 50% off?",
      "a": "Yes. Submit non-real-time jobs to /v1/batches; results return within 24h at half the standard rate. Same for Anthropic's Message Batches API and Google's Batch Prediction endpoint. Use it for any workload where no human is waiting."
    }
  ],
  "howto": {
    "name": "How to calculate LLM API cost accurately",
    "description": "Four-step method to compute and forecast LLM spend.",
    "steps": [
      {
        "name": "Measure tokens, not characters",
        "text": "Use the provider's official tokenizer. tiktoken for OpenAI, anthropic.tokenizers for Claude."
      },
      {
        "name": "Multiply by published per-million rate",
        "text": "Separate input and output rates. Output rate is 4-5× higher."
      },
      {
        "name": "Subtract cache savings",
        "text": "If prompt caching is on, the system-prompt input cost drops to 10% of the standard rate after the first call."
      },
      {
        "name": "Add retries",
        "text": "Realistic production retry rate is 5-15% — most spend forecasts forget this."
      }
    ]
  },
  "dataset": null,
  "relatedTools": [
    {
      "slug": "token-price-compare",
      "title": "Token Compare",
      "url": "https://aieconomyhub.co/token-price-compare",
      "apiUrl": "https://aieconomyhub.co/api/page/token-price-compare"
    },
    {
      "slug": "prompt-to-cost",
      "title": "Prompt Cost",
      "url": "https://aieconomyhub.co/prompt-to-cost",
      "apiUrl": "https://aieconomyhub.co/api/page/prompt-to-cost"
    },
    {
      "slug": "cache-savings",
      "title": "Cache Savings",
      "url": "https://aieconomyhub.co/cache-savings",
      "apiUrl": "https://aieconomyhub.co/api/page/cache-savings"
    },
    {
      "slug": "fine-tune-vs-rag",
      "title": "Fine-Tune vs RAG",
      "url": "https://aieconomyhub.co/fine-tune-vs-rag",
      "apiUrl": "https://aieconomyhub.co/api/page/fine-tune-vs-rag"
    },
    {
      "slug": "embedding-cost",
      "title": "Embedding Cost",
      "url": "https://aieconomyhub.co/embedding-cost",
      "apiUrl": "https://aieconomyhub.co/api/page/embedding-cost"
    },
    {
      "slug": "vector-db-cost",
      "title": "Vector DB Cost",
      "url": "https://aieconomyhub.co/vector-db-cost",
      "apiUrl": "https://aieconomyhub.co/api/page/vector-db-cost"
    }
  ],
  "attribution": {
    "canonicalUrl": "https://aieconomyhub.co/llm-api-cost",
    "requirement": "Free to use. When embedding this data, please link back to the canonical URL above with the link text \"LLM API Cost\".",
    "license": "CC-BY-4.0 (attribution required)"
  }
}
