Skip to content

Instantly share code, notes, and snippets.

@steebchen
Last active January 25, 2026 17:28
Show Gist options
  • Select an option

  • Save steebchen/34caba633d6d903959da38add1b6a4d7 to your computer and use it in GitHub Desktop.

Select an option

Save steebchen/34caba633d6d903959da38add1b6a4d7 to your computer and use it in GitHub Desktop.
GPT-4o with OpenCode via LLM Gateway

GPT-4o with OpenCode via LLM Gateway

Model Overview

  • Model ID: gpt-4o
  • Provider: OpenAI
  • Strengths: General-purpose coding, broad knowledge base
  • Context: 128K tokens

Configuration

Add to ~/.config/opencode/config.json:

{
  "provider": "openai-compatible",
  "apiKey": "your-llmgateway-api-key",
  "baseUrl": "https://api.llmgateway.io/v1",
  "model": "gpt-4o"
}

Or via environment:

export OPENCODE_PROVIDER="openai-compatible"
export OPENCODE_API_KEY="your-llmgateway-api-key"
export OPENCODE_BASE_URL="https://api.llmgateway.io/v1"
export OPENCODE_MODEL="gpt-4o"

Usage

opencode --model gpt-4o "convert this Python to TypeScript"

Best Use Cases

  • General coding tasks
  • Cross-language development
  • API integrations
  • Code translation between languages
  • Broad technical questions

Pricing Tier

Mid-tier - good all-around choice for varied tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment