I’m getting a 401 while calling the wp-json endpoint via ajax

I had accidentally created a POST rather than a GET. Obviously, you need credentials if you post.