Effectively but not quite. Anthropic does mostly support the OpenAI API but there are minor feature gaps. You have to use Anthropic's bespoke API to use everything (which may or may not be important to you).
There are some gotchas with it too. e.g. The "system" role message isn't supported in the Anthropic API. It's not the biggest deal but it's a potential footgun.
On the other hand, the openrouter SDK + API takes care of this for you: Their one gateway has ways of enabling provider-specific features. You can switch the model name and pretty much be good to go.
Claude Code does not work with other models out of the box. You need a wrapper around Claude Code that translates other model requests + respondes to what the harness expects.
That makes sense, though I wonder if Claude is a bit of an outlier there because they have the developer audience?
As an example, GLM document being committed to compatibility with OpenAI: https://docs.z.ai/guides/develop/openai/python
My uninformed guess would be that everyone except the frontier labs is probably motivated to do that too.
Similarly they document configuring Claude Code for their models, so I assume they implement Anthropic’s interface there too: https://docs.z.ai/devpack/tool/claude#manual-configuration