I would bet money Anthropic and OpenAI are actually profitable on inference. The problem is they have to spend large sums of money to train models that are essentially worthless after a few months.
They make more money from inference than they do training the model, but then the next model gets so much more expensive to train so their annual figures have been in the red.