Skip to content

Glossary

OpenAI-compatible API

An OpenAI-compatible API is an endpoint that accepts the same request and response shapes as OpenAI's own API, so an existing client can be pointed at it by changing only the base URL, the API key and the model name.

OpenAI-compatible endpointdrop-in replacementOpenAI SDK compatible

Compatibility means the wire contract, not the model. The request body, the streaming format, the usage object and the error envelope match, so the official SDKs and the large ecosystem built on them work unmodified. The model behind the endpoint is a different model and will answer differently.

What compatibility does not cover is worth stating plainly, because that is where migrations break. Prompts tuned against one model's tendencies do not transfer intact. Model ids are provider-specific. Provider-specific extensions — anything outside the documented request shape — are not portable by definition, and any code branching on them needs review.

Error semantics are the other common surprise. Status codes are reused across conditions, so a client that decides what to do from the status code alone rather than the error body will handle some failures wrongly. That is a portability bug, not a compatibility gap, and it is usually already latent before the migration.

The practical test of compatibility is whether a working client can be moved by editing configuration rather than code. That is the bar this API is built to.

What it costs you

Switching cost, not price, is what keeps most teams on an expensive endpoint: a rate difference is only worth capturing if capturing it costs less than it saves. Wire compatibility collapses that migration cost to a configuration change plus prompt re-testing, which is what turns a published rate difference into a saving you can actually take. It also removes the lock-in in the other direction, since an integration written against a portable contract can be moved away again.

Worked from today’s rates

Moving an existing client to GLM-5.2 means setting the base URL to https://router.xark.io/api/v1, supplying a key from this service, and sending "z-ai/glm-5.2" as the model. The request body does not change.

Related terms

Go deeper

Get an API key — $5 free credit

Every rate quoted above is published in full on the pricing page, alongside the model publisher’s own official rate.