About the charge for 1000 tokens?

I have a question about the charge for per 1000 tokens?
Whether the token is only completion_tokens(generated tokens),or prompt_tokens + completion_tokens?
Thanks for your reply!

prompt_tokens + completion_tokens
https://platform.openai.com/docs/guides/chat/introduction
Both input and output tokens count toward these quantities. For example, if your API call used 10 tokens in the message input and you received 20 tokens in the message output, you would be billed for 30 tokens.

1 Like

They charge for both, but separately. You can see the Input and Output pricing here. So basically, if you use 500 input tokens and 1000 output tokens you are charged the full output price and half the input price.