Models and labs

How much does it cost to use GPT-3?

· By Robert Scales · 4 min read

Short answer

GPT-3 is billed by the token, a piece of a word, and you pay for both the text you send and the text it writes back. Since OpenAI's September 1 price cut, the most capable model, Davinci, costs $0.02 per 1,000 tokens (about 750 words), and the smaller models cost a fraction of that.

Using GPT-3 through OpenAI's API costs money per piece of text, not per month. There is no subscription: you pay for what you use. For most small experiments the bill is a few cents, and new accounts start with $18 of free credit to spend during their first three months. Once you plan a real job, though, such as processing a whole inbox or a folder of reports, it pays to estimate the cost before you press run.

The unit of billing is the token. A token is a chunk of text, often a whole short word, sometimes part of a longer one, and it can include the space before it. OpenAI's rule of thumb for English is that one token is about four characters, or three quarters of a word, so 1,000 tokens is roughly 750 words.

The current price list

On September 1, OpenAI lowered the prices of its base GPT-3 models, saying it had made them more efficient to run. Davinci dropped from $0.06 to $0.02 per 1,000 tokens, a two-thirds cut. Here are the current rates for the four base models:

ModelPrice per 1,000 tokensWhat OpenAI says about it
Ada$0.0004The fastest model
Babbage$0.0005A step up from Ada
Curie$0.0020Handles many Davinci tasks, faster, for a tenth of the price
Davinci$0.0200The most powerful model

Two details matter. First, you pay for both directions. A request is billed on the tokens in your prompt plus the tokens in the completion, the text the model sends back. Second, some settings multiply the output. If you ask for several alternative completions with the n or best_of parameters, each one counts.

Fine-tuned models, which you train on your own examples, cost more per token: using a fine-tuned Davinci model is $0.12 per 1,000 tokens, and those prices did not change in September. Usage in the Playground, OpenAI's web page for testing prompts, is billed the same way as API calls.

A worked estimate: summarizing 100 emails

Suppose you want a two-sentence summary of each of 100 customer emails. Each request contains a short instruction plus one email:

Prompt
Summarize this customer email in two sentences. Name the product and what the customer wants.

Email:
[paste one email here]

Summary:

Now estimate the tokens. The numbers below are illustrative; your own emails will differ.

Part of each requestWordsTokens (words ÷ 0.75)
Instruction20about 27
One email200about 267
Summary written back45about 60
Total per emailabout 354

For 100 emails, that is about 35,400 tokens, or 35.4 thousand. Multiply by each model's price:

ModelEstimated cost for 100 emails
Davinci35.4 × $0.02 = about $0.71
Curie35.4 × $0.002 = about $0.07
Davinci before September 135.4 × $0.06 = about $2.12

Even with Davinci, the whole job costs less than a dollar. The cost grows in a straight line, so 10,000 emails would be about $71 with Davinci and about $7 with Curie. That gap is why it is worth testing whether a cheaper model is good enough for a task before scaling it up.

Try it: Pick five real emails or notes of typical length. Run the summary prompt on each with Curie, then with Davinci, and compare the results. Write down the token counts the Playground shows, average them, and multiply by the number of items in your full job.

Ways to keep the bill down

OpenAI's own pricing page suggests several levers. Keep prompts short: an instruction you repeat on every request is paid for every time. Set a sensible maximum length for the reply. Use a stop sequence, a marker that tells the model where to end, so it does not ramble. Avoid generating many alternatives unless you need them. And use the cheapest model that does the job well.

You can also protect yourself from surprises. In your account's billing settings you can set a soft limit, which emails you when spending passes a threshold, and a hard limit, after which requests stop being served.

How do you estimate tokens before you run a job?

Start with the rules of thumb. In English, divide the number of words by 0.75, or divide the number of characters by 4. A typical paragraph is about 100 tokens, and OpenAI notes that about 1,500 words come to roughly 2,048 tokens. Count all three parts of each request: your fixed instruction, the variable input such as one email, and the expected reply. Then multiply by the number of requests.

For a closer number, use OpenAI's free Tokenizer tool, which shows exactly how a piece of text is split, or paste your prompt into the Playground, where a counter shows the token total. Test a handful of real samples rather than one, because lengths vary. For the reply, use your max_tokens setting as a ceiling: OpenAI explains that a single request can use up to the prompt's tokens plus max_tokens times the number of completions you ask for.

Two cautions. Languages other than English often take more tokens for the same text, so a French or Spanish job can cost more than the word count suggests. And formatting adds up: long separators, repeated labels and example blocks in a few-shot prompt all count on every call. Add a safety margin of 10 to 20 percent to your estimate, set a soft limit near that figure, and check the usage page in your account after the first batch.

Sources

  1. Pricing (OpenAI API) — OpenAI, November 11, 2022
  2. Pricing (OpenAI API), with the September 1, 2022 price change notice — OpenAI, August 26, 2022
  3. What are tokens and how to count them? — OpenAI Help Center, March 21, 2022

Get the free Guide to Artificial Intelligence

Sign up for the weekly newsletter and receive the free guide: what changed in AI this week, one lesson, one prompt to try. Unsubscribe in one click.

How we handle your address

Back to top

Display

Your choices are saved in this browser only. No data is sent.

Text size
100%
Colours
Reading
More settings
Accessibility statement