OpenCode
OpenCode can call LootVM through an OpenAI-compatible provider entry. Put the provider in project opencode.json / opencode.jsonc or in your user OpenCode config, then select the model in OpenCode.
OpenCode config shapes vary by version (provider vs providers, npm vs package). Use the schema your installed OpenCode documents; the values below are what must point at LootVM.
Values
Section titled “Values”| Field | Value |
|---|---|
| Base URL | https://api.lootvm.com/v1 (no /chat/completions suffix) |
| API key | LootVM-issued key (env var preferred) |
| Model id | Exact id from GET /v1/models for your key |
Example provider block
Section titled “Example provider block”{ "$schema": "https://opencode.ai/config.json", "provider": { "lootvm": { "npm": "@ai-sdk/openai-compatible", "name": "LootVM", "options": { "baseURL": "https://api.lootvm.com/v1", "apiKey": "{env:LOOTVM_API_KEY}" }, "models": { "your-enabled-model": { "name": "LootVM model" } } } }, "model": "lootvm/your-enabled-model"}Then:
export LOOTVM_API_KEY='your-lootvm-api-key'opencodeIf your OpenCode build uses a providers map and @opencode/ai/providers/openai-compatible, keep the same baseURL and credential pattern and follow that build’s package field names.
Verify
Section titled “Verify”curl --fail-with-body https://api.lootvm.com/v1/models \ -H "Authorization: Bearer ${LOOTVM_API_KEY}"
opencode modelsTroubleshooting
Section titled “Troubleshooting”| Symptom | Check |
|---|---|
| Provider missing in picker | Provider id in config does not match model (lootvm/...) |
401 |
Env var empty in the shell that started OpenCode; prefer {env:...} over committing secrets |
| Connection / timeout | baseURL must end with /v1, not /v1/chat/completions |
| Model unknown | Model key must match /v1/models character for character |
See Foundation (SDKs) and Chat Completions.