OpenAI SDK

Point the official openai package at LLMRPM in Node or Python.

Configuration

SettingValue
API shapeOpenAI-compatible
Base URLhttps://llmrpm.com/api/v1
AuthAuthorization: Bearer llmrpm_...
  • Install the official openai package in your application.
  • Set LLMRPM_API_KEY server-side and map it to OPENAI_API_KEY if the SDK expects that variable.
  • Set the SDK baseURL / base_url to https://llmrpm.com/api/v1.
  • Use any public model ID returned by GET /api/v1/models.

Example

JavaScript — openai
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.LLMRPM_API_KEY,
  baseURL: "https://llmrpm.com/api/v1",
});

const completion = await client.chat.completions.create({
  model: "claude-sonnet-5",
  messages: [{ role: "user", content: "Write three product taglines." }],
  max_tokens: 400,
});
Python — openai
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["LLMRPM_API_KEY"],
    base_url="https://llmrpm.com/api/v1",
)

completion = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[{"role": "user", "content": "Write three product taglines."}],
    max_tokens=400,
)

Troubleshooting

SymptomCause & fix
Authentication errorCheck that the API key has no extra spaces and has not been revoked in the dashboard.
Model rejectedUse a public model ID returned by GET /api/v1/models; do not use display names or aliases.
Connection issueConfirm the configured base URL is exactly the one shown above and that your network allows HTTPS to llmrpm.com.

Notes

  • Streaming and tool calling behave as documented in Chat completions.
  • Keep the key server-side; never ship it in a browser bundle.