コンテンツにスキップ

OpenCode 無料モデルガイド

API キーやクレジットカードなしで、完全無料の LLM モデルで OpenCode を使用します。

Free Model Options

ProviderModelFree TierRequirements
Google GeminiGemini 2.5 Flash250 requests/dayGoogle account
GroqLlama 3.1 8BFree tierGroq account
OllamaVarious local modelsUnlimitedGPU recommended
GitHub CopilotGPT-4oFree tierGitHub account

Google Gemini はクレジットカードなしで1 日あたり 250 件の無料リクエストを提供します。

Get Your Free API Key

  1. Google AI Studio にアクセス
  2. Google アカウントでログイン
  3. 「Get API key」をクリック
  4. API キーをコピー

Configure OpenCode

# Start the TUI
opencode tui

# Then configure your provider
/connect

# Select Google and enter your API key

またはコマンドラインから認証します:

opencode auth login --provider google
# Start OpenCode with Gemini
opencode tui --model google/gemini-2.5-flash

Option 2: Ollama (100% Local, Unlimited)

インターネットなしで AI モデルを完全にローカルで実行します。

Install Ollama

macOS/Linux:

curl -fsSL https://ollama.com/install.sh | sh

Windows: ollama.com からダウンロード

Download a Model

# Download Qwen 2.5 Coder (recommended for coding)
ollama pull qwen2.5-coder

# Or download Llama 3.1
ollama pull llama3.1

# Or download Code Llama
ollama pull codellama

Configure OpenCode

# Start the TUI
opencode tui

# Configure Ollama as your provider
/connect

# Select Ollama (it runs on localhost:11434 by default)

Start Coding

opencode tui --model ollama/qwen2.5-coder

Option 3: Groq (Free Tier)

Groq は API で高速モデルへの無料アクセスを提供します。

Get Your API Key

  1. console.groq.com にアクセス
  2. 無料アカウントに登録
  3. API キーを作成
  4. API キーをコピー

Configure OpenCode

# Start the TUI
opencode tui

# Configure Groq
/connect

# Select Groq and enter your API key

Start Coding

opencode tui --model groq/llama-3.1-8b-instant

Option 4: GitHub Copilot

GitHub アカウントをお持ちの場合、OpenCode で GitHub Copilotを使用できます。

Configure OpenCode

# Start the TUI
opencode tui

# Configure GitHub Copilot
/connect

# Select GitHub and authenticate via browser

Comparison of Free Options

FeatureGoogle GeminiOllamaGroqGitHub Copilot
Free Tier250 req/dayUnlimitedLimitedFree tier
PrivacyCloudLocalCloudCloud
SpeedFastDepends on hardwareVery fastFast
Model QualityExcellentGoodGoodExcellent
Offline

Tips for Using Free Models

  1. Start with Gemini: 最も設定が簡単で、慷慨的な無料枠があります
  2. Use Ollama for privacy: コードを完全にローカルに保持
  3. Switch models:異なるタスクに異なるモデルを使用
  4. Monitor usage: opencode stats で API 使用状況を確認

Troubleshooting

Rate Limits

レート制限に達した場合:

  • 制限がリセットされるのを待つ
  • 別の無料 provider に切り替え
  • 無制限のローカル使用には Ollama を使用

Slow Performance

モデルが遅い場合:

  • 別のモデルを試す(Gemini Flash は Pro より高速)
  • 最速の応答時間には Groq を使用
  • Ollama の場合、良い GPU があることを確認

Authentication Issues

認証が失敗した場合:

  • API キーが正しいことを確認
  • アカウントがアクティブであることを確認
  • /connect で再認証を試す

Next Steps