Every request an SDK makes is the base URL plus a path. Get the base URL right and the rest of the client works unchanged.
How it works
The client joins two parts:
| Part | Example |
|---|---|
| Base URL | https://inference.broadnet.ai/v1 |
| Endpoint path | /chat/completions |
| Full request URL | https://inference.broadnet.ai/v1/chat/completions |
In code, the parameter name depends on the library:
# Python SDK
client = OpenAI(base_url="https://inference.broadnet.ai/v1", api_key=os.environ["BROADNET_API_KEY"])
// Node SDK
const client = new OpenAI({ baseURL: "https://inference.broadnet.ai/v1", apiKey: process.env.BROADNET_API_KEY });
Both official SDKs fall back to the OPENAI_BASE_URL environment variable, and to OpenAI’s own address when nothing is set. Other tools use names such as api_base or OPENAI_API_BASE.
Why it matters
The base URL is what makes an OpenAI-compatible API a drop-in change. It also decides where your prompts go and who bills you. A wrong value can send traffic, and your API key, to the wrong provider. Keep it in configuration next to the key, not hard-coded in several places.
Routers use the same idea: you point the base URL at the router instead of at a model provider.
On BroadNet Inference
The base URL is https://inference.broadnet.ai/v1 for every model: chat, vision and speech to text. Chat goes to /chat/completions and transcription to /audio/transcriptions. The curl quickstart shows a first request, and the LangChain guide shows where the setting lives in a framework.
Common mistakes
- Missing
/v1.https://inference.broadnet.aiwithout/v1produces 404 errors from the SDK. - Doubled path. Pasting the full endpoint, such as
.../v1/chat/completions, as the base URL makes the SDK call.../chat/completions/chat/completions. - Leftover environment variables. An old
OPENAI_BASE_URLin your shell overrides what you expect. Print it when requests go to the wrong place. - Plain HTTP. Always use
https://. Bearer keys must travel over TLS. - Changing the URL but not the model. Each provider has its own model IDs, such as
broadnet/deepseek-v4.1-flash.
Moving a whole app? Work through the migration checklist.