Accessing probabilities of all tokens in a response

Hi,
Is there a way to access the probabilities of all tokens in a response using the OpenAI API? Using Playground, I am able to select various words and see their probabilities (even if they are not the first word outputted in the response). Is there a way to do this for all words in a response with the API?

I noticed the logprobs parameter, but this appears to do something else based on the description.

Thanks!

1 Like

Hi @m-a.schenk , thanks for the answer! Appreciate it.

As a follow-up, do you know if it is possible to get probabilities for the top 5 options for a particular token position? This is possible on the GUI in Playground. I’m wondering if running your example with logprobs = 5 would do the trick - would you be able to share the output of that with your same example if possible? I’m trying to get a sense of the output without any credits in my account right now.

Thanks for your time!

1 Like

Hi @saahil ,
interesting question.
Unfortunately, I cannot see the answer you mentioned by @m-a.schenk.
Could you please share it with us?
BR.
Paul