Integrations

OpenCode

OpenCode is an open-source terminal coding agent. It speaks the OpenAI wire format, so it works against Pendra with a custom provider that points at Pendra's OpenAI-compatible base URL, https://api.pendra.ai/api/v1, and your pdr_sk_ key.

Your model list is per-account. The models available on Pendra are exactly the ones your own workers are serving — that set differs from account to account and changes as you install or remove models. The recommended setup below discovers your live model list automatically; a static fallback is documented after it.

Recommended — a live, per-account model list

OpenCode does not query a provider's /models endpoint on its own (it's a requested feature), so a static config would list models you may not actually have installed. The community dynamic custom providers plugin closes that gap: it re-reads Pendra's model list on every start, so OpenCode shows precisely what your worker pool serves.

The plugin is an independent, third-party project — not maintained by Pendra. Check its README for the latest options before relying on it.

1. Install the plugin

bash
opencode plugin opencode-dynamic-custom-providers

2. Add Pendra as a dynamic provider

Edit opencode.json (project root, or ~/.config/opencode/opencode.json for a global config). With "dynamic": true and no explicit models block, the plugin autodiscovers Pendra's models:

opencode.json
// opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "pendra": {
      "name": "Pendra",
      "dynamic": true,
      "options": {
        "baseURL": "https://api.pendra.ai/api/v1",
        "apiKey": "{env:PENDRA_API_KEY}"
      }
    }
  }
}

Fallback — a fixed model list

If you'd rather not add a plugin, define a standard OpenAI-compatible provider and list the models yourself. Each key under models must match an id returned by GET /api/v1/models — list yours at /models. A model you haven't installed on a worker will simply return an error when called.

opencode.json
// opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "pendra": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Pendra",
      "options": {
        "baseURL": "https://api.pendra.ai/api/v1",
        "apiKey": "{env:PENDRA_API_KEY}"
      },
      "models": {
        "qwen3-coder:30b": { "name": "Qwen3 Coder 30B (Pendra)" },
        "qwen3.6:27b": { "name": "Qwen3.6 27B (Pendra)" },
        "gpt-oss:120b": { "name": "GPT-OSS 120B (Pendra)" }
      }
    }
  }
}

What each key does

KeyPurpose
npm@ai-sdk/openai-compatible — the AI SDK adapter OpenCode uses for OpenAI-style APIs. (Omit it when using the dynamic plugin.)
nameDisplay name shown in the /models picker.
options.baseURLPendra's OpenAI-compatible base. OpenCode appends /chat/completions and /models.
options.apiKeyYour Pendra pdr_sk_ key. {env:PENDRA_API_KEY} pulls it from the environment.
modelsThe models to expose. Each becomes pendra/<id> in OpenCode. Only needed for the static setup.

Set the key and run

bash
export PENDRA_API_KEY=pdr_sk_...

# pick a model with the /models picker, or launch straight into one:
opencode --model pendra/qwen3-coder:30b

Choosing models

Pick reasoning-strong models for coding — e.g. qwen3-coder:30b, qwen3.6:27b, or gpt-oss:120b — from whatever your workers are serving. Browse the live catalogue at /models, and see choosing a model size for what your hardware can run.

Official provider listing

We're working to add Pendra to models.dev, the registry OpenCode reads its built-in providers from, so "Pendra" appears in the provider list without any custom config. Until then — and for an accurate, per-account model list either way — use the setup above.

Troubleshooting

  • 401 Unauthorized: make sure PENDRA_API_KEY is exported in the same shell (or set options.apiKey directly).
  • No models listed: confirm at least one worker is connected and serving a model (/models should return it), and that baseURL ends in /api/v1 — the /v1 prefix is Pendra's Anthropic surface, not the OpenAI model list.
  • "Provider not found": the key under provider (pendra) must match what you reference in --model pendra/<id>.
  • Model errors on call: that model isn't installed on any of your workers. Install it from the console, or pick one /models shows.

Related