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-key

Choose your development language

Examples for JavaScript, Python, Go, Java, C#, Ruby and PHP.

npm install openai
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/models
  • POST /v1/chat/completions
  • POST /v1/responses

See each model page and the dashboard for current model IDs and endpoint support.