How to point LangChain ChatOpenAI at an OpenAI-compatible API
AECore AI is an OpenAI-compatible API for genuine official models: the full Claude range, GPT, Gemini, DeepSeek, Kimi and GLM, typically 10–25% below official list for Claude, GPT and Gemini, and up to 45% for DeepSeek, Kimi and GLM. In LangChain, pass that endpoint to ChatOpenAI as base_url (the /v1 root, not /chat/completions), plus your key and a model ID from your model list. Test credits after we understand your volume.
Official LangChain documentation warns that ChatOpenAI targets OpenAI’s own specs. Not every OpenAI-only parameter is guaranteed to work. Seedance 2.5 video generation is available on the same AECore account; this page does not claim it runs through ChatOpenAI. See the Seedance 2.5 developer guide and Seedance 2.5 API pricing for video.
Request test credits OpenAI-compatible API LiteLLM how-to Email us
What does ChatOpenAI(base_url=…) actually change?
Instantiate ChatOpenAI from langchain-openai and pass base_url (alias openai_api_base) set to the API root from your onboarding — usually ending in /v1, not the full /chat/completions path — plus your key and model ID. Official LangChain docs warn that ChatOpenAI targets official OpenAI API specifications only. As of 13 November 2026 the integration page documents use_responses_api=True for OpenAI Responses-API features and does not recommend use_responses_api=False for a third-party host. The snippet below sets use_responses_api=False so calls stay on Chat Completions, which an OpenAI-compatible Completions backend expects.
Setting base_url sends Chat Completions calls to a host you choose, instead of OpenAI’s default host. Official documentation, re-fetched 13 November 2026, 10:20 Asia/Shanghai: LangChain’s ChatOpenAI integration and the Python ChatOpenAI reference. Those pages belong to LangChain; they are not AECore docs.
How do I point Python LangChain at AECore?
In the snippet below, replace <base URL from your onboarding> and <model id from your model list> with the values provided after onboarding. The base_url is the API root (often ending in /v1), not the full /chat/completions path.
from langchain_openai import ChatOpenAI
# Replace the values in angle brackets with your onboarding details. The base URL is provided after onboarding.
# base_url is the API root, often ending in /v1 — not /chat/completions.
llm = ChatOpenAI(
model="<model id from your model list>",
api_key="<your API key>",
base_url="<base URL from your onboarding>",
use_responses_api=False, # keeps Chat Completions; not an official “use False for third-party hosts” recommendation
)
print(llm.invoke("Draft a 30-second scene outline.").content)
You still set model IDs, and you should verify streaming, tools and other options on a test workload.
Should I set use_responses_api=False?
The flag still exists. Official LangChain docs as of 13 November 2026 use use_responses_api=True when you want OpenAI’s Responses API; they do not recommend use_responses_api=False for a non-OpenAI host. We set False in the snippet only to keep requests on Chat Completions. Check the current ChatOpenAI integration page before relying on this flag.
How do I do the same in JavaScript?
The short @langchain/openai form uses configuration.baseURL with the same values.
import { ChatOpenAI } from "@langchain/openai";
// Replace the values in angle brackets with your onboarding details. The base URL is provided after onboarding.
const llm = new ChatOpenAI({
model: "<model id from your model list>",
apiKey: "<your API key>",
configuration: {
baseURL: "<base URL from your onboarding>",
},
});
Can I use Claude, Gemini or DeepSeek through this ChatOpenAI instance?
Yes, by changing the model argument to the ID on your onboarding list, against the same base_url and key. The full official Claude range is available, as are GPT, Gemini, DeepSeek, Kimi and GLM.
For vendor-specific fields, official LangChain recommends the provider-specific packages. AECore AI resells genuine official tokens — typically 10–25% below official list for Claude, GPT and Gemini, and up to 45% for DeepSeek, Kimi and GLM — and refunds the affected usage if a delivered model is not the genuine official version. See the OpenAI-compatible API pillar, cheaper Claude on an OpenAI-compatible API, and the DeepSeek, Kimi and GLM comparison. Seedance 2.5 sits on the same account but is not claimed as a ChatOpenAI call.
How much cheaper than official list?
Public bands only — these are not a guaranteed unit discount:
- Claude, GPT and Gemini: typically 10–25% below official list, depending on volume (full current official Claude range).
- Seedance 2.5: typically 10–20% below official list, by volume.
- DeepSeek, Kimi and GLM: up to 45% below official list.
Prepaid credits, no top-up fees. Official-list unit figures, when you need them, live only on the dated official list-price dataset and on Claude API pricing — cite the fetch date on those pages; do not paste a second table here. Try the cost calculator (bands only) and see all public discount bands.
How do I get test credits?
Test credits are available on request for qualified teams (manual review). Tell us which models you need, your expected monthly volume and your business. We set up test credits after we understand those needs. The base URL and model list are provided after onboarding. Prefer to talk? Contact us or email partner@aecoreai.com. Request the credits on the test-credits form. EU data residency available. AECore AI is operated from Cyprus by Aether Core Intelligence Ltd (HE 496647). We are not an official vendor partner and we did not train the models. See trust and the authenticity guarantee.
FAQ
How do I point LangChain ChatOpenAI at an OpenAI-compatible API?
Instantiate ChatOpenAI from langchain-openai and pass base_url (alias openai_api_base) set to the API root from your onboarding — usually ending in /v1, not the full /chat/completions path — plus your key and model ID. Official LangChain docs warn that ChatOpenAI targets official OpenAI API specifications only. As of 13 November 2026 the integration page documents use_responses_api=True for OpenAI Responses-API features and does not recommend use_responses_api=False for a third-party host. The snippet below sets use_responses_api=False so calls stay on Chat Completions, which an OpenAI-compatible Completions backend expects.
Does AECore AI publish a public API host I can paste into LangChain today?
No public hostname is printed on this page. After a needs conversation and test-credit onboarding, AECore AI issues your base URL, key, and model list. In the examples, replace <base URL from your onboarding> with the base URL provided after onboarding.
Can I use Claude, Gemini or DeepSeek through this ChatOpenAI instance?
Yes, by changing the model argument to the ID on your onboarding list, against the same base_url and key. The full official Claude range is available, as are GPT, Gemini, DeepSeek, Kimi and GLM. Seedance 2.5 sits on the same account but is not claimed as a ChatOpenAI call.
Do I need to change my code to use an OpenAI-compatible reseller?
You change the base URL and the API key, and you set model IDs to the IDs on your onboarding list. That is not “zero code changes.” Clients such as the official OpenAI SDK, LiteLLM, and LangChain ChatOpenAI all accept a custom base URL; vendor-specific parameters may not pass through. AECore AI issues the base URL and the model list at onboarding.
How much cheaper than official list?
Public bands only: Claude, GPT and Gemini typically 10–25% below official list depending on volume; Seedance 2.5 typically 10–20%; DeepSeek, Kimi and GLM up to 45%. These are bands, not a guaranteed unit discount. See pricing and the cost calculator.
How do I get test credits?
Test credits are available on request for qualified teams (manual review). Tell us which models you need, your expected monthly volume and your business. We set up test credits after we understand those needs. Use the test-credits form, or Contact us, or email partner@aecoreai.com.
Request test credits
Test credits are available on request for qualified teams (manual review). Tell us which models you need, your expected monthly volume and your business — we set up test credits after we understand those needs. For a general enquiry, contact us or email partner@aecoreai.com. AECore AI is operated from Cyprus.