So, you want to use a non-reasoning model, which is very important here. Get the logprobs for your test case, look at the structure, and ask the agent to build you a demo viewer. I’d suggest a prompt that separates your confidence section, answer, and CoT with new lines. Then you can split the logprobs by new lines tokens, inspect perplexity for the CoT, and look at the probabilities for the confidence and answer tokens.
The placement of your answer also matters—I once accidentally put the answer before the reasoning, and it biased the model. Also, in the API call, specify that you want probabilities for all potential tokens so you can compare how likely each response was.
You can just ask Cursor to build it out for you, by the way.