OpenAI API Pricing: Tokens, Models & Limits
In this article
OpenAI API pricing depends on the model you choose and is calculated per 1,000 tokens (with a token roughly equal to 0.75 words in English). You pay only for what you use, and each model has its own rate per million input and output tokens, plus context length and rate limits that cap how many requests you can send per minute.
How Token Pricing Works
OpenAI charges separately for input tokens (the prompt you send) and output tokens (the response the model generates). The price is quoted per 1 million tokens, but your bill is calculated per 1,000 tokens. For example, if a model costs $5 per 1M input tokens and $15 per 1M output tokens, a request with 2,000 input tokens and 500 output tokens would cost:
- Input: 2,000 / 1,000 × ($5 / 1,000) = $0.01
- Output: 500 / 1,000 × ($15 / 1,000) = $0.0075
- Total: $0.0175 for that request
A token is not a whole word—it’s a chunk of text. Common short words like “the” are one token, while longer words may split into multiple tokens. As a rough guide, 100 tokens ≈ 75 English words. The exact token count depends on the language and the tokenizer used.
Current Models and Their Prices
OpenAI offers several model families, each with different capabilities and price points. Prices are per million tokens and were last updated in mid-2025; always check the official pricing page for the latest numbers.
- GPT-4o: $2.50 input / $10 output per million tokens. Context window 128K tokens. Good balance of intelligence and cost.
- GPT-4o mini: $0.15 input / $0.60 output per million tokens. Same 128K context, much cheaper, ideal for high-volume tasks.
- GPT-4.1: $2 input / $8 output per million tokens. 1M token context, optimized for long documents and coding.
- GPT-4.1 mini: $0.40 input / $1.60 output per million tokens. Cheaper long-context option.
- GPT-4.1 nano: $0.10 input / $0.40 output per million tokens. Fastest and cheapest for simple classification and autocomplete.
- o3 and o4-mini: Reasoning models. o3 costs $2 input / $8 output; o4-mini costs $1.10 input / $4.40 output. They think step-by-step before answering, so they use more output tokens.
- GPT-3.5 Turbo: Legacy, $0.50 input / $1.50 output per million tokens. Still available but being phased out.
Note that reasoning models like o3 generate “thinking” tokens that are billed as output tokens, so a simple question may cost more than with GPT-4o.
Usage Limits and Rate Limits
Every API account has rate limits—the maximum number of requests and tokens you can send per minute (RPM and TPM). These limits depend on your plan and the model:
- Free tier: Very low limits (e.g., 3 requests per minute for GPT-4o mini). Good for testing only.
- Pay-as-you-go Tier 1: Default for new paid accounts. GPT-4o: 500 RPM, 80K TPM. GPT-4o mini: 1,000 RPM, 200K TPM.
- Higher tiers: Increase as you spend more over time. Tier 2 (after $50 spend) doubles many limits; Tier 3 (after $200) raises them further; Tier 4 and 5 unlock even higher caps.
You can request a limit increase through your OpenAI account dashboard, but approval depends on your payment history and usage patterns. Rate limits exist to protect the infrastructure and ensure fair access.
How to Estimate Your Costs
To budget, you need to know your average tokens per request and your expected volume. Here’s a simple process:
- Use the Tokenizer tool in OpenAI’s documentation to count tokens in a sample prompt and response.
- Multiply by your expected number of requests per day.
- Apply the model’s per-token price.
For example, if you build a chatbot that sends 500 tokens in and 200 tokens out per conversation, and you expect 10,000 conversations per month using GPT-4o:
- Input tokens: 500 × 10,000 = 5,000,000 → 5 × $2.50 = $12.50
- Output tokens: 200 × 10,000 = 2,000,000 → 2 × $10 = $20
- Total: $32.50 per month
Switching to GPT-4o mini would cost about $2.10 for the same volume—a 93% reduction. So choose the smallest model that meets your quality needs.
Common Mistakes and Misconceptions
Many developers overpay or hit unexpected limits due to a few common errors:
- Counting characters instead of tokens: Tokens are not characters. A 1,000-character prompt may be 250 tokens, but a 1,000-token prompt is about 750 words. Always use the tokenizer.
- Ignoring output tokens: Responses can be long, especially if you ask for detailed answers. Set a
max_tokensparameter to cap the response length and control costs. - Not using caching: OpenAI offers automatic prompt caching for repeated prefixes at a 50% discount on input tokens. If your app sends the same system prompt every time, you’ll save money.
- Assuming rate limits are fixed: They can change based on your tier and the model’s load. Monitor your usage dashboard.
- Forgetting about batch API: If you don’t need real-time responses, the Batch API gives a 50% discount on both input and output tokens. It’s ideal for bulk jobs like data extraction.
Comparing OpenAI to Other Providers
OpenAI is not the only option. Anthropic’s Claude models and Google’s Gemini also charge per token. As of mid-2025, Claude Sonnet 4 costs $3 input / $15 output per million tokens, slightly more than GPT-4o. Gemini 1.5 Pro is $1.25 input / $5 output, cheaper for input-heavy workloads. However, pricing alone isn’t everything—model quality, speed, and context length matter. OpenAI’s GPT-4o mini is one of the cheapest capable models, but for very high volume with simple tasks, open-source models running on your own hardware can be even cheaper if you have the infrastructure.
Frequently Asked Questions
How many tokens are in a typical API request?
A short prompt like “Summarize this article” is about 5 tokens. A paragraph of 100 words is roughly 130 tokens. A full page of text (about 500 words) is around 650 tokens. Responses vary widely—a one-sentence answer might be 20 tokens, while a detailed essay could be 1,000+ tokens.
What happens if I exceed my rate limit?
You get a 429 HTTP error with a message like “Rate limit reached.” Your request is not processed. You can retry after the limit resets (usually within a minute) or implement exponential backoff in your code. To avoid this, monitor your usage and request a limit increase if needed.
Can I set a hard budget to avoid surprise bills?
Yes. In the OpenAI API dashboard, you can set a monthly spending limit (e.g., $50). Once reached, all API calls stop until you raise or remove the limit. You can also set per-request max_tokens to cap output length.
Is there a free tier for the OpenAI API?
Yes, new users get a small amount of free credits (e.g., $5) and access to low-rate-limit versions of models like GPT-4o mini. It’s enough for testing but not for production. After the credits expire, you must add a payment method.
Does the Batch API really save 50%?
Yes, for requests that can wait up to 24 hours, the Batch API charges 50% less for both input and output tokens. This is ideal for offline processing like generating training data or analyzing large datasets. The results are returned in a file within 24 hours.
Why did my bill show more tokens than I expected?
Often because of the system prompt, chat history, or tool definitions being sent with every request. Also, reasoning models like o3 include hidden “thinking” tokens. Check the usage breakdown in the dashboard to see input vs. output tokens per request.