What Code to Change When Switching LLM APIs: Three Must-Change Configs and Four Compatibility Checks

When staying on the OpenAI-compatible protocol, switching models usually requires changing only base_url, api_key, and model—but if your code uses length parameters, sampling parameters, streaming usage, tool calling, or structured outputs, verify each against the target model.

How to Change Custom base_url in LangChain: Python, JS, Environment Variable Priority, and 404 Troubleshooting

Clear up where to put base_url when connecting LangChain to OpenAI-compatible endpoints: Python's ChatOpenAI, OpenAIEmbeddings, init_chat_model, and JS/TS configuration.baseURL; also covers priority of three config sources, why /v1 path errors, why streaming token stats become empty, and why third-party-specific fields aren't read.

How to Add an OpenAI-Compatible Channel in One API: Proxy URL, Key, Model Name, and Test Error Troubleshooting

Add a third-party or self-hosted OpenAI-compatible channel in One API: select "OpenAI" as channel type, fill in the compatible endpoint as proxy, enter the upstream key, and manually add the exact upstream model names. Verify with the "Test" button. The article explains each form field in order and covers troubleshooting for 404, 401, and Connection refused, plus when to enable model mapping.

How to Add a Custom LLM in Cherry Studio: Provider, API URL, Model ID, and Troubleshooting

A complete guide to connecting any OpenAI-compatible API as a custom provider in Cherry Studio, covering whether the API URL should include /v1, how to manually add models when the list fails to load, which capability tags to select, and how to troubleshoot message failures, 401, and 404 errors after setup.

Adding an OpenAI-Compatible Model in Dify: How to Fill the base_url, Whether to Include /v1, and How to Troubleshoot Save Failures

In Dify's OpenAI-API-compatible provider, the LLM API endpoint URL must be written as "protocol + domain + /v1" with no trailing slash; this article explains how to fill each field and how to troubleshoot save failures such as 404s from missing /v1, /v1/v1 on non-LLM models, mismatched model names, and misused localhost in Docker.