SDK Reference
OpenAI SDK Compatibility
BazaarLink is fully compatible with the OpenAI Python and Node.js SDKs. Only two changes needed:
Before (OpenAI direct)
After (BazaarLink)
That's it!
All other features — streaming, tool calling, structured output, async — work exactly the same. The only change is base_url, api_key, and adding the provider prefix to model IDs.
Python
Installation
pip install openaiSynchronous
Async
Streaming with async
TypeScript / Node.js
Installation
npm install openaiBasic Usage
Streaming
LangChain
Use BazaarLink with LangChain by configuring the OpenAI-compatible base URL.
LlamaIndex
Use BazaarLink in LlamaIndex RAG pipelines. LlamaIndex supports any OpenAI-compatible endpoint — just change two parameters.
Vercel AI SDK
Integrate the Vercel AI SDK with BazaarLink in your Next.js app. Supports streaming, tool calling, and structured output.
Installation
npm install ai @ai-sdk/openai