OPENAI COMPATIBLE
Connect with the OpenAI SDK
Keep the OpenAI SDK and compatible clients you already use. Point the Base URL and API key to LLMRouter.
Configure the endpoint and key
export OPENAI_BASE_URL=https://api.llmrouter.pro/v1
export OPENAI_API_KEY=sk-lr-your-keyChoose your development language
Examples for JavaScript, Python, Go, Java, C#, Ruby and PHP.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-lr-your-key",
baseURL: "https://api.llmrouter.pro/v1",
});
const response = await client.chat.completions.create({
model: "your-model",
messages: [{ role: "user", content: "Hello" }],
});
console.log(response.choices[0].message.content);Available endpoints
GET /v1/modelsPOST /v1/chat/completionsPOST /v1/responses
See each model page and the dashboard for current model IDs and endpoint support.