OpenCode
Setting Up OpenCode
Prerequisites
Step 1: the Config File
Option A: OpenAI Format (All Models)
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"hyprlab-oai": {
"npm": "@ai-sdk/openai-compatible",
"name": "HyprLab (OpenAI)",
"options": {
"baseURL": "https://api.hyprlab.io/v1"
},
"models": {
"gpt-5.2": {
"name": "GPT-5.2",
"cost": { "input": 1.225, "output": 9.8 },
"limit": { "context": 200000, "output": 32768 }
},
"gpt-5.2-pro": {
"name": "GPT-5.2 Pro",
"cost": { "input": 18.9, "output": 151.2 },
"limit": { "context": 200000, "output": 32768 }
}
}
}
}
}Option B: Anthropic Format (Claude Models)
Option C: Google Format (Gemini Models)
Step 2: Authenticate with HyprLab
Step 3: Start OpenCode
Step 4: Select Your Model
Step 5: Send Your First Message
Configuration Reference
Model Properties
Property
Description
Example
Available Providers
Provider ID
SDK
Use For
Base URLs
Provider
Base URL
Troubleshooting
"Unauthorized" Error
Model Not Showing
Wrong Pricing/Context Shown
Last updated