CreatechzAI Tools
Home › Prompting and AI workflows › Few-shot prompting

Few-shot prompting: how many examples, and what they cost

Few-shot prompting teaches a model a task by showing it examples inside the prompt. This guide explains what the research says, how many examples vendors recommend, and what each example costs in tokens, using a real classification prompt we measured. Price your own prompt with the prompt cost calculator; more guides are in prompting and AI workflows.

Quick answerFew-shot prompting puts a few input and output examples in the prompt so the model infers the task. Anthropic recommends 3 to 5 well-crafted examples; OpenAI advises a diverse range. In our classification prompt each example added about 18 tokens, so 10 examples added 181 tokens to every request.

By the Chelure Enterprises Editorial Team. Last reviewed . How we check our sources.

What few-shot means

In "Language Models are Few-Shot Learners", Brown et al. (2020) applied GPT-3, a 175-billion-parameter model, to tasks without gradient updates or fine-tuning, specifying the task and demonstrations purely through text. They report that scaling up the model greatly improves few-shot performance, sometimes reaching competitiveness with earlier fine-tuned approaches, and they note datasets where few-shot learning still struggles. Zero-shot means no examples; one-shot means one; few-shot means several.

What the vendors recommend

The prompt we measured

The task is to classify a customer email into one of five categories. The prompt is an instruction, then k examples in the form Email: ... / Category: ..., then the new email.

Classify each customer email into exactly one category: shipping, returns, sizing, product_care, other. Reply with the category only.

Email: My parcel has not arrived and it has been eight working days.
Category: shipping

Email: How do I send back the tent? It does not fit my car.
Category: returns

Email: Is the medium jacket long enough for someone who is 190 cm tall?
Category: sizing

Email: Where is my order? The estimated date was last Friday.
Category:

That is the 3-example version. Token counts below use OpenAI's o200k_base encoding; the extra-cost columns assume 100,000 requests at each model's uncached input price.

ExamplesPrompt tokensExtra tokens vs zero-shotExtra cost, 100,000 requests, Haiku 5.5Extra cost, 100,000 requests, Sonnet 5.5
0440$0.00$0.00
16319$0.19$3.80
310561$0.61$12.20
513692$0.92$18.40
10225181$1.81$36.20

Each example costs about 18 tokens here, so the cost of examples is small for short ones but grows with long ones: examples that include whole documents can dwarf the instruction. Whether the extra accuracy is worth it depends on your task, so measure accuracy on a held-out set with 0, 3 and 5 examples before paying for more.

Keeping the cost down

Frequently asked questions

What is few-shot prompting?

Few-shot prompting gives the model a handful of input and output examples in the prompt so it can infer the task. Brown et al. (2020) describe it as specifying the task and demonstrations purely through text, with no gradient updates or fine-tuning.

How many examples should I use?

Anthropic recommends 3 to 5 well-crafted examples for best results; OpenAI advises showing a diverse range of possible inputs with the desired outputs. Beyond a few, extra examples add cost faster than accuracy, so test on your own data.

What does it cost?

Every example is input tokens on every request. In our classification prompt each example added about 18 tokens: 3 examples added 61 and 10 added 181 tokens over the zero-shot prompt.

Can examples be cached?

Yes, if they sit at the start of the prompt and stay identical. Both OpenAI and Anthropic cache by prefix, so put the instruction and examples first and the new input last.

Is few-shot better than fine-tuning?

They solve different problems. Few-shot costs nothing to set up but is paid for on every request; fine-tuning front-loads the effort. The original GPT-3 paper contrasts few-shot with fine-tuning approaches that need thousands or tens of thousands of examples.

Sources

Primary sources opened on November 13, 2026. Prices come from our verified price table (see the methodology).

Token counts measured with tiktoken on November 13, 2026 (build/_measure_prompting.py). The prompt and examples are ours.