Foundation (SDKs)
Use this page when you call LootVM from application code. IDE and CLI tools have their own guides under Client Integrations.
Shared values
Section titled “Shared values”| Setting | Value |
|---|---|
| OpenAI-compatible base URL | https://api.lootvm.com/v1 |
| Anthropic-compatible host | https://api.lootvm.com (SDK appends /v1/messages) |
| Credential | LootVM-issued API key from the Console |
Never put the key in the URL. Prefer environment variables or a secret manager.
OpenAI SDK (Chat Completions)
Section titled “OpenAI SDK (Chat Completions)”export OPENAI_API_KEY='your-lootvm-api-key'export OPENAI_BASE_URL='https://api.lootvm.com/v1'from openai import OpenAI
client = OpenAI( api_key="your-lootvm-api-key", base_url="https://api.lootvm.com/v1",)
resp = client.chat.completions.create( model="your-enabled-model", messages=[{"role": "user", "content": "Hello from LootVM"}],)print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.LOOTVM_KEY, baseURL: "https://api.lootvm.com/v1",});
const resp = await client.chat.completions.create({ model: "your-enabled-model", messages: [{ role: "user", content: "Hello from LootVM" }],});console.log(resp.choices[0].message.content);Use a model id from GET /v1/models for your key. See Chat Completions.
Anthropic SDK (Messages)
Section titled “Anthropic SDK (Messages)”import anthropic
client = anthropic.Anthropic( api_key="your-lootvm-api-key", base_url="https://api.lootvm.com",)
msg = client.messages.create( model="your-enabled-model", max_tokens=256, messages=[{"role": "user", "content": "Hello from LootVM"}],)print(msg.content)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ apiKey: process.env.LOOTVM_KEY, baseURL: "https://api.lootvm.com",});
const msg = await client.messages.create({ model: "your-enabled-model", max_tokens: 256, messages: [{ role: "user", content: "Hello from LootVM" }],});console.log(msg.content);The Anthropic SDK posts to {base_url}/v1/messages. Do not set base_url to https://api.lootvm.com/v1 or the path doubles. See Messages (Claude) and Authentication.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Check |
|---|---|
401 / unauthorized |
Wrong or revoked LootVM key; key not loaded in the process environment |
404 on chat or messages |
Base URL missing or doubling /v1; confirm the SDK’s expected root |
| Model not found | Model id not in /v1/models for this key, or not enabled in the Console |
| Upstream-looking errors | You sent an upstream vendor key to api.lootvm.com instead of a LootVM key |