الجواب المباشر

تشرح هذه الصفحة كيف تستخدم الفرق بوابة NextModel المتوافقة مع OpenAI. Add NextModel as an OpenAI-compatible provider in opencode.json. وتضيف الخطوات العملية، وملاحظات الإعداد، والأسئلة الشائعة.

Config file

Put the block in ~/.config/opencode/opencode.json (global) or opencode.json in the project root (higher priority). The npm package must be @ai-sdk/openai-compatible; model ids must match the catalog exactly — copy them from GET /v1/models.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "nextmodel": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "NextModel",
      "options": {
        "baseURL": "https://api.nextmodel.app/v1",
        "apiKey": "$NEXTMODEL_API_KEY"
      },
      "models": {
        "qwen/qwen3.7-max": { "name": "Qwen 3.7 Max" },
        "anthropic/claude-sonnet-4.5": { "name": "Claude Sonnet 4.5" }
      }
    }
  },
  "model": "nextmodel/qwen/qwen3.7-max"
}