7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.
TypeScript
feat(providers): add OpenCode Zen (OpenAI-compatible) with 4 free models
Tashfeen6305924d992c
diff --git a/server/src/__tests__/providers/openai-compat.test.ts b/server/src/__tests__/providers/openai-compat.test.tsindex f490b602..a536e4e9 100644--- a/server/src/__tests__/providers/openai-compat.test.ts+++ b/server/src/__tests__/providers/openai-compat.test.ts@@ -247,6 +247,7 @@ describe('OpenAICompatProvider - platform instances', () => {{ platform: 'openrouter', name: 'OpenRouter', baseUrl: 'https://openrouter.ai/api/v1' },{ platform: 'github', name: 'GitHub Models', baseUrl: 'https://models.github.ai/inference' },{ platform: 'zhipu', name: 'Zhipu AI', baseUrl: 'https://open.bigmodel.cn/api/paas/v4' },+ { platform: 'opencode', name: 'OpenCode Zen', baseUrl: 'https://opencode.ai/zen/v1' },] as const;for (const p of platforms) {diff --git a/server/src/db/index.ts b/server/src/db/index.tsindex b4f17029..d86af702 100644--- a/server/src/db/index.ts+++ b/server/src/db/index.ts@@ -52,6 +52,7 @@ export function initDb(dbPath?: string): Database.Database {migrateModelsV15(db);migrateModelsV16Vision(db);migrateModelsV17IntelligenceTiers(db);+ migrateModelsV18OpenCodeZen(db);ensureUnifiedKey(db);console.log(`Database initialized at ${resolvedPath}`);@@ -1469,6 +1470,52 @@ function migrateModelsV17IntelligenceTiers(db: Database.Database) {apply();}+// ── V18: OpenCode Zen provider (2026-06) ──+// Adds the OpenCode Zen gateway (#128, originally contributed by @Aldo-f). Zen is+// an OpenAI-compatible service whose paid models bill pay-as-you-go but which+// also exposes a rotating set of *promotional* free models. Access is via a FREE+// account key from https://opencode.ai/auth — no credit card; billing only+// applies if you call paid models. We require that key like any other provider+// (we do NOT use Zen's unauthenticated path).+//+// We seed only the four models the Zen docs explicitly label free — big-pickle,+// deepseek-v4-flash-free, mimo-v2.5-free, nemotron-3-super-free. The live+// /v1/models list also surfaces qwen3.6-plus-free and minimax-m3-free, but those+// are NOT documented as free, so they're intentionally omitted (same "verified+// only" bar as V12-V14). Tiers follow V17's bands (deepseek-v4-flash → Frontier,+// nemotron-3-super → Large). Caveats per docs: promotional/limited-time, "trial+// use only — not for production", and prompts/outputs may be used to improve the+// models (NVIDIA logs Nemotron traffic). Conservative shared 20 RPM / 200 RPD,+// matching the OpenRouter :free pool pattern. Idempotent (INSERT OR IGNORE ++// fallback_config backfill), safe to re-run.+function migrateModelsV18OpenCodeZen(db: Database.Database) {+ const insert = db.prepare(`+ INSERT OR IGNORE INTO models (platform, model_id, display_name, intelligence_rank, speed_rank, size_label, rpm_limit, rpd_limit, tpm_limit, tpd_limit, monthly_token_budget, context_window)+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)+ `);+ const additions: Array<[string, string, string, number, number, string, number | null, number | null, number | null, number | null, string, number | null]> = [+ ['opencode', 'big-pickle', 'Big Pickle (OpenCode Zen, stealth)', 10, 4, 'Large', 20, 200, null, null, 'promo (trial)', 131072],+ ['opencode', 'deepseek-v4-flash-free', 'DeepSeek V4 Flash Free (OpenCode Zen)', 4, 4, 'Frontier', 20, 200, null, null, 'promo (trial)', 131072],+ ['opencode', 'mimo-v2.5-free', 'MiMo-V2.5 Free (OpenCode Zen)', 14, 4, 'Medium', 20, 200, null, null, 'promo (trial)', 131072],+ ['opencode', 'nemotron-3-super-free', 'Nemotron 3 Super Free (OpenCode Zen)', 12, 4, 'Large', 20, 200, null, null, 'promo (trial)', 131072],+ ];++ const apply = db.transaction(() => {+ for (const a of additions) insert.run(...a);+ const missing = db.prepare(`+ SELECT m.id FROM models m+ LEFT JOIN fallback_config f ON m.id = f.model_db_id+ WHERE f.id IS NULL ORDER BY m.intelligence_rank ASC+ `).all() as { id: number }[];+ if (missing.length > 0) {+ const maxPriority = (db.prepare('SELECT COALESCE(MAX(priority), 0) AS mx FROM fallback_config').get() as { mx: number }).mx;+ const addFb = db.prepare('INSERT INTO fallback_config (model_db_id, priority, enabled) VALUES (?, ?, 1)');+ for (let i = 0; i < missing.length; i++) addFb.run(missing[i].id, maxPriority + i + 1);+ }+ });+ apply();+}+function ensureUnifiedKey(db: Database.Database) {const existing = db.prepare("SELECT value FROM settings WHERE key = 'unified_api_key'").get() as { value: string } | undefined;if (!existing) {diff --git a/server/src/providers/index.ts b/server/src/providers/index.tsindex a149c9d9..6faada34 100644--- a/server/src/providers/index.ts+++ b/server/src/providers/index.ts@@ -143,6 +143,18 @@ register(new OpenAICompatProvider({baseUrl: 'https://api.llm7.io/v1',}));+// OpenCode Zen — OpenAI-compatible gateway (https://opencode.ai/zen/v1), same+// adapter as Groq/OpenRouter. A handful of promotional models are free for a+// limited time; they need a free account key from https://opencode.ai/auth+// (no card required — billing only applies to paid models). The free roster is+// trial-only and prompts/outputs may be used to improve the models, so we seed+// just the docs-confirmed free IDs (migrateModelsV18) with conservative limits.+register(new OpenAICompatProvider({+ platform: 'opencode',+ name: 'OpenCode Zen',+ baseUrl: 'https://opencode.ai/zen/v1',+}));+// Chutes was evaluated for V11 and dropped: probe with a free-tier key// returned 402 on every model — "Quota exceeded and account balance is// $0.0, please pay with fiat or send tao". The "free" tier requires adiff --git a/server/src/routes/keys.ts b/server/src/routes/keys.tsindex caff9631..128dcc8f 100644--- a/server/src/routes/keys.ts+++ b/server/src/routes/keys.ts@@ -12,7 +12,7 @@ export const keysRouter = Router();const PLATFORMS = ['google', 'groq', 'cerebras', 'sambanova', 'nvidia', 'mistral','openrouter', 'github', 'cohere', 'cloudflare', 'zhipu', 'ollama',- 'kilo', 'pollinations', 'llm7', 'huggingface', 'custom',+ 'kilo', 'pollinations', 'llm7', 'huggingface', 'opencode', 'custom',] as const;const addKeySchema = z.object({diff --git a/shared/types.ts b/shared/types.tsindex 1c917ef5..064d795d 100644--- a/shared/types.ts+++ b/shared/types.ts@@ -22,6 +22,9 @@ export type Platform =| 'pollinations'| 'llm7'| 'huggingface'+ // OpenCode Zen — OpenAI-compatible gateway. Free promotional models require a+ // free (no-card) account key from opencode.ai/auth; see migrateModelsV18.+ | 'opencode'// User-configured OpenAI-compatible endpoint (llama.cpp, LM Studio, vLLM,// Ollama, any base_url). The endpoint URL lives on the api_keys row; see #117.| 'custom';