AtmoRouter guide: which Vercel AI SDK provider to use with an OpenAI-compatible gateway
AtmoRouter published a comparison of three ways to connect the Vercel AI SDK to an OpenAI-compatible gateway, concluding that the dedicated openai-compatible provider is the safest choice because the default OpenAI factory calls the Responses API.
Why it matters
The article is written by AtmoRouter about its own gateway. It relies on two documented facts: since AI SDK 5, the default openai('model-id') factory in @ai-sdk/openai calls the Responses API, and AtmoRouter has no public /v1/responses endpoint. That leaves openai.chat() or the @ai-sdk/openai-compatible package, which sends plain Chat Completions requests and exposes options such as includeUsage and transformRequestBody.
The guide includes a provider file, one-shot and streaming calls, and a Next.js route handler that forwards the request's abort signal. Per AtmoRouter's streaming docs, disconnecting cancels the gateway request, but an interrupted stream can still be billed for tokens already processed.
It also prices one illustrative request of 12,000 input and 600 output tokens at catalogue from-rates for several models and lists common mistakes: a wrong /v1 suffix, shortened model IDs, and retry loops stacked on the SDK's default of two retries. Prices change, so readers should check the live model page before relying on the numbers.