| Model | Completion | Prompt | Context | TPM | RPM | 1M Tokens |
|---|---|---|---|---|---|---|
| gpt-4-0314 | $0.06/1K | $0.03/1K | 8192 | 40000 | 200 | $1200.00 |
| gpt-4-32k-0314 | $0.06/1K | $0.12/1K | 32768 | 80000 | 400 | $1200.00 |
| gpt-3.5-turb | $0.002/1K | $0.002/1K | 4096 | 40000 | 200 | $4.00 |
Cost Per Token = $0.02 / 1,000 tokens = $0.00002
Prompt Cost = 43 tokens * $0.00002 = $0.00086
Completion Cost = 13 tokens * $0.00002 = $0.00026
Total Cost = $0.00086 + $0.00026 = $0.00112
Cost Per Character = $0.00112 / (56 tokens * 4 characters per token) = $0.00112 / 224 characters = $0.000005 cost per character
Cost Per Word = $0.00112 / (56 tokens * .75 words) = $0.00112 / 42 words = $0.00002667 cost per word
We can see this passive to active prompt and completion cost us just over a 10th of a penny. So a wordbot user could do 10 of these conversions and assuming each sentence is about the same size as this example, and it would cost us a penny.
The above cost seems insignificant, but it isn’t. When you account for many thousands of users running thousands of prompts, the cost can be significant. To demonstrate this in a small way, let’s do a quick GPT3 cost calculation on a user generating a 2,950 word article. Our prompt will be 50 words. We’ll use the Davinci mode again, which is $0.02 per 1000 tokens.
Words = 3,000 (50 from the prompt + 2,950 from the completion)
Tokens = 4,000 (3,000 words / .75 tokens per word)
Cost = $0.08 or 8 cents (4,000 tokens / 1,000 tokens * $0.02 cost per 1,000 tokens)
Below is the entire function written out as one.
Total GPT3 Cost = Prompt words of 50 + 2,950 words of completion = 3,000 total words / .75 tokens per word = 4,000 tokens / 1,000 tokens = 4 * $0.02 cost per 1,000 tokens = $0.08
With what we’ve learned in this article, we were able to quickly calculate that generating a 2,950 word article from a 50 word AI prompt cost us 8 cents.
Data from wordbot.io