chore: add default headers

Kujtim Hoxha created

Change summary

cmd/openrouter/main.go                     |   4 
internal/providers/configs/openrouter.json | 200 +++++++++--------------
pkg/catwalk/provider.go                    |   1 
3 files changed, 81 insertions(+), 124 deletions(-)

Detailed changes

cmd/openrouter/main.go 🔗

@@ -247,6 +247,10 @@ func main() {
 		DefaultLargeModelID: "anthropic/claude-sonnet-4",
 		DefaultSmallModelID: "anthropic/claude-3.5-haiku",
 		Models:              []catwalk.Model{},
+		DefaultHeaders: map[string]string{
+			"HTTP-Referer": "https://charm.land",
+			"X-Title":      "Crush",
+		},
 	}
 
 	for _, model := range modelsResp.Data {

internal/providers/configs/openrouter.json 🔗

@@ -7,6 +7,45 @@
   "default_large_model_id": "anthropic/claude-sonnet-4",
   "default_small_model_id": "anthropic/claude-3.5-haiku",
   "models": [
+    {
+      "id": "z-ai/glm-4.5",
+      "name": "Z.AI: GLM 4.5",
+      "cost_per_1m_in": 0.6,
+      "cost_per_1m_out": 2.2,
+      "cost_per_1m_in_cached": 0,
+      "cost_per_1m_out_cached": 0.11,
+      "context_window": 128000,
+      "default_max_tokens": 48000,
+      "can_reason": true,
+      "has_reasoning_efforts": false,
+      "supports_attachments": false
+    },
+    {
+      "id": "z-ai/glm-4.5-air",
+      "name": "Z.AI: GLM 4.5 Air",
+      "cost_per_1m_in": 0.19999999999999998,
+      "cost_per_1m_out": 1.1,
+      "cost_per_1m_in_cached": 0,
+      "cost_per_1m_out_cached": 0.03,
+      "context_window": 128000,
+      "default_max_tokens": 48000,
+      "can_reason": true,
+      "has_reasoning_efforts": false,
+      "supports_attachments": false
+    },
+    {
+      "id": "z-ai/glm-4-32b",
+      "name": "Z.AI: GLM 4 32B ",
+      "cost_per_1m_in": 0.09999999999999999,
+      "cost_per_1m_out": 0.09999999999999999,
+      "cost_per_1m_in_cached": 0,
+      "cost_per_1m_out_cached": 0,
+      "context_window": 128000,
+      "default_max_tokens": 12800,
+      "can_reason": false,
+      "has_reasoning_efforts": false,
+      "supports_attachments": false
+    },
     {
       "id": "qwen/qwen3-coder:free",
       "name": "Qwen: Qwen3 Coder  (free)",
@@ -47,10 +86,10 @@
       "supports_attachments": true
     },
     {
-      "id": "qwen/qwen3-235b-a22b-07-25",
-      "name": "Qwen: Qwen3 235B A22B 2507",
+      "id": "qwen/qwen3-235b-a22b-2507",
+      "name": "Qwen: Qwen3 235B A22B Instruct 2507",
       "cost_per_1m_in": 0.15,
-      "cost_per_1m_out": 0.7999999999999999,
+      "cost_per_1m_out": 0.85,
       "cost_per_1m_in_cached": 0,
       "cost_per_1m_out_cached": 0,
       "context_window": 262144,
@@ -59,19 +98,6 @@
       "has_reasoning_efforts": false,
       "supports_attachments": false
     },
-    {
-      "id": "moonshotai/kimi-k2:free",
-      "name": "MoonshotAI: Kimi K2 (free)",
-      "cost_per_1m_in": 0,
-      "cost_per_1m_out": 0,
-      "cost_per_1m_in_cached": 0,
-      "cost_per_1m_out_cached": 0,
-      "context_window": 65536,
-      "default_max_tokens": 6553,
-      "can_reason": false,
-      "has_reasoning_efforts": false,
-      "supports_attachments": false
-    },
     {
       "id": "moonshotai/kimi-k2",
       "name": "MoonshotAI: Kimi K2",
@@ -137,19 +163,6 @@
       "has_reasoning_efforts": false,
       "supports_attachments": true
     },
-    {
-      "id": "minimax/minimax-m1",
-      "name": "MiniMax: MiniMax M1",
-      "cost_per_1m_in": 0.55,
-      "cost_per_1m_out": 2.2,
-      "cost_per_1m_in_cached": 0,
-      "cost_per_1m_out_cached": 0,
-      "context_window": 1000000,
-      "default_max_tokens": 20000,
-      "can_reason": true,
-      "has_reasoning_efforts": false,
-      "supports_attachments": false
-    },
     {
       "id": "google/gemini-2.5-flash-lite-preview-06-17",
       "name": "Google: Gemini 2.5 Flash Lite Preview 06-17",
@@ -218,10 +231,10 @@
     {
       "id": "x-ai/grok-3",
       "name": "xAI: Grok 3",
-      "cost_per_1m_in": 3,
-      "cost_per_1m_out": 15,
+      "cost_per_1m_in": 5,
+      "cost_per_1m_out": 25,
       "cost_per_1m_in_cached": 0,
-      "cost_per_1m_out_cached": 0.75,
+      "cost_per_1m_out_cached": 1.25,
       "context_window": 131072,
       "default_max_tokens": 13107,
       "can_reason": false,
@@ -283,12 +296,12 @@
     {
       "id": "deepseek/deepseek-r1-0528",
       "name": "DeepSeek: R1 0528",
-      "cost_per_1m_in": 0.7,
-      "cost_per_1m_out": 2.5,
+      "cost_per_1m_in": 2.5500000000000003,
+      "cost_per_1m_out": 5.95,
       "cost_per_1m_in_cached": 0,
       "cost_per_1m_out_cached": 0,
       "context_window": 163840,
-      "default_max_tokens": 81920,
+      "default_max_tokens": 65536,
       "can_reason": true,
       "has_reasoning_efforts": false,
       "supports_attachments": false
@@ -384,19 +397,6 @@
       "has_reasoning_efforts": false,
       "supports_attachments": true
     },
-    {
-      "id": "arcee-ai/caller-large",
-      "name": "Arcee AI: Caller Large",
-      "cost_per_1m_in": 0.55,
-      "cost_per_1m_out": 0.85,
-      "cost_per_1m_in_cached": 0,
-      "cost_per_1m_out_cached": 0,
-      "context_window": 32768,
-      "default_max_tokens": 3276,
-      "can_reason": false,
-      "has_reasoning_efforts": false,
-      "supports_attachments": false
-    },
     {
       "id": "arcee-ai/virtuoso-large",
       "name": "Arcee AI: Virtuoso Large",
@@ -410,19 +410,6 @@
       "has_reasoning_efforts": false,
       "supports_attachments": false
     },
-    {
-      "id": "arcee-ai/virtuoso-medium-v2",
-      "name": "Arcee AI: Virtuoso Medium V2",
-      "cost_per_1m_in": 0.5,
-      "cost_per_1m_out": 0.7999999999999999,
-      "cost_per_1m_in_cached": 0,
-      "cost_per_1m_out_cached": 0,
-      "context_window": 131072,
-      "default_max_tokens": 16384,
-      "can_reason": false,
-      "has_reasoning_efforts": false,
-      "supports_attachments": false
-    },
     {
       "id": "qwen/qwen3-4b:free",
       "name": "Qwen: Qwen3 4B (free)",
@@ -439,12 +426,12 @@
     {
       "id": "qwen/qwen3-30b-a3b",
       "name": "Qwen: Qwen3 30B A3B",
-      "cost_per_1m_in": 0.15,
-      "cost_per_1m_out": 0.6,
+      "cost_per_1m_in": 0.08,
+      "cost_per_1m_out": 0.29,
       "cost_per_1m_in_cached": 0,
       "cost_per_1m_out_cached": 0,
-      "context_window": 131072,
-      "default_max_tokens": 13107,
+      "context_window": 40960,
+      "default_max_tokens": 20480,
       "can_reason": true,
       "has_reasoning_efforts": false,
       "supports_attachments": false
@@ -491,12 +478,12 @@
     {
       "id": "qwen/qwen3-235b-a22b",
       "name": "Qwen: Qwen3 235B A22B",
-      "cost_per_1m_in": 0.13,
-      "cost_per_1m_out": 0.6,
+      "cost_per_1m_in": 0.22,
+      "cost_per_1m_out": 0.88,
       "cost_per_1m_in_cached": 0,
       "cost_per_1m_out_cached": 0,
-      "context_window": 40960,
-      "default_max_tokens": 20480,
+      "context_window": 131072,
+      "default_max_tokens": 13107,
       "can_reason": true,
       "has_reasoning_efforts": false,
       "supports_attachments": false
@@ -608,8 +595,8 @@
     {
       "id": "meta-llama/llama-4-maverick",
       "name": "Meta: Llama 4 Maverick",
-      "cost_per_1m_in": 0.15,
-      "cost_per_1m_out": 0.85,
+      "cost_per_1m_in": 0.18,
+      "cost_per_1m_out": 0.6,
       "cost_per_1m_in_cached": 0,
       "cost_per_1m_out_cached": 0,
       "context_window": 1048576,
@@ -621,12 +608,12 @@
     {
       "id": "meta-llama/llama-4-scout",
       "name": "Meta: Llama 4 Scout",
-      "cost_per_1m_in": 0.08,
-      "cost_per_1m_out": 0.3,
+      "cost_per_1m_in": 0.15,
+      "cost_per_1m_out": 0.6,
       "cost_per_1m_in_cached": 0,
       "cost_per_1m_out_cached": 0,
       "context_window": 1048576,
-      "default_max_tokens": 524288,
+      "default_max_tokens": 104857,
       "can_reason": false,
       "has_reasoning_efforts": false,
       "supports_attachments": true
@@ -644,28 +631,15 @@
       "has_reasoning_efforts": false,
       "supports_attachments": true
     },
-    {
-      "id": "deepseek/deepseek-chat-v3-0324:free",
-      "name": "DeepSeek: DeepSeek V3 0324 (free)",
-      "cost_per_1m_in": 0,
-      "cost_per_1m_out": 0,
-      "cost_per_1m_in_cached": 0,
-      "cost_per_1m_out_cached": 0,
-      "context_window": 163840,
-      "default_max_tokens": 16384,
-      "can_reason": false,
-      "has_reasoning_efforts": false,
-      "supports_attachments": false
-    },
     {
       "id": "deepseek/deepseek-chat-v3-0324",
       "name": "DeepSeek: DeepSeek V3 0324",
-      "cost_per_1m_in": 0.77,
-      "cost_per_1m_out": 0.77,
+      "cost_per_1m_in": 0.28,
+      "cost_per_1m_out": 1.1400000000000001,
       "cost_per_1m_in_cached": 0,
       "cost_per_1m_out_cached": 0,
       "context_window": 163840,
-      "default_max_tokens": 65536,
+      "default_max_tokens": 81920,
       "can_reason": false,
       "has_reasoning_efforts": false,
       "supports_attachments": false
@@ -677,21 +651,8 @@
       "cost_per_1m_out": 0,
       "cost_per_1m_in_cached": 0,
       "cost_per_1m_out_cached": 0,
-      "context_window": 96000,
-      "default_max_tokens": 48000,
-      "can_reason": false,
-      "has_reasoning_efforts": false,
-      "supports_attachments": true
-    },
-    {
-      "id": "mistralai/mistral-small-3.1-24b-instruct",
-      "name": "Mistral: Mistral Small 3.1 24B",
-      "cost_per_1m_in": 0.09999999999999999,
-      "cost_per_1m_out": 0.3,
-      "cost_per_1m_in_cached": 0,
-      "cost_per_1m_out_cached": 0,
-      "context_window": 131072,
-      "default_max_tokens": 13107,
+      "context_window": 128000,
+      "default_max_tokens": 12800,
       "can_reason": false,
       "has_reasoning_efforts": false,
       "supports_attachments": true
@@ -972,12 +933,12 @@
     {
       "id": "meta-llama/llama-3.3-70b-instruct",
       "name": "Meta: Llama 3.3 70B Instruct",
-      "cost_per_1m_in": 0.039,
-      "cost_per_1m_out": 0.12,
+      "cost_per_1m_in": 0.13,
+      "cost_per_1m_out": 0.39,
       "cost_per_1m_in_cached": 0,
       "cost_per_1m_out_cached": 0,
       "context_window": 131072,
-      "default_max_tokens": 4096,
+      "default_max_tokens": 60000,
       "can_reason": false,
       "has_reasoning_efforts": false,
       "supports_attachments": false
@@ -1073,19 +1034,6 @@
       "has_reasoning_efforts": false,
       "supports_attachments": true
     },
-    {
-      "id": "thedrummer/unslopnemo-12b",
-      "name": "TheDrummer: UnslopNemo 12B",
-      "cost_per_1m_in": 0.39999999999999997,
-      "cost_per_1m_out": 0.39999999999999997,
-      "cost_per_1m_in_cached": 0,
-      "cost_per_1m_out_cached": 0,
-      "context_window": 32000,
-      "default_max_tokens": 16000,
-      "can_reason": false,
-      "has_reasoning_efforts": false,
-      "supports_attachments": false
-    },
     {
       "id": "anthropic/claude-3.5-haiku:beta",
       "name": "Anthropic: Claude 3.5 Haiku (self-moderated)",
@@ -1156,8 +1104,8 @@
       "name": "Anthropic: Claude 3.5 Sonnet",
       "cost_per_1m_in": 3,
       "cost_per_1m_out": 15,
-      "cost_per_1m_in_cached": 3.75,
-      "cost_per_1m_out_cached": 0.3,
+      "cost_per_1m_in_cached": 0,
+      "cost_per_1m_out_cached": 0,
       "context_window": 200000,
       "default_max_tokens": 4096,
       "can_reason": false,
@@ -1866,5 +1814,9 @@
       "has_reasoning_efforts": false,
       "supports_attachments": false
     }
-  ]
+  ],
+  "default_headers": {
+    "HTTP-Referer": "https://charm.land",
+    "X-Title": "Crush"
+  }
 }

pkg/catwalk/provider.go 🔗

@@ -39,6 +39,7 @@ type Provider struct {
 	DefaultLargeModelID string            `json:"default_large_model_id,omitempty"`
 	DefaultSmallModelID string            `json:"default_small_model_id,omitempty"`
 	Models              []Model           `json:"models,omitempty"`
+	DefaultHeaders      map[string]string `json:"default_headers,omitempty"`
 }
 
 // Model represents an AI model configuration.