What drives OpenAI API cost
An OpenAI API request can include system instructions, the user's message, retrieved documents, tool definitions and conversation history. All of that becomes input context. The generated answer becomes output, which is usually priced separately from input.
For a realistic estimate, use a production-sized prompt rather than a short test message. Include the history and retrieved context your application normally sends, then model retries or multi-step calls as additional interactions.
| OpenAI workload | Tokens to include | Common budgeting mistake |
|---|---|---|
| Support chatbot | Instructions, message history and reply | Estimating only the newest user message |
| Document summary | Extracted document text and summary | Leaving out repeated formatting instructions |
| Tool-using workflow | Tool schemas, tool results and final answer | Counting one request when the workflow makes several |
Choose the right OpenAI model tier
Use the same representative workload when comparing GPT models. A smaller model can materially reduce monthly spend for classification, extraction and short answers, while a more capable model may be justified for complex reasoning or high-value outputs.
Cached input can lower the cost of repeated instructions when the selected model supports it. This calculator shows cached-input pricing separately, but batch, priority, regional and tool-specific charges should be verified against the official OpenAI documentation.
| Model tier | Good starting point for | Cost consideration |
|---|---|---|
| Flagship GPT | Complex analysis and high-value reasoning | Highest cost; validate quality gains with an evaluation set |
| GPT mini | Chatbots, summaries and routine workflows | Balanced option for repeated production traffic |
| GPT nano | Classification, routing and simple extraction | Lowest cost when the task is narrow and testable |
Official Pricing Sources
Provider prices and billing rules can change. Verify the current rates and special pricing conditions before committing a production budget.