Remix.run Logo
bensyverson 5 hours ago

OpenRouter is a proxy, not an automatic router. Rather than building API clients for five different AI providers, you build one client to OpenRouter, and switching models become extremely easy. This matters when new models are coming out virtually every day.

mcintyre1994 5 hours ago | parent | next [-]

Dumb question but aren’t they all OpenAI API compliant? I thought that was pretty standard, eg I know Anthropic works with it. Also Claude Code can work with different models, they’re probably not using OpenRouter for that?

lanyard-textile 2 hours ago | parent [-]

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.

sajithdilshan 5 hours ago | parent | prev [-]

Does that means if by any chance all frontier model companies agrees to use an open protocol for the API open router would go out of business?

benced 5 hours ago | parent | next [-]

All the model companies except kind of Anthropic (and even they half-assedly do) implement the OpenAI API. It's not an open standard but, like the S3 API, it effectively is.

And, to answer your question, no. The existence of a common API makes it trivial to change zero code and send requests to a different model.

solidasparagus 3 hours ago | parent [-]

The Anthropic messages API is a competing standard (it's just better than the OpenAI API which even OpenAI has moved away from) and some Chinese providers use it as their standard.

bensyverson 5 hours ago | parent | prev | next [-]

It's more complicated than that. Lots of providers use an "OpenAI-ish" API, but many of them have subtle differences in things like tool calling or thinking blocks. OpenRouter normalizes the wire format.

OpenRouter does more than just proxying; they also aggregate providers for open-weight models, which has a stabilizing effect on pricing and gives you protection against a single provider's downtime.

notatoad 5 hours ago | parent | prev [-]

no. i don't know if openrouter even guarantees consistent protocl across models.

the value of openrouter is it offers centralized billing. you can route your calls to any provider you want, test a whole bunch of models against each other, and you just get one bill from openrouter. switching to a new model, or a new provider of the same model, doesn't mean setting up a new billing account with a new provider.

sajithdilshan 4 hours ago | parent [-]

I see, that make sense, thanks for the explanation. Because otherwise I was thinking their whole business model would be just to provide an API tool library.