
Product
Socket Threat Intel Now Shows Which Malware Campaigns Were Blocked or Detected
Socket Threat Intel now shows which malware campaigns were blocked or detected in your organization, with links to scans and Firewall events.
Unified AI SDK for OpenAI, Gemini, Claude, Perplexity, and DeepSeek. Designed like AWS SDK v3.
Bridge AI is a unified, type-safe SDK for interacting with multiple AI providers (OpenAI, Gemini, Claude, Perplexity, and DeepSeek). Designed with the elegance and modularity of AWS SDK v3, it provides a seamless interface whether you're building a simple bot or a complex multi-model application.
AsyncIterable stream support across all providers.npm install bridge-ai
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=...
ANTHROPIC_API_KEY=...
import { BridgeAIClient } from 'bridge-ai';
const client = new BridgeAIClient({ provider: 'openai' });
const response = await client.chat({
prompt: 'What is the future of AI?'
});
console.log(response.text);
console.log(`Cost: $${response.cost}`); // $0.00004
Get real-time responses with a single unified interface.
const stream = client.chatStream({ prompt: 'Write a long story...' });
for await (const chunk of stream) {
process.stdout.write(chunk.text);
}
Force the model to return valid JSON.
const res = await client.chat({
prompt: 'List 3 fruits',
responseFormat: 'json'
});
console.log(res.json); // [{name: "Apple"}, ...]
Send images to any supported model consistently.
const res = await client.chat({
prompt: 'What is inside this image?',
images: [{
type: 'url',
data: 'https://example.com/photo.jpg'
}]
});
Ensure 100% uptime by defining fallbacks. Bridge AI also automatically retries on rate limits (429) or server errors.
const client = new BridgeAIClient({
provider: 'openai',
fallbackProviders: ['gemini', 'claude'],
retryOptions: { retries: 3 }
});
Bridge AI is the first SDK to natively support TOON (Token-Oriented Object Notation). Use it to send complex structured data (like large arrays or objects) while saving up to 40% on token costs compared to JSON.
const res = await client.chat({
prompt: { user: 'Alice', history: [...lots of data] },
useToon: true // Automatically serializes prompt to TOON
});
Every prompt is hashed (SHA-256). Use the onResponse hook to save to your database.
const client = new BridgeAIClient({
onResponse: ({ prompt, response, hash }) => {
db.save({ hash, text: response.text });
}
});
const response = await client.chat({
prompt: 'What is the weather?',
tools: [{
name: 'getWeather',
description: 'Get weather',
parameters: { ... }
}]
});
if (response.toolCalls) {
// Execute function calls
}
Test your app without spending a cent.
const client = new BridgeAIClient({ provider: 'mock' });
| Provider | Config Name | Default Model | Env Variable |
|---|---|---|---|
| OpenAI | openai | gpt-4-turbo-preview | OPENAI_API_KEY |
| Google Gemini | gemini | gemini-1.5-flash | GEMINI_API_KEY |
| Anthropic Claude | claude | claude-3-5-sonnet-20240620 | ANTHROPIC_API_KEY |
| Perplexity | perplexity | llama-3-sonar-large-32k-online | PERPLEXITY_API_KEY |
| DeepSeek | deepseek | deepseek-chat | DEEPSEEK_API_KEY |
Visit our GitHub Pages for full API reference.
MIT © Himanshu Mamgain
FAQs
Unified AI SDK for OpenAI, Gemini, Claude, Perplexity, and DeepSeek. Designed like AWS SDK v3.
The npm package bridge-ai receives a total of 9 weekly downloads. As such, bridge-ai popularity was classified as not popular.
We found that bridge-ai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Socket Threat Intel now shows which malware campaigns were blocked or detected in your organization, with links to scans and Firewall events.

Security News
Fixes for eMudhra and Brotli are out. Getting them everywhere they’re needed means tracking down bundled libraries, runtimes, and certificate stores.

Threat Research
/Security News
Socket uncovered secret-stealing workflows that ran in LiteLLM’s GitHub repository 11 days before the supply chain attack on PyPI and Docker.