How to Access Gemini Claude GPT 4o and DeepSeek With One API Call
A developer tutorial showing how to access Gemini, Claude, GPT-4o, and DeepSeek through a single unified API endpoint using RBAOS — no separate integrations required.
Getting Started in 5 Minutes
This tutorial shows you how to call Gemini, Claude, GPT-4o, and DeepSeek through a single RBAOS API endpoint. By the end, you will have working code for all four models without managing four separate provider integrations.
Prerequisites
- An RBAOS account (sign up at rbaos.com)
- Your RBAOS API key from the dashboard
- Node.js 18+ or Python 3.9+ (examples below cover both)
Step 1: Get Your API Key
After signing up, go to your RBAOS dashboard and generate an API key from the API Keys section. Store it as an environment variable:
# Add to your .env file
RBAOS_API_KEY=rbaos_your_api_key_hereStep 2: Making Your First Multi-Model Calls
Using Fetch (JavaScript)
const RBAOS_BASE = 'https://api.rbaos.com/v1';
const headers = {
'Authorization': `Bearer ${process.env.RBAOS_API_KEY}`,
'Content-Type': 'application/json'
};
async function callModel(model, userMessage) {
const response = await fetch(`${RBAOS_BASE}/chat/completions`, {
method: 'POST',
headers,
body: JSON.stringify({
model,
messages: [{ role: 'user', content: userMessage }],
max_tokens: 500
})
});
const data = await response.json();
return data.choices[0].message.content;
}
// Call all four models with the same interface
const prompt = 'Explain the concept of recursion in two sentences.';
const results = await Promise.all([
callModel('gemini-2.0-pro', prompt),
callModel('claude-sonnet-4', prompt),
callModel('gpt-4o', prompt),
callModel('deepseek-r2', prompt)
]);
console.log('Gemini:', results[0]);
console.log('Claude:', results[1]);
console.log('GPT-4o:', results[2]);
console.log('DeepSeek:', results[3]);Using Python
import os
import httpx
import asyncio
RBAOS_BASE = 'https://api.rbaos.com/v1'
headers = {
'Authorization': f'Bearer {os.environ["RBAOS_API_KEY"]}',
'Content-Type': 'application/json'
}
async def call_model(client, model: str, message: str) -> str:
response = await client.post(
f'{RBAOS_BASE}/chat/completions',
headers=headers,
json={
'model': model,
'messages': [{'role': 'user', 'content': message}],
'max_tokens': 500
}
)
data = response.json()
return data['choices'][0]['message']['content']
async def main():
prompt = 'Explain recursion in two sentences.'
models = ['gemini-2.0-pro', 'claude-sonnet-4', 'gpt-4o', 'deepseek-r2']
async with httpx.AsyncClient() as client:
tasks = [call_model(client, model, prompt) for model in models]
results = await asyncio.gather(*tasks)
for model, result in zip(models, results):
print(f'{model}: {result}\n')
asyncio.run(main())Step 3: Using the OpenAI SDK (No Code Changes)
If you are already using the OpenAI Python or Node.js SDK, you can point it at RBAOS with two line changes:
import OpenAI from 'openai';
// Before: pointed at OpenAI
// const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
// After: pointed at RBAOS — now access every provider
const client = new OpenAI({
apiKey: process.env.RBAOS_API_KEY,
baseURL: 'https://api.rbaos.com/v1'
});
// Same SDK code, now routes to any provider
const claudeResponse = await client.chat.completions.create({
model: 'claude-opus-4',
messages: [{ role: 'user', content: 'Hello' }]
});
const geminiResponse = await client.chat.completions.create({
model: 'gemini-2.0-ultra',
messages: [{ role: 'user', content: 'Hello' }]
});Step 4: Add Automatic Routing
Once you have the basics working, add automatic routing so you do not need to specify the model manually:
// Let RBAOS pick the best model based on your routing config
const response = await fetch(`${RBAOS_BASE}/chat/completions`, {
method: 'POST',
headers: {
...headers,
'X-Task-Type': 'summarization', // routing hint
'X-Max-Cost-USD': '0.01' // cost ceiling
},
body: JSON.stringify({
model: 'auto', // gateway selects the model
messages: [{ role: 'user', content: 'Summarize: ' + longDocument }]
})
});Step 5: Handle Errors Correctly
async function callWithErrorHandling(model, messages) {
try {
const response = await fetch(`${RBAOS_BASE}/chat/completions`, {
method: 'POST',
headers,
body: JSON.stringify({ model, messages })
});
if (!response.ok) {
const error = await response.json();
// RBAOS returns normalized error codes regardless of which provider failed
console.error('API error:', error.error.code, error.error.message);
throw new Error(error.error.message);
}
return await response.json();
} catch (error) {
console.error('Request failed:', error.message);
throw error;
}
}For the complete API reference including all supported models, parameters, and response formats, see the RBAOS product documentation. For routing configuration beyond these basics, how to route AI requests automatically covers the full setup. API key and tier details are on the pricing page.
Frequently asked questions
No. RBAOS manages the provider credentials centrally. You sign up for RBAOS, get one API key, and access all supported providers through it.
Yes. RBAOS exposes a standard HTTP API. Any language that can make HTTP requests works — Python, JavaScript, Ruby, Go, PHP, Rust, or any other.
The model responses are the same — RBAOS passes your request to the provider and returns the response. There is no modification of model output. Request format normalization happens transparently.
Related posts
Explore Related Articles
Unified AI API One Key to Access Every Major LLM
One API key, one integration, every major language model. This is not a compromise — it is strictly better than managing separate provider accounts.
How to Use 500 AI Models Without Managing 500 API Keys
Managing multiple AI provider accounts is a maintenance nightmare. A unified API layer gives you access to every major model without the credential sprawl.
How to Route AI Requests to the Best LLM Automatically
Not every AI task needs the same model. Smart routing sends simple jobs to cheap models and complex ones to frontier models — automatically.
How to Use RBAOS Code
Tutorial pages should lower activation friction, answer setup questions early, and make the next action obvious.
RBAOS for DevOps: Automating Infrastructure and Deployment Workflows
DevOps teams can use RBAOS to automate infrastructure management, deployment pipelines, monitoring workflows, and incident response processes.
RBAOS for Product Managers: AI-Powered Research, Planning, and Communication
Product managers can use RBAOS for user research synthesis, requirements documentation, competitive analysis, and stakeholder communication at scale.
RBAOS for Customer Support: Faster Resolution, Consistent Quality
Customer support teams using RBAOS can handle higher ticket volumes with better consistency, faster resolution times, and lower cost per resolution.
How to Use RBAOS CLI for Cloud Operations
This tutorial covers the full workflow for run aws and google cloud cli commands from your browser using rbaos cli inside RBAOS — from initial setup to finished output.
How to Connect External Services to RBAOS
This tutorial covers the full workflow for connect your existing tools — crms, apis, communication platforms — to rbaos using built-in connectors inside RBAOS — from initial setup to finished output.
How to Set Up Your RBAOS Workspace
This tutorial covers the full workflow for set up a project workspace in rbaos so that agents, code, and cli surfaces share full context inside RBAOS — from initial setup to finished output.
How to Run Agentic Workflows in RBAOS
This tutorial covers the full workflow for build and execute multi-step agentic workflows inside rbaos without writing orchestration code inside RBAOS — from initial setup to finished output.
How to Use RBAOS for DevOps Automation
This tutorial covers the full workflow for use rbaos to automate common devops tasks including deployments, cli operations, and incident response workflows inside RBAOS — from initial setup to finished output.
How to Build Your First AI Agent on RBAOS
This tutorial covers the full workflow for configure and deploy your first autonomous ai agent inside the rbaos platform without prior ml experience inside RBAOS — from initial setup to finished output.
How to Debug Code with RBAOS Code
This tutorial covers the full workflow for use rbaos code's ai debugging surface to identify, trace, and fix bugs faster than manual inspection inside RBAOS — from initial setup to finished output.
How to Generate Production-Ready Code with RBAOS
This tutorial covers the full workflow for use rbaos code to generate boilerplate, functions, and complete modules with project-aware context inside RBAOS — from initial setup to finished output.
How Startups Use RBAOS to Ship Faster
This tutorial covers the full workflow for use rbaos as a lean engineering multiplier — replacing the need for dedicated devops and tooling engineers in early-stage startups inside RBAOS — from initial setup to finished output.
How to Automate Cloud Workflows with RBAOS
This tutorial covers the full workflow for use rbaos's cli surface and agent layer to automate repetitive cloud operations across aws and google cloud inside RBAOS — from initial setup to finished output.
How to Invite Your Team to RBAOS
This tutorial covers the full workflow for add team members to your rbaos workspace, configure access roles, and set up shared context for collaborative agentic work inside RBAOS — from initial setup to finished output.
How Freelancers Use RBAOS to Deliver Faster
This tutorial covers the full workflow for use rbaos as a solo delivery platform — combining coding, automation, and client workflow management without extra tools inside RBAOS — from initial setup to finished output.
How to Audit AI Agent Activity in RBAOS
This tutorial covers the full workflow for use rbaos's activity log to review, replay, and verify every action taken by autonomous agents in your workspace inside RBAOS — from initial setup to finished output.