One API for all LLM providers
LLM Gateway provides a unified API interface that's fully compatible with the OpenAI API format. This means you can easily migrate from OpenAI to any other provider without changing your code. Simply update the base URL and API key, and you're ready to go.
Switch between providers without modifying your application code
Use the familiar OpenAI SDK and API format across all providers
Migrate from OpenAI to other providers in minutes, not days
Add new providers as they become available without code changes
Build applications that can use different providers for different use cases
Switch to cheaper providers for less critical workloads
Avoid vendor lock-in by using a provider-agnostic API
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.llmgateway.io/v1",
apiKey: process.env.LLMGATEWAY_API_KEY,
});
const completion = await client.chat.completions.create({
model: "anthropic/claude-3-5-sonnet-20241022",
messages: [
{ role: "user", content: "Hello, how are you?" }
],
});
console.log(completion.choices[0].message.content);