Skip to content

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.

  • macOS, Linux, or Windows
  • A modern terminal emulator (WezTerm, Alacritty, Ghostty, or Kitty)
  • OpenCode installed (Installation guide)
  • AIShop24H API key (Get one here)

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": {}
}
}
}
}
ModelModel ID
Claude Opus 4.6anthropic/claude-opus-4.6
Claude Opus 4.5 Thinkinganthropic/claude-opus-4.5-thinking
Claude Sonnet 4.6anthropic/claude-sonnet-4.6
Claude Sonnet 4.5anthropic/claude-sonnet-4.5
Claude Sonnet 4.5 Thinkinganthropic/claude-sonnet-4.5-thinking
Claude Haiku 4.5anthropic/claude-haiku-4.5
Gemini 3 Flash Previewgoogle/gemini-3-flash-preview
Gemini 3 Pro Previewgoogle/gemini-3-pro-preview

Start OpenCode in your project directory:

Terminal window
cd your-project
opencode

Problem: “API Key invalid or unauthorized” error

Solutions:

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"

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

Problem: Configuration changes don’t take effect

Solutions:

  1. Close OpenCode and restart
  2. Check JSON syntax is valid (use a JSON validator)
  3. Verify config file location:
    • Global: ~/.config/opencode/opencode.json
    • Project: opencode.json in project root