#Chat Completion Price with Streaming = true

1 messages · Page 1 of 1 (latest)

grand rivet
#

How can I calculate the pricing for OpenAI API with Streaming?

junior pewterBOT
#

Hi @grand rivet. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

When using the OpenAI API with streaming, you are charged for the tokens you have received so far plus a small number of tokens generated while the system detects you have closed the connection, usually between 7-15 tokens. This is different from non-streaming usage where you are charged for the full generation.

To calculate the cost, you would need to know the number of tokens used in your request and the cost per token. The cost per token can be found on the OpenAI pricing page.

Please note that disconnects and errors in API communications are typically considered losses unless you have a specific agreement to track and reimburse. These agreements are typically offered to high volume users by contractual arrangement.

For more details, you can refer to the OpenAI Pricing page (https://openai.com/pricing) and the OpenAI Community post (https://community.openai.com/t/516646) on this topic.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: