# Does OpenAI charge for both prompt and completion?

**URL:** <https://community.openai.com/t/does-openai-charge-for-both-prompt-and-completion/17276>\
**Category:** API\
**Created:** [April 24, 2022, 11:40pm UTC](https://community.openai.com/t/does-openai-charge-for-both-prompt-and-completion/17276 "2022-04-24T23:40:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![conda78o](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/conda78o/32/8205_2.png) [@conda78o](https://community.openai.com/u/conda78o)\
**Post date:** [April 24, 2022, 11:40pm UTC](https://community.openai.com/t/does-openai-charge-for-both-prompt-and-completion/17276/1 "2022-04-24T23:40:08Z")

</div>

Hi everyone, I had a simple question. Does OpenAI only charge for the number of tokens generated in the completion, or do they charge for both the number of tokens used in prompt and generated in the completion? Please answer if anybody knows. Thanks.

---

<div class="post-metadata">

**Author:** ![boris](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/boris/32/701_2.png) [@boris](https://community.openai.com/u/boris)\
**Post date:** [April 24, 2022, 11:46pm UTC](https://community.openai.com/t/does-openai-charge-for-both-prompt-and-completion/17276/2 "2022-04-24T23:46:00Z")

</div>

Both prompt and completion. Same price per token

---

<div class="post-metadata">

**Author:** ![vsiegel](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/vsiegel/32/9116_2.png) [@vsiegel](https://community.openai.com/u/vsiegel)\
**Post date:** [June 9, 2023, 10:19am UTC](https://community.openai.com/t/does-openai-charge-for-both-prompt-and-completion/17276/3 "2023-06-09T10:19:14Z")

</div>

No, not the same for most models! Usually the prompt tokens cost half of the completion tokens.  
The exception is gpt-3.5-turbo (ChatGPT), where the price is the same.

My recent notes on that:

```auto
OPENAI_PRICING_USD_PER_1K_TOKENS = {
    'prompt': {
        'gpt-3.5-turbo': 0.002,
        'gpt-4-32k': 0.06,
        'gpt-4': 0.03,
    },
    'completion': {
        "gpt-3.5-turbo": 0.002,
        'gpt-4-32k': 0.12,
        'gpt-4': 0.06,
    }
}

```

---

<div class="post-metadata">

**Author:** ![GADEL](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/gadel/32/236899_2.png) [@GADEL](https://community.openai.com/u/GADEL)\
**Post date:** [November 7, 2023, 1:50pm UTC](https://community.openai.com/t/does-openai-charge-for-both-prompt-and-completion/17276/4 "2023-11-07T13:50:38Z")

</div>

Thanks for this clarification on the charges for separate input and output tokens.
