24 lines
679 B
Plaintext
24 lines
679 B
Plaintext
--- internal/config/config.go
|
|
+++ internal/config/config.go
|
|
@@ -177,6 +177,22 @@ func (c *ProviderConfig) SetupGitHubCopilot() {
|
|
maps.Copy(c.ExtraHeaders, copilot.Headers())
|
|
}
|
|
|
|
+func (c *ProviderConfig) SetupClaudeCode() {
|
|
+ c.FlatRate = true
|
|
+ c.SystemPromptPrefix = "You are Claude Code, Anthropic's official CLI for Claude."
|
|
+ if c.ExtraHeaders == nil {
|
|
+ c.ExtraHeaders = make(map[string]string)
|
|
+ }
|
|
+ c.ExtraHeaders["anthropic-version"] = "2023-06-01"
|
|
+ const want = "oauth-2025-04-20"
|
|
+ if v := c.ExtraHeaders["anthropic-beta"]; !strings.Contains(v, want) {
|
|
+ if v != "" {
|
|
+ v += ","
|
|
+ }
|
|
+ c.ExtraHeaders["anthropic-beta"] = v + want
|
|
+ }
|
|
+}
|
|
+
|
|
type MCPType string
|