OpenCode Integration
OpenCode is an open-source AI coding agent available as a terminal-based interface, desktop app, or IDE extension. This guide shows you how to connect OpenCode to AIShop24H.
Prerequisites
Section titled “Prerequisites”- macOS, Linux, or Windows
- A modern terminal emulator (WezTerm, Alacritty, Ghostty, or Kitty)
- OpenCode installed (Installation guide)
- AIShop24H API key (Get one here)
Configuration
Section titled “Configuration”Create or edit ~/.config/opencode/opencode.json:
{ "$schema": "https://opencode.ai/config.json", "provider": { "aishop24h": { "npm": "@ai-sdk/openai-compatible", "name": "AI Shop 24h Provider", "options": { "baseURL": "https://aishop24h.com/v1", "apiKey": "your_aishop24h_api_key" }, "models": { "anthropic/claude-opus-4.5-thinking": {}, "anthropic/claude-sonnet-4.5-thinking": {}, "anthropic/claude-sonnet-4.5": {} } } }}{ "$schema": "https://opencode.ai/config.json", "provider": { "aishop24h": { "npm": "@ai-sdk/anthropic", "name": "AI Shop 24h Provider", "options": { "baseURL": "https://aishop24h.com/v1", "apiKey": "your_aishop24h_api_key" }, "models": { "anthropic/claude-opus-4.5-thinking": {}, "anthropic/claude-sonnet-4.5-thinking": {}, "anthropic/claude-sonnet-4.5": {} } } }}Available Models
Section titled “Available Models”| Model | Model ID |
|---|---|
| Claude Opus 4.6 | anthropic/claude-opus-4.6 |
| Claude Opus 4.5 Thinking | anthropic/claude-opus-4.5-thinking |
| Claude Sonnet 4.6 | anthropic/claude-sonnet-4.6 |
| Claude Sonnet 4.5 | anthropic/claude-sonnet-4.5 |
| Claude Sonnet 4.5 Thinking | anthropic/claude-sonnet-4.5-thinking |
| Claude Haiku 4.5 | anthropic/claude-haiku-4.5 |
| Gemini 3 Flash Preview | google/gemini-3-flash-preview |
| Gemini 3 Pro Preview | google/gemini-3-pro-preview |
Start OpenCode in your project directory:
cd your-projectopencodeTroubleshooting
Section titled “Troubleshooting”Invalid API Key
Section titled “Invalid API Key”Problem: “API Key invalid or unauthorized” error
Solutions:
- Verify your API key is correct
- Check your account balance at AIShop24H Dashboard
Connection Failed
Section titled “Connection Failed”Problem: Unable to connect to API
Solutions:
- Confirm Base URL is exactly
https://aishop24h.com/v1 - Check your internet connection
- Test with curl:
Terminal window curl https://aishop24h.com/v1/models \-H "Authorization: Bearer YOUR_API_KEY"
Model Not Found
Section titled “Model Not Found”Problem: “Model not found” error
Solutions:
- Use the exact model ID format (e.g.,
anthropic/claude-sonnet-4.5) - Verify the model is available in your subscription
Config Not Loading
Section titled “Config Not Loading”Problem: Configuration changes don’t take effect
Solutions:
- Close OpenCode and restart
- Check JSON syntax is valid (use a JSON validator)
- Verify config file location:
- Global:
~/.config/opencode/opencode.json - Project:
opencode.jsonin project root
- Global:
Support
Section titled “Support”- Official Website: https://aishop24h.com
- API Documentation: https://docs.aishop24h.com
- OpenCode Documentation: https://opencode.ai/docs
- OpenCode Discord: https://opencode.ai/discord