One API, 23 adapters
Register a provider, then call the same methods everywhere. Swapping a vendor is a string, not a rewrite — and the catalog knows each provider's models, context windows and pricing.
17 providers · one client@hilbras/sdk puts 23 provider adapters behind a single API — streaming, tool calling and validated structured output — with budgets, retries and guardrails, and no runtime dependencies.
// One client, any provider. Fallback and a spend cap included. import { HilbrasClient } from '@hilbras/sdk'; const client = new HilbrasClient({ budget: { sessionBudget: 2.5 } }); client.addProvider({ name: 'openai', apiKey: process.env.OPENAI_API_KEY }); client.addProvider({ name: 'anthropic', apiKey: process.env.ANTHROPIC_API_KEY }); for await (const chunk of client.stream({ provider: 'openai', model: 'gpt-5.6-terra', messages: [{ role: 'user', content: 'Explain vector search' }], fallback: [{ provider: 'anthropic', model: 'claude-sonnet-5' }], })) { if (chunk.type === 'text') process.stdout.write(chunk.text); } // text · reasoning · tool_call · usage · finish — typed, every time
Bring the providers you already use
Provider differences belong in one place. Your application keeps calling stream() andcomplete() while models, regions and vendors change underneath it.
Register a provider, then call the same methods everywhere. Swapping a vendor is a string, not a rewrite — and the catalog knows each provider's models, context windows and pricing.
17 providers · one clientEvery chunk is typed — text, reasoning, tool call, usage, finish. SSE framing handles CRLF, usage is accounted per provider, and a fallback that is configured actually runs.
Typed chunks · first-chunk latencySession and per-request budgets with reservations, retries with capped backoff, a circuit breaker, fallback chains, RBAC, and an audit log that redacts credentials before writing.
Budgets · retries · auditOne package, no transitive runtime dependencies. TypeScript types come with it.
npm install @hilbras/sdk
Bring keys for the services you already use, or point at a local Ollama endpoint.
client.addProvider({ name: 'openai', apiKey })Stream or complete, with tools, schemas and fallback declared on the call.
await client.stream({ provider, model, messages })Add a second when you need it — routing, fallback and budgets are already there.