Few-Shot Examples Cost Calculator

See how many few-shot examples you can afford per context budget

Ad placeholder (leaderboard)

Few-shot examples cost calculator

Few-shot prompting is the fastest way to steer a model, but every example sits in the prompt and is billed on every call. This calculator tells you two things at once: how many examples physically fit inside your context budget, and what each additional example costs you per call and per day, so you can pick a count that balances accuracy against spend.

How it works

Your fixed overhead — the system prompt plus the user query plus space reserved for the answer — is subtracted from the total token budget. What remains is divided by the tokens per example to get the maximum number of examples that fit. Each example’s input tokens are priced at the model’s input rate to give the marginal cost per example, and the calculator projects the cost per call and daily cost at your chosen example count and volume.

Tips and notes

  • Reserve room for the answer. If you fill the whole window with examples, there is nothing left for the completion — always leave an output margin.
  • Quality beats quantity. A few diverse, representative examples usually outperform many similar ones, and they are cheaper.
  • Compare against fine-tuning. If you need many examples on high volume, a fine-tuned model can be cheaper per call because the examples are no longer in the prompt — model both and compare.
  • Counts are estimates. Confirm exact tokenization with your provider for precise billing.
Ad placeholder (rectangle)