OpenAI SDK
Point the official openai package at LLMRPM in Node or Python.
Configuration
| Setting | Value |
|---|---|
| API shape | OpenAI-compatible |
| Base URL | https://llmrpm.com/api/v1 |
| Auth | Authorization: Bearer llmrpm_... |
- Install the official
openaipackage in your application. - Set
LLMRPM_API_KEYserver-side and map it toOPENAI_API_KEYif the SDK expects that variable. - Set the SDK
baseURL/base_urltohttps://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,
)Recommended models
Any public ID from the model list works. Common picks:
claude-sonnet-5— strong model for reasoning, refactors, and coding agents.claude-haiku-4.5— fast option for autocomplete, small questions, and lightweight tasks.deepseek-v4-pro— alternative based on your active catalog and plan.
Troubleshooting
| Symptom | Cause & fix |
|---|---|
| Authentication error | Check that the API key has no extra spaces and has not been revoked in the dashboard. |
| Model rejected | Use a public model ID returned by GET /api/v1/models; do not use display names or aliases. |
| Connection issue | Confirm 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.