feat: Claude Opus via cliproxy 프록시 설정 + base_url 지원

- ClaudeWriter에 base_url 파라미터 추가 (프록시 지원)
- engine.json: provider=claude, cliproxy.gru.farm 프록시 설정
- fallback_chain: claude → gemini → groq 순서

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
JOUNGWOOK KWON
2026-03-31 12:09:14 +09:00
parent 1bdd212639
commit 139d621fd8
2 changed files with 11 additions and 6 deletions

View File

@@ -66,13 +66,14 @@ BaseVideoGenerator = object
# ─── Writer 구현체 ──────────────────────────────────────
class ClaudeWriter(BaseWriter):
"""Anthropic Claude API를 사용하는 글쓰기 엔진"""
"""Anthropic Claude API를 사용하는 글쓰기 엔진 (프록시 base_url 지원)"""
def __init__(self, cfg: dict):
self.api_key = os.getenv(cfg.get('api_key_env', 'ANTHROPIC_API_KEY'), '')
self.model = cfg.get('model', 'claude-opus-4-5')
self.model = cfg.get('model', 'claude-sonnet-4-6')
self.max_tokens = cfg.get('max_tokens', 4096)
self.temperature = cfg.get('temperature', 0.7)
self.base_url = cfg.get('base_url', '') # 프록시 URL (옵션)
def write(self, prompt: str, system: str = '') -> str:
if not self.api_key:
@@ -80,7 +81,10 @@ class ClaudeWriter(BaseWriter):
return ''
try:
import anthropic
client = anthropic.Anthropic(api_key=self.api_key)
client_kwargs = {'api_key': self.api_key}
if self.base_url:
client_kwargs['base_url'] = self.base_url
client = anthropic.Anthropic(**client_kwargs)
kwargs: dict = {
'model': self.model,
'max_tokens': self.max_tokens,

View File

@@ -2,8 +2,8 @@
"_comment": "The 4th Path 블로그 자동 수익 엔진 — 엔진 설정 (v3)",
"_updated": "2026-03-29",
"writing": {
"provider": "gemini",
"fallback_chain": ["groq"],
"provider": "claude",
"fallback_chain": ["gemini", "groq"],
"_comment_provider": "openclaw=ChatGPT Pro(OAuth), claude_web=Claude Max(웹쿠키), gemini_web=Gemini Pro(웹쿠키), claude=Anthropic API키, gemini=Google AI API키, groq=Groq API키",
"options": {
"openclaw": {
@@ -20,7 +20,8 @@
"psidts_env": "GEMINI_WEB_1PSIDTS"
},
"claude": {
"api_key_env": "ANTHROPIC_API_KEY",
"api_key_env": "CLIPROXY_API_KEY",
"base_url": "https://cliproxy.gru.farm",
"model": "claude-opus-4-6",
"max_tokens": 4096,
"temperature": 0.7