Adopting it is a two-line swap.
Already speak OpenAI? Point the SDK at busbar and pick a pool by name. The request, left as OpenAI, may have been served by Anthropic and came back as OpenAI, translated both ways.
Already speak Anthropic? Point the Anthropic SDK at busbar and pick a pool by name. The request, left as Anthropic, may have been served by OpenAI and came back as Anthropic, translated both ways.
Already speak Gemini? Point the google-genai SDK at busbar and pick a pool by name. The request, left as Gemini, may have been served by Bedrock and came back as Gemini, translated both ways.
Already speak Amazon Bedrock? Point boto3 at busbar and pick a pool by name. The request, left as Bedrock, may have been served by Anthropic and came back as Bedrock, translated both ways.
Already speak Cohere? Point the Cohere SDK at busbar and pick a pool by name. The request, left as Cohere, may have been served by Gemini and came back as Cohere, translated both ways.
On the OpenAI Responses API? Same SDK, same two lines. The request, left as a Responses call, may have been served by Cohere and came back as Responses, translated both ways.
The model name is a config value, not a code dependency.
app.py
# Already speak OpenAI? Just swap the base URL.
- client = OpenAI(api_key=OPENAI_KEY)
+ client = OpenAI(
+ api_key=BUSBAR_TOKEN,
+ base_url="http://busbar:8080",
+ )
# "fast" = a pool you define in config:
# 80% Claude / 20% GPT-4o, Gemini on failover.
client.chat.completions.create(
model="fast",
messages=[{"role": "user", "content": "Hi!"}],
)
app.py
# Already speak Anthropic? Just swap the base URL.
- client = Anthropic(api_key=ANTHROPIC_KEY)
+ client = Anthropic(
+ api_key=BUSBAR_TOKEN,
+ base_url="http://busbar:8080",
+ )
# "fast" = a pool you define in config:
# 80% Claude / 20% GPT-4o, Gemini on failover.
client.messages.create(
model="fast", max_tokens=1024,
messages=[{"role": "user", "content": "Hi!"}],
)
app.py
# Already speak Gemini? Just swap the base URL.
- client = genai.Client(api_key=GEMINI_KEY)
+ client = genai.Client(
+ api_key=BUSBAR_TOKEN,
+ http_options={"base_url": "http://busbar:8080"},
+ )
# "fast" = a pool you define in config:
# 80% Claude / 20% GPT-4o, Gemini on failover.
client.models.generate_content(
model="fast",
contents="Hi!",
)
app.py
# Already speak Bedrock? Just swap the endpoint.
- bedrock = boto3.client("bedrock-runtime")
+ bedrock = boto3.client(
+ "bedrock-runtime",
+ endpoint_url="http://busbar:8080",
+ )
# "fast" = a pool you define in config:
# 80% Claude / 20% GPT-4o, Gemini on failover.
bedrock.converse(
modelId="fast",
messages=[{"role": "user", "content": [{"text": "Hi!"}]}],
)
app.py
# Already speak Cohere? Just swap the base URL.
- co = cohere.ClientV2(api_key=COHERE_KEY)
+ co = cohere.ClientV2(
+ api_key=BUSBAR_TOKEN,
+ base_url="http://busbar:8080",
+ )
# "fast" = a pool you define in config:
# 80% Claude / 20% GPT-4o, Gemini on failover.
co.chat(
model="fast",
messages=[{"role": "user", "content": "Hi!"}],
)
app.py
# The Responses API? Same swap, same client.
- client = OpenAI(api_key=OPENAI_KEY)
+ client = OpenAI(
+ api_key=BUSBAR_TOKEN,
+ base_url="http://busbar:8080",
+ )
# "fast" = a pool you define in config:
# 80% Claude / 20% GPT-4o, Gemini on failover.
client.responses.create(
model="fast",
input="Hi!",
)