OpenCode 無料モデルガイド
API キーやクレジットカードなしで、完全無料の LLM モデルで OpenCode を使用します。
Free Model Options
| Provider | Model | Free Tier | Requirements |
|---|---|---|---|
| Google Gemini | Gemini 2.5 Flash | 250 requests/day | Google account |
| Groq | Llama 3.1 8B | Free tier | Groq account |
| Ollama | Various local models | Unlimited | GPU recommended |
| GitHub Copilot | GPT-4o | Free tier | GitHub account |
Option 1: Google Gemini (Recommended)
Google Gemini はクレジットカードなしで1 日あたり 250 件の無料リクエストを提供します。
Get Your Free API Key
- Google AI Studio にアクセス
- Google アカウントでログイン
- 「Get API key」をクリック
- 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
Recommended Model
# 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
- console.groq.com にアクセス
- 無料アカウントに登録
- API キーを作成
- 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
| Feature | Google Gemini | Ollama | Groq | GitHub Copilot |
|---|---|---|---|---|
| Free Tier | 250 req/day | Unlimited | Limited | Free tier |
| Privacy | Cloud | Local | Cloud | Cloud |
| Speed | Fast | Depends on hardware | Very fast | Fast |
| Model Quality | Excellent | Good | Good | Excellent |
| Offline | ❌ | ✅ | ❌ | ❌ |
Tips for Using Free Models
- Start with Gemini: 最も設定が簡単で、慷慨的な無料枠があります
- Use Ollama for privacy: コードを完全にローカルに保持
- Switch models:異なるタスクに異なるモデルを使用
- Monitor usage:
opencode statsで API 使用状況を確認
Troubleshooting
Rate Limits
レート制限に達した場合:
- 制限がリセットされるのを待つ
- 別の無料 provider に切り替え
- 無制限のローカル使用には Ollama を使用
Slow Performance
モデルが遅い場合:
- 別のモデルを試す(Gemini Flash は Pro より高速)
- 最速の応答時間には Groq を使用
- Ollama の場合、良い GPU があることを確認
Authentication Issues
認証が失敗した場合:
- API キーが正しいことを確認
- アカウントがアクティブであることを確認
/connectで再認証を試す
Next Steps
- クイックスタートガイド - OpenCode を始める
- モデルドキュメント - 利用可能なすべてのモデルを確認
- 設定 - 設定をカスタマイズ