Meta Pixel OpenAI API Pricing Calculator | 100% Free

OpenAI GPT API Pricing Calculator And Other LLM

Calculate and compare the cost of using OpenAI, Azure, Anthropic Claude, Llama 2, Google Gemini, Mistral, and Cohere LLM APIs for your AI project with our simple and powerful free calculator. Latest numbers as of October 2024

How Costs Are Calculated

Understanding the pricing formula for LLM API calls

Basic Formula:

Cost = (Input tokens × Input price/1M) + (Output tokens × Output price/1M) × API calls

For Text Models:

  • Input tokens: Your prompt length
  • Output tokens: Model's response length
  • Prices vary by model (see table below)
  • Cached input: Save ~75% on input tokens when reusing prompts

For Image Models:

  • Input tokens: Prompt length
  • Output tokens: Based on image size and quality
  • Fixed token amounts based on dimensions

All costs are calculated in USD. Adjust the parameters below to see how changes affect your pricing.

Thank you for the amazing response on Reddit! 37K views • 98% upvotes • 96 shares

View discussion

Tip: Share your calculations with others by copying the URL - it includes all your current settings and filters.

Your Input

500 tokens

Your Output

100 tokens

API Calls

1 call

Token Usage

See model-specific costs in the table below

Compare API Pricing

All prices in USD. Costs calculated based on your inputs above.

ProviderModelKnowledge CutoffContextInput/1M tokensOutput/1M tokensPer Call
Chat/Completion Models
OpenAI / Azuregpt-4-32kSep 202132k$60.00$120.00$0.0420$0.04
OpenAI / Azuregpt-4Sep 20218K$30.00$60.00$0.0210$0.02
Anthropicclaude opusAug 2023200K$15.00$75.00$0.0150$0.02
OpenAI / Azureo3Mar 2024128K$10.00$40.00$0.0090$0.01
OpenAI / Azuregpt-4 turboApr 2023128K$10.00$30.00$0.0080$0.01
OpenAI / Azuregpt-4 turbo with visionApr 2023128K$10.00$30.00$0.0080$0.01
OpenAI / Azuregpt-4o previewApr 2023128K$10.00$30.00$0.0080$0.01
OpenAI / Azuregpt-4-0125-previewDec 2023128K$10.00$30.00$0.0080$0.01
OpenAI / Azuregpt-4-1106-previewApr 2023128K$10.00$30.00$0.0080$0.01
OpenAI / Azuregpt-4-1106-vision-previewApr 2023128K$10.00$30.00$0.0080$0.01
OpenAI / Azuregpt-4-turbo-previewDec 2023128K$10.00$30.00$0.0080$0.01
OpenAI / Azuregpt-4-vision-previewApr 2023128K$10.00$30.00$0.0080$0.01
Anthropicclaude 3.7 sonnetJun 2024200K$8.00$24.00$0.0064$0.01
Mistral AImistral-large-latestSep 202132K$8.00$24.00$0.0064$0.01
OpenAI / Azureo3 (cached input)Mar 2024128K$2.50$40.00$0.0053$0.01
OpenAI / Azuregpt-4oOctober 2023128K$5.00$15.00$0.0040$0.00
OpenAI / Azuregpt-4o-2024-05-13October 2023128K$5.00$15.00$0.0040$0.00
Anthropicclaude sonnetAug 2023200K$3.00$15.00$0.0030$0.00
Anthropicclaude 3.5 sonnetApr 2024200K$3.00$15.00$0.0030$0.00
Googlegemini 1.5 proEarly 20231 Million$3.50$10.50$0.0028$0.00
Mistral AImistral-medium-latestSep 202132K$2.70$8.10$0.0022$0.00
OpenAI / Azuregpt-4o (cached input)October 2023128K$1.25$15.00$0.0021$0.00
OpenAI / Azuregpt-4.1June 20241M$2.00$8.00$0.0018$0.00
Googlegemini 2.5 proApril 20241 Million$1.25$10.00$0.0016$0.00
Mistral AImistral-small-latestSep 202132K$2.00$6.00$0.0016$0.00
OpenAI / Azuretext-davinci-003Jun 20214K$2.00$2.00$0.0012$0.00
OpenAI / Azuredavinci-002Oct 202116K$2.00$2.00$0.0012$0.00
OpenAI / Azuregpt-4.1 (cached input)June 20241M$0.50$8.00$0.0011$0.00
OpenAI / Azureo4-miniMar 2024128K$1.10$4.40$0.0010$0.00
OpenAI / Azuregpt-3.5-turbo-instructSep 20214K$1.50$2.00$0.0010$0.00
OpenAI / Azuregpt-3.5-turbo-instruct-0914Sep 20214K$1.50$2.00$0.0010$0.00
Meta (via Anyscale)llama 2 70bSep 20224K$1.00$1.00$0.0006$0.00
OpenAI / Azureo4-mini (cached input)Mar 2024128K$0.28$4.40$0.0006$0.00
Amazontitan text expressN/A8K$0.80$1.60$0.0006$0.00
Mistral AIopen-mixtral-8x7bSep 202132K$0.70$0.70$0.0004$0.00
OpenAI / Azuregpt-3.5-turbo-0125Sep 202116K$0.50$1.50$0.0004$0.00
Googlegemini 1.0 proEarly 202332K$0.50$1.50$0.0004$0.00
OpenAI / Azuregpt-3.5-turbo-1106Sep 202116K$0.50$1.50$0.0004$0.00
OpenAI / Azuregpt-4.1-miniJune 20241M$0.40$1.60$0.0004$0.00
Anthropicclaude haikuAug 2023200K$0.25$1.25$0.0003$0.00
Googlegemini 1.5 flashEarly 20231 Million$0.35$0.70$0.0002$0.00
OpenAI / Azuregpt-4.1-mini (cached input)June 20241M$0.10$1.60$0.0002$0.00
Amazontitan text liteN/A4K$0.30$0.40$0.0002$0.00
Mistral AIopen-mistral-7b32K$0.25$0.25$0.0002$0.00
OpenAI / Azuregpt-4o-miniOctober 2023128K$0.15$0.60$0.0001$0.00
Googlegemini 2.5 flashApril 20241 Million$0.15$0.60$0.0001$0.00
OpenAI / Azurebabbage-002Oct 202116K$0.20$0.20$0.0001$0.00
OpenAI / Azuregpt-4.1-nanoJune 20241M$0.10$0.40$0.0001$0.00
Mistral (via Anyscale)mistral-7b-instruct-v0.1Sep 202132K$0.15$0.15$0.0001$0.00
Googlegemini 2.0 flashJune 20241 Million$0.10$0.40$0.0001$0.00
OpenAI / Azuregpt-4o-mini (cached input)October 2023128K$0.04$0.60$0.0001$0.00
OpenAI / Azuregpt-4.1-nano (cached input)June 20241M$0.03$0.40$0.0001$0.00
Googlegemini 2.0 flash with context cachingJune 20241 Million$0.03$0.40$0.0001$0.00
Fine-tuning Models
OpenAIgpt-3.5 turboSep 20214K$3.00$6.00$0.0000$0.00
Googlepalm 2Mid 20218K$2.00$2.00$0.0000$0.00
Embedding Models
OpenAI / Azureada v2 $0.10$0.0000$0.00
OpenAI / Azuretext-embedding-3-small $0.02$0.0000$0.00
OpenAI / Azuretext-embedding-3-large $0.13$0.0000$0.00
OpenAI / Azuretext-embedding-ada-002 $0.10$0.0000$0.00
Anthropicclaude 3 haiku embeddings $0.10$0.0000$0.00
Anthropicclaude 3 sonnet embeddings $0.10$0.0000$0.00
Anthropicclaude 3 opus embeddings $0.10$0.0000$0.00
Googlepalm 2 $0.40$0.0000$0.00
Cohereembed $0.10$0.0000$0.00
Mistralembed $0.10$0.0000$0.00
Amazontital embeddings $0.10$0.0000$0.00
Image Generation Models
OpenAIgpt-image-1 (portrait, high)Apr 20251024x1536 (6240 Output Tokens)$5.00$40.00$0.2521$0.25
OpenAIgpt-image-1 (landscape, high)Apr 20251536x1024 (6208 Output Tokens)$5.00$40.00$0.2508$0.25
OpenAIgpt-image-1 (square, high)Apr 20251024x1024 (4160 Output Tokens)$5.00$40.00$0.1689$0.17
OpenAIgpt-image-1 (portrait, medium)Apr 20251024x1536 (1584 Output Tokens)$5.00$40.00$0.0659$0.07
OpenAIgpt-image-1 (landscape, medium)Apr 20251536x1024 (1568 Output Tokens)$5.00$40.00$0.0652$0.07
OpenAIgpt-image-1 (square, medium)Apr 20251024x1024 (1056 Output Tokens)$5.00$40.00$0.0447$0.04
OpenAIgpt-image-1 (portrait, low)Apr 20251024x1536 (408 Output Tokens)$5.00$40.00$0.0188$0.02
OpenAIgpt-image-1 (landscape, low)Apr 20251536x1024 (400 Output Tokens)$5.00$40.00$0.0185$0.02
OpenAIgpt-image-1 (square, low)Apr 20251024x1024 (272 Output Tokens)$5.00$40.00$0.0134$0.01
OpenAIcomputer-use-preview-2025-03-11Mar 2025Computer Vision$3.00$12.00$0.0000$0.00
OpenAI / Azure
Anthropic
Google
Mistral

Pro Tips: Optimize Your API Costs

Prompt Engineering

  • Be concise: Shorter prompts mean fewer input tokens and lower costs.
  • Constrain responses: Ask for brief responses when appropriate to reduce output tokens.
  • Use system messages wisely: They count as input tokens but can drastically improve quality and reduce the need for follow-up messages.
  • Batch when possible: Process multiple items in a single API call rather than making separate calls.

Model Selection

  • Right-size your model: Don't use GPT-4 when GPT-3.5 is sufficient for your task.
  • Use specialized models: Embedding models for search, fine-tuned models for specific tasks.
  • Consider context needs: Only pay for longer context when you actually need it.
  • Test before scaling: Run small-scale tests on different models to find the best price/performance ratio.

Vision API Optimization

  • Resize images: Downscale images before sending to reduce token usage.
  • Crop unnecessary areas: Remove irrelevant portions of images.
  • Use lower quality: For many tasks, low-quality image settings work fine.
  • Consider detail needs: Only use high detail settings when absolutely necessary.

Infrastructure Best Practices

  • Cache responses: Store and reuse responses for common queries.
  • Use cached input: Save costs by reusing prompt contexts with session IDs.
  • Implement rate limits: Prevent unintended usage spikes.
  • Set budget alerts: Create notifications when approaching spending thresholds.
  • Monitor usage patterns: Regularly review API usage to identify optimization opportunities.

Remember: The cheapest AI call is the one you don't make. Optimize your application architecture to minimize unnecessary API calls.

FAQ about OpenAI GPT API & Other LLMs

Where can I find the official OpenAI & other LLMs pricing?

You can find the official OpenAI pricing here.
For gpt-image-1 pricing, you can find it here.
For Mistral Platform pricing and rate limits, you can find them here.
Claude AI pricing and rate limits can be found here.
Google's AI pricing, or gemini pricing, or palm pricing can be found here.
Amazon's AI pricing, or bedrock pricing, can be found here.

What is an OpenAI token?

A token is a part of a text that can be word, subword, punctuation mark or symbol. It is the unit of account of OpenAI APIs.

What is an OpenAI execution?

An OpenAI execution is the combination of the invite to OpenAI and the response from OpenAI. All text in the prompt and response count for OpenAI billing.

What is an OpenAI prompt?

The OpenAI prompt is the instructions or question you send to OpenAI in order to get a response. It is text written in normal, natural language, for example:
Prompt: "Write a tagline for an ice cream shop".

What is an OpenAI response?

This is the response OpenAI gives you to the prompt you sent, for example:
Prompt: "Write a tagline for an ice cream shop"
Response: "We serve up smiles with every scoop!"

Can I set an OpenAI billing limit?

You can configure a billing limit in the OpenAI billing settings, in order to control your costs.

How to monitor my OpenAI API cost based on usage?

You can review your usage in the OpenAI dashboard usage section. You can easily set a spending limit in the OpenAI dashboard billing section.

How to estimate my token usage for a given prompt?

You can use OpenAI's tokenizer to estimate your token usage for a given prompt. You can find the calculator here.

How does OpenAI calculate tokens for images in vision models like GPT-4.1?

OpenAI vision models process images by dividing them into tiles. For GPT-4.1, images are first resized if they exceed 2048px in any dimension. If the shortest side is larger than 768px, it's scaled down. The image is then divided into 512×512px tiles, with each tile costing 170 tokens. A base cost of 85 tokens is added per request. The total token cost is calculated as: (number of tiles × 170 tokens per tile) + 85 base tokens. You can use our Image Tokens calculator tab to estimate these costs precisely.

What is cached input pricing in OpenAI models?

Cached input pricing is a way to reduce costs when making multiple API calls with the same input tokens. When you use cached input (by including a session_id in your API calls), you're only charged the full input token rate for the first call, and a significantly reduced rate (typically 75% lower) for subsequent calls with the same content. This is particularly useful for applications where you need to reuse the same context or instructions across multiple requests, such as chatbots with fixed system prompts or tools that process similar inputs frequently. Models with "(cached input)" in their name in our calculator represent the pricing for these cached token scenarios.