I think that you might need to load credentials.json as a dictionary in python because it ix expecting a dictionary but you instead are passing a set.
This addition to code might work:
import json
with open("credentials.json", "r") as f:
credz = json.load(f)