BazaarLinkBazaarLink
Sign in
DocsAPI ReferenceSDK ReferenceAgentic UsageAI Skills

Agentic Usage

Agent Frameworks

Use BazaarLink with popular agent frameworks. Since BazaarLink is OpenAI-compatible, most frameworks work out of the box — just set the base URL and API key.

Vercel AI SDK

import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";

const bazaarlink = createOpenAI({
  baseURL: "https://api.bazaarlink.ai/v1",
  apiKey: "sk-bl-YOUR_API_KEY",
});

const { text } = await generateText({
  model: bazaarlink("openai/gpt-4o"),
  prompt: "Write a haiku about programming",
});

console.log(text);

CrewAI

from crewai import Agent, Task, Crew
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    base_url="https://api.bazaarlink.ai/v1",
    api_key="sk-bl-YOUR_API_KEY",
    model="anthropic/claude-sonnet-4.6",
)

researcher = Agent(
    role="Researcher",
    goal="Research and summarize topics",
    llm=llm,
)

task = Task(
    description="Research the latest trends in AI agents",
    agent=researcher,
)

crew = Crew(agents=[researcher], tasks=[task])
result = crew.kickoff()
print(result)

AutoGen

from autogen import AssistantAgent, UserProxyAgent

config_list = [{
    "model": "openai/gpt-4o",
    "base_url": "https://api.bazaarlink.ai/v1",
    "api_key": "sk-bl-YOUR_API_KEY",
}]

assistant = AssistantAgent(
    "assistant",
    llm_config={"config_list": config_list},
)

user_proxy = UserProxyAgent(
    "user_proxy",
    human_input_mode="NEVER",
    code_execution_config={"work_dir": "coding"},
)

user_proxy.initiate_chat(
    assistant,
    message="Write a Python function to calculate fibonacci numbers",
)

Environment Variables

Most agent frameworks support configuration via environment variables:

# .env
OPENAI_API_KEY=sk-bl-YOUR_API_KEY
OPENAI_BASE_URL=https://api.bazaarlink.ai/v1
Environment Variables
Any framework that supports the OpenAI API or custom base URLs can work with BazaarLink. Just set the base URL and use a BazaarLink API key.
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
AI Agent Guides | Autonomous Workflows & Model Fallback