Perhaps you missed that the person you are replying to was talking about the GitHub API and not their web interface?
Here’s the API reference: https://docs.github.com/en/rest/reference/repos#create-an-or...
I don’t see any parameter for setting the default to master instead of main. However it does seem like you can change it after it has been created with a subsequent update call.