BazaarLinkBazaarLink
Sign in
DocsAPI ReferenceSDK ReferenceAgentic UsageAI Skills
Contents

OpenAI SDK Compatibility

OpenAI SDK Compatibility

BazaarLink is fully compatible with the OpenAI Python and Node.js SDKs. Only two changes needed:

Before (OpenAI direct)
from openai import OpenAI

client = OpenAI(
    api_key="sk-..."
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[...]
)
After (BazaarLink)
from openai import OpenAI

client = OpenAI(
    base_url="https://api.bazaarlink.ai/v1",
    api_key="sk-bl-YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="openai/gpt-4o",  # add provider/
    messages=[...]
)
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.
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
OpenAI SDK Compatibility | BazaarLink