{"slug": "choosing-a-model-for-opencode-via-openrouter-privacy-price-and-performance", "title": "Choosing a Model for OpenCode via OpenRouter: Privacy, Price, and Performance", "summary": "Open-weight model families DeepSeek, Qwen and GLM are the cheapest options for driving OpenCode through OpenRouter as of 2026-09-27, with DeepSeek V4 Pro priced at roughly one-twentieth of Gemini 3.1 Pro Preview's and GPT-5.2's output cost, according to an OpenRouter API snapshot. The guide argues the privacy risk in agentic coding sessions comes from the serving provider's jurisdiction and compulsion law rather than the model weights, since open-weight models such as DeepSeek, Qwen, Kimi and GLM can run on any host, GPU or laptop. Kimi is not a price leader, with K3 at GPT and Claude frontier pricing, while OpenAI is the priciest frontier and Gemini sits mid-range.", "body_md": "*2026–09–27*\n\nPractical guide for picking a model and provider when driving OpenCode through OpenRouter, balancing data-privacy risk against price and performance. Prices are as of 2026–09–27 and are OpenRouter’s listed rates.\n\n*Disclosure: I’m not affiliated with any of the model developers or service providers mentioned here.*\n\nOpenCode’s /connect connects **providers**; OpenRouter is one of them. Entries like \"DeepSeek\" and \"DeepSeek (China)\" are distinct serving endpoints — the suffix denotes the host's jurisdiction, not a different model. To use OpenRouter as the payment gateway, connect **OpenRouter** once, then choose models with /models (for example deepseek/deepseek-v4-flash); the upstream host is then selected by OpenRouter's routing, which you can constrain (see §5).\n\nThe distinction that matters throughout this note is between the **model** and the **serving provider**. An open-weight model (DeepSeek, Qwen, Kimi, GLM) is a set of downloadable files; it carries no inherent data risk. The risk lives in the **service that hosts it and the law that governs that service**.\n\nA Chinese *model* is not the same as a Chinese *service*. The open weights can run anywhere — a non-Chinese host, your own GPU, or a laptop. What changes the privacy calculus is who operates the endpoint.\n\nThis is a **jurisdiction and compulsion** risk, not a claim that any vendor abuses data. It matters most for proprietary code and secrets; for public or open-source work the risk is low.\n\n**Assessment checklist per provider:** (a) legal jurisdiction of the serving entity; (b) retention policy and whether Zero Data Retention is available; © training-on-inputs policy; (d) whether you can pin or exclude providers; (e) DPA availability; (f) whether self-host or BYOC is possible. In an agentic coding session, what you send is high-sensitivity — source, file contents, and sometimes secrets.\n\nOpenRouter’s listed price is the **cheapest endpoint** for a model, and endpoints differ in quantization (fp4 vs fp8 weight precision — fewer bits is cheaper but lossy), so treat these as a floor, not a like-for-like quality figure.\n\n*Table generated 2026–09–27 from the OpenRouter API. Model prices change frequently — treat this as a snapshot and re-run the scripts in §4 before relying on any number.*\n\n**Price winners: DeepSeek, with Qwen and GLM close.** The open-weight families are far cheaper, especially on output tokens. DeepSeek V4 Pro is frontier-capable at roughly a twentieth of Gemini 3.1 Pro Preview’s and GPT-5.2’s output cost. **Kimi is not a price leader** — K3 sits at GPT and Claude frontier pricing. OpenAI is the priciest frontier; Gemini sits mid.\n\nList every model’s price, per million tokens, with curl and jq:\n\n```\ncurl -s https://openrouter.ai/api/v1/models \\  | jq -r '.data[] | [.id, (.pricing.prompt|tonumber*1e6), (.pricing.completion|tonumber*1e6)] | @tsv' \\  | sort -t$'\\t' -k3 -n | head -30\n```\n\nPrint the cheapest models per family with Python:\n\n``` bash\n#!/usr/bin/env python3\"\"\"Cheapest OpenRouter models per family, per million tokens.\"\"\"import jsonimport urllib.requestFAMILIES = {    \"deepseek\": \"deepseek\",    \"qwen\": \"qwen\",    \"moonshotai\": \"kimi\",    \"google\": \"gemini\",    \"openai\": \"openai\",    \"z-ai\": \"glm\",}def per_million(x):    try:        return float(x) * 1_000_000    except (TypeError, ValueError):        return Nonewith urllib.request.urlopen(\"https://openrouter.ai/api/v1/models\") as resp:    models = json.load(resp)[\"data\"]for author, label in FAMILIES.items():    rows = [m for m in models if m[\"id\"].startswith(author + \"/\")]    rows.sort(key=lambda m: per_million(m[\"pricing\"].get(\"completion\")) or 9e9)    print(f\"=== {label} ({author}) — {len(rows)} models ===\")    for m in rows[:5]:        p = m[\"pricing\"]        inp = per_million(p.get(\"prompt\"))        out = per_million(p.get(\"completion\"))        print(f\"  {m['id']:<52} in ${inp:.3f}/M  out ${out:.3f}/M\")\n```\n\nInspect one model’s per-provider endpoints — price, quantization, context — the check that reveals the price floor:\n\n```\ncurl -s \"https://openrouter.ai/api/v1/models/deepseek/deepseek-v4-flash-0731/endpoints\" \\  | jq -r '.data.endpoints[] | [.provider_name, .quantization, (.pricing.prompt|tonumber*1e6), (.pricing.completion|tonumber*1e6)] | @tsv'\n{  \"$schema\": \"https://opencode.ai/config.json\",  \"model\": \"openrouter/deepseek/deepseek-v4-pro\",  \"small_model\": \"openrouter/deepseek/deepseek-v4-flash\"}\n```\n\nControls to set on OpenRouter: **enforce Zero Data Retention**, **opt out of training**, and pin or exclude providers by jurisdiction. For agentic tool-calling reliability prefer the :exacto routing variant; avoid :floor, which often routes to **fp4** and can degrade tool calls.\n\nbtw, i use arch\n\n[Choosing a Model for OpenCode via OpenRouter: Privacy, Price, and Performance](https://blog.devgenius.io/choosing-a-model-for-opencode-via-openrouter-privacy-price-and-performance-b12b13dae7d9) was originally published in [Dev Genius](https://blog.devgenius.io) on Medium, where people are continuing the conversation by highlighting and responding to this story.", "url": "https://wpnews.pro/news/choosing-a-model-for-opencode-via-openrouter-privacy-price-and-performance", "canonical_source": "https://blog.devgenius.io/choosing-a-model-for-opencode-via-openrouter-privacy-price-and-performance-b12b13dae7d9?source=rss----4e2c1156667e---4", "published_at": "2026-10-13 10:39:53+00:00", "updated_at": "2026-10-15 04:58:28.855915+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "ai-infrastructure", "developer-tools"], "entities": ["OpenCode", "OpenRouter", "DeepSeek", "Qwen", "Kimi", "GLM", "Gemini 3.1 Pro Preview", "GPT-5.2"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/choosing-a-model-for-opencode-via-openrouter-privacy-price-and-performance", "markdown": "https://wpnews.pro/news/choosing-a-model-for-opencode-via-openrouter-privacy-price-and-performance.md", "text": "https://wpnews.pro/news/choosing-a-model-for-opencode-via-openrouter-privacy-price-and-performance.txt", "jsonld": "https://wpnews.pro/news/choosing-a-model-for-opencode-via-openrouter-privacy-price-and-performance.jsonld"}}