We route 51 upstream sellers behind a single OpenAI-compatible endpoint. Every seller advertises OpenAI compatibility. In practice they speak at least six different dialects, and the differences are not cosmetic — they decide whether a request succeeds, how much you are billed, and whether your client library can parse the answer.
Where the dialects diverge
1. Streaming frame format. OpenAI emits data: {...} chunks terminated by data: [DONE]. Some upstreams omit the terminator, some send a final chunk with an empty choices array, and a few send SSE comments as keepalives. A client that waits for [DONE] hangs forever on the upstreams that do not send it; a client that stops at the first empty delta truncates the answer.
2. Usage accounting in streams. OpenAI includes usage in the final chunk when you pass stream_options: {include_usage: true}. Many compatible servers ignore that field entirely and either never report usage or report it per chunk. If you bill on reported usage, an upstream that never reports it bills you zero — and then the invoice arrives from the seller anyway.
3. Error envelope. OpenAI returns {"error":{"message":...,"type":...,"code":...}} with a HTTP status. Compatible servers variously return a bare string, an OpenAI-shaped error with HTTP 200, or a provider-native error (for example a Chinese code/msg pair). A gateway that only inspects HTTP status will treat a 200-with-error as a successful response and pass it to the client.
4. Function calling and tool schemas. tools support varies: some accept only functions, some reject strict, some ignore parallel_tool_calls silently rather than erroring. Silent ignoring is the dangerous case — the model answers without using the tool you required, and nothing in the response tells you why.
5. Multimodal content parts. image_url with a base64 data URL works on some, only on public URLs on others, and some only accept their own hosted file identifiers. A gateway has to translate rather than pass through.
6. Token counting. tiktoken-style estimation matches OpenAI tokenizers but not necessarily the upstream's own tokenizer, which matters the moment you compare a billed amount with a local estimate.
What we do about it
Three rules, in order of importance:
-
Normalise the stream, not the request. Every upstream's SSE is rewritten into the OpenAI frame format, including a guaranteed
[DONE]and a synthesised final usage chunk. Clients never see a dialect. - Treat HTTP 200 with an error body as an error. Error detection is by payload shape, not status code.
- Refuse rather than ignore. If a request uses a feature the selected upstream cannot honour (a tool schema it will silently drop, a content part it cannot read), the gateway returns a clear error instead of a quietly degraded answer. A degraded answer costs more than a failed request, because you only discover it in production.
The compatibility surface we test on every upstream is documented here: https://ai.dijinlong.com/docs
If you are evaluating a marketplace, these six items are the questions worth asking before you build: https://ai.dijinlong.com/faq
Per-model capability and upstream notes are listed here: https://ai.dijinlong.com/model-plaza
And price comparisons only make sense after a request actually succeeds, which is why the billing unit is recorded per model: https://ai.dijinlong.com/model-docs
Disclosure: I run LONG AI, the gateway described here. The dialect list comes from our own compatibility tests against 51 upstream sellers.
Top comments (0)