tokenmix 0.4.11 → 0.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,6 +8,7 @@ One account, one balance, 160+ models routed automatically across Claude / GPT /
8
8
 
9
9
  Behind the zero-config CLI is a gateway built to be the **honest, transparent** LLM backend for BYOK coding agents:
10
10
 
11
+ - **The model you pick is the model you get.** Your request routes to the real upstream model you named — no silent downgrade to a cheaper one (the grey market's classic "sold Opus, served Haiku"). Model aliases are name normalization only, never a swap.
11
12
  - **Transparent, real-time billing.** `tokenmix balance` shows your actual balance, gift credit, and total spent — to micro-USD precision, not opaque "credits". `tokenmix models` lists every model's real price (free models show `$0`, not a dash).
12
13
  - **Prompt caching that saves you money — automatically.** Cache hits bill at the discounted rate with nothing to configure: OpenAI / DeepSeek / Gemini / Qwen via their `cached_tokens`, Anthropic via `cache_control` pass-through (cache reads ≈10% of the input price). The savings are yours, and you can see them.
13
14
  - **One key, every protocol.** OpenAI Chat Completions, Anthropic Messages, and the Responses API — all on one account, which is why every agent below (terminal and editor alike) runs on a single balance.
@@ -90,6 +91,17 @@ TOKENMIX_LANG=ja npx tokenmix doctor # 日本語
90
91
  TOKENMIX_LANG=fr npx tokenmix doctor # Français
91
92
  ```
92
93
 
94
+ ## Default model
95
+
96
+ Agents default to `claude-sonnet-4.6`. Override it for any launch with the `TOKENMIX_DEFAULT_MODEL` environment variable — handy for a cheaper/faster default or for scripting:
97
+
98
+ ```bash
99
+ TOKENMIX_DEFAULT_MODEL=claude-haiku-4.5 npx tokenmix opencode
100
+ TOKENMIX_DEFAULT_MODEL=qwen-flash npx tokenmix aider
101
+ ```
102
+
103
+ (`tokenmix claude` and `tokenmix codex` speak the Anthropic / Responses protocols, so they need a Claude-family model; the other agents accept any chat model.)
104
+
93
105
  ## Configuration Location
94
106
 
95
107
  Your TokenMix credentials are stored locally at:
@@ -62,7 +62,9 @@ export async function runAgent(agent, args) {
62
62
  process.exit(1);
63
63
  }
64
64
  const baseUrl = apiBaseUrl(cfg);
65
- const defaultModel = cfg.defaultModel || DEFAULT_MODEL;
65
+ // TOKENMIX_DEFAULT_MODEL env overrides the model — handy for CI/scripts that want a
66
+ // cheap model, or as a power-user default. Falls back to stored config, then built-in.
67
+ const defaultModel = process.env.TOKENMIX_DEFAULT_MODEL || cfg.defaultModel || DEFAULT_MODEL;
66
68
  // Refuse early with a friendly message if the agent's binary needs a newer Node
67
69
  // than we're running on (Codex/Qwen need 22) — avoids a cryptic npm/install error.
68
70
  if (agent.minNode && nodeMajor() < agent.minNode) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenmix",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "description": "Zero-config CLI to use any open-source coding agent with TokenMix as the unified LLM backend.",
5
5
  "type": "module",
6
6
  "bin": {