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