Access answers by key and check the primitive before interpreting its fields. Probability keys and legend keys are strings in decoded JSON.
Example
for name, answer in result["answers"].items():
if answer["type"] == "choice":
print(name, answer["choice"], answer["confidence"])
print(result["usage"]["input_tokens"])