xonecas.io
79113
Ma

mini-coding-agent / commit cb624f6

fix: opencode api per model

xonecas2026-10-04 cb624f6d23baff7d09c41f568ff0ed728de70ce3 parent c88a430

6 files changed

.gitignore+1−0
@@ -1,3 +1,4 @@
11 .zig-cache/
22 zig-out/
33 zig-pkg/
4+__pycache__/
src/api/anthropic_messages.zig+1−1
@@ -190,7 +190,7 @@ fn buildBody(req: api.Request) ![]u8 {
190190 }
191191
192192 fn buildUrl(a: std.mem.Allocator, base: []const u8) ![]u8 {
193- return api.buildUrl(a, base, "/v1/messages");
193+ return api.buildUrl(a, base, "/messages");
194194 }
195195
196196 fn headers(a: std.mem.Allocator, req: api.Request, key: []const u8) ![]http.Header {
src/catalog.zig+130−150
@@ -1,4 +1,4 @@
1-// Generated by tools/gen_catalog.py from models.dev. Do not edit.
1+// Generated by tools/gen_catalog.py. Do not edit.
22 // Refresh with `python3 tools/gen_catalog.py`.
33
44 const std = @import("std");
@@ -7,6 +7,8 @@ pub const ModelInfo = struct {
77 provider: []const u8,
88 id: []const u8,
99 name: []const u8,
10+ api: []const u8,
11+ base_url: []const u8,
1012 images: bool,
1113 reasoning: bool,
1214 context: u64,
@@ -18,155 +20,133 @@ pub const ModelInfo = struct {
1820 };
1921
2022 pub const entries = [_]ModelInfo{
21- .{ .provider = "opencode", .id = "big-pickle", .name = "Big Pickle", .images = false, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
22- .{ .provider = "opencode", .id = "claude-3-5-haiku", .name = "Claude Haiku 3.5", .images = true, .reasoning = false, .context = 200000, .max_output = 8192, .effort = &.{}, .cost_input = 0.8, .cost_output = 4.0, .cost_cache_read = 0.08 },
23- .{ .provider = "opencode", .id = "claude-fable-5", .name = "Claude Fable 5", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 10.0, .cost_output = 50.0, .cost_cache_read = 1.0 },
24- .{ .provider = "opencode", .id = "claude-fable-5-1", .name = "Claude Fable 5.1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 10.0, .cost_output = 50.0, .cost_cache_read = 0.25 },
25- .{ .provider = "opencode", .id = "claude-haiku-4-5", .name = "Claude Haiku 4.5", .images = true, .reasoning = true, .context = 200000, .max_output = 64000, .effort = &.{}, .cost_input = 1.0, .cost_output = 5.0, .cost_cache_read = 0.1 },
26- .{ .provider = "opencode", .id = "claude-opus-4-1", .name = "Claude Opus 4.1", .images = true, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 15.0, .cost_output = 75.0, .cost_cache_read = 1.5 },
27- .{ .provider = "opencode", .id = "claude-opus-4-5", .name = "Claude Opus 4.5", .images = true, .reasoning = true, .context = 200000, .max_output = 64000, .effort = &.{ "low", "medium", "high" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
28- .{ .provider = "opencode", .id = "claude-opus-4-6", .name = "Claude Opus 4.6", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
29- .{ .provider = "opencode", .id = "claude-opus-4-7", .name = "Claude Opus 4.7", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
30- .{ .provider = "opencode", .id = "claude-opus-4-8", .name = "Claude Opus 4.8", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
31- .{ .provider = "opencode", .id = "claude-opus-5", .name = "Claude Opus 5", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
32- .{ .provider = "opencode", .id = "claude-opus-5-5", .name = "Claude Opus 5.5", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 4.0, .cost_output = 20.0, .cost_cache_read = 0.2 },
33- .{ .provider = "opencode", .id = "claude-sonnet-4", .name = "Claude Sonnet 4", .images = true, .reasoning = true, .context = 1000000, .max_output = 64000, .effort = &.{}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
34- .{ .provider = "opencode", .id = "claude-sonnet-4-5", .name = "Claude Sonnet 4.5", .images = true, .reasoning = true, .context = 1000000, .max_output = 64000, .effort = &.{}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
35- .{ .provider = "opencode", .id = "claude-sonnet-4-6", .name = "Claude Sonnet 4.6", .images = true, .reasoning = true, .context = 1000000, .max_output = 64000, .effort = &.{ "low", "medium", "high", "max" }, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
36- .{ .provider = "opencode", .id = "claude-sonnet-5", .name = "Claude Sonnet 5", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.2 },
37- .{ .provider = "opencode", .id = "claude-sonnet-5-5", .name = "Claude Sonnet 5.5", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.2 },
38- .{ .provider = "opencode", .id = "deepseek-v4-flash", .name = "DeepSeek V4 Flash", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.028 },
39- .{ .provider = "opencode", .id = "deepseek-v4-flash-free", .name = "DeepSeek V4 Flash Free", .images = false, .reasoning = true, .context = 200000, .max_output = 128000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
40- .{ .provider = "opencode", .id = "deepseek-v4-flash-vision-exp", .name = "DeepSeek V4 Flash Vision Exp", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.028 },
41- .{ .provider = "opencode", .id = "deepseek-v4-pro", .name = "DeepSeek V4 Pro", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "high", "max" }, .cost_input = 1.74, .cost_output = 3.84, .cost_cache_read = 0.145 },
42- .{ .provider = "opencode", .id = "deepseek-v4.1-flash", .name = "DeepSeek V4.1 Flash", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.006 },
43- .{ .provider = "opencode", .id = "fledge-alpha-free", .name = "Fledge Alpha Free", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
44- .{ .provider = "opencode", .id = "gemini-3-flash", .name = "Gemini 3 Flash", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 0.5, .cost_output = 3.0, .cost_cache_read = 0.05 },
45- .{ .provider = "opencode", .id = "gemini-3-pro", .name = "Gemini 3 Pro", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "high" }, .cost_input = 2.0, .cost_output = 12.0, .cost_cache_read = 0.2 },
46- .{ .provider = "opencode", .id = "gemini-3.1-pro", .name = "Gemini 3.1 Pro Preview", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 2.0, .cost_output = 12.0, .cost_cache_read = 0.2 },
47- .{ .provider = "opencode", .id = "gemini-3.5-flash", .name = "Gemini 3.5 Flash", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 9.0, .cost_cache_read = 0.15 },
48- .{ .provider = "opencode", .id = "gemini-3.5-flash-lite", .name = "Gemini 3.5 Flash Lite", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 0.3, .cost_output = 2.5, .cost_cache_read = 0.03 },
49- .{ .provider = "opencode", .id = "gemini-3.6-flash", .name = "Gemini 3.6 Flash", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 7.5, .cost_cache_read = 0.15 },
50- .{ .provider = "opencode", .id = "gemini-3.7-flash", .name = "Gemini 3.7 Flash", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 7.5, .cost_cache_read = 0.15 },
51- .{ .provider = "opencode", .id = "gemini-3.8-flash", .name = "Gemini 3.8 Flash", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 7.5, .cost_cache_read = 0.15 },
52- .{ .provider = "opencode", .id = "glm-4.6", .name = "GLM-4.6", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.6, .cost_output = 2.2, .cost_cache_read = 0.1 },
53- .{ .provider = "opencode", .id = "glm-4.7", .name = "GLM-4.7", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.6, .cost_output = 2.2, .cost_cache_read = 0.1 },
54- .{ .provider = "opencode", .id = "glm-4.7-free", .name = "GLM-4.7 Free", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
55- .{ .provider = "opencode", .id = "glm-5", .name = "GLM-5", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 1.0, .cost_output = 3.2, .cost_cache_read = 0.2 },
56- .{ .provider = "opencode", .id = "glm-5-free", .name = "GLM-5 Free", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
57- .{ .provider = "opencode", .id = "glm-5.1", .name = "GLM-5.1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
58- .{ .provider = "opencode", .id = "glm-5.2", .name = "GLM-5.2", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
59- .{ .provider = "opencode", .id = "glm-5.3", .name = "GLM-5.3", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
60- .{ .provider = "opencode", .id = "glm-5.3-flash", .name = "GLM-5.3-Flash", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.5, .cost_cache_read = 0.03 },
61- .{ .provider = "opencode", .id = "gpt-5", .name = "GPT-5", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
62- .{ .provider = "opencode", .id = "gpt-5-codex", .name = "GPT-5 Codex", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
63- .{ .provider = "opencode", .id = "gpt-5-nano", .name = "GPT-5 Nano", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 0.05, .cost_output = 0.4, .cost_cache_read = 0.005 },
64- .{ .provider = "opencode", .id = "gpt-5.1", .name = "GPT-5.1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
65- .{ .provider = "opencode", .id = "gpt-5.1-codex", .name = "GPT-5.1 Codex", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
66- .{ .provider = "opencode", .id = "gpt-5.1-codex-max", .name = "GPT-5.1 Codex Max", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 1.25, .cost_output = 10.0, .cost_cache_read = 0.125 },
67- .{ .provider = "opencode", .id = "gpt-5.1-codex-mini", .name = "GPT-5.1 Codex Mini", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high" }, .cost_input = 0.25, .cost_output = 2.0, .cost_cache_read = 0.025 },
68- .{ .provider = "opencode", .id = "gpt-5.2", .name = "GPT-5.2", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
69- .{ .provider = "opencode", .id = "gpt-5.2-codex", .name = "GPT-5.2 Codex", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
70- .{ .provider = "opencode", .id = "gpt-5.3-codex", .name = "GPT-5.3 Codex", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
71- .{ .provider = "opencode", .id = "gpt-5.3-codex-spark", .name = "GPT-5.3 Codex Spark", .images = false, .reasoning = true, .context = 128000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
72- .{ .provider = "opencode", .id = "gpt-5.4", .name = "GPT-5.4", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 2.5, .cost_output = 15.0, .cost_cache_read = 0.25 },
73- .{ .provider = "opencode", .id = "gpt-5.4-mini", .name = "GPT-5.4 Mini", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 0.75, .cost_output = 4.5, .cost_cache_read = 0.075 },
74- .{ .provider = "opencode", .id = "gpt-5.4-nano", .name = "GPT-5.4 Nano", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 0.2, .cost_output = 1.25, .cost_cache_read = 0.02 },
75- .{ .provider = "opencode", .id = "gpt-5.4-pro", .name = "GPT-5.4 Pro", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "medium", "high", "xhigh" }, .cost_input = 30.0, .cost_output = 180.0, .cost_cache_read = 30.0 },
76- .{ .provider = "opencode", .id = "gpt-5.5", .name = "GPT-5.5", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 5.0, .cost_output = 30.0, .cost_cache_read = 0.5 },
77- .{ .provider = "opencode", .id = "gpt-5.5-pro", .name = "GPT-5.5 Pro", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "medium", "high", "xhigh" }, .cost_input = 30.0, .cost_output = 180.0, .cost_cache_read = 30.0 },
78- .{ .provider = "opencode", .id = "gpt-5.6-luna", .name = "GPT-5.6 Luna", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.2, .cost_output = 1.2, .cost_cache_read = 0.02 },
79- .{ .provider = "opencode", .id = "gpt-5.6-sol", .name = "GPT-5.6 Sol", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 4.0, .cost_output = 20.0, .cost_cache_read = 0.4 },
80- .{ .provider = "opencode", .id = "gpt-5.6-terra", .name = "GPT-5.6 Terra", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.5, .cost_output = 15.0, .cost_cache_read = 0.25 },
81- .{ .provider = "opencode", .id = "gpt-6-astra", .name = "GPT-6 Astra", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 10.0, .cost_output = 50.0, .cost_cache_read = 1.0 },
82- .{ .provider = "opencode", .id = "gpt-6-luna", .name = "GPT-6 Luna", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.1, .cost_output = 0.5, .cost_cache_read = 0.01 },
83- .{ .provider = "opencode", .id = "gpt-6-sol", .name = "GPT-6 Sol", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.2 },
84- .{ .provider = "opencode", .id = "gpt-6.1-sol", .name = "GPT-6.1 Sol", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.1 },
85- .{ .provider = "opencode", .id = "grok-4.5", .name = "Grok 4.5", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.3 },
86- .{ .provider = "opencode", .id = "grok-4.6", .name = "Grok 4.6", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
87- .{ .provider = "opencode", .id = "grok-4.7", .name = "Grok 4.7", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
88- .{ .provider = "opencode", .id = "grok-build-0.1", .name = "Grok Build 0.1", .images = true, .reasoning = true, .context = 256000, .max_output = 256000, .effort = &.{}, .cost_input = 1.0, .cost_output = 2.0, .cost_cache_read = 0.2 },
89- .{ .provider = "opencode", .id = "grok-code", .name = "Grok Code Fast 1", .images = false, .reasoning = true, .context = 256000, .max_output = 256000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
90- .{ .provider = "opencode", .id = "hy3-free", .name = "Hy3 Free", .images = false, .reasoning = true, .context = 190000, .max_output = 64000, .effort = &.{ "low", "medium", "high" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
91- .{ .provider = "opencode", .id = "hy3-preview-free", .name = "Hy3 preview Free", .images = false, .reasoning = true, .context = 256000, .max_output = 64000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
92- .{ .provider = "opencode", .id = "kimi-k2", .name = "Kimi K2", .images = false, .reasoning = false, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.4, .cost_output = 2.5, .cost_cache_read = 0.4 },
93- .{ .provider = "opencode", .id = "kimi-k2-thinking", .name = "Kimi K2 Thinking", .images = false, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.4, .cost_output = 2.5, .cost_cache_read = 0.4 },
94- .{ .provider = "opencode", .id = "kimi-k2.5", .name = "Kimi K2.5", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.6, .cost_output = 3.0, .cost_cache_read = 0.08 },
95- .{ .provider = "opencode", .id = "kimi-k2.5-free", .name = "Kimi K2.5 Free", .images = true, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
96- .{ .provider = "opencode", .id = "kimi-k2.6", .name = "Kimi K2.6", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.16 },
97- .{ .provider = "opencode", .id = "kimi-k2.7-code", .name = "Kimi K2.7 Code", .images = true, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.19 },
98- .{ .provider = "opencode", .id = "kimi-k3", .name = "Kimi K3", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{"max"}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
99- .{ .provider = "opencode", .id = "laguna-s-2.1-free", .name = "Laguna S 2.1 Free", .images = false, .reasoning = true, .context = 256000, .max_output = 32000, .effort = &.{ "low", "medium", "high" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
100- .{ .provider = "opencode", .id = "ling-2.6-flash-free", .name = "Ling 2.6 Flash Free", .images = false, .reasoning = false, .context = 262100, .max_output = 32800, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
101- .{ .provider = "opencode", .id = "ling-3.0-flash-fin-free", .name = "Ling 3.0 Flash Fin Free", .images = false, .reasoning = true, .context = 262144, .max_output = 32768, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
102- .{ .provider = "opencode", .id = "ling-3.0-flash-free", .name = "Ling-3.0-flash Free", .images = false, .reasoning = true, .context = 262144, .max_output = 32768, .effort = &.{ "low", "medium", "high" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
103- .{ .provider = "opencode", .id = "ling-3.0-tiny-free", .name = "Ling-3.0-tiny Free", .images = false, .reasoning = true, .context = 262144, .max_output = 32768, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
104- .{ .provider = "opencode", .id = "ling-3.1-flash-free", .name = "Ling 3.1 Flash Free", .images = false, .reasoning = true, .context = 262144, .max_output = 32768, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
105- .{ .provider = "opencode", .id = "longcat-2.0-free", .name = "LongCat-2.0 Free", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
106- .{ .provider = "opencode", .id = "longcat-2.5-preview-free", .name = "LongCat 2.5 Preview Free", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
107- .{ .provider = "opencode", .id = "mimo-v2-flash-free", .name = "MiMo V2 Flash Free", .images = false, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
108- .{ .provider = "opencode", .id = "mimo-v2-omni-free", .name = "MiMo V2 Omni Free", .images = true, .reasoning = true, .context = 262144, .max_output = 64000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
109- .{ .provider = "opencode", .id = "mimo-v2-pro-free", .name = "MiMo V2 Pro Free", .images = true, .reasoning = true, .context = 1048576, .max_output = 64000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
110- .{ .provider = "opencode", .id = "mimo-v2.5-free", .name = "MiMo V2.5 Free", .images = true, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
111- .{ .provider = "opencode", .id = "mimo-v2.6-flash-free", .name = "MiMo-V2.6-Flash Free", .images = true, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
112- .{ .provider = "opencode", .id = "minimax-m2.1", .name = "MiniMax-M2.1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.1 },
113- .{ .provider = "opencode", .id = "minimax-m2.1-free", .name = "MiniMax-M2.1 Free", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
114- .{ .provider = "opencode", .id = "minimax-m2.5", .name = "MiniMax-M2.5", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
115- .{ .provider = "opencode", .id = "minimax-m2.5-free", .name = "MiniMax-M2.5 Free", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
116- .{ .provider = "opencode", .id = "minimax-m2.7", .name = "MiniMax-M2.7", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
117- .{ .provider = "opencode", .id = "minimax-m3", .name = "MiniMax-M3", .images = true, .reasoning = true, .context = 512000, .max_output = 128000, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
118- .{ .provider = "opencode", .id = "minimax-m3-free", .name = "MiniMax-M3 Free", .images = false, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
119- .{ .provider = "opencode", .id = "muse-spark-1.2", .name = "Muse Spark 1.2", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 1.25, .cost_output = 4.25, .cost_cache_read = 0.15 },
120- .{ .provider = "opencode", .id = "muse-spark-1.2-contributor-free", .name = "Muse Spark 1.2 Free", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
121- .{ .provider = "opencode", .id = "muse-spark-1.3", .name = "Muse Spark 1.3", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 1.25, .cost_output = 4.25, .cost_cache_read = 0.15 },
122- .{ .provider = "opencode", .id = "muse-spark-1.3-contributor-free", .name = "Muse Spark 1.3 Free", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
123- .{ .provider = "opencode", .id = "nemotron-3-super-free", .name = "Nemotron 3 Super Free", .images = false, .reasoning = true, .context = 204800, .max_output = 128000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
124- .{ .provider = "opencode", .id = "nemotron-3-ultra-free", .name = "Nemotron 3 Ultra Free", .images = false, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
125- .{ .provider = "opencode", .id = "nemotron-3.5-lightning-free", .name = "Nemotron 3.5 Lightning Free", .images = false, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
126- .{ .provider = "opencode", .id = "north-mini-code-free", .name = "North Mini Code Free", .images = false, .reasoning = true, .context = 256000, .max_output = 64000, .effort = &.{ "none", "high" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
127- .{ .provider = "opencode", .id = "qwen3-coder", .name = "Qwen3 Coder", .images = false, .reasoning = false, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.45, .cost_output = 1.8, .cost_cache_read = 0.0 },
128- .{ .provider = "opencode", .id = "qwen3.5-plus", .name = "Qwen3.5 Plus", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.2, .cost_output = 1.2, .cost_cache_read = 0.02 },
129- .{ .provider = "opencode", .id = "qwen3.6-plus", .name = "Qwen3.6 Plus", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.5, .cost_output = 3.0, .cost_cache_read = 0.05 },
130- .{ .provider = "opencode", .id = "qwen3.6-plus-free", .name = "Qwen3.6 Plus Free", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
131- .{ .provider = "opencode", .id = "qwen3.8-flash", .name = "Qwen3.8 Flash", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "medium", "xhigh" }, .cost_input = 0.15, .cost_output = 0.47, .cost_cache_read = 0.016 },
132- .{ .provider = "opencode", .id = "qwen3.8-max", .name = "Qwen3.8 Max", .images = true, .reasoning = true, .context = 262144, .max_output = 131072, .effort = &.{}, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.25 },
133- .{ .provider = "opencode", .id = "ring-2.6-1t-free", .name = "Ring 2.6 1T Free", .images = false, .reasoning = true, .context = 262000, .max_output = 66000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
134- .{ .provider = "opencode", .id = "space-bunny-free", .name = "Space Bunny Free", .images = true, .reasoning = true, .context = 1048576, .max_output = 524288, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
135- .{ .provider = "opencode", .id = "trinity-large-preview-free", .name = "Trinity Large Preview", .images = false, .reasoning = false, .context = 131072, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
136- .{ .provider = "opencode", .id = "x-preview-f-free", .name = "Ox Alpha Free (Unlimited)", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
137- .{ .provider = "opencode-go", .id = "deepseek-v4-flash", .name = "DeepSeek V4 Flash", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.003 },
138- .{ .provider = "opencode-go", .id = "deepseek-v4-flash-vision-exp", .name = "DeepSeek V4 Flash Vision Exp", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.003 },
139- .{ .provider = "opencode-go", .id = "deepseek-v4-pro", .name = "DeepSeek V4 Pro (New)", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "high", "max" }, .cost_input = 0.66, .cost_output = 1.98, .cost_cache_read = 0.022 },
140- .{ .provider = "opencode-go", .id = "deepseek-v4.1-flash", .name = "DeepSeek V4.1 Flash", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.003 },
141- .{ .provider = "opencode-go", .id = "glm-5.2", .name = "GLM-5.2", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
142- .{ .provider = "opencode-go", .id = "glm-5.3", .name = "GLM-5.3", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
143- .{ .provider = "opencode-go", .id = "glm-5.3-flash", .name = "GLM-5.3-Flash", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.5, .cost_cache_read = 0.03 },
144- .{ .provider = "opencode-go", .id = "gpt-5.6-luna", .name = "GPT-5.6 Luna", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.2, .cost_output = 1.2, .cost_cache_read = 0.02 },
145- .{ .provider = "opencode-go", .id = "gpt-6-luna", .name = "GPT-6 Luna", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.1, .cost_output = 0.5, .cost_cache_read = 0.01 },
146- .{ .provider = "opencode-go", .id = "grok-4.5", .name = "Grok 4.5", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.3 },
147- .{ .provider = "opencode-go", .id = "grok-4.6", .name = "Grok 4.6", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
148- .{ .provider = "opencode-go", .id = "grok-4.7", .name = "Grok 4.7", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
149- .{ .provider = "opencode-go", .id = "hy3", .name = "Hy3", .images = false, .reasoning = true, .context = 256000, .max_output = 128000, .effort = &.{ "none", "low", "high" }, .cost_input = 0.14, .cost_output = 0.58, .cost_cache_read = 0.035 },
150- .{ .provider = "opencode-go", .id = "hy4-preview", .name = "Hy4 preview", .images = false, .reasoning = true, .context = 1024000, .max_output = 64000, .effort = &.{ "none", "high" }, .cost_input = 0.834, .cost_output = 2.501, .cost_cache_read = 0.042 },
151- .{ .provider = "opencode-go", .id = "kimi-k2.6", .name = "Kimi K2.6", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.16 },
152- .{ .provider = "opencode-go", .id = "kimi-k2.7-code", .name = "Kimi K2.7 Code", .images = true, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.19 },
153- .{ .provider = "opencode-go", .id = "kimi-k3", .name = "Kimi K3", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{"max"}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
154- .{ .provider = "opencode-go", .id = "longcat-2.0", .name = "LongCat-2.0", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.006 },
155- .{ .provider = "opencode-go", .id = "longcat-2.5-preview-free", .name = "LongCat 2.5 Preview Free", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
156- .{ .provider = "opencode-go", .id = "mimo-v2.5", .name = "MiMo V2.5", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{}, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.0028 },
157- .{ .provider = "opencode-go", .id = "mimo-v2.5-pro", .name = "MiMo V2.5 Pro", .images = true, .reasoning = true, .context = 1048576, .max_output = 128000, .effort = &.{}, .cost_input = 0.435, .cost_output = 0.87, .cost_cache_read = 0.003625 },
158- .{ .provider = "opencode-go", .id = "mimo-v2.6-flash", .name = "MiMo-V2.6-Flash", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{}, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.0028 },
159- .{ .provider = "opencode-go", .id = "mimo-v2.6-pro", .name = "MiMo-V2.6-Pro", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{}, .cost_input = 0.435, .cost_output = 0.87, .cost_cache_read = 0.003625 },
160- .{ .provider = "opencode-go", .id = "minimax-m2.7", .name = "MiniMax-M2.7", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
161- .{ .provider = "opencode-go", .id = "minimax-m3", .name = "MiniMax-M3", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
162- .{ .provider = "opencode-go", .id = "muse-spark-1.2-contributor", .name = "Muse Spark 1.2 Contributor", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.1, .cost_output = 0.2, .cost_cache_read = 0.002 },
163- .{ .provider = "opencode-go", .id = "muse-spark-1.3-contributor", .name = "Muse Spark 1.3 Contributor", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.1, .cost_output = 0.2, .cost_cache_read = 0.002 },
164- .{ .provider = "opencode-go", .id = "qwen3.6-plus", .name = "Qwen3.6 Plus", .images = true, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{}, .cost_input = 0.5, .cost_output = 3.0, .cost_cache_read = 0.05 },
165- .{ .provider = "opencode-go", .id = "qwen3.7-max", .name = "Qwen3.7 Max", .images = false, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{}, .cost_input = 2.5, .cost_output = 7.5, .cost_cache_read = 0.5 },
166- .{ .provider = "opencode-go", .id = "qwen3.7-plus", .name = "Qwen3.7 Plus", .images = true, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{}, .cost_input = 0.4, .cost_output = 1.6, .cost_cache_read = 0.04 },
167- .{ .provider = "opencode-go", .id = "qwen3.8-flash", .name = "Qwen3.8 Flash", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "medium", "xhigh" }, .cost_input = 0.15, .cost_output = 0.47, .cost_cache_read = 0.016 },
168- .{ .provider = "opencode-go", .id = "qwen3.8-max", .name = "Qwen3.8 Max", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "medium", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.25 },
169- .{ .provider = "opencode-go", .id = "space-bunny-free", .name = "Space Bunny Free", .images = true, .reasoning = true, .context = 1048576, .max_output = 524288, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
23+ .{ .provider = "opencode", .id = "big-pickle", .name = "Big Pickle", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
24+ .{ .provider = "opencode", .id = "claude-fable-5", .name = "Claude Fable 5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 10.0, .cost_output = 50.0, .cost_cache_read = 1.0 },
25+ .{ .provider = "opencode", .id = "claude-fable-5-1", .name = "Claude Fable 5.1", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 10.0, .cost_output = 50.0, .cost_cache_read = 0.25 },
26+ .{ .provider = "opencode", .id = "claude-haiku-4-5", .name = "Claude Haiku 4.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 200000, .max_output = 64000, .effort = &.{}, .cost_input = 1.0, .cost_output = 5.0, .cost_cache_read = 0.1 },
27+ .{ .provider = "opencode", .id = "claude-opus-4-5", .name = "Claude Opus 4.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 200000, .max_output = 64000, .effort = &.{ "low", "medium", "high" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
28+ .{ .provider = "opencode", .id = "claude-opus-4-6", .name = "Claude Opus 4.6", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
29+ .{ .provider = "opencode", .id = "claude-opus-4-7", .name = "Claude Opus 4.7", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
30+ .{ .provider = "opencode", .id = "claude-opus-4-8", .name = "Claude Opus 4.8", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
31+ .{ .provider = "opencode", .id = "claude-opus-5", .name = "Claude Opus 5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
32+ .{ .provider = "opencode", .id = "claude-opus-5-5", .name = "Claude Opus 5.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 4.0, .cost_output = 20.0, .cost_cache_read = 0.2 },
33+ .{ .provider = "opencode", .id = "claude-sonnet-4", .name = "Claude Sonnet 4", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 64000, .effort = &.{}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
34+ .{ .provider = "opencode", .id = "claude-sonnet-4-5", .name = "Claude Sonnet 4.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 64000, .effort = &.{}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
35+ .{ .provider = "opencode", .id = "claude-sonnet-4-6", .name = "Claude Sonnet 4.6", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 64000, .effort = &.{ "low", "medium", "high", "max" }, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
36+ .{ .provider = "opencode", .id = "claude-sonnet-5", .name = "Claude Sonnet 5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.2 },
37+ .{ .provider = "opencode", .id = "claude-sonnet-5-5", .name = "Claude Sonnet 5.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.2 },
38+ .{ .provider = "opencode", .id = "deepseek-v4-flash", .name = "DeepSeek V4 Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.028 },
39+ .{ .provider = "opencode", .id = "deepseek-v4-flash-free", .name = "DeepSeek V4 Flash Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 200000, .max_output = 128000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
40+ .{ .provider = "opencode", .id = "deepseek-v4-flash-vision-exp", .name = "DeepSeek V4 Flash Vision Exp", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.028 },
41+ .{ .provider = "opencode", .id = "deepseek-v4-pro", .name = "DeepSeek V4 Pro", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "high", "max" }, .cost_input = 1.74, .cost_output = 3.84, .cost_cache_read = 0.145 },
42+ .{ .provider = "opencode", .id = "deepseek-v4.1-flash", .name = "DeepSeek V4.1 Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.006 },
43+ .{ .provider = "opencode", .id = "fledge-alpha-free", .name = "Fledge Alpha Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
44+ .{ .provider = "opencode", .id = "gemini-3-flash", .name = "Gemini 3 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 0.5, .cost_output = 3.0, .cost_cache_read = 0.05 },
45+ .{ .provider = "opencode", .id = "gemini-3.1-pro", .name = "Gemini 3.1 Pro Preview", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 2.0, .cost_output = 12.0, .cost_cache_read = 0.2 },
46+ .{ .provider = "opencode", .id = "gemini-3.5-flash", .name = "Gemini 3.5 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 9.0, .cost_cache_read = 0.15 },
47+ .{ .provider = "opencode", .id = "gemini-3.5-flash-lite", .name = "Gemini 3.5 Flash Lite", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 0.3, .cost_output = 2.5, .cost_cache_read = 0.03 },
48+ .{ .provider = "opencode", .id = "gemini-3.6-flash", .name = "Gemini 3.6 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 7.5, .cost_cache_read = 0.15 },
49+ .{ .provider = "opencode", .id = "gemini-3.7-flash", .name = "Gemini 3.7 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 7.5, .cost_cache_read = 0.15 },
50+ .{ .provider = "opencode", .id = "gemini-3.8-flash", .name = "Gemini 3.8 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 7.5, .cost_cache_read = 0.15 },
51+ .{ .provider = "opencode", .id = "glm-5", .name = "GLM-5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 1.0, .cost_output = 3.2, .cost_cache_read = 0.2 },
52+ .{ .provider = "opencode", .id = "glm-5.1", .name = "GLM-5.1", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
53+ .{ .provider = "opencode", .id = "glm-5.2", .name = "GLM-5.2", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
54+ .{ .provider = "opencode", .id = "glm-5.3", .name = "GLM-5.3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
55+ .{ .provider = "opencode", .id = "glm-5.3-flash", .name = "GLM-5.3-Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.5, .cost_cache_read = 0.03 },
56+ .{ .provider = "opencode", .id = "gpt-5", .name = "GPT-5", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
57+ .{ .provider = "opencode", .id = "gpt-5-codex", .name = "GPT-5 Codex", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
58+ .{ .provider = "opencode", .id = "gpt-5-nano", .name = "GPT-5 Nano", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 0.05, .cost_output = 0.4, .cost_cache_read = 0.005 },
59+ .{ .provider = "opencode", .id = "gpt-5.1", .name = "GPT-5.1", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
60+ .{ .provider = "opencode", .id = "gpt-5.1-codex", .name = "GPT-5.1 Codex", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
61+ .{ .provider = "opencode", .id = "gpt-5.1-codex-max", .name = "GPT-5.1 Codex Max", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 1.25, .cost_output = 10.0, .cost_cache_read = 0.125 },
62+ .{ .provider = "opencode", .id = "gpt-5.1-codex-mini", .name = "GPT-5.1 Codex Mini", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high" }, .cost_input = 0.25, .cost_output = 2.0, .cost_cache_read = 0.025 },
63+ .{ .provider = "opencode", .id = "gpt-5.2", .name = "GPT-5.2", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
64+ .{ .provider = "opencode", .id = "gpt-5.2-codex", .name = "GPT-5.2 Codex", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
65+ .{ .provider = "opencode", .id = "gpt-5.3-codex", .name = "GPT-5.3 Codex", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
66+ .{ .provider = "opencode", .id = "gpt-5.3-codex-spark", .name = "GPT-5.3 Codex Spark", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 128000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
67+ .{ .provider = "opencode", .id = "gpt-5.4", .name = "GPT-5.4", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 2.5, .cost_output = 15.0, .cost_cache_read = 0.25 },
68+ .{ .provider = "opencode", .id = "gpt-5.4-mini", .name = "GPT-5.4 Mini", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 0.75, .cost_output = 4.5, .cost_cache_read = 0.075 },
69+ .{ .provider = "opencode", .id = "gpt-5.4-nano", .name = "GPT-5.4 Nano", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 0.2, .cost_output = 1.25, .cost_cache_read = 0.02 },
70+ .{ .provider = "opencode", .id = "gpt-5.4-pro", .name = "GPT-5.4 Pro", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "medium", "high", "xhigh" }, .cost_input = 30.0, .cost_output = 180.0, .cost_cache_read = 30.0 },
71+ .{ .provider = "opencode", .id = "gpt-5.5", .name = "GPT-5.5", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 5.0, .cost_output = 30.0, .cost_cache_read = 0.5 },
72+ .{ .provider = "opencode", .id = "gpt-5.5-pro", .name = "GPT-5.5 Pro", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "medium", "high", "xhigh" }, .cost_input = 30.0, .cost_output = 180.0, .cost_cache_read = 30.0 },
73+ .{ .provider = "opencode", .id = "gpt-5.6-luna", .name = "GPT-5.6 Luna", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.2, .cost_output = 1.2, .cost_cache_read = 0.02 },
74+ .{ .provider = "opencode", .id = "gpt-5.6-sol", .name = "GPT-5.6 Sol", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 4.0, .cost_output = 20.0, .cost_cache_read = 0.4 },
75+ .{ .provider = "opencode", .id = "gpt-5.6-terra", .name = "GPT-5.6 Terra", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.5, .cost_output = 15.0, .cost_cache_read = 0.25 },
76+ .{ .provider = "opencode", .id = "gpt-6-astra", .name = "GPT-6 Astra", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 10.0, .cost_output = 50.0, .cost_cache_read = 1.0 },
77+ .{ .provider = "opencode", .id = "gpt-6-luna", .name = "GPT-6 Luna", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.1, .cost_output = 0.5, .cost_cache_read = 0.01 },
78+ .{ .provider = "opencode", .id = "gpt-6-sol", .name = "GPT-6 Sol", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.2 },
79+ .{ .provider = "opencode", .id = "gpt-6.1-sol", .name = "GPT-6.1 Sol", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.1 },
80+ .{ .provider = "opencode", .id = "grok-4.5", .name = "Grok 4.5", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.3 },
81+ .{ .provider = "opencode", .id = "grok-4.6", .name = "Grok 4.6", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
82+ .{ .provider = "opencode", .id = "grok-4.7", .name = "Grok 4.7", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
83+ .{ .provider = "opencode", .id = "grok-build-0.1", .name = "Grok Build 0.1", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 256000, .max_output = 256000, .effort = &.{}, .cost_input = 1.0, .cost_output = 2.0, .cost_cache_read = 0.2 },
84+ .{ .provider = "opencode", .id = "kimi-k2.5", .name = "Kimi K2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.6, .cost_output = 3.0, .cost_cache_read = 0.08 },
85+ .{ .provider = "opencode", .id = "kimi-k2.6", .name = "Kimi K2.6", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.16 },
86+ .{ .provider = "opencode", .id = "kimi-k2.7-code", .name = "Kimi K2.7 Code", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.19 },
87+ .{ .provider = "opencode", .id = "kimi-k3", .name = "Kimi K3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{"max"}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
88+ .{ .provider = "opencode", .id = "ling-3.0-flash-fin-free", .name = "Ling 3.0 Flash Fin Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 262144, .max_output = 32768, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
89+ .{ .provider = "opencode", .id = "ling-3.1-flash-free", .name = "Ling 3.1 Flash Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 262144, .max_output = 32768, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
90+ .{ .provider = "opencode", .id = "longcat-2.5-preview-free", .name = "LongCat 2.5 Preview Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
91+ .{ .provider = "opencode", .id = "mimo-v2.5-free", .name = "MiMo V2.5 Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
92+ .{ .provider = "opencode", .id = "mimo-v2.6-flash-free", .name = "MiMo-V2.6-Flash Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
93+ .{ .provider = "opencode", .id = "minimax-m2.5", .name = "MiniMax-M2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
94+ .{ .provider = "opencode", .id = "minimax-m2.7", .name = "MiniMax-M2.7", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
95+ .{ .provider = "opencode", .id = "minimax-m3", .name = "MiniMax-M3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 512000, .max_output = 128000, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
96+ .{ .provider = "opencode", .id = "muse-spark-1.2", .name = "Muse Spark 1.2", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 1.25, .cost_output = 4.25, .cost_cache_read = 0.15 },
97+ .{ .provider = "opencode", .id = "muse-spark-1.2-contributor-free", .name = "Muse Spark 1.2 Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
98+ .{ .provider = "opencode", .id = "muse-spark-1.3", .name = "Muse Spark 1.3", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 1.25, .cost_output = 4.25, .cost_cache_read = 0.15 },
99+ .{ .provider = "opencode", .id = "muse-spark-1.3-contributor-free", .name = "Muse Spark 1.3 Free", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
100+ .{ .provider = "opencode", .id = "nemotron-3-ultra-free", .name = "Nemotron 3 Ultra Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
101+ .{ .provider = "opencode", .id = "nemotron-3.5-lightning-free", .name = "Nemotron 3.5 Lightning Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
102+ .{ .provider = "opencode", .id = "qwen3.5-plus", .name = "Qwen3.5 Plus", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.2, .cost_output = 1.2, .cost_cache_read = 0.02 },
103+ .{ .provider = "opencode", .id = "qwen3.6-plus", .name = "Qwen3.6 Plus", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.5, .cost_output = 3.0, .cost_cache_read = 0.05 },
104+ .{ .provider = "opencode", .id = "qwen3.8-flash", .name = "Qwen3.8 Flash", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "medium", "xhigh" }, .cost_input = 0.15, .cost_output = 0.47, .cost_cache_read = 0.016 },
105+ .{ .provider = "opencode", .id = "qwen3.8-max", .name = "Qwen3.8 Max", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 131072, .effort = &.{}, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.25 },
106+ .{ .provider = "opencode", .id = "space-bunny-free", .name = "Space Bunny Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 524288, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
107+ .{ .provider = "opencode-go", .id = "deepseek-flash", .name = "deepseek-flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
108+ .{ .provider = "opencode-go", .id = "deepseek-v4-flash", .name = "DeepSeek V4 Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.003 },
109+ .{ .provider = "opencode-go", .id = "deepseek-v4-flash-vision-exp", .name = "DeepSeek V4 Flash Vision Exp", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.003 },
110+ .{ .provider = "opencode-go", .id = "deepseek-v4-pro", .name = "DeepSeek V4 Pro (New)", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "high", "max" }, .cost_input = 0.66, .cost_output = 1.98, .cost_cache_read = 0.022 },
111+ .{ .provider = "opencode-go", .id = "deepseek-v4.1-flash", .name = "DeepSeek V4.1 Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.003 },
112+ .{ .provider = "opencode-go", .id = "glm-5", .name = "glm-5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
113+ .{ .provider = "opencode-go", .id = "glm-5.1", .name = "glm-5.1", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
114+ .{ .provider = "opencode-go", .id = "glm-5.2", .name = "GLM-5.2", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
115+ .{ .provider = "opencode-go", .id = "glm-5.3", .name = "GLM-5.3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
116+ .{ .provider = "opencode-go", .id = "glm-5.3-flash", .name = "GLM-5.3-Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.5, .cost_cache_read = 0.03 },
117+ .{ .provider = "opencode-go", .id = "gpt-5.6-luna", .name = "GPT-5.6 Luna", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.2, .cost_output = 1.2, .cost_cache_read = 0.02 },
118+ .{ .provider = "opencode-go", .id = "gpt-6-luna", .name = "GPT-6 Luna", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.1, .cost_output = 0.5, .cost_cache_read = 0.01 },
119+ .{ .provider = "opencode-go", .id = "grok-4.5", .name = "Grok 4.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.3 },
120+ .{ .provider = "opencode-go", .id = "grok-4.6", .name = "Grok 4.6", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
121+ .{ .provider = "opencode-go", .id = "grok-4.7", .name = "Grok 4.7", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
122+ .{ .provider = "opencode-go", .id = "hy3", .name = "Hy3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 256000, .max_output = 128000, .effort = &.{ "none", "low", "high" }, .cost_input = 0.14, .cost_output = 0.58, .cost_cache_read = 0.035 },
123+ .{ .provider = "opencode-go", .id = "hy3-preview", .name = "hy3-preview", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
124+ .{ .provider = "opencode-go", .id = "hy4-preview", .name = "Hy4 preview", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1024000, .max_output = 64000, .effort = &.{ "none", "high" }, .cost_input = 0.834, .cost_output = 2.501, .cost_cache_read = 0.042 },
125+ .{ .provider = "opencode-go", .id = "kimi-k2.5", .name = "kimi-k2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
126+ .{ .provider = "opencode-go", .id = "kimi-k2.6", .name = "Kimi K2.6", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.16 },
127+ .{ .provider = "opencode-go", .id = "kimi-k2.7-code", .name = "Kimi K2.7 Code", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.19 },
128+ .{ .provider = "opencode-go", .id = "kimi-k3", .name = "Kimi K3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{"max"}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
129+ .{ .provider = "opencode-go", .id = "longcat-2.0", .name = "LongCat-2.0", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.006 },
130+ .{ .provider = "opencode-go", .id = "longcat-2.5-preview-free", .name = "LongCat 2.5 Preview Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
131+ .{ .provider = "opencode-go", .id = "mimo-v2-omni", .name = "mimo-v2-omni", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
132+ .{ .provider = "opencode-go", .id = "mimo-v2-pro", .name = "mimo-v2-pro", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
133+ .{ .provider = "opencode-go", .id = "mimo-v2.5", .name = "MiMo V2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{}, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.0028 },
134+ .{ .provider = "opencode-go", .id = "mimo-v2.5-pro", .name = "MiMo V2.5 Pro", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 128000, .effort = &.{}, .cost_input = 0.435, .cost_output = 0.87, .cost_cache_read = 0.003625 },
135+ .{ .provider = "opencode-go", .id = "mimo-v2.6-flash", .name = "MiMo-V2.6-Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{}, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.0028 },
136+ .{ .provider = "opencode-go", .id = "mimo-v2.6-pro", .name = "MiMo-V2.6-Pro", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{}, .cost_input = 0.435, .cost_output = 0.87, .cost_cache_read = 0.003625 },
137+ .{ .provider = "opencode-go", .id = "minimax-m2.5", .name = "minimax-m2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
138+ .{ .provider = "opencode-go", .id = "minimax-m2.7", .name = "MiniMax-M2.7", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
139+ .{ .provider = "opencode-go", .id = "minimax-m3", .name = "MiniMax-M3", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
140+ .{ .provider = "opencode-go", .id = "muse-spark-1.2-contributor", .name = "Muse Spark 1.2 Contributor", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.1, .cost_output = 0.2, .cost_cache_read = 0.002 },
141+ .{ .provider = "opencode-go", .id = "muse-spark-1.3-contributor", .name = "Muse Spark 1.3 Contributor", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.1, .cost_output = 0.2, .cost_cache_read = 0.002 },
142+ .{ .provider = "opencode-go", .id = "omen-alpha", .name = "omen-alpha", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
143+ .{ .provider = "opencode-go", .id = "qwen3.5-plus", .name = "qwen3.5-plus", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
144+ .{ .provider = "opencode-go", .id = "qwen3.6-plus", .name = "Qwen3.6 Plus", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{}, .cost_input = 0.5, .cost_output = 3.0, .cost_cache_read = 0.05 },
145+ .{ .provider = "opencode-go", .id = "qwen3.7-max", .name = "Qwen3.7 Max", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{}, .cost_input = 2.5, .cost_output = 7.5, .cost_cache_read = 0.5 },
146+ .{ .provider = "opencode-go", .id = "qwen3.7-plus", .name = "Qwen3.7 Plus", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{}, .cost_input = 0.4, .cost_output = 1.6, .cost_cache_read = 0.04 },
147+ .{ .provider = "opencode-go", .id = "qwen3.8-flash", .name = "Qwen3.8 Flash", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "medium", "xhigh" }, .cost_input = 0.15, .cost_output = 0.47, .cost_cache_read = 0.016 },
148+ .{ .provider = "opencode-go", .id = "qwen3.8-max", .name = "Qwen3.8 Max", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "medium", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.25 },
149+ .{ .provider = "opencode-go", .id = "space-bunny-free", .name = "Space Bunny Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 524288, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
170150 };
171151
172152 pub fn lookup(provider: []const u8, id: []const u8) ?*const ModelInfo {
src/models.zig+25−25
@@ -6,12 +6,11 @@ const catalog = @import("catalog.zig");
66 const config = @import("config.zig");
77 const types = @import("types.zig");
88
9-/// A provider whose wire details are compiled in. The catalog carries the
10-/// per-model metadata; this carries where and how the provider is reached.
9+/// A provider whose authentication is compiled in. Where and how the provider
10+/// is reached — the wire and the base URL — is a property of each catalog
11+/// model, not of the provider: one provider id may serve several wires.
1112 const Builtin = struct {
1213 id: []const u8,
13- base_url: []const u8,
14- api: []const u8,
1514 env_keys: []const []const u8,
1615 session_header: ?[]const u8,
1716 };
@@ -19,15 +18,11 @@ const Builtin = struct {
1918 const builtins = [_]Builtin{
2019 .{
2120 .id = "opencode-go",
22- .base_url = "https://opencode.ai/zen/go/v1",
23- .api = "openai-completions",
2421 .env_keys = &.{"OPENCODE_API_KEY"},
2522 .session_header = "x-opencode-session",
2623 },
2724 .{
2825 .id = "opencode",
29- .base_url = "https://opencode.ai/zen/v1",
30- .api = "openai-completions",
3126 .env_keys = &.{"OPENCODE_API_KEY"},
3227 .session_header = "x-opencode-session",
3328 },
@@ -96,21 +91,26 @@ pub fn resolve(a: std.mem.Allocator, cfg: *const config.Config, err: *?[]const u
9691 pub fn resolveNamed(a: std.mem.Allocator, cfg: *const config.Config, provider_id: []const u8, model_id: []const u8, err: *?[]const u8) ?types.Model {
9792 for (builtins) |b| {
9893 if (!std.mem.eql(u8, b.id, provider_id)) continue;
99- const info = catalog.lookup(b.id, model_id);
94+ // The catalog is the only source of the wire and the base URL, and it
95+ // holds no model it cannot address. A missing entry is unresolvable.
96+ const info = catalog.lookup(provider_id, model_id) orelse {
97+ err.* = std.fmt.allocPrint(a, "unknown model \"{s}\" for provider \"{s}\"", .{ model_id, provider_id }) catch "unknown model";
98+ return null;
99+ };
100100 return types.Model{
101101 .id = model_id,
102- .name = if (info) |i| i.name else model_id,
103- .api = b.api,
102+ .name = info.name,
103+ .api = info.api,
104104 .provider = provider_id,
105- .base_url = b.base_url,
105+ .base_url = info.base_url,
106106 .api_key = firstEnv(b.env_keys),
107- .effort = if (info) |i| clampEffort(i, cfg.thinking_effort) else cfg.thinking_effort orelse "",
108- .supports_images = if (info) |i| i.images else true,
109- .context_window = if (info) |i| i.context else 0,
110- .max_tokens = if (info) |i| i.max_output else 0,
111- .cost_input = if (info) |i| i.cost_input else 0,
112- .cost_output = if (info) |i| i.cost_output else 0,
113- .cost_cache_read = if (info) |i| i.cost_cache_read else 0,
107+ .effort = clampEffort(info, cfg.thinking_effort),
108+ .supports_images = info.images,
109+ .context_window = info.context,
110+ .max_tokens = info.max_output,
111+ .cost_input = info.cost_input,
112+ .cost_output = info.cost_output,
113+ .cost_cache_read = info.cost_cache_read,
114114 .session_header = b.session_header,
115115 };
116116 }
@@ -168,16 +168,16 @@ pub fn providers(a: std.mem.Allocator, cfg: *const config.Config) []ProviderEntr
168168
169169 /// Every model a provider offers: the catalog entries for a built-in, the
170170 /// declared ids for a custom provider.
171-pub fn catalogModels(a: std.mem.Allocator, cfg: *const config.Config, provider_id: []const u8) []types.Model {
171+pub fn catalogModels(a: std.mem.Allocator, cfg: *const config.Config, provider_id: []const u8) ![]types.Model {
172172 var out: std.ArrayList(types.Model) = .empty;
173173 for (builtins) |b| {
174174 if (!std.mem.eql(u8, b.id, provider_id)) continue;
175175 for (&catalog.entries) |*entry| {
176- if (!std.mem.eql(u8, entry.provider, b.id)) continue;
176+ if (!std.mem.eql(u8, entry.provider, provider_id)) continue;
177177 var err: ?[]const u8 = null;
178- if (resolveNamed(a, cfg, provider_id, entry.id, &err)) |m| out.append(a, m) catch {};
178+ if (resolveNamed(a, cfg, provider_id, entry.id, &err)) |m| try out.append(a, m);
179179 }
180- return out.toOwnedSlice(a) catch &.{};
180+ return try out.toOwnedSlice(a);
181181 }
182182 for (cfg.custom_providers) |p| {
183183 if (!std.mem.eql(u8, p.id, provider_id)) continue;
@@ -194,7 +194,7 @@ pub fn catalogModels(a: std.mem.Allocator, cfg: *const config.Config, provider_i
194194 pub fn supportedLevels(provider_id: []const u8, model_id: []const u8) []const []const u8 {
195195 for (builtins) |b| {
196196 if (!std.mem.eql(u8, b.id, provider_id)) continue;
197- const info = catalog.lookup(b.id, model_id) orelse return &ladder;
197+ const info = catalog.lookup(provider_id, model_id) orelse return &ladder;
198198 // A model that does not reason runs "off" and offers nothing else,
199199 // matching what `clampEffort` will send.
200200 if (!info.reasoning) return &.{"off"};
@@ -208,7 +208,7 @@ pub fn supportedLevels(provider_id: []const u8, model_id: []const u8) []const []
208208 pub fn clampNamed(provider_id: []const u8, model_id: []const u8, desired: []const u8) []const u8 {
209209 for (builtins) |b| {
210210 if (!std.mem.eql(u8, b.id, provider_id)) continue;
211- const info = catalog.lookup(b.id, model_id) orelse return desired;
211+ const info = catalog.lookup(provider_id, model_id) orelse return desired;
212212 return clampEffort(info, desired);
213213 }
214214 return desired;
src/tui/tui.zig+7−1
@@ -893,7 +893,13 @@ const Tui = struct {
893893 }
894894
895895 fn startModelSelect(self: *Tui, provider_id: []const u8) void {
896- const list = models_mod.catalogModels(self.a, self.cfg, provider_id);
896+ const list = models_mod.catalogModels(self.a, self.cfg, provider_id) catch {
897+ self.separator = true;
898+ self.push(styles.red(self.a, "! out of memory"));
899+ self.separator = true;
900+ self.command_active = false;
901+ return;
902+ };
897903 var ids: std.ArrayList([]const u8) = .empty;
898904 var names: std.ArrayList([]const u8) = .empty;
899905 for (list) |m| {
tools/gen_catalog.py+153−50
@@ -1,26 +1,85 @@
11 #!/usr/bin/env python3
2-"""Generates src/catalog.zig from the models.dev catalog.
2+"""Generates src/catalog.zig.
33
4-Run `python3 tools/gen_catalog.py` to refresh it. The output is committed, so a
5-normal `zig build` needs no network. Override the source with a path or URL and
6-the output with a second argument.
4+The gateway decides which models exist and the docs decide which wire serves
5+each one, so every per-model fact comes from a live source. The output is
6+committed, so a normal `zig build` needs no network. Run
7+`python3 tools/gen_catalog.py` to refresh it.
78 """
89
910 import json
1011 import sys
1112 import urllib.request
1213
13-SOURCE = "https://models.dev/api.json"
14-PROVIDERS = ["opencode", "opencode-go"]
15-
16-
17-def fetch(src):
18- if src.startswith(("http://", "https://")):
19- req = urllib.request.Request(src, headers={"User-Agent": "mini-catalog/1"})
20- with urllib.request.urlopen(req) as r:
21- return json.load(r)
22- with open(src) as f:
23- return json.load(f)
14+MODELS_DEV = "https://models.dev/api.json"
15+
16+PROVIDERS = [
17+ {
18+ "id": "opencode",
19+ "listing": "https://opencode.ai/zen/v1/models",
20+ "docs": "https://opencode.ai/docs/zen.md",
21+ },
22+ {
23+ "id": "opencode-go",
24+ "listing": "https://opencode.ai/zen/go/v1/models",
25+ "docs": "https://opencode.ai/docs/go.md",
26+ },
27+]
28+
29+# The four wires, as the path suffix that ends their endpoint URL.
30+SUFFIX_WIRES = [
31+ ("/chat/completions", "openai-completions"),
32+ ("/responses", "openai-responses"),
33+ ("/messages", "anthropic-messages"),
34+]
35+
36+# The AI SDK package names the docs and models.dev use for each wire.
37+NPM_WIRES = {
38+ "@ai-sdk/openai-compatible": "openai-completions",
39+ "@ai-sdk/openai": "openai-responses",
40+ "@ai-sdk/anthropic": "anthropic-messages",
41+ "@ai-sdk/google": "google-generative-ai",
42+}
43+
44+
45+def fetch(url):
46+ req = urllib.request.Request(url, headers={"User-Agent": "mini-catalog/1"})
47+ with urllib.request.urlopen(req) as r:
48+ return r.read()
49+
50+
51+def fetch_json(url):
52+ return json.loads(fetch(url))
53+
54+
55+def parse_docs(text):
56+ """Model id -> endpoint URL, from every pipe table row in the docs."""
57+ out = {}
58+ for line in text.splitlines():
59+ line = line.strip()
60+ if not line.startswith("|"):
61+ continue
62+ cells = [c.strip() for c in line.strip("|").split("|")]
63+ if len(cells) < 3:
64+ continue
65+ endpoint = cells[2]
66+ if not (endpoint.startswith("`") and endpoint.endswith("`")):
67+ continue
68+ endpoint = endpoint[1:-1]
69+ if endpoint.startswith("http"):
70+ out[cells[1]] = endpoint
71+ return out
72+
73+
74+def wire_of(url, model_id):
75+ """The wire and the base URL an endpoint URL names, or (None, None)."""
76+ for suffix, wire in SUFFIX_WIRES:
77+ if url.endswith(suffix):
78+ return wire, url[: -len(suffix)]
79+ google = "/models/" + model_id
80+ if url.endswith(google):
81+ return "google-generative-ai", url[: -len(google)]
82+ return None, None
2483
2584
2685 def zstr(s):
@@ -34,13 +93,65 @@ def effort_of(model):
3493 return []
3594
3695
96+def resolve(provider, model_id, docs, models_dev):
97+ """The wire and base URL for one model, or (None, None) when neither the
98+ docs nor models.dev names a wire and the provider has no usable default."""
99+ url = docs.get(model_id)
100+ if url is not None:
101+ # The docs named an endpoint, so they own the answer: either it is one
102+ # of the four wires or the model is unaddressable.
103+ wire, base = wire_of(url, model_id)
104+ return wire, (base or "").rstrip("/")
105+ entry = (models_dev.get("models") or {}).get(model_id) or {}
106+ npm = (entry.get("provider") or {}).get("npm") or (
107+ provider.get("npm") if "npm" in provider else None
108+ )
109+ wire = NPM_WIRES.get(npm)
110+ base = (provider.get("api") or "").rstrip("/")
111+ if wire and base.startswith("https://") and "/models/" not in base:
112+ return wire, base
113+ return None, None
114+
115+
116+def entry_line(provider_id, model_id, api, base_url, model):
117+ limit = model.get("limit") or {}
118+ cost = model.get("cost") or {}
119+ effort = effort_of(model)
120+ if len(effort) == 1:
121+ eff = "&.{%s}" % zstr(effort[0])
122+ elif effort:
123+ eff = "&.{ %s }" % ", ".join(zstr(v) for v in effort)
124+ else:
125+ eff = "&.{}"
126+ return (
127+ " .{ .provider = %s, .id = %s, .name = %s, .api = %s, "
128+ ".base_url = %s, .images = %s, .reasoning = %s, .context = %d, "
129+ ".max_output = %d, .effort = %s, .cost_input = %s, .cost_output = %s, "
130+ ".cost_cache_read = %s },"
131+ % (
132+ zstr(provider_id),
133+ zstr(model_id),
134+ zstr(model.get("name") or model_id),
135+ zstr(api),
136+ zstr(base_url),
137+ "true" if model.get("attachment") else "false",
138+ "true" if model.get("reasoning") else "false",
139+ int(limit.get("context") or 0),
140+ int(limit.get("output") or 0),
141+ eff,
142+ repr(float(cost.get("input") or 0)),
143+ repr(float(cost.get("output") or 0)),
144+ repr(float(cost.get("cache_read") or 0)),
145+ )
146+ )
147+
148+
37149 def main():
38- src = sys.argv[1] if len(sys.argv) > 1 else SOURCE
39- out = sys.argv[2] if len(sys.argv) > 2 else "src/catalog.zig"
40- data = fetch(src)
150+ out = sys.argv[1] if len(sys.argv) > 1 else "src/catalog.zig"
151+ models_dev = fetch_json(MODELS_DEV)
41152
42153 lines = [
43- "// Generated by tools/gen_catalog.py from models.dev. Do not edit.",
154+ "// Generated by tools/gen_catalog.py. Do not edit.",
44155 "// Refresh with `python3 tools/gen_catalog.py`.",
45156 "",
46157 "const std = @import(\"std\");",
@@ -49,6 +160,8 @@ def main():
49160 " provider: []const u8,",
50161 " id: []const u8,",
51162 " name: []const u8,",
163+ " api: []const u8,",
164+ " base_url: []const u8,",
52165 " images: bool,",
53166 " reasoning: bool,",
54167 " context: u64,",
@@ -63,41 +176,31 @@ def main():
63176 ]
64177
65178 count = 0
66- for provider in PROVIDERS:
67- p = data.get(provider)
68- if not p:
69- sys.exit("catalog: provider %r missing from source" % provider)
70- for mid in sorted(p["models"]):
71- m = p["models"][mid]
72- effort = effort_of(m)
73- if len(effort) == 1:
74- eff = "&.{%s}" % zstr(effort[0])
75- elif effort:
76- eff = "&.{ %s }" % ", ".join(zstr(v) for v in effort)
77- else:
78- eff = "&.{}"
79- limit = m.get("limit") or {}
80- cost = m.get("cost") or {}
179+ for spec in PROVIDERS:
180+ provider_id = spec["id"]
181+ provider = models_dev.get(provider_id)
182+ if provider is None:
183+ sys.exit("catalog: provider %r missing from models.dev" % provider_id)
184+ docs = parse_docs(fetch(spec["docs"]).decode("utf-8"))
185+ listing = sorted(m["id"] for m in fetch_json(spec["listing"])["data"])
186+ catalog = provider["models"]
187+
188+ skipped = []
189+ for model_id in listing:
190+ api, base_url = resolve(provider, model_id, docs, catalog)
191+ if api is None:
192+ where = docs.get(model_id)
193+ skipped.append((model_id, where or "no endpoint"))
194+ continue
81195 lines.append(
82- " .{ .provider = %s, .id = %s, .name = %s, .images = %s, "
83- ".reasoning = %s, .context = %d, .max_output = %d, .effort = %s, "
84- ".cost_input = %s, .cost_output = %s, .cost_cache_read = %s },"
85- % (
86- zstr(provider),
87- zstr(mid),
88- zstr(m.get("name") or mid),
89- "true" if m.get("attachment") else "false",
90- "true" if m.get("reasoning") else "false",
91- int(limit.get("context") or 0),
92- int(limit.get("output") or 0),
93- eff,
94- repr(float(cost.get("input") or 0)),
95- repr(float(cost.get("output") or 0)),
96- repr(float(cost.get("cache_read") or 0)),
97- )
196+ entry_line(provider_id, model_id, api, base_url, catalog.get(model_id) or {})
98197 )
99198 count += 1
100199
200+ print("%s: %d models" % (provider_id, len(listing) - len(skipped)))
201+ for model_id, endpoint in skipped:
202+ print(" skipped %s (%s)" % (model_id, endpoint), file=sys.stderr)
203+
101204 lines += [
102205 "};",
103206 "",