Package Exports
- @blackman-ai/sdk
- @blackman-ai/sdk/dist/esm/index.js
- @blackman-ai/sdk/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@blackman-ai/sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@blackman-ai/sdk
Official TypeScript/JavaScript SDK for Blackman AI - The AI API proxy that optimizes token usage to reduce costs.
Features
- 🚀 Drop-in replacement for OpenAI, Anthropic, and other LLM APIs
- 💰 Automatic token optimization (save 20-40% on costs)
- 📊 Built-in analytics and cost tracking
- 🔒 Enterprise-grade security with SSO support
- ⚡ Low latency overhead (<50ms)
- 🎯 Semantic caching for repeated queries
Installation
npm install @blackman-ai/sdkQuick Start
import { Configuration, CompletionsApi } from '@blackman-ai/sdk';
const config = new Configuration({
basePath: 'https://app.useblackman.ai',
accessToken: 'sk_your_blackman_api_key' // Get from https://app.useblackman.ai
});
const api = new CompletionsApi(config);
const response = await api.completions({
provider: 'OpenAI',
model: 'gpt-4o',
messages: [
{ role: 'user', content: 'Explain quantum computing in simple terms' }
]
});
console.log(response.choices[0].message.content);
console.log(`Tokens saved: ${response.usage.prompt_tokens}`);Authentication
Get your API key from the Blackman AI Dashboard.
Documentation
Support
- 📧 Email: support@blackman.ai
- 💬 Discord: Join our community
- 🐛 Issues: GitHub Issues
License
MIT © Blackman AI