Drop-in OpenAI-format ↔ Anthropic / Google / DeepSeek / Perplexity / xAI / Kimi translator. Parameter mapping, message reshape, tool-call translation, SSE streaming bridge — all without a single runtime dependency.
The canonical chat completions wire format. Generate a typed client SDK in any language, or validate inbound requests in your gateway.
Generated TypeDoc for every exported function, type and config. Click through types, see source links.
Quick start, translation matrix per provider, retry policy, tree-shaking, migration plan.
Runnable mini-projects: basic Anthropic call, SSE streaming, multi-provider fallback router, and a drop-in Express proxy server.
import { sendAnthropicRequest } from '@encorp.ai/llm-open-proxy';
const { response, usage, warnings } = await sendAnthropicRequest({
apiKey: process.env.ANTHROPIC_API_KEY!,
body: {
model: 'claude-opus-4-6',
messages: [
{ role: 'system', content: 'You are helpful.' },
{ role: 'user', content: 'Hello' },
],
max_completion_tokens: 256,
},
});
console.log(response.choices[0].message.content);
// `response` is OpenAI-shaped, regardless of upstream.