المظهر
اللغة

OpenCode

إعداد OpenCode باستخدام GetVibe API عبر ~/.config/opencode/opencode.json: موفّر متوافق مع OpenAI مع baseURL هو getvibeapi.com/v1.

OpenCode حزمة npm للبرمجة بالوكيل في الطرفية. يتم إعداد الموفرين في ~/.config/opencode/opencode.json.

إعداد جاهز يضم كل النماذج

لا يقرأ OpenCode أحجام السياق من /v1/models: النموذج الذي تضيفه يدويًا يظهر بسياق 0 ولا يتم ضغط السجل في الوقت المناسب. بدلًا من كتابة الأرقام يدويًا، نزّل الإعداد المُولَّد — فهو مبني من فهرسنا: كل نموذج منشور مع اسمه وسياقه وحد الإخراج وعلامات الصور / الاستدلال / الأدوات. لا يحتوي على مفتاح، فقط مرجع {env:GETVIBE_API_KEY}.

# macOS / Linux — a fresh config with every model and its context
mkdir -p ~/.config/opencode
curl -fsSL https://getvibeapi.com/api/integrations/opencode.json -o ~/.config/opencode/opencode.json
# Windows PowerShell
New-Item -ItemType Directory -Force "$HOME\.config\opencode" | Out-Null
Invoke-WebRequest https://getvibeapi.com/api/integrations/opencode.json -OutFile "$HOME\.config\opencode\opencode.json"

إذا كان opencode.json لديك مخصّصًا بالفعل، فلا تستبدله — استبدل كتلة المزوّد فقط واحتفظ بالباقي:

# Already have an opencode.json — replace only the provider block (needs jq)
cd ~/.config/opencode && cp opencode.json opencode.json.bak
curl -fsSL https://getvibeapi.com/api/integrations/opencode.json -o provider.json
jq --slurpfile pv provider.json '.provider = ((.provider // {}) + $pv[0].provider)' opencode.json.bak > opencode.json
# Only the models you need (comma-separated IDs); ?variants=1 adds pinned channels too
curl -fsSL "https://getvibeapi.com/api/integrations/opencode.json?models=claude-opus-5.5,openai/gpt-6.1-sol"
تتغيّر القائمة — عند ظهور طُرز جديدة، شغّل الأمر نفسه مرة أخرى. احذف أي مُدخلات طُرز كتبتها يدويًا، وإلا سيُظهر المُنتقي نسخًا مكرّرة بسياق 0.

opencode.json يدويًا

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "getvibe": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "GetVibe",
      "options": {
        "baseURL": "https://getvibeapi.com/v1",
        "apiKey": "{env:GETVIBE_API_KEY}"
      },
      "models": {
        "gpt-6.1-sol": {
          "name": "GPT-6.1 Sol",
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          }
        },
        "claude-opus-5.5": {
          "name": "Claude Opus 5.5",
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          }
        },
        "deepseek-v4.1-flash": {
          "name": "DeepSeek V4.1 Flash",
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          }
        },
        "kimi-k3.1-pro": {
          "name": "Kimi K3.1 Pro",
          "attachment": false,
          "modalities": {
            "input": [
              "text"
            ],
            "output": [
              "text"
            ]
          }
        }
      }
    }
  },
  "model": "getvibe/gpt-6.1-sol"
}

اضبط GETVIBE_API_KEY قبل بدء OpenCode وشغّله من النافذة نفسها: export GETVIBE_API_KEY="sk-pv-…" (macOS/Linux)، أو setx GETVIBE_API_KEY "sk-pv-…" ثم نافذة PowerShell جديدة (Windows). من دون المتغير، يرسل OpenCode مفتاحًا فارغًا ويتلقّى الخطأ 401 «مفتاح API غير صالح». أتفضّل عدم استخدام متغير؟ ضع المفتاح نفسه بدلًا من {env:GETVIBE_API_KEY} في الحقل apiKey.

في models، اذكر فقط معرّفات النماذج العامة التي تحتاجها. القائمة الكاملة في الكتالوج. للاستخدام العادي، اكتب الاسم المجرّد دون :suffix: فاللاحقة تثبّت قناة واحدة وتعطّل التحويل التلقائي إلى قناة سليمة.
تحتاج الصور إلى "attachment": true. يستقي OpenCode قدرات النموذج من سجل models.dev، وهو لا يدرج GetVibe، لذا يُعامل النموذج المُعرَّف بـ {} فارغ على أنه لا يقبل أي مرفقات ويرسل OpenCode الطلب دون الصورة. فيقول النموذج عندها بصدق إنه لا يراها، مع أنه يمتلك قدرة الرؤية. أضف attachment وmodalities لكل نموذج يعرضه catalog بمدخل صور. وقد فحصنا بقية عمليات التكامل المنشورة أيضًا: فـ Cline وCursor وRoo Code وKilo Code وAider وContinue لا تحتوي أمثلتها على خريطة منفصلة لقدرات النماذج، لذا فإن هذا الإعداد الخاص بـ OpenCode وحده ليس ناقصًا في تلك الإعدادات.
OpenCode + GetVibe API — مزوّد opencode.json | GetVibe API