Found this issue on github, and the error does in fact have to do with the API key. Turns out if there's any leading or trailing whitespace in the API key being used, this error will crop up when pushing for a second time, despite the initial push working fine.