오픈코드

OpenCode는 Anthropic 네이티브 형식을 지원하며, baseURL 오버라이드로 구독핀 엔드포인트를 가장 쉽게 연결할 수 있습니다.

방법 1 · 인터랙티브 (/connect)

terminal
bash
1opencode2 3"docs-token-comment"># 터미널에서 입력4/connect

실행 후 아래 순서대로 입력합니다.

  1. Provider 선택 → Anthropic 또는 Other / Custom Provider
  2. Base URL → https://api-anthropic.com/v1
  3. API Key → 발급받은 키 전체 붙여넣기
  4. 모델 선택 → claude-opus-4-8 · claude-sonnet-4-6 · claude-haiku-4-5-20251001 · claude-opus-4-7

방법 2 · config.json 직접 편집

terminal
bash
1code ~/.opencode/opencode.json   "docs-token-comment"># 또는 프로젝트 루트에 opencode.json 생성

아래 내용을 그대로 붙여넣고 키만 본인 값으로 바꿉니다.

~/.opencode/opencode.json
json5
1{2  "$schema": "https://opencode.ai/config.json",3  "provider": {4    "anthropic": {5      "options": {6        "baseURL": "https://api-anthropic.com/v1",7        "apiKey": "여기에_발급받은_API키를_넣어주세요"8      },9      "models": {10        "claude-opus-4-8": { "name": "Claude Opus 4.8 (최신 플래그십)" },11        "claude-sonnet-4-6": { "name": "Claude Sonnet 4.6 (추천)" },12        "claude-haiku-4-5-20251001": { "name": "Claude Haiku 4.5 (빠르고 저비용)" },13        "claude-opus-4-7": { "name": "Claude Opus 4.7 (고성능)" }14      }15    }16  },17  "defaultModel": "claude-sonnet-4-6",18  "instructions": [19    "항상 비용 효율적으로 생각하고, Haiku는 가벼운 작업에, Sonnet은 중요한 작업에 사용해"20  ]21}

적용 및 확인

terminal
bash
1opencode restart2opencode models      "docs-token-comment"># 등록된 모델 확인3opencode config      "docs-token-comment"># 현재 설정 확인4opencode auth list   "docs-token-comment"># API Key 확인

테스트:

terminal
bash
1opencode "내 프로젝트 구조 분석하고, main.py에 Claude를 사용한 간단한 AI 에이전트 코드 작성해줘"

한 번에 끝내기

인터랙티브 없이 한 번에 적용하려면:

terminal
bash
1cat > ~/.opencode/opencode.json << EOF2{3  "$schema": "https://opencode.ai/config.json",4  "provider": {5    "anthropic": {6      "options": {7        "baseURL": "https://api-anthropic.com/v1",8        "apiKey": "여기에_발급받은_API키를_넣어주세요"9      }10    }11  }12}13EOF14 15opencode restart && opencode models
이 문서가 도움이 되었나요?