{"slug": "two-fields-not-a-migration-moving-an-openai-compatible-client-to-a-cheaper", "title": "Two fields, not a migration: moving an OpenAI-compatible client to a cheaper endpoint", "summary": "An engineer running the API side of a small LLM reseller, TapixAI, outlined a five-point checklist for migrating OpenAI-compatible clients such as Open WebUI, LibreChat and Cline to a cheaper endpoint, arguing that switching is a matter of changing the base URL and key rather than rewriting code. The checklist covers model ids in /v1/models, streaming chunk shape, billing minimums and units, token accounting via the usage block, and tool_calls support, with the author warning that agent loops can bill 30–60× the tokens of a single typed sentence.", "body_md": "Most \"cheap LLM API\" comparisons are price tables. Price tables are the least useful part of the decision, because the thing that actually breaks when you switch providers is never the price — it is the model id, the streaming shape, or a minimum top-up you did not notice.\n\nI run the API side of a small reseller, so read the honest parts below as self-interest in both directions: I want you to test your endpoint properly, and I also want to tell you when switching is a bad idea.\n\nOpen WebUI, LibreChat, Cherry Studio, LobeChat, Chatbox and Cline are all OpenAI-compatible clients. They do not call vendor SDKs. Whatever you point them at has to answer four things:\n\n`POST /v1/chat/completions` with and without `stream: true`\n`usage` block that splits input and output tokens`GET /v1/models` with ids the client can render in a dropdown\nEverything else — routing, aggregation, retries — is the provider's problem, not yours. That is why migration is two fields (base URL and key), not a rewrite.\n\n**1. Model ids.** Aggregators use prefixed ids (`anthropic/claude-sonnet`), a direct gateway often serves the upstream id (` claude-sonnet-4-6`). If the id is not in `/v1/models`, the client's dropdown stays empty and the user concludes \"it doesn't work\". Check before blaming the client:\n\n```\ncurl -s https://tapixai.com/v1/models -H \"Authorization: Bearer $KEY\" | head -c 400\n```\n\n**2. Streaming chunk shape.** Some gateways stream a single final chunk instead of many deltas. That passes in curl and feels broken in a UI that renders token by token. Ask for ~40 tokens of output and count the `data:` lines. Fewer than five deltas means the UI will feel frozen regardless of real latency.\n\n**3. Billing minimums and units.** A $10 minimum with $3 of monthly usage is worse than a slightly higher per-token price with a $1 minimum. Also check whether cached input is discounted and whether 429s or timeouts are billed. They should not be.\n\nCompare the same workload, not the same sticker price. For a mid-tier model, one call with 2,000 input and 500 output tokens:\n\n| What | Where it comes from | \n|---|---|\n| input tokens billed | `usage.prompt_tokens` , not your estimate | \n| cached input | is prompt caching supported, and does it show as a discount | \n| minimum spend | what you must pay before the first useful call | \n| failed calls | are rate-limit errors billed | \n\nRun the same prompt on both providers, one week apart, and read the `usage` block both times. If the numbers differ by more than a few percent for identical text, one of them counts differently and your price comparison is measuring nothing.\n\nCline, Continue and similar agents do not send one request. They loop: read file, propose edit, run tests, read output, retry. Every turn re-sends the conversation so far, so a 20-step task can bill 30–60× the tokens of the sentence you typed.\n\nTwo consequences:\n\nThere is a trick that beats any discount: point the mechanical turns (rename, import fix, add a log line) at a smaller model and keep the big model for planning. Most agent turns are mechanical.\n\n`tools` array: the response contains `tool_calls`, not a paragraph explaining what it would do.\nIf all five pass, you have migrated. If any fails, you have found a reason to stay, and that is worth more than a price table.\n\nIf you want to see the whole flow on your own key without touching config first: [https://tapixai.com/start](https://tapixai.com/start) runs one real call and prints the error verbatim if it fails. Setup guides for ten clients (Cline, Open WebUI, Cherry Studio, LibreChat, n8n, SillyTavern, LobeChat, Chatbox, Dify, Continue) are at [https://tapixai.com/integrations](https://tapixai.com/integrations).", "url": "https://wpnews.pro/news/two-fields-not-a-migration-moving-an-openai-compatible-client-to-a-cheaper", "canonical_source": "https://dev.to/xinxin_zhao_9a9238c80a105/two-fields-not-a-migration-moving-an-openai-compatible-client-to-a-cheaper-endpoint-55fj", "published_at": "2026-11-27 14:12:35+00:00", "updated_at": "2026-11-27 14:14:58.510981+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "ai-agents", "developer-tools"], "entities": ["TapixAI", "Open WebUI", "LibreChat", "Cherry Studio", "LobeChat", "Chatbox", "Cline", "Continue"], "also_reported_by": [], "takeaway": "Verify an OpenAI-compatible endpoint against five checks — model ids in /v1/models, at least five streaming deltas for ~40 output tokens, billing minimums and whether 429s are billed, usage-block token counts matching across providers, and tool_calls in responses — before switching, since agent loop", "recommendation": {"advice": "Before migrating, run the same prompt on both providers a week apart and compare usage blocks; if token counts differ by more than a few percent for identical text, the price comparison is invalid.", "playbook": "llm-cost", "playbook_url": "https://wpnews.pro/playbooks/llm-cost"}, "alternates": {"html": "https://wpnews.pro/news/two-fields-not-a-migration-moving-an-openai-compatible-client-to-a-cheaper", "markdown": "https://wpnews.pro/news/two-fields-not-a-migration-moving-an-openai-compatible-client-to-a-cheaper.md", "text": "https://wpnews.pro/news/two-fields-not-a-migration-moving-an-openai-compatible-client-to-a-cheaper.txt", "jsonld": "https://wpnews.pro/news/two-fields-not-a-migration-moving-an-openai-compatible-client-to-a-cheaper.jsonld"}}