[Solved] Assistants Code Intepreter API - How is session pricing defined?

Hi OpenAI team,

First off, congrats on an amazing Dev day, you guys really do deliver and it’s refreshing to get a tech event to be excited for again. Amazing work!

I’m trying to understand the pricing as it’s listed as $0.03 per session to use the code interpreter tool. My question is about how a session is defined. Is a session defined as:

a. I send a query that uses code interpreter and that is $0.03 for one code interpreter usage (i.e. code interpreter executes code = $0.03)? So if a chat had 10 code interpreter triggers, that would be $0.30?

or

b. I use code interpreter and the instance is “awake” and like in the ChatGPT app, a session is 15 minutes or so from the first initial call. If I call it 10 times within that 15 minute window, it’s $0.03 regardless.

Which one is a correct interpretation or am I wrong on both? If we could get some more clarity on how a session is defined, that would be awesome.

Thank you again team, appreciate the hard work as always.

Landon


EDIT: I missed this help article here where they state the following:

Code Interpreter is priced at $0.03 / session. If your assistant calls Code Interpreter simultaneously in two different threads , this would create two Code Interpreter sessions (2 * $0.03). Each session is active by default for one hour, which means that you would only pay this fee once if your user keeps giving instructions to Code Interpreter in the same thread for up to one hour.

Thank goodness! Hope this helps anyone with the confusion.

1 Like

Same question here.

0.03$ per query would be crazy!

I’m hoping I’m wrong on this but so far I believe this is actually the case unfortunately.

1 Like

Your session is a session you can run as many queries as you want until the session is destroyed so

Updated my question with the help article. Thank goodness!

Can we close this topic as it has a noted solution?

Throw in a link to documentation and it can be closed. Actually, this is the only documentation:

Tool Input
Code interpreter $0.03 / session (free until 12/13/2023)
Retrieval $0.20 / GB / assistant / day (free until 01/12/2024)

Code Interpreter is charged at $0.03 per session. If your Assistant calls Code Interpreter simultaneously in two different threads (e.g., one thread per end-user), two Code Interpreter sessions are created. Each session is active by default for one hour, which means that you only pay for one session per if users interact with Code Interpreter in the same thread for up to one hour.

Yes you read that right, one per ______


The price list also fibs: “the assistant intelligently chooses which context from the thread to include when calling the model”

The reply was to the first post by the OP but Discourse does not show this. So waiting for the OP to note it can be closed. :slightly_smiling_face: