github / github/copilot-cli

Allow custom headers for BYOK

オープン
#3,399 コメント 3 件 リアクション 14 件 担当者 1 名 @stephentoub が担当を希望しています GitHub で見る
area:configuration area:models
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### Describe the feature or problem you'd like to solve

Some LLM servers require specific headers to be sent, allow to set custom http(s) headers
Examples could be:

- X-Tenant-ID / X-Organization-ID: Identifies which company or sub-organization is making the request to ensure their specific data boundaries and rate limits are respected.
- X-User-ID: Tracks usage down to the individual employee or end-user, often used to prevent a single user from exhausting the company's API quota.
- X-Fallback-Models: Instructs the gateway on what to do if the primary model is down
- X-Cache-Bypass: Forces the server to ignore the cache and generate a fresh response from the LLM. Useful for testing or if the LLM is expected to return real-time data.
- anthropic-beta: Anthropic frequently uses this to enable experimental features

### Proposed solution

Add COPILOT_EXTRA_HEADERS (or COPILOT_CUSTOM_HEADERS) to set one ore multiple headers in the format "Name: Value" (newline for multiple headers)

Filter out headers `Authorization `or `x-api-key` (or do not allow them)

### Example prompts or workflows

export COPILOT_EXTRA_HEADERS="X-Tenant-ID: 1234\nX-Proxy-Bypass: true"

### Additional context

_No response_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。