amalgm 0.0.0 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +41 -1
  2. package/bin/amalgm.js +8 -2
  3. package/lib/auth-store.js +223 -0
  4. package/lib/cli.js +1132 -0
  5. package/lib/paths.js +30 -0
  6. package/lib/supervisor.js +476 -0
  7. package/lib/tunnel-chat.js +328 -0
  8. package/lib/tunnel-events.js +499 -0
  9. package/package.json +30 -3
  10. package/runtime/README.md +4 -0
  11. package/runtime/lib/chatInput.js +315 -0
  12. package/runtime/lib/harnesses.js +988 -0
  13. package/runtime/lib/local/amalgmStore.js +136 -0
  14. package/runtime/lib/local/credentialResolver.js +425 -0
  15. package/runtime/lib/mcpApps/registry.js +619 -0
  16. package/runtime/package.json +5 -0
  17. package/runtime/scripts/amalgm-mcp/agents/rest.js +144 -0
  18. package/runtime/scripts/amalgm-mcp/agents/store.js +684 -0
  19. package/runtime/scripts/amalgm-mcp/agents/talk.js +1162 -0
  20. package/runtime/scripts/amalgm-mcp/agents/tools.js +221 -0
  21. package/runtime/scripts/amalgm-mcp/artifacts/advertise.js +132 -0
  22. package/runtime/scripts/amalgm-mcp/artifacts/rest.js +103 -0
  23. package/runtime/scripts/amalgm-mcp/artifacts/store.js +157 -0
  24. package/runtime/scripts/amalgm-mcp/artifacts/supervisor.js +402 -0
  25. package/runtime/scripts/amalgm-mcp/artifacts/tools.js +176 -0
  26. package/runtime/scripts/amalgm-mcp/browser/page.js +637 -0
  27. package/runtime/scripts/amalgm-mcp/browser/tools.js +688 -0
  28. package/runtime/scripts/amalgm-mcp/config.js +140 -0
  29. package/runtime/scripts/amalgm-mcp/credentials/rest.js +45 -0
  30. package/runtime/scripts/amalgm-mcp/deps.js +40 -0
  31. package/runtime/scripts/amalgm-mcp/email/inbound.js +215 -0
  32. package/runtime/scripts/amalgm-mcp/events/executor.js +179 -0
  33. package/runtime/scripts/amalgm-mcp/events/ingress.js +113 -0
  34. package/runtime/scripts/amalgm-mcp/events/matcher.js +125 -0
  35. package/runtime/scripts/amalgm-mcp/events/rest.js +200 -0
  36. package/runtime/scripts/amalgm-mcp/events/ring-buffer.js +19 -0
  37. package/runtime/scripts/amalgm-mcp/events/store.js +113 -0
  38. package/runtime/scripts/amalgm-mcp/events/tools.js +306 -0
  39. package/runtime/scripts/amalgm-mcp/events/webhook-url.js +28 -0
  40. package/runtime/scripts/amalgm-mcp/fs/rest.js +293 -0
  41. package/runtime/scripts/amalgm-mcp/index.js +100 -0
  42. package/runtime/scripts/amalgm-mcp/lib/chat-runner.js +167 -0
  43. package/runtime/scripts/amalgm-mcp/lib/email-md.js +288 -0
  44. package/runtime/scripts/amalgm-mcp/lib/mcp-resolver.js +63 -0
  45. package/runtime/scripts/amalgm-mcp/lib/prefs.js +441 -0
  46. package/runtime/scripts/amalgm-mcp/lib/storage.js +92 -0
  47. package/runtime/scripts/amalgm-mcp/lib/supabase.js +118 -0
  48. package/runtime/scripts/amalgm-mcp/lib/tool-result.js +177 -0
  49. package/runtime/scripts/amalgm-mcp/local/rest.js +87 -0
  50. package/runtime/scripts/amalgm-mcp/mcp-connections/rest.js +234 -0
  51. package/runtime/scripts/amalgm-mcp/notify/index.js +107 -0
  52. package/runtime/scripts/amalgm-mcp/server/core-tools.js +20 -0
  53. package/runtime/scripts/amalgm-mcp/server/http.js +377 -0
  54. package/runtime/scripts/amalgm-mcp/server/mcp.js +127 -0
  55. package/runtime/scripts/amalgm-mcp/slack/inbound.js +200 -0
  56. package/runtime/scripts/amalgm-mcp/state/db.js +194 -0
  57. package/runtime/scripts/amalgm-mcp/state/events.js +113 -0
  58. package/runtime/scripts/amalgm-mcp/state/rest.js +64 -0
  59. package/runtime/scripts/amalgm-mcp/state/snapshot.js +76 -0
  60. package/runtime/scripts/amalgm-mcp/tasks/executor.js +225 -0
  61. package/runtime/scripts/amalgm-mcp/tasks/rest.js +110 -0
  62. package/runtime/scripts/amalgm-mcp/tasks/schedule-normalization.js +85 -0
  63. package/runtime/scripts/amalgm-mcp/tasks/scheduler.js +105 -0
  64. package/runtime/scripts/amalgm-mcp/tasks/store.js +154 -0
  65. package/runtime/scripts/amalgm-mcp/tasks/tools.js +391 -0
  66. package/runtime/scripts/amalgm-mcp/toolbox/rest.js +75 -0
  67. package/runtime/scripts/amalgm-mcp/toolbox/runner.js +257 -0
  68. package/runtime/scripts/amalgm-mcp/toolbox/store.js +933 -0
  69. package/runtime/scripts/amalgm-mcp/toolbox/tools.js +269 -0
  70. package/runtime/scripts/amalgm-mcp/user-api-keys/rest.js +105 -0
  71. package/runtime/scripts/amalgm-mcp/workspace/rest.js +497 -0
  72. package/runtime/scripts/chat-core/adapters/claude.js +165 -0
  73. package/runtime/scripts/chat-core/adapters/codex.js +313 -0
  74. package/runtime/scripts/chat-core/adapters/opencode.js +412 -0
  75. package/runtime/scripts/chat-core/auth.js +177 -0
  76. package/runtime/scripts/chat-core/contract.js +328 -0
  77. package/runtime/scripts/chat-core/credentials/store.js +212 -0
  78. package/runtime/scripts/chat-core/egress.js +87 -0
  79. package/runtime/scripts/chat-core/engine.js +253 -0
  80. package/runtime/scripts/chat-core/event-schema.js +231 -0
  81. package/runtime/scripts/chat-core/events.js +190 -0
  82. package/runtime/scripts/chat-core/index.js +11 -0
  83. package/runtime/scripts/chat-core/input.js +50 -0
  84. package/runtime/scripts/chat-core/normalizers/claude.js +450 -0
  85. package/runtime/scripts/chat-core/normalizers/codex.js +380 -0
  86. package/runtime/scripts/chat-core/normalizers/normalizer_spec.md +259 -0
  87. package/runtime/scripts/chat-core/normalizers/opencode.js +552 -0
  88. package/runtime/scripts/chat-core/normalizers/tool_contract.md +123 -0
  89. package/runtime/scripts/chat-core/normalizers/usage_contract.md +304 -0
  90. package/runtime/scripts/chat-core/parts.js +253 -0
  91. package/runtime/scripts/chat-core/recorder.js +65 -0
  92. package/runtime/scripts/chat-core/runtime.js +86 -0
  93. package/runtime/scripts/chat-core/server.js +163 -0
  94. package/runtime/scripts/chat-core/sse.js +196 -0
  95. package/runtime/scripts/chat-core/stores.js +100 -0
  96. package/runtime/scripts/chat-core/tool-display.js +149 -0
  97. package/runtime/scripts/chat-core/tool-shape.js +143 -0
  98. package/runtime/scripts/chat-core/tooling/mcp-bundle.js +161 -0
  99. package/runtime/scripts/chat-core/tooling/mcp-relay.js +97 -0
  100. package/runtime/scripts/chat-core/tooling/native-binaries.js +608 -0
  101. package/runtime/scripts/chat-core/tooling/system-prompt.js +20 -0
  102. package/runtime/scripts/chat-core/usage.js +343 -0
  103. package/runtime/scripts/chat-server/config.js +110 -0
  104. package/runtime/scripts/chat-server/db.js +529 -0
  105. package/runtime/scripts/chat-server/index.js +33 -0
  106. package/runtime/scripts/chat-server/model-catalog.js +327 -0
  107. package/runtime/scripts/chat-server.js +75 -0
  108. package/runtime/scripts/credential-adapter.js +131 -0
  109. package/runtime/scripts/fs-watcher.js +888 -0
  110. package/runtime/scripts/local-gateway.js +854 -0
  111. package/runtime/scripts/platform-context.txt +246 -0
  112. package/runtime/scripts/port-monitor.js +175 -0
  113. package/runtime/scripts/proxy-token-store.js +162 -0
  114. package/runtime/scripts/runtime-auth.js +163 -0
  115. package/runtime/scripts/test-claude-code-models.js +87 -0
  116. package/runtime/tsconfig.json +15 -0
@@ -0,0 +1,327 @@
1
+ /**
2
+ * Model Catalog — Complete pricing & specs for all Vercel AI Gateway language models.
3
+ * Auto-generated from https://ai-gateway.vercel.sh/v1/models on 2026-05-07.
4
+ * 197 language models across 23 providers (Opus 1M variants split out).
5
+ *
6
+ * Pricing is per 1M tokens (USD). null = not available/applicable.
7
+ */
8
+
9
+ 'use strict';
10
+
11
+ const MODEL_CATALOG = [
12
+ // ── alibaba (22) ───────────────────────────────────────────
13
+ { id: "alibaba/qwen-3-14b", name: "Qwen3-14B", provider: "alibaba", contextWindow: 40960, maxOutput: 16384, inputPrice: 0.12, outputPrice: 0.24, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-04-01" },
14
+ { id: "alibaba/qwen-3-235b", name: "Qwen3 235B A22b Instruct 2507", provider: "alibaba", contextWindow: 131000, maxOutput: 40000, inputPrice: 0.6, outputPrice: 1.2, cacheRead: 0.6, cacheWrite: null, tags: ["tool-use", "implicit-caching"], released: "2025-04-01" },
15
+ { id: "alibaba/qwen-3-30b", name: "Qwen3-30B-A3B", provider: "alibaba", contextWindow: 40960, maxOutput: 16384, inputPrice: 0.08, outputPrice: 0.29, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-04-01" },
16
+ { id: "alibaba/qwen-3-32b", name: "Qwen 3 32B", provider: "alibaba", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.16, outputPrice: 0.64, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-04-01" },
17
+ { id: "alibaba/qwen-3.6-max-preview", name: "Qwen 3.6 Max Preview", provider: "alibaba", contextWindow: 240000, maxOutput: 64000, inputPrice: 1.3, outputPrice: 7.8, cacheRead: 0.26, cacheWrite: 1.625, tags: ["reasoning", "tool-use", "implicit-caching", "file-input", "vision"], released: "2026-04-20" },
18
+ { id: "alibaba/qwen3-235b-a22b-thinking", name: "Qwen3 VL 235B A22B Thinking", provider: "alibaba", contextWindow: 131072, maxOutput: 32768, inputPrice: 0.4, outputPrice: 4, cacheRead: null, cacheWrite: null, tags: ["vision", "reasoning", "tool-use", "file-input"], released: "2025-09-24" },
19
+ { id: "alibaba/qwen3-coder", name: "Qwen3 Coder 480B A35B Instruct", provider: "alibaba", contextWindow: 262144, maxOutput: 65536, inputPrice: 1.5, outputPrice: 7.5, cacheRead: 0.3, cacheWrite: null, tags: ["tool-use"], released: "2025-04-01" },
20
+ { id: "alibaba/qwen3-coder-30b-a3b", name: "Qwen 3 Coder 30B A3B Instruct", provider: "alibaba", contextWindow: 262144, maxOutput: 8192, inputPrice: 0.15, outputPrice: 0.6, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-04-01" },
21
+ { id: "alibaba/qwen3-coder-next", name: "Qwen3 Coder Next", provider: "alibaba", contextWindow: 256000, maxOutput: 256000, inputPrice: 0.5, outputPrice: 1.2, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-07-22" },
22
+ { id: "alibaba/qwen3-coder-plus", name: "Qwen3 Coder Plus", provider: "alibaba", contextWindow: 1000000, maxOutput: 65536, inputPrice: 1, outputPrice: 5, cacheRead: 0.2, cacheWrite: null, tags: ["tool-use"], released: "2025-07-23" },
23
+ { id: "alibaba/qwen3-max", name: "Qwen3 Max", provider: "alibaba", contextWindow: 262144, maxOutput: 32768, inputPrice: 1.2, outputPrice: 6, cacheRead: 0.24, cacheWrite: null, tags: ["tool-use", "implicit-caching"], released: "2025-09-23" },
24
+ { id: "alibaba/qwen3-max-preview", name: "Qwen3 Max Preview", provider: "alibaba", contextWindow: 262144, maxOutput: 32768, inputPrice: 1.2, outputPrice: 6, cacheRead: 0.24, cacheWrite: null, tags: ["tool-use", "implicit-caching"], released: "2025-09-23" },
25
+ { id: "alibaba/qwen3-max-thinking", name: "Qwen 3 Max Thinking", provider: "alibaba", contextWindow: 256000, maxOutput: 65536, inputPrice: 1.2, outputPrice: 6, cacheRead: 0.24, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: null },
26
+ { id: "alibaba/qwen3-next-80b-a3b-instruct", name: "Qwen3 Next 80B A3B Instruct", provider: "alibaba", contextWindow: 131072, maxOutput: 32768, inputPrice: 0.15, outputPrice: 1.2, cacheRead: null, cacheWrite: null, tags: [], released: "2025-09-12" },
27
+ { id: "alibaba/qwen3-next-80b-a3b-thinking", name: "Qwen3 Next 80B A3B Thinking", provider: "alibaba", contextWindow: 131072, maxOutput: 32768, inputPrice: 0.15, outputPrice: 1.2, cacheRead: null, cacheWrite: null, tags: [], released: "2025-09-12" },
28
+ { id: "alibaba/qwen3-vl-235b-a22b-instruct", name: "Qwen3 VL 235B A22B Instruct", provider: "alibaba", contextWindow: 131072, maxOutput: 129024, inputPrice: 0.4, outputPrice: 1.6, cacheRead: null, cacheWrite: null, tags: ["vision"], released: "2025-09-24" },
29
+ { id: "alibaba/qwen3-vl-instruct", name: "Qwen3 VL 235B A22B Instruct", provider: "alibaba", contextWindow: 131072, maxOutput: 129024, inputPrice: 0.4, outputPrice: 1.6, cacheRead: null, cacheWrite: null, tags: ["vision"], released: "2025-09-24" },
30
+ { id: "alibaba/qwen3-vl-thinking", name: "Qwen3 VL 235B A22B Thinking", provider: "alibaba", contextWindow: 131072, maxOutput: 32768, inputPrice: 0.4, outputPrice: 4, cacheRead: null, cacheWrite: null, tags: ["vision", "reasoning", "tool-use", "file-input"], released: "2025-09-24" },
31
+ { id: "alibaba/qwen3.5-flash", name: "Qwen 3.5 Flash", provider: "alibaba", contextWindow: 1000000, maxOutput: 64000, inputPrice: 0.1, outputPrice: 0.4, cacheRead: 0.001, cacheWrite: 0.125, tags: ["vision", "explicit-caching", "file-input", "reasoning", "tool-use"], released: "2026-02-24" },
32
+ { id: "alibaba/qwen3.5-plus", name: "Qwen 3.5 Plus", provider: "alibaba", contextWindow: 1000000, maxOutput: 64000, inputPrice: 0.4, outputPrice: 2.4, cacheRead: 0.04, cacheWrite: 0.5, tags: ["vision", "explicit-caching", "file-input", "reasoning", "tool-use"], released: "2026-02-16" },
33
+ { id: "alibaba/qwen3.6-27b", name: "Qwen 3.6 27B", provider: "alibaba", contextWindow: 256000, maxOutput: 256000, inputPrice: 0.6, outputPrice: 3.6, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "file-input", "vision"], released: "2026-04-22" },
34
+ { id: "alibaba/qwen3.6-plus", name: "Qwen 3.6 Plus", provider: "alibaba", contextWindow: 1000000, maxOutput: 64000, inputPrice: 0.5, outputPrice: 3, cacheRead: 0.1, cacheWrite: 0.625, tags: ["reasoning", "tool-use", "implicit-caching", "vision", "file-input"], released: "2026-04-02" },
35
+ // ── amazon (4) ────────────────────────────────────────────
36
+ { id: "amazon/nova-2-lite", name: "Nova 2 Lite", provider: "amazon", contextWindow: 1000000, maxOutput: 1000000, inputPrice: 0.3, outputPrice: 2.5, cacheRead: 0.075, cacheWrite: null, tags: ["reasoning", "vision"], released: "2024-12-01" },
37
+ { id: "amazon/nova-lite", name: "Nova Lite", provider: "amazon", contextWindow: 300000, maxOutput: 8192, inputPrice: 0.06, outputPrice: 0.24, cacheRead: null, cacheWrite: null, tags: [], released: "2024-12-03" },
38
+ { id: "amazon/nova-micro", name: "Nova Micro", provider: "amazon", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.035, outputPrice: 0.14, cacheRead: null, cacheWrite: null, tags: [], released: null },
39
+ { id: "amazon/nova-pro", name: "Nova Pro", provider: "amazon", contextWindow: 300000, maxOutput: 8192, inputPrice: 0.8, outputPrice: 3.2, cacheRead: null, cacheWrite: null, tags: [], released: "2024-12-03" },
40
+ // ── anthropic (14) ─────────────────────────────────────────
41
+ { id: "anthropic/claude-3-haiku", name: "Claude 3 Haiku", provider: "anthropic", contextWindow: 200000, maxOutput: 4096, inputPrice: 0.25, outputPrice: 1.25, cacheRead: 0.03, cacheWrite: 0.3, tags: ["tool-use", "vision", "explicit-caching"], released: "2023-03-01" },
42
+ { id: "anthropic/claude-3.5-haiku", name: "Claude 3.5 Haiku", provider: "anthropic", contextWindow: 200000, maxOutput: 8192, inputPrice: 0.8, outputPrice: 4, cacheRead: 0.08, cacheWrite: 1, tags: ["file-input", "tool-use", "vision", "explicit-caching"], released: "2023-11-06" },
43
+ { id: "anthropic/claude-3.7-sonnet", name: "Claude 3.7 Sonnet", provider: "anthropic", contextWindow: 200000, maxOutput: 8192, inputPrice: 3, outputPrice: 15, cacheRead: 0.3, cacheWrite: 3.75, tags: ["file-input", "reasoning", "tool-use", "vision", "explicit-caching"], released: "2024-01-25" },
44
+ { id: "anthropic/claude-haiku-4.5", name: "Claude Haiku 4.5", provider: "anthropic", contextWindow: 200000, maxOutput: 64000, inputPrice: 1, outputPrice: 5, cacheRead: 0.1, cacheWrite: 1.25, tags: ["file-input", "reasoning", "tool-use", "vision", "explicit-caching"], released: "2025-10-15" },
45
+ { id: "anthropic/claude-opus-4", name: "Claude Opus 4", provider: "anthropic", contextWindow: 200000, maxOutput: 32000, inputPrice: 15, outputPrice: 75, cacheRead: 1.5, cacheWrite: 18.75, tags: ["file-input", "reasoning", "tool-use", "vision", "explicit-caching"], released: "2025-08-05" },
46
+ { id: "anthropic/claude-opus-4.1", name: "Claude Opus 4.1", provider: "anthropic", contextWindow: 200000, maxOutput: 32000, inputPrice: 15, outputPrice: 75, cacheRead: 1.5, cacheWrite: 18.75, tags: ["file-input", "reasoning", "tool-use", "vision", "explicit-caching"], released: "2025-05-22" },
47
+ { id: "anthropic/claude-opus-4.5", name: "Claude Opus 4.5", provider: "anthropic", contextWindow: 200000, maxOutput: 64000, inputPrice: 5, outputPrice: 25, cacheRead: 0.5, cacheWrite: 6.25, tags: ["tool-use", "reasoning", "vision", "file-input", "explicit-caching"], released: "2024-11-24" },
48
+ { id: "anthropic/claude-opus-4.6", name: "Claude Opus 4.6", provider: "anthropic", contextWindow: 200000, maxOutput: 128000, inputPrice: 5, outputPrice: 25, cacheRead: 0.5, cacheWrite: 6.25, tags: ["tool-use", "reasoning", "vision", "file-input", "explicit-caching", "web-search"], released: "2026-02-05" },
49
+ { id: "anthropic/claude-opus-4.6-1m", name: "Claude Opus 4.6 (1M context)", provider: "anthropic", contextWindow: 1000000, maxOutput: 128000, inputPrice: 5, outputPrice: 25, cacheRead: 0.5, cacheWrite: 6.25, tags: ["tool-use", "reasoning", "vision", "file-input", "explicit-caching", "web-search"], released: "2026-02-05" },
50
+ { id: "anthropic/claude-opus-4.7", name: "Claude Opus 4.7", provider: "anthropic", contextWindow: 200000, maxOutput: 128000, inputPrice: 5, outputPrice: 25, cacheRead: 0.5, cacheWrite: 6.25, tags: ["tool-use", "reasoning", "vision", "file-input", "explicit-caching", "web-search"], released: "2026-04-16" },
51
+ { id: "anthropic/claude-opus-4.7-1m", name: "Claude Opus 4.7 (1M context)", provider: "anthropic", contextWindow: 1000000, maxOutput: 128000, inputPrice: 5, outputPrice: 25, cacheRead: 0.5, cacheWrite: 6.25, tags: ["tool-use", "reasoning", "vision", "file-input", "explicit-caching", "web-search"], released: "2026-04-16" },
52
+ { id: "anthropic/claude-sonnet-4", name: "Claude Sonnet 4", provider: "anthropic", contextWindow: 1000000, maxOutput: 64000, inputPrice: 3, outputPrice: 15, cacheRead: 0.3, cacheWrite: 3.75, tags: ["file-input", "reasoning", "tool-use", "vision", "explicit-caching"], released: "2025-05-22" },
53
+ { id: "anthropic/claude-sonnet-4.5", name: "Claude Sonnet 4.5", provider: "anthropic", contextWindow: 1000000, maxOutput: 64000, inputPrice: 3, outputPrice: 15, cacheRead: 0.3, cacheWrite: 3.75, tags: ["file-input", "reasoning", "tool-use", "vision", "explicit-caching"], released: "2025-09-29" },
54
+ { id: "anthropic/claude-sonnet-4.6", name: "Claude Sonnet 4.6", provider: "anthropic", contextWindow: 1000000, maxOutput: 128000, inputPrice: 3, outputPrice: 15, cacheRead: 0.3, cacheWrite: 3.75, tags: ["file-input", "reasoning", "tool-use", "vision", "explicit-caching", "web-search"], released: "2026-02-17" },
55
+ // ── arcee-ai (3) ──────────────────────────────────────────
56
+ { id: "arcee-ai/trinity-large-preview", name: "Trinity Large Preview", provider: "arcee-ai", contextWindow: 131000, maxOutput: 131000, inputPrice: 0.25, outputPrice: 1, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-01-01" },
57
+ { id: "arcee-ai/trinity-large-thinking", name: "Trinity Large Thinking", provider: "arcee-ai", contextWindow: 262100, maxOutput: 80000, inputPrice: 0.25, outputPrice: 0.9, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2026-04-01" },
58
+ { id: "arcee-ai/trinity-mini", name: "Trinity Mini", provider: "arcee-ai", contextWindow: 131072, maxOutput: 131072, inputPrice: 0.045, outputPrice: 0.15, cacheRead: null, cacheWrite: null, tags: [], released: "2025-12-01" },
59
+ // ── bytedance (2) ─────────────────────────────────────────
60
+ { id: "bytedance/seed-1.6", name: "Seed 1.6", provider: "bytedance", contextWindow: 256000, maxOutput: 32000, inputPrice: 0.25, outputPrice: 2, cacheRead: 0.05, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-09-01" },
61
+ { id: "bytedance/seed-1.8", name: "Bytedance Seed 1.8", provider: "bytedance", contextWindow: 256000, maxOutput: 64000, inputPrice: 0.25, outputPrice: 2, cacheRead: 0.05, cacheWrite: null, tags: ["reasoning", "vision", "implicit-caching"], released: "2025-09-01" },
62
+ // ── cohere (1) ────────────────────────────────────────────
63
+ { id: "cohere/command-a", name: "Command A", provider: "cohere", contextWindow: 256000, maxOutput: 8000, inputPrice: 2.5, outputPrice: 10, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-03-13" },
64
+ // ── deepseek (8) ──────────────────────────────────────────
65
+ { id: "deepseek/deepseek-r1", name: "DeepSeek-R1", provider: "deepseek", contextWindow: 128000, maxOutput: 8192, inputPrice: 1.35, outputPrice: 5.4, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-01-20" },
66
+ { id: "deepseek/deepseek-v3", name: "DeepSeek V3 0324", provider: "deepseek", contextWindow: 163840, maxOutput: 16384, inputPrice: 0.77, outputPrice: 0.77, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2024-12-26" },
67
+ { id: "deepseek/deepseek-v3.1", name: "DeepSeek-V3.1", provider: "deepseek", contextWindow: 163840, maxOutput: 8192, inputPrice: 0.56, outputPrice: 1.68, cacheRead: 0.28, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-08-21" },
68
+ { id: "deepseek/deepseek-v3.1-terminus", name: "DeepSeek V3.1 Terminus", provider: "deepseek", contextWindow: 131072, maxOutput: 65536, inputPrice: 0.27, outputPrice: 1, cacheRead: 0.135, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-09-22" },
69
+ { id: "deepseek/deepseek-v3.2", name: "DeepSeek V3.2", provider: "deepseek", contextWindow: 128000, maxOutput: 8000, inputPrice: 0.28, outputPrice: 0.42, cacheRead: 0.028, cacheWrite: null, tags: ["tool-use", "implicit-caching"], released: "2025-12-01" },
70
+ { id: "deepseek/deepseek-v3.2-thinking", name: "DeepSeek V3.2 Thinking", provider: "deepseek", contextWindow: 128000, maxOutput: 8000, inputPrice: 0.62, outputPrice: 1.85, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-12-01" },
71
+ { id: "deepseek/deepseek-v4-flash", name: "DeepSeek V4 Flash", provider: "deepseek", contextWindow: 1000000, maxOutput: 384000, inputPrice: 0.14, outputPrice: 0.28, cacheRead: 0.0028, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2026-04-23" },
72
+ { id: "deepseek/deepseek-v4-pro", name: "DeepSeek V4 Pro", provider: "deepseek", contextWindow: 1000000, maxOutput: 384000, inputPrice: 0.435, outputPrice: 0.87, cacheRead: 0.0036, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2026-04-23" },
73
+ // ── google (15) ────────────────────────────────────────────
74
+ { id: "google/gemini-2.0-flash", name: "Gemini 2.0 Flash", provider: "google", contextWindow: 1048576, maxOutput: 8192, inputPrice: 0.15, outputPrice: 0.6, cacheRead: 0.025, cacheWrite: null, tags: ["file-input", "tool-use", "vision", "web-search"], released: "2024-12-11" },
75
+ { id: "google/gemini-2.0-flash-lite", name: "Gemini 2.0 Flash Lite", provider: "google", contextWindow: 1048576, maxOutput: 8192, inputPrice: 0.075, outputPrice: 0.3, cacheRead: 0.02, cacheWrite: null, tags: ["file-input", "tool-use", "vision", "web-search"], released: "2024-12-11" },
76
+ { id: "google/gemini-2.5-flash", name: "Gemini 2.5 Flash", provider: "google", contextWindow: 1000000, maxOutput: 65536, inputPrice: 0.3, outputPrice: 2.5, cacheRead: 0.03, cacheWrite: null, tags: ["file-input", "reasoning", "tool-use", "vision", "web-search", "implicit-caching"], released: "2025-03-20" },
77
+ { id: "google/gemini-2.5-flash-image", name: "Nano Banana (Gemini 2.5 Flash Image)", provider: "google", contextWindow: 32768, maxOutput: 65536, inputPrice: 0.3, outputPrice: 2.5, cacheRead: 0.03, cacheWrite: null, tags: ["image-generation", "web-search"], released: "2025-03-20" },
78
+ { id: "google/gemini-2.5-flash-lite", name: "Gemini 2.5 Flash Lite", provider: "google", contextWindow: 1048576, maxOutput: 65536, inputPrice: 0.1, outputPrice: 0.4, cacheRead: 0.01, cacheWrite: null, tags: ["file-input", "reasoning", "tool-use", "vision", "web-search", "implicit-caching"], released: "2025-06-17" },
79
+ { id: "google/gemini-2.5-pro", name: "Gemini 2.5 Pro", provider: "google", contextWindow: 1048576, maxOutput: 65536, inputPrice: 1.25, outputPrice: 10, cacheRead: 0.125, cacheWrite: null, tags: ["file-input", "reasoning", "tool-use", "vision", "web-search", "implicit-caching"], released: "2025-03-20" },
80
+ { id: "google/gemini-3-flash", name: "Gemini 3 Flash", provider: "google", contextWindow: 1000000, maxOutput: 65000, inputPrice: 0.5, outputPrice: 3, cacheRead: 0.05, cacheWrite: null, tags: ["reasoning", "tool-use", "file-input", "vision", "web-search", "implicit-caching"], released: "2025-12-17" },
81
+ { id: "google/gemini-3-pro-image", name: "Nano Banana Pro (Gemini 3 Pro Image)", provider: "google", contextWindow: 65536, maxOutput: 32768, inputPrice: 2, outputPrice: 12, cacheRead: 0.2, cacheWrite: null, tags: ["image-generation", "web-search"], released: "2025-09-01" },
82
+ { id: "google/gemini-3-pro-preview", name: "Gemini 3 Pro Preview", provider: "google", contextWindow: 1000000, maxOutput: 64000, inputPrice: 2, outputPrice: 12, cacheRead: 0.2, cacheWrite: null, tags: ["file-input", "tool-use", "reasoning", "vision", "web-search", "implicit-caching"], released: "2025-11-18" },
83
+ { id: "google/gemini-3.1-flash-image-preview", name: "Gemini 3.1 Flash Image Preview (Nano Banana 2)", provider: "google", contextWindow: 131072, maxOutput: 32768, inputPrice: 0.5, outputPrice: 3, cacheRead: 0.05, cacheWrite: null, tags: ["image-generation", "web-search", "vision", "reasoning"], released: "2026-02-26" },
84
+ { id: "google/gemini-3.1-flash-lite", name: "Gemini 3.1 Flash Lite", provider: "google", contextWindow: 1000000, maxOutput: 65000, inputPrice: 0.25, outputPrice: 1.5, cacheRead: 0.03, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "file-input", "vision", "web-search"], released: "2026-05-07" },
85
+ { id: "google/gemini-3.1-flash-lite-preview", name: "Gemini 3.1 Flash Lite Preview", provider: "google", contextWindow: 1000000, maxOutput: 65000, inputPrice: 0.25, outputPrice: 1.5, cacheRead: 0.03, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "vision", "file-input", "web-search"], released: "2026-03-03" },
86
+ { id: "google/gemini-3.1-pro-preview", name: "Gemini 3.1 Pro Preview", provider: "google", contextWindow: 1000000, maxOutput: 64000, inputPrice: 2, outputPrice: 12, cacheRead: 0.2, cacheWrite: null, tags: ["file-input", "tool-use", "reasoning", "vision", "web-search", "implicit-caching"], released: "2025-11-18" },
87
+ { id: "google/gemma-4-26b-a4b-it", name: "Gemma 4 26B A4B IT", provider: "google", contextWindow: 262144, maxOutput: 131072, inputPrice: 0.13, outputPrice: 0.4, cacheRead: null, cacheWrite: null, tags: ["vision", "tool-use", "file-input"], released: "2026-04-02" },
88
+ { id: "google/gemma-4-31b-it", name: "Gemma 4 31B IT", provider: "google", contextWindow: 262144, maxOutput: 131072, inputPrice: 0.14, outputPrice: 0.4, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision", "file-input"], released: "2026-04-02" },
89
+ // ── inception (2) ─────────────────────────────────────────
90
+ { id: "inception/mercury-2", name: "Mercury 2", provider: "inception", contextWindow: 128000, maxOutput: 128000, inputPrice: 0.25, outputPrice: 0.75, cacheRead: 0.025, cacheWrite: null, tags: ["tool-use", "reasoning"], released: "2026-02-24" },
91
+ { id: "inception/mercury-coder-small", name: "Mercury Coder Small Beta", provider: "inception", contextWindow: 32000, maxOutput: 16384, inputPrice: 0.25, outputPrice: 1, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-02-26" },
92
+ // ── interfaze (1) ─────────────────────────────────────────
93
+ { id: "interfaze/interfaze-beta", name: "Interfaze Beta", provider: "interfaze", contextWindow: 1000000, maxOutput: 32000, inputPrice: 1.5, outputPrice: 3.5, cacheRead: null, cacheWrite: null, tags: ["reasoning"], released: "2025-10-07" },
94
+ // ── kwaipilot (2) ─────────────────────────────────────────
95
+ { id: "kwaipilot/kat-coder-pro-v1", name: "KAT-Coder-Pro V1", provider: "kwaipilot", contextWindow: 256000, maxOutput: 32000, inputPrice: 0.03, outputPrice: 1.2, cacheRead: 0.06, cacheWrite: null, tags: ["reasoning"], released: "2025-10-24" },
96
+ { id: "kwaipilot/kat-coder-pro-v2", name: "Kat Coder Pro V2", provider: "kwaipilot", contextWindow: 256000, maxOutput: 256000, inputPrice: 0.3, outputPrice: 1.2, cacheRead: 0.06, cacheWrite: null, tags: ["tool-use", "reasoning", "implicit-caching"], released: "2026-03-27" },
97
+ // ── meituan (2) ───────────────────────────────────────────
98
+ { id: "meituan/longcat-flash-chat", name: "LongCat Flash Chat", provider: "meituan", contextWindow: 128000, maxOutput: 100000, inputPrice: null, outputPrice: null, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-08-30" },
99
+ { id: "meituan/longcat-flash-thinking-2601", name: "LongCat Flash Thinking 2601", provider: "meituan", contextWindow: 32768, maxOutput: 32768, inputPrice: null, outputPrice: null, cacheRead: null, cacheWrite: null, tags: ["reasoning"], released: null },
100
+ // ── meta (9) ──────────────────────────────────────────────
101
+ { id: "meta/llama-3.1-70b", name: "Llama 3.1 70B Instruct", provider: "meta", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.72, outputPrice: 0.72, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2024-07-23" },
102
+ { id: "meta/llama-3.1-8b", name: "Llama 3.1 8B Instruct", provider: "meta", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.22, outputPrice: 0.22, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2024-07-23" },
103
+ { id: "meta/llama-3.2-11b", name: "Llama 3.2 11B Vision Instruct", provider: "meta", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.16, outputPrice: 0.16, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2024-09-25" },
104
+ { id: "meta/llama-3.2-1b", name: "Llama 3.2 1B Instruct", provider: "meta", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.1, outputPrice: 0.1, cacheRead: null, cacheWrite: null, tags: [], released: "2024-09-18" },
105
+ { id: "meta/llama-3.2-3b", name: "Llama 3.2 3B Instruct", provider: "meta", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.15, outputPrice: 0.15, cacheRead: null, cacheWrite: null, tags: [], released: "2024-09-18" },
106
+ { id: "meta/llama-3.2-90b", name: "Llama 3.2 90B Vision Instruct", provider: "meta", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.72, outputPrice: 0.72, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2024-09-25" },
107
+ { id: "meta/llama-3.3-70b", name: "Llama 3.3 70B Instruct", provider: "meta", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.72, outputPrice: 0.72, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2024-12-06" },
108
+ { id: "meta/llama-4-maverick", name: "Llama 4 Maverick 17B Instruct", provider: "meta", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.24, outputPrice: 0.97, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2025-04-05" },
109
+ { id: "meta/llama-4-scout", name: "Llama 4 Scout 17B Instruct", provider: "meta", contextWindow: 128000, maxOutput: 8192, inputPrice: 0.17, outputPrice: 0.66, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2025-04-05" },
110
+ // ── minimax (7) ───────────────────────────────────────────
111
+ { id: "minimax/minimax-m2", name: "MiniMax M2", provider: "minimax", contextWindow: 205000, maxOutput: 205000, inputPrice: 0.3, outputPrice: 1.2, cacheRead: 0.03, cacheWrite: 0.375, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-10-27" },
112
+ { id: "minimax/minimax-m2.1", name: "MiniMax M2.1", provider: "minimax", contextWindow: 204800, maxOutput: 131072, inputPrice: 0.3, outputPrice: 1.2, cacheRead: 0.03, cacheWrite: 0.375, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-10-27" },
113
+ { id: "minimax/minimax-m2.1-lightning", name: "MiniMax M2.1 Lightning", provider: "minimax", contextWindow: 204800, maxOutput: 131072, inputPrice: 0.3, outputPrice: 2.4, cacheRead: 0.03, cacheWrite: 0.375, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-10-27" },
114
+ { id: "minimax/minimax-m2.5", name: "MiniMax M2.5", provider: "minimax", contextWindow: 204800, maxOutput: 131000, inputPrice: 0.3, outputPrice: 1.2, cacheRead: 0.03, cacheWrite: 0.375, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2026-02-12" },
115
+ { id: "minimax/minimax-m2.5-highspeed", name: "MiniMax M2.5 High Speed", provider: "minimax", contextWindow: 204800, maxOutput: 131000, inputPrice: 0.6, outputPrice: 2.4, cacheRead: 0.03, cacheWrite: 0.375, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2026-02-12" },
116
+ { id: "minimax/minimax-m2.7", name: "Minimax M2.7", provider: "minimax", contextWindow: 204800, maxOutput: 131000, inputPrice: 0.3, outputPrice: 1.2, cacheRead: 0.06, cacheWrite: 0.375, tags: ["reasoning", "tool-use", "implicit-caching", "file-input", "vision"], released: "2026-03-18" },
117
+ { id: "minimax/minimax-m2.7-highspeed", name: "MiniMax M2.7 High Speed", provider: "minimax", contextWindow: 204800, maxOutput: 131100, inputPrice: 0.6, outputPrice: 2.4, cacheRead: 0.06, cacheWrite: 0.375, tags: ["reasoning", "tool-use", "implicit-caching", "vision"], released: "2026-03-18" },
118
+ // ── mistral (15) ───────────────────────────────────────────
119
+ { id: "mistral/codestral", name: "Mistral Codestral", provider: "mistral", contextWindow: 128000, maxOutput: 4000, inputPrice: 0.3, outputPrice: 0.9, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2024-05-29" },
120
+ { id: "mistral/devstral-2", name: "Devstral 2", provider: "mistral", contextWindow: 256000, maxOutput: 256000, inputPrice: 0.4, outputPrice: 2, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-12-09" },
121
+ { id: "mistral/devstral-small", name: "Devstral Small 1.1", provider: "mistral", contextWindow: 128000, maxOutput: 64000, inputPrice: 0.1, outputPrice: 0.3, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-05-07" },
122
+ { id: "mistral/devstral-small-2", name: "Devstral Small 2", provider: "mistral", contextWindow: 256000, maxOutput: 256000, inputPrice: 0.1, outputPrice: 0.3, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-05-07" },
123
+ { id: "mistral/magistral-medium", name: "Magistral Medium 2509", provider: "mistral", contextWindow: 128000, maxOutput: 64000, inputPrice: 2, outputPrice: 5, cacheRead: null, cacheWrite: null, tags: ["reasoning", "vision"], released: "2025-03-17" },
124
+ { id: "mistral/magistral-small", name: "Magistral Small 2509", provider: "mistral", contextWindow: 128000, maxOutput: 64000, inputPrice: 0.5, outputPrice: 1.5, cacheRead: null, cacheWrite: null, tags: ["reasoning", "vision"], released: "2025-03-17" },
125
+ { id: "mistral/ministral-14b", name: "Ministral 14B", provider: "mistral", contextWindow: 256000, maxOutput: 256000, inputPrice: 0.2, outputPrice: 0.2, cacheRead: null, cacheWrite: null, tags: ["vision", "file-input"], released: "2025-12-01" },
126
+ { id: "mistral/ministral-3b", name: "Ministral 3B", provider: "mistral", contextWindow: 128000, maxOutput: 4000, inputPrice: 0.1, outputPrice: 0.1, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2024-10-01" },
127
+ { id: "mistral/ministral-8b", name: "Ministral 8B", provider: "mistral", contextWindow: 128000, maxOutput: 4000, inputPrice: 0.15, outputPrice: 0.15, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2024-10-01" },
128
+ { id: "mistral/mistral-large-3", name: "Mistral Large 3", provider: "mistral", contextWindow: 256000, maxOutput: 256000, inputPrice: 0.5, outputPrice: 1.5, cacheRead: null, cacheWrite: null, tags: ["vision"], released: "2025-12-02" },
129
+ { id: "mistral/mistral-medium", name: "Mistral Medium 3.1", provider: "mistral", contextWindow: 128000, maxOutput: 64000, inputPrice: 0.4, outputPrice: 2, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2025-05-07" },
130
+ { id: "mistral/mistral-nemo", name: "Mistral Nemo 12B", provider: "mistral", contextWindow: 131072, maxOutput: 131072, inputPrice: 0.02, outputPrice: 0.04, cacheRead: null, cacheWrite: null, tags: [], released: "2024-07-01" },
131
+ { id: "mistral/mistral-small", name: "Mistral Small", provider: "mistral", contextWindow: 32000, maxOutput: 4000, inputPrice: 0.1, outputPrice: 0.3, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2024-09-01" },
132
+ { id: "mistral/pixtral-12b", name: "Pixtral 12B 2409", provider: "mistral", contextWindow: 128000, maxOutput: 4000, inputPrice: 0.15, outputPrice: 0.15, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2024-09-01" },
133
+ { id: "mistral/pixtral-large", name: "Pixtral Large", provider: "mistral", contextWindow: 128000, maxOutput: 4000, inputPrice: 2, outputPrice: 6, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2024-11-01" },
134
+ // ── moonshotai (6) ────────────────────────────────────────
135
+ { id: "moonshotai/kimi-k2", name: "Kimi K2 Instruct", provider: "moonshotai", contextWindow: 131072, maxOutput: 131072, inputPrice: 0.57, outputPrice: 2.3, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-09-05" },
136
+ { id: "moonshotai/kimi-k2-thinking", name: "Kimi K2 Thinking", provider: "moonshotai", contextWindow: 262114, maxOutput: 262114, inputPrice: 0.6, outputPrice: 2.5, cacheRead: 0.15, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-11-06" },
137
+ { id: "moonshotai/kimi-k2-thinking-turbo", name: "Kimi K2 Thinking Turbo", provider: "moonshotai", contextWindow: 262114, maxOutput: 262114, inputPrice: 1.15, outputPrice: 8, cacheRead: 0.15, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-11-06" },
138
+ { id: "moonshotai/kimi-k2-turbo", name: "Kimi K2 Turbo", provider: "moonshotai", contextWindow: 256000, maxOutput: 16384, inputPrice: 1.15, outputPrice: 8, cacheRead: 0.15, cacheWrite: null, tags: ["tool-use"], released: "2025-09-05" },
139
+ { id: "moonshotai/kimi-k2.5", name: "Kimi K2.5", provider: "moonshotai", contextWindow: 262114, maxOutput: 262114, inputPrice: 0.6, outputPrice: 3, cacheRead: 0.1, cacheWrite: null, tags: ["reasoning", "vision", "tool-use", "implicit-caching"], released: "2026-01-26" },
140
+ { id: "moonshotai/kimi-k2.6", name: "Kimi K2.6", provider: "moonshotai", contextWindow: 262000, maxOutput: 262000, inputPrice: 0.95, outputPrice: 4, cacheRead: 0.16, cacheWrite: null, tags: ["reasoning", "tool-use", "vision", "file-input", "implicit-caching"], released: "2026-04-20" },
141
+ // ── morph (2) ─────────────────────────────────────────────
142
+ { id: "morph/morph-v3-fast", name: "Morph V3 Fast", provider: "morph", contextWindow: 81920, maxOutput: 16384, inputPrice: 0.8, outputPrice: 1.2, cacheRead: null, cacheWrite: null, tags: [], released: "2024-08-15" },
143
+ { id: "morph/morph-v3-large", name: "Morph V3 Large", provider: "morph", contextWindow: 81920, maxOutput: 16384, inputPrice: 0.9, outputPrice: 1.9, cacheRead: null, cacheWrite: null, tags: [], released: "2024-08-15" },
144
+ // ── nvidia (4) ────────────────────────────────────────────
145
+ { id: "nvidia/nemotron-3-nano-30b-a3b", name: "Nemotron 3 Nano 30B A3B", provider: "nvidia", contextWindow: 262144, maxOutput: 262144, inputPrice: 0.05, outputPrice: 0.24, cacheRead: null, cacheWrite: null, tags: ["reasoning"], released: "2024-12-01" },
146
+ { id: "nvidia/nemotron-3-super-120b-a12b", name: "NVIDIA Nemotron 3 Super 120B A12B", provider: "nvidia", contextWindow: 256000, maxOutput: 32000, inputPrice: 0.15, outputPrice: 0.65, cacheRead: null, cacheWrite: null, tags: [], released: "2026-03-18" },
147
+ { id: "nvidia/nemotron-nano-12b-v2-vl", name: "Nvidia Nemotron Nano 12B V2 VL", provider: "nvidia", contextWindow: 131072, maxOutput: 131072, inputPrice: 0.2, outputPrice: 0.6, cacheRead: null, cacheWrite: null, tags: ["vision", "reasoning", "tool-use"], released: "2024-12-01" },
148
+ { id: "nvidia/nemotron-nano-9b-v2", name: "Nvidia Nemotron Nano 9B V2", provider: "nvidia", contextWindow: 131072, maxOutput: 131072, inputPrice: 0.06, outputPrice: 0.23, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-08-18" },
149
+ // ── openai (41) ────────────────────────────────────────────
150
+ { id: "openai/gpt-3.5-turbo", name: "GPT-3.5 Turbo", provider: "openai", contextWindow: 16385, maxOutput: 4096, inputPrice: 0.5, outputPrice: 1.5, cacheRead: null, cacheWrite: null, tags: [], released: "2023-05-28" },
151
+ { id: "openai/gpt-3.5-turbo-instruct", name: "GPT-3.5 Turbo Instruct", provider: "openai", contextWindow: 8192, maxOutput: 4096, inputPrice: 1.5, outputPrice: 2, cacheRead: null, cacheWrite: null, tags: [], released: "2023-09-28" },
152
+ { id: "openai/gpt-4-turbo", name: "GPT-4 Turbo", provider: "openai", contextWindow: 128000, maxOutput: 4096, inputPrice: 10, outputPrice: 30, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2023-11-06" },
153
+ { id: "openai/gpt-4.1", name: "GPT-4.1", provider: "openai", contextWindow: 1047576, maxOutput: 32768, inputPrice: 2, outputPrice: 8, cacheRead: 0.5, cacheWrite: null, tags: ["file-input", "tool-use", "vision", "implicit-caching", "web-search"], released: "2025-04-14" },
154
+ { id: "openai/gpt-4.1-mini", name: "GPT-4.1 mini", provider: "openai", contextWindow: 1047576, maxOutput: 32768, inputPrice: 0.4, outputPrice: 1.6, cacheRead: 0.1, cacheWrite: null, tags: ["file-input", "tool-use", "vision", "implicit-caching", "web-search"], released: "2025-05-14" },
155
+ { id: "openai/gpt-4.1-nano", name: "GPT-4.1 nano", provider: "openai", contextWindow: 1047576, maxOutput: 32768, inputPrice: 0.1, outputPrice: 0.4, cacheRead: 0.025, cacheWrite: null, tags: ["file-input", "tool-use", "vision", "implicit-caching", "web-search"], released: "2025-04-14" },
156
+ { id: "openai/gpt-4o", name: "GPT-4o", provider: "openai", contextWindow: 128000, maxOutput: 16384, inputPrice: 2.5, outputPrice: 10, cacheRead: 1.25, cacheWrite: null, tags: ["file-input", "tool-use", "vision", "implicit-caching", "web-search"], released: "2024-05-13" },
157
+ { id: "openai/gpt-4o-mini", name: "GPT-4o mini", provider: "openai", contextWindow: 128000, maxOutput: 16384, inputPrice: 0.15, outputPrice: 0.6, cacheRead: 0.075, cacheWrite: null, tags: ["file-input", "tool-use", "vision", "implicit-caching", "web-search"], released: "2024-07-18" },
158
+ { id: "openai/gpt-4o-mini-search-preview", name: "GPT 4o Mini Search Preview", provider: "openai", contextWindow: 128000, maxOutput: 16384, inputPrice: 0.15, outputPrice: 0.6, cacheRead: null, cacheWrite: null, tags: ["web-search"], released: "2025-03-12" },
159
+ { id: "openai/gpt-5", name: "GPT-5", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 1.25, outputPrice: 10, cacheRead: 0.125, cacheWrite: null, tags: ["file-input", "implicit-caching", "reasoning", "tool-use", "vision", "image-generation", "web-search"], released: "2025-08-01" },
160
+ { id: "openai/gpt-5-chat", name: "GPT 5 Chat", provider: "openai", contextWindow: 128000, maxOutput: 16384, inputPrice: 1.25, outputPrice: 10, cacheRead: 0.125, cacheWrite: null, tags: ["tool-use", "implicit-caching", "file-input", "image-generation", "vision", "reasoning", "web-search"], released: "2025-08-07" },
161
+ { id: "openai/gpt-5-codex", name: "GPT-5-Codex", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 1.25, outputPrice: 10, cacheRead: 0.125, cacheWrite: null, tags: ["file-input", "implicit-caching", "reasoning", "tool-use", "web-search"], released: "2025-09-15" },
162
+ { id: "openai/gpt-5-mini", name: "GPT-5 mini", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 0.25, outputPrice: 2, cacheRead: 0.025, cacheWrite: null, tags: ["file-input", "implicit-caching", "reasoning", "tool-use", "vision", "web-search"], released: "2025-08-07" },
163
+ { id: "openai/gpt-5-nano", name: "GPT-5 nano", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 0.05, outputPrice: 0.4, cacheRead: 0.005, cacheWrite: null, tags: ["file-input", "implicit-caching", "reasoning", "tool-use", "vision", "image-generation", "web-search"], released: "2025-08-07" },
164
+ { id: "openai/gpt-5-pro", name: "GPT-5 pro", provider: "openai", contextWindow: 400000, maxOutput: 272000, inputPrice: 15, outputPrice: 120, cacheRead: null, cacheWrite: null, tags: ["file-input", "implicit-caching", "reasoning", "tool-use", "vision", "image-generation", "web-search"], released: null },
165
+ { id: "openai/gpt-5.1-codex", name: "GPT-5.1-Codex", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 1.25, outputPrice: 10, cacheRead: 0.125, cacheWrite: null, tags: ["file-input", "tool-use", "reasoning", "vision", "web-search", "implicit-caching"], released: "2025-11-12" },
166
+ { id: "openai/gpt-5.1-codex-max", name: "GPT 5.1 Codex Max", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 1.25, outputPrice: 10, cacheRead: 0.125, cacheWrite: null, tags: ["reasoning", "file-input", "tool-use", "vision", "web-search", "implicit-caching"], released: "2025-11-19" },
167
+ { id: "openai/gpt-5.1-codex-mini", name: "GPT 5.1 Codex Mini", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 0.25, outputPrice: 2, cacheRead: 0.025, cacheWrite: null, tags: ["reasoning", "file-input", "vision", "tool-use", "web-search", "implicit-caching"], released: "2025-11-12" },
168
+ { id: "openai/gpt-5.1-instant", name: "GPT-5.1 Instant", provider: "openai", contextWindow: 128000, maxOutput: 16384, inputPrice: 1.25, outputPrice: 10, cacheRead: 0.125, cacheWrite: null, tags: ["tool-use", "vision", "file-input", "reasoning", "implicit-caching", "web-search"], released: "2025-11-12" },
169
+ { id: "openai/gpt-5.1-thinking", name: "GPT 5.1 Thinking", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 1.25, outputPrice: 10, cacheRead: 0.125, cacheWrite: null, tags: ["tool-use", "implicit-caching", "file-input", "reasoning", "vision", "web-search", "image-generation"], released: "2025-11-12" },
170
+ { id: "openai/gpt-5.2", name: "GPT 5.2", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 1.75, outputPrice: 14, cacheRead: 0.175, cacheWrite: null, tags: ["tool-use", "vision", "file-input", "reasoning", "implicit-caching", "web-search"], released: "2025-12-11" },
171
+ { id: "openai/gpt-5.2-chat", name: "GPT 5.2 Chat", provider: "openai", contextWindow: 128000, maxOutput: 16384, inputPrice: 1.75, outputPrice: 14, cacheRead: 0.175, cacheWrite: null, tags: ["vision", "file-input", "tool-use", "reasoning", "implicit-caching", "web-search"], released: "2025-12-11" },
172
+ { id: "openai/gpt-5.2-codex", name: "GPT 5.2 Codex", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 1.75, outputPrice: 14, cacheRead: 0.175, cacheWrite: null, tags: ["file-input", "tool-use", "reasoning", "vision", "web-search", "implicit-caching"], released: "2025-12-18" },
173
+ { id: "openai/gpt-5.2-pro", name: "GPT 5.2 ", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 21, outputPrice: 168, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision", "implicit-caching", "reasoning", "file-input", "web-search"], released: "2025-12-11" },
174
+ { id: "openai/gpt-5.3-chat", name: "GPT-5.3 Chat", provider: "openai", contextWindow: 128000, maxOutput: 16384, inputPrice: 1.75, outputPrice: 14, cacheRead: 0.175, cacheWrite: null, tags: ["vision", "file-input", "tool-use", "reasoning", "implicit-caching", "web-search"], released: "2026-03-03" },
175
+ { id: "openai/gpt-5.3-codex", name: "GPT 5.3 Codex", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 1.75, outputPrice: 14, cacheRead: 0.175, cacheWrite: null, tags: ["reasoning", "tool-use", "file-input", "vision", "web-search", "implicit-caching"], released: "2026-02-24" },
176
+ { id: "openai/gpt-5.4", name: "GPT 5.4", provider: "openai", contextWindow: 1050000, maxOutput: 128000, inputPrice: 2.5, outputPrice: 15, cacheRead: 0.25, cacheWrite: null, tags: ["reasoning", "tool-use", "vision", "file-input", "implicit-caching", "web-search"], released: "2026-03-05" },
177
+ { id: "openai/gpt-5.4-mini", name: "GPT 5.4 Mini", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 0.75, outputPrice: 4.5, cacheRead: 0.075, cacheWrite: null, tags: ["reasoning", "tool-use", "vision", "file-input", "implicit-caching", "web-search"], released: "2026-03-17" },
178
+ { id: "openai/gpt-5.4-nano", name: "GPT 5.4 Nano", provider: "openai", contextWindow: 400000, maxOutput: 128000, inputPrice: 0.2, outputPrice: 1.25, cacheRead: 0.02, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "web-search", "vision", "file-input"], released: "2026-03-17" },
179
+ { id: "openai/gpt-5.4-pro", name: "GPT 5.4 Pro", provider: "openai", contextWindow: 1050000, maxOutput: 128000, inputPrice: 30, outputPrice: 180, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use", "vision", "file-input", "implicit-caching", "web-search"], released: "2026-03-05" },
180
+ { id: "openai/gpt-5.5", name: "GPT 5.5", provider: "openai", contextWindow: 1000000, maxOutput: 128000, inputPrice: 5, outputPrice: 30, cacheRead: 0.5, cacheWrite: null, tags: ["reasoning", "tool-use", "web-search", "implicit-caching", "file-input", "vision"], released: "2026-04-24" },
181
+ { id: "openai/gpt-5.5-pro", name: "GPT 5.5 Pro", provider: "openai", contextWindow: 1000000, maxOutput: 128000, inputPrice: 30, outputPrice: 180, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "file-input", "web-search", "vision"], released: "2026-04-24" },
182
+ { id: "openai/gpt-oss-120b", name: "GPT OSS 120B", provider: "openai", contextWindow: 131072, maxOutput: 131000, inputPrice: 0.35, outputPrice: 0.75, cacheRead: 0.25, cacheWrite: null, tags: ["implicit-caching"], released: "2025-08-05" },
183
+ { id: "openai/gpt-oss-20b", name: "GPT OSS 120B", provider: "openai", contextWindow: 131072, maxOutput: 8192, inputPrice: 0.05, outputPrice: 0.2, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-08-05" },
184
+ { id: "openai/gpt-oss-safeguard-20b", name: "GPT OSS Safeguard 20B", provider: "openai", contextWindow: 131072, maxOutput: 65536, inputPrice: 0.075, outputPrice: 0.3, cacheRead: 0.037, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2024-12-01" },
185
+ { id: "openai/o1", name: "o1", provider: "openai", contextWindow: 200000, maxOutput: 100000, inputPrice: 15, outputPrice: 60, cacheRead: 7.5, cacheWrite: null, tags: ["file-input", "reasoning", "tool-use", "vision", "implicit-caching"], released: "2024-12-05" },
186
+ { id: "openai/o3", name: "o3", provider: "openai", contextWindow: 200000, maxOutput: 100000, inputPrice: 2, outputPrice: 8, cacheRead: 0.5, cacheWrite: null, tags: ["file-input", "reasoning", "tool-use", "vision", "implicit-caching"], released: "2025-04-16" },
187
+ { id: "openai/o3-deep-research", name: "o3-deep-research", provider: "openai", contextWindow: 200000, maxOutput: 100000, inputPrice: 10, outputPrice: 40, cacheRead: 2.5, cacheWrite: null, tags: ["reasoning", "file-input", "tool-use", "vision", "implicit-caching"], released: "2024-06-26" },
188
+ { id: "openai/o3-mini", name: "o3-mini", provider: "openai", contextWindow: 200000, maxOutput: 100000, inputPrice: 1.1, outputPrice: 4.4, cacheRead: 0.55, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2024-12-20" },
189
+ { id: "openai/o3-pro", name: "o3 Pro", provider: "openai", contextWindow: 200000, maxOutput: 100000, inputPrice: 20, outputPrice: 80, cacheRead: null, cacheWrite: null, tags: ["reasoning", "vision", "file-input", "tool-use", "web-search"], released: "2025-04-16" },
190
+ { id: "openai/o4-mini", name: "o4-mini", provider: "openai", contextWindow: 200000, maxOutput: 100000, inputPrice: 1.1, outputPrice: 4.4, cacheRead: 0.275, cacheWrite: null, tags: ["file-input", "reasoning", "tool-use", "vision", "implicit-caching", "web-search"], released: "2025-04-16" },
191
+ // ── perplexity (3) ────────────────────────────────────────
192
+ { id: "perplexity/sonar", name: "Sonar", provider: "perplexity", contextWindow: 127000, maxOutput: 8000, inputPrice: null, outputPrice: null, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2025-02-19" },
193
+ { id: "perplexity/sonar-pro", name: "Sonar Pro", provider: "perplexity", contextWindow: 200000, maxOutput: 8000, inputPrice: null, outputPrice: null, cacheRead: null, cacheWrite: null, tags: ["tool-use", "vision"], released: "2025-02-19" },
194
+ { id: "perplexity/sonar-reasoning-pro", name: "Sonar Reasoning Pro", provider: "perplexity", contextWindow: 127000, maxOutput: 8000, inputPrice: null, outputPrice: null, cacheRead: null, cacheWrite: null, tags: ["reasoning"], released: "2025-02-19" },
195
+ // ── xai (17) ───────────────────────────────────────────────
196
+ { id: "xai/grok-3", name: "Grok 3 Beta", provider: "xai", contextWindow: 131072, maxOutput: 131072, inputPrice: 3, outputPrice: 15, cacheRead: 0.75, cacheWrite: null, tags: ["tool-use"], released: "2025-02-17" },
197
+ { id: "xai/grok-3-fast", name: "Grok 3 Fast Beta", provider: "xai", contextWindow: 131072, maxOutput: 131072, inputPrice: 5, outputPrice: 25, cacheRead: 1.25, cacheWrite: null, tags: ["tool-use"], released: "2025-02-17" },
198
+ { id: "xai/grok-3-mini", name: "Grok 3 Mini Beta", provider: "xai", contextWindow: 131072, maxOutput: 131072, inputPrice: 0.3, outputPrice: 0.5, cacheRead: 0.075, cacheWrite: null, tags: ["tool-use"], released: "2025-02-17" },
199
+ { id: "xai/grok-3-mini-fast", name: "Grok 3 Mini Fast Beta", provider: "xai", contextWindow: 131072, maxOutput: 131072, inputPrice: 0.6, outputPrice: 4, cacheRead: null, cacheWrite: null, tags: ["tool-use"], released: "2025-02-17" },
200
+ { id: "xai/grok-4", name: "Grok 4", provider: "xai", contextWindow: 256000, maxOutput: 256000, inputPrice: 3, outputPrice: 15, cacheRead: 0.75, cacheWrite: null, tags: ["reasoning", "tool-use", "vision", "web-search"], released: "2025-07-09" },
201
+ { id: "xai/grok-4-fast-non-reasoning", name: "Grok 4 Fast Non-Reasoning", provider: "xai", contextWindow: 2000000, maxOutput: 256000, inputPrice: 0.2, outputPrice: 0.5, cacheRead: 0.05, cacheWrite: null, tags: ["tool-use", "implicit-caching", "vision", "file-input", "web-search"], released: "2025-09-19" },
202
+ { id: "xai/grok-4-fast-reasoning", name: "Grok 4 Fast Reasoning", provider: "xai", contextWindow: 2000000, maxOutput: 256000, inputPrice: 0.2, outputPrice: 0.5, cacheRead: 0.05, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "vision", "file-input", "web-search"], released: "2025-07-09" },
203
+ { id: "xai/grok-4.1-fast-non-reasoning", name: "Grok 4.1 Fast Non-Reasoning", provider: "xai", contextWindow: 2000000, maxOutput: 30000, inputPrice: 0.2, outputPrice: 0.5, cacheRead: 0.05, cacheWrite: null, tags: ["tool-use", "implicit-caching", "vision", "file-input", "web-search"], released: "2025-07-09" },
204
+ { id: "xai/grok-4.1-fast-reasoning", name: "Grok 4.1 Fast Reasoning", provider: "xai", contextWindow: 2000000, maxOutput: 30000, inputPrice: 0.2, outputPrice: 0.5, cacheRead: 0.05, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "vision", "file-input", "web-search"], released: "2025-07-09" },
205
+ { id: "xai/grok-4.20-multi-agent", name: "Grok 4.20 Multi-Agent", provider: "xai", contextWindow: 2000000, maxOutput: 2000000, inputPrice: 1.25, outputPrice: 2.5, cacheRead: 0.2, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "vision", "file-input", "web-search"], released: "2026-03-09" },
206
+ { id: "xai/grok-4.20-multi-agent-beta", name: "Grok 4.20 Multi Agent Beta", provider: "xai", contextWindow: 2000000, maxOutput: 2000000, inputPrice: 1.25, outputPrice: 2.5, cacheRead: 0.2, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "vision", "file-input", "web-search"], released: "2026-03-11" },
207
+ { id: "xai/grok-4.20-non-reasoning", name: "Grok 4.20 Non-Reasoning", provider: "xai", contextWindow: 2000000, maxOutput: 2000000, inputPrice: 1.25, outputPrice: 2.5, cacheRead: 0.2, cacheWrite: null, tags: ["tool-use", "implicit-caching", "vision", "file-input", "web-search"], released: "2026-03-09" },
208
+ { id: "xai/grok-4.20-non-reasoning-beta", name: "Grok 4.20 Beta Non-Reasoning", provider: "xai", contextWindow: 2000000, maxOutput: 2000000, inputPrice: 1.25, outputPrice: 2.5, cacheRead: 0.2, cacheWrite: null, tags: ["tool-use", "implicit-caching", "vision", "file-input", "web-search"], released: "2026-03-11" },
209
+ { id: "xai/grok-4.20-reasoning", name: "Grok 4.20 Reasoning", provider: "xai", contextWindow: 2000000, maxOutput: 2000000, inputPrice: 1.25, outputPrice: 2.5, cacheRead: 0.2, cacheWrite: null, tags: ["reasoning", "vision", "tool-use", "file-input", "implicit-caching", "web-search"], released: "2026-03-09" },
210
+ { id: "xai/grok-4.20-reasoning-beta", name: "Grok 4.20 Beta Reasoning", provider: "xai", contextWindow: 2000000, maxOutput: 2000000, inputPrice: 1.25, outputPrice: 2.5, cacheRead: 0.2, cacheWrite: null, tags: ["reasoning", "tool-use", "vision", "file-input", "implicit-caching", "web-search"], released: "2026-03-11" },
211
+ { id: "xai/grok-4.3", name: "Grok 4.3", provider: "xai", contextWindow: 1000000, maxOutput: 1000000, inputPrice: 1.25, outputPrice: 2.5, cacheRead: 0.2, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "file-input", "vision", "web-search"], released: "2026-04-30" },
212
+ { id: "xai/grok-code-fast-1", name: "Grok Code Fast 1", provider: "xai", contextWindow: 256000, maxOutput: 256000, inputPrice: 0.2, outputPrice: 1.5, cacheRead: 0.02, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-08-28" },
213
+ // ── xiaomi (4) ────────────────────────────────────────────
214
+ { id: "xiaomi/mimo-v2-flash", name: "MiMo V2 Flash", provider: "xiaomi", contextWindow: 262144, maxOutput: 32000, inputPrice: 0.1, outputPrice: 0.3, cacheRead: 0.01, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2025-12-17" },
215
+ { id: "xiaomi/mimo-v2-pro", name: "MiMo V2 Pro", provider: "xiaomi", contextWindow: 1000000, maxOutput: 128000, inputPrice: 1, outputPrice: 3, cacheRead: 0.2, cacheWrite: null, tags: ["reasoning", "tool-use"], released: "2026-03-18" },
216
+ { id: "xiaomi/mimo-v2.5", name: "MiMo M2.5", provider: "xiaomi", contextWindow: 1050000, maxOutput: 131100, inputPrice: 0.4, outputPrice: 2, cacheRead: 0.08, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "file-input", "vision"], released: "2026-04-22" },
217
+ { id: "xiaomi/mimo-v2.5-pro", name: "MiMo V2.5 Pro", provider: "xiaomi", contextWindow: 1050000, maxOutput: 131000, inputPrice: 1, outputPrice: 3, cacheRead: 0.2, cacheWrite: null, tags: ["reasoning", "tool-use", "vision", "file-input", "implicit-caching"], released: "2026-04-22" },
218
+ // ── zai (13) ───────────────────────────────────────────────
219
+ { id: "zai/glm-4.5", name: "GLM-4.5", provider: "zai", contextWindow: 128000, maxOutput: 96000, inputPrice: 0.6, outputPrice: 2.2, cacheRead: 0.11, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-07-28" },
220
+ { id: "zai/glm-4.5-air", name: "GLM 4.5 Air", provider: "zai", contextWindow: 128000, maxOutput: 96000, inputPrice: 0.2, outputPrice: 1.1, cacheRead: 0.03, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-07-28" },
221
+ { id: "zai/glm-4.5v", name: "GLM 4.5V", provider: "zai", contextWindow: 66000, maxOutput: 16000, inputPrice: 0.6, outputPrice: 1.8, cacheRead: 0.11, cacheWrite: null, tags: ["tool-use", "vision", "implicit-caching"], released: "2025-08-11" },
222
+ { id: "zai/glm-4.6", name: "GLM 4.6", provider: "zai", contextWindow: 200000, maxOutput: 96000, inputPrice: 0.6, outputPrice: 2.2, cacheRead: 0.11, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-09-30" },
223
+ { id: "zai/glm-4.6v", name: "GLM-4.6V", provider: "zai", contextWindow: 128000, maxOutput: 24000, inputPrice: 0.3, outputPrice: 0.9, cacheRead: 0.05, cacheWrite: null, tags: ["vision", "file-input", "reasoning", "tool-use", "implicit-caching"], released: "2025-09-30" },
224
+ { id: "zai/glm-4.6v-flash", name: "GLM-4.6V-Flash", provider: "zai", contextWindow: 128000, maxOutput: 24000, inputPrice: null, outputPrice: null, cacheRead: null, cacheWrite: null, tags: ["vision", "reasoning", "file-input", "tool-use", "implicit-caching"], released: "2025-09-30" },
225
+ { id: "zai/glm-4.7", name: "GLM 4.7", provider: "zai", contextWindow: 131000, maxOutput: 40000, inputPrice: 2.25, outputPrice: 2.75, cacheRead: 2.25, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-12-22" },
226
+ { id: "zai/glm-4.7-flash", name: "GLM 4.7 Flash", provider: "zai", contextWindow: 200000, maxOutput: 131000, inputPrice: 0.07, outputPrice: 0.4, cacheRead: null, cacheWrite: null, tags: ["reasoning", "tool-use"], released: null },
227
+ { id: "zai/glm-4.7-flashx", name: "GLM 4.7 FlashX", provider: "zai", contextWindow: 200000, maxOutput: 128000, inputPrice: 0.06, outputPrice: 0.4, cacheRead: 0.01, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2025-01-01" },
228
+ { id: "zai/glm-5", name: "GLM 5", provider: "zai", contextWindow: 202800, maxOutput: 131100, inputPrice: 1, outputPrice: 3.2, cacheRead: 0.2, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2026-02-12" },
229
+ { id: "zai/glm-5-turbo", name: "GLM 5 Turbo", provider: "zai", contextWindow: 202800, maxOutput: 131100, inputPrice: 1.2, outputPrice: 4, cacheRead: 0.24, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2026-03-15" },
230
+ { id: "zai/glm-5.1", name: "GLM 5.1", provider: "zai", contextWindow: 202800, maxOutput: 64000, inputPrice: 1.4, outputPrice: 4.4, cacheRead: 0.26, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching"], released: "2026-04-07" },
231
+ { id: "zai/glm-5v-turbo", name: "GLM 5V Turbo", provider: "zai", contextWindow: 200000, maxOutput: 128000, inputPrice: 1.2, outputPrice: 4, cacheRead: 0.24, cacheWrite: null, tags: ["reasoning", "tool-use", "implicit-caching", "vision", "file-input"], released: "2026-04-01" },
232
+ ];
233
+
234
+ // ── Lookup helpers ──────────────────────────────────────────────────────────
235
+
236
+ /** Find model by exact ID or fuzzy match (strips provider prefix, date suffixes). */
237
+ // CLI agent internal model names → catalog IDs
238
+ const MODEL_ALIASES = {
239
+ 'claude-code-opus': 'anthropic/claude-opus-4.7',
240
+ 'opus': 'anthropic/claude-opus-4.7',
241
+ 'opus1m': 'anthropic/claude-opus-4.7-1m',
242
+ 'opus[1m]': 'anthropic/claude-opus-4.7-1m',
243
+ 'claude-opus-4-7': 'anthropic/claude-opus-4.7',
244
+ 'claude-opus-4.7-1m': 'anthropic/claude-opus-4.7-1m',
245
+ 'claude-opus-4.7:1m': 'anthropic/claude-opus-4.7-1m',
246
+ 'claude-opus-4-6': 'anthropic/claude-opus-4.6',
247
+ 'claude-opus-4-5': 'anthropic/claude-opus-4.5',
248
+ 'claude-code-opus-45': 'anthropic/claude-opus-4.5',
249
+ 'claude-code-sonnet': 'anthropic/claude-sonnet-4.6',
250
+ 'claude-code-sonnet-45': 'anthropic/claude-sonnet-4.5',
251
+ 'claude-code-haiku': 'anthropic/claude-haiku-4.5',
252
+ };
253
+
254
+ function getModel(modelId) {
255
+ if (!modelId) return null;
256
+ const id = modelId.toLowerCase();
257
+
258
+ // Check aliases first (e.g. claude-code-opus -> anthropic/claude-opus-4.7)
259
+ const aliased = MODEL_ALIASES[id];
260
+ if (aliased) return MODEL_CATALOG.find(e => e.id === aliased) || null;
261
+
262
+ // Exact match
263
+ let m = MODEL_CATALOG.find(e => e.id === id);
264
+ if (m) return m;
265
+
266
+ // Strip provider prefix ('anthropic/claude-sonnet-4.6' -> 'claude-sonnet-4.6')
267
+ const bare = id.includes('/') ? id.split('/').pop() : id;
268
+ m = MODEL_CATALOG.find(e => e.id.endsWith('/' + bare));
269
+ if (m) return m;
270
+
271
+ // Normalize hyphens to dots in version numbers ('claude-sonnet-4-6' -> 'claude-sonnet-4.6')
272
+ const dotted = bare.replace(/-(\d+)-(\d+)$/, '-$1.$2')
273
+ .replace(/-(\d+)-(\d+)-/, '-$1.$2-');
274
+ if (dotted !== bare) {
275
+ m = MODEL_CATALOG.find(e => e.id.endsWith('/' + dotted));
276
+ if (m) return m;
277
+ }
278
+
279
+ // Strip date suffix ('claude-haiku-4-5-20251001' -> 'claude-haiku-4-5')
280
+ const noDate = bare.replace(/-\d{8}$/, '');
281
+ if (noDate !== bare) {
282
+ m = MODEL_CATALOG.find(e => e.id.endsWith('/' + noDate));
283
+ if (m) return m;
284
+ // Also try with dot normalization
285
+ const dottedNoDate = noDate.replace(/-(\d+)-(\d+)$/, '-$1.$2');
286
+ if (dottedNoDate !== noDate) {
287
+ m = MODEL_CATALOG.find(e => e.id.endsWith('/' + dottedNoDate));
288
+ if (m) return m;
289
+ }
290
+ }
291
+
292
+ return null;
293
+ }
294
+
295
+ /** Calculate cost in USD for a given model and token counts.
296
+ * inputTokens = non-cached input tokens (charged at inputPrice)
297
+ * cacheReadTokens = tokens served from cache (charged at cacheRead price)
298
+ * cacheWriteTokens = tokens written to cache (charged at cacheWrite price)
299
+ */
300
+ function calculateCost(modelId, inputTokens, outputTokens, cacheReadTokens = 0, cacheWriteTokens = 0) {
301
+ const m = getModel(modelId);
302
+ if (!m) return null;
303
+
304
+ let cost = 0;
305
+ if (m.inputPrice != null) cost += (inputTokens / 1_000_000) * m.inputPrice;
306
+ if (m.outputPrice != null) cost += (outputTokens / 1_000_000) * m.outputPrice;
307
+ if (m.cacheRead != null && cacheReadTokens > 0) {
308
+ cost += (cacheReadTokens / 1_000_000) * m.cacheRead;
309
+ }
310
+ if (m.cacheWrite != null && cacheWriteTokens > 0) {
311
+ cost += (cacheWriteTokens / 1_000_000) * m.cacheWrite;
312
+ }
313
+
314
+ return Math.round(cost * 1_000_000) / 1_000_000; // 6 decimal places
315
+ }
316
+
317
+ /** Get all models for a provider. */
318
+ function getModelsByProvider(provider) {
319
+ return MODEL_CATALOG.filter(m => m.provider === provider.toLowerCase());
320
+ }
321
+
322
+ /** Get list of all providers. */
323
+ function getProviders() {
324
+ return [...new Set(MODEL_CATALOG.map(m => m.provider))];
325
+ }
326
+
327
+ module.exports = { MODEL_CATALOG, getModel, calculateCost, getModelsByProvider, getProviders };
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Chat Server — shim entry point.
3
+ *
4
+ * Delegates to the modular chat-server/ directory.
5
+ * Kept for backwards compatibility with deploy scripts
6
+ * that reference `node scripts/chat-server.js` directly.
7
+ *
8
+ * If no AMALGM_PROXY_TOKEN is set, attempts to mint one from the
9
+ * admin secret before loading the server (standalone fallback).
10
+ *
11
+ * Module structure:
12
+ * chat-server/index.js — process entrypoint
13
+ * chat-server/config.js — env vars and proxy/Supabase config
14
+ * chat-server/db.js — Supabase persistence
15
+ * chat-core/ — frozen session contract, native runtime adapters, temp/raw-temp,
16
+ * SSE normalization, local egress, and usage policy
17
+ */
18
+
19
+ async function boot() {
20
+ // If no proxy token is set but we have an admin secret, mint one.
21
+ // The orchestrator (entrypoint.sh / electron/main.ts) usually provides
22
+ // the token. This is the fallback for standalone/test runs.
23
+ if (!process.env.AMALGM_PROXY_TOKEN) {
24
+ if (
25
+ process.env.AMALGM_RUNTIME_SOURCE === 'npm'
26
+ || process.env.AMALGM_LOCAL_MODE === 'true'
27
+ || process.env.AMALGM_ALLOW_ADMIN_TOKEN_MINT !== 'true'
28
+ ) {
29
+ require('./chat-server/index');
30
+ return;
31
+ }
32
+ const adminSecret = process.env.PROXY_ADMIN_SECRET || process.env.ADMIN_SECRET;
33
+ if (adminSecret) {
34
+ const proxyUrl = process.env.AMALGM_PROXY_URL || 'https://amalgm-api-proxy-v2.fly.dev';
35
+ try {
36
+ const userId = process.env.AMALGM_USER_ID || process.env.USER_ID || process.env.NEXT_PUBLIC_AMALGM_USER_ID || '';
37
+ const containerId = process.env.AMALGM_CONTAINER_ID || 'standalone';
38
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(userId)) {
39
+ console.warn('[boot] Skipping proxy token mint: AMALGM_USER_ID is required for standalone Amalgm usage');
40
+ } else {
41
+ const res = await fetch(`${proxyUrl}/internal/token`, {
42
+ method: 'POST',
43
+ headers: {
44
+ 'Content-Type': 'application/json',
45
+ 'x-admin-secret': adminSecret,
46
+ },
47
+ body: JSON.stringify({
48
+ userId,
49
+ containerId,
50
+ }),
51
+ });
52
+
53
+ if (res.ok) {
54
+ const { token } = await res.json();
55
+ process.env.AMALGM_PROXY_TOKEN = token;
56
+ if (!process.env.AMALGM_PROXY_URL) process.env.AMALGM_PROXY_URL = proxyUrl;
57
+ console.log('[boot] Minted HMAC proxy token (standalone fallback)');
58
+ } else {
59
+ const text = await res.text().catch(() => '');
60
+ console.warn(`[boot] Failed to mint proxy token: ${res.status} ${text.slice(0, 100)}`);
61
+ }
62
+ }
63
+ } catch (err) {
64
+ console.warn(`[boot] Error minting proxy token: ${err.message}`);
65
+ }
66
+ }
67
+ }
68
+
69
+ require('./chat-server/index');
70
+ }
71
+
72
+ boot().catch(err => {
73
+ console.error('[boot] Fatal:', err);
74
+ process.exit(1);
75
+ });