diff --git a/README.ja-JP.md b/README.ja-JP.md index 963e08b..180c9ec 100644 --- a/README.ja-JP.md +++ b/README.ja-JP.md @@ -117,21 +117,27 @@ sudo cp dist/opencodereview /usr/local/bin/ocr # オプションA: 対話的な設定 ocr config set llm.url https://api.anthropic.com/v1/messages ocr config set llm.auth_token your-api-key-here -ocr config set llm.auth_header x-api-key ocr config set llm.model claude-opus-4-6 ocr config set llm.use_anthropic true # オプションB: 環境変数(最優先) export OCR_LLM_URL=https://api.anthropic.com/v1/messages export OCR_LLM_TOKEN=your-api-key-here -export OCR_LLM_AUTH_HEADER=x-api-key export OCR_LLM_MODEL=claude-opus-4-6 export OCR_USE_ANTHROPIC=true ``` 設定は`~/.opencodereview/config.json`に保存されます。 -Anthropicでは、標準の`sk-ant-*` APIキーは`x-api-key`を使用し、OAuthトークンは`authorization`を使用します。`llm.auth_header` / `OCR_LLM_AUTH_HEADER`を省略した場合、OCRは既存の`authorization` bearer-token動作を維持します。 +**`auth_header`(オプション):** Anthropic使用時にAPIキーを送信するHTTPヘッダーを制御します。省略時のデフォルトは`authorization`(Bearerトークン)です。標準の`sk-ant-*` APIキーを使用する場合は、`x-api-key`に設定する必要があります: + +```bash +ocr config set llm.auth_header x-api-key +# または +export OCR_LLM_AUTH_HEADER=x-api-key +``` + +サポートされる値:`x-api-key`、`authorization`(エイリアス:`bearer`)。それ以外の値はエラーになります。 また、Claude Codeの環境変数(`ANTHROPIC_BASE_URL`、`ANTHROPIC_AUTH_TOKEN`、`ANTHROPIC_MODEL`)とも互換性があり、`~/.zshrc` / `~/.bashrc`からこれらのexportをパースします。 diff --git a/README.ko-KR.md b/README.ko-KR.md index a38d413..9f45d36 100644 --- a/README.ko-KR.md +++ b/README.ko-KR.md @@ -117,21 +117,27 @@ sudo cp dist/opencodereview /usr/local/bin/ocr # Option A: 대화형 config ocr config set llm.url https://api.anthropic.com/v1/messages ocr config set llm.auth_token your-api-key-here -ocr config set llm.auth_header x-api-key ocr config set llm.model claude-opus-4-6 ocr config set llm.use_anthropic true # Option B: 환경 변수(가장 높은 우선순위) export OCR_LLM_URL=https://api.anthropic.com/v1/messages export OCR_LLM_TOKEN=your-api-key-here -export OCR_LLM_AUTH_HEADER=x-api-key export OCR_LLM_MODEL=claude-opus-4-6 export OCR_USE_ANTHROPIC=true ``` config는 `~/.opencodereview/config.json`에 저장됩니다. -Anthropic에서는 표준 `sk-ant-*` API key는 `x-api-key`를 사용하고, OAuth token은 `authorization`을 사용합니다. `llm.auth_header` / `OCR_LLM_AUTH_HEADER`를 생략하면 OCR은 기존 `authorization` bearer-token 동작을 유지합니다. +**`auth_header` (선택사항):** Anthropic 사용 시 API key를 전송할 HTTP header를 제어합니다. 생략하면 기본값은 `authorization` (Bearer token)입니다. 표준 `sk-ant-*` API key를 사용하는 경우 `x-api-key`로 설정해야 합니다: + +```bash +ocr config set llm.auth_header x-api-key +# 또는 +export OCR_LLM_AUTH_HEADER=x-api-key +``` + +지원되는 값: `x-api-key`, `authorization` (별칭: `bearer`). 그 외 값은 오류로 처리됩니다. Claude Code 환경 변수(`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_MODEL`)와도 호환되며, `~/.zshrc` / `~/.bashrc`의 export도 파싱합니다. diff --git a/README.md b/README.md index 9223656..5e54617 100644 --- a/README.md +++ b/README.md @@ -117,21 +117,27 @@ sudo cp dist/opencodereview /usr/local/bin/ocr # Option A: Interactive config ocr config set llm.url https://api.anthropic.com/v1/messages ocr config set llm.auth_token your-api-key-here -ocr config set llm.auth_header x-api-key ocr config set llm.model claude-opus-4-6 ocr config set llm.use_anthropic true # Option B: Environment variables (highest priority) export OCR_LLM_URL=https://api.anthropic.com/v1/messages export OCR_LLM_TOKEN=your-api-key-here -export OCR_LLM_AUTH_HEADER=x-api-key export OCR_LLM_MODEL=claude-opus-4-6 export OCR_USE_ANTHROPIC=true ``` Config is stored in `~/.opencodereview/config.json`. -For Anthropic, standard `sk-ant-*` API keys use `x-api-key`; OAuth tokens use `authorization`. If `llm.auth_header` / `OCR_LLM_AUTH_HEADER` is omitted, OCR keeps the existing `authorization` bearer-token behavior. +**`auth_header` (optional):** Controls which HTTP header carries the API key when using Anthropic. Defaults to `authorization` (Bearer token) if omitted. If you use a standard `sk-ant-*` API key, you must set it to `x-api-key`: + +```bash +ocr config set llm.auth_header x-api-key +# or +export OCR_LLM_AUTH_HEADER=x-api-key +``` + +Supported values: `x-api-key`, `authorization` (alias: `bearer`). Other values are rejected with an error. It is also compatible with Claude Code environment variables (`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_MODEL`) and parses `~/.zshrc` / `~/.bashrc` for those exports. diff --git a/README.zh-CN.md b/README.zh-CN.md index d4c448c..897ebf3 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -117,21 +117,27 @@ sudo cp dist/opencodereview /usr/local/bin/ocr # 方式 A:交互式配置 ocr config set llm.url https://api.anthropic.com/v1/messages ocr config set llm.auth_token your-api-key-here -ocr config set llm.auth_header x-api-key ocr config set llm.model claude-opus-4-6 ocr config set llm.use_anthropic true # 方式 B:环境变量(优先级最高) export OCR_LLM_URL=https://api.anthropic.com/v1/messages export OCR_LLM_TOKEN=your-api-key-here -export OCR_LLM_AUTH_HEADER=x-api-key export OCR_LLM_MODEL=claude-opus-4-6 export OCR_USE_ANTHROPIC=true ``` 配置存储于 `~/.opencodereview/config.json`。 -对于 Anthropic,标准 `sk-ant-*` API key 使用 `x-api-key`;OAuth token 使用 `authorization`。如果未配置 `llm.auth_header` / `OCR_LLM_AUTH_HEADER`,OCR 会保留现有的 `authorization` bearer-token 行为。 +**`auth_header`(可选):** 控制使用 Anthropic 时通过哪个 HTTP header 传递 API key。省略时默认为 `authorization`(Bearer token)。如果你使用标准 `sk-ant-*` API key,需要将其设为 `x-api-key`: + +```bash +ocr config set llm.auth_header x-api-key +# 或 +export OCR_LLM_AUTH_HEADER=x-api-key +``` + +支持的值:`x-api-key`、`authorization`(别名:`bearer`)。其他值会直接报错。 同时兼容了 Claude Code 环境变量(`ANTHROPIC_BASE_URL`、`ANTHROPIC_AUTH_TOKEN`、`ANTHROPIC_MODEL`),并解析 `~/.zshrc` / `~/.bashrc` 中的相关导出。