Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Add reviewed display pricing for the two Provider API additions published after the previous snapshot: `Qwen/Qwen4-Max` at $1.50 input / $4.50 output / $0.075 cache read / $1.875 cache write per million tokens, and `tencent/hy4-flash` at $0.07 / $0.281 / $0.003 with no cache-write charge. Both values come from the official pricing page rows `qwen-4-max` and `tencent/hy4-flash`, publish no long-context tier, and carry no promotion. No model left the API in this window. Refresh the 100-model API and pricing snapshots to 2026-11-16; the pricing check reports no drift. Static capability metadata stays at `command-code@1.89.1`, which does not list either model, so both remain text-only without reasoning or effort flags until upstream ships them.

## 0.8.4 - 2026-11-15

- Stop handing revoked or rotated API keys back on refresh. `refreshToken` used to return the stored key unchanged with a new ten-year expiry. On Oh My Pi, that let OMP keep selecting a dead `/login` credential over a valid one, and every request failed with `401 Invalid 'Authorization' header or token`. Refresh now checks the key against `whoami` first, and a `401` there fails the refresh with the message `401 invalid_token`. OMP forces a refresh after a `401`; when the refresh fails with that message, it signs the credential out and uses the next stored one. A network error or 5xx response from `whoami` fails the refresh with its own error, which OMP treats as temporary and does not sign out. pi refreshes only on expiry, so it runs the new check only then. ([#217](https://github.com/patlux/pi-commandcode-provider/pull/217))
Expand Down
4 changes: 3 additions & 1 deletion src/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface TemporaryPricing {
}

export const PRICING_SOURCE_URL = "https://commandcode.ai/docs/resources/pricing-limits"
export const PRICING_LAST_VERIFIED = "2026-11-13"
export const PRICING_LAST_VERIFIED = "2026-11-16"

export const ZERO_MODEL_COST: CommandCodeModelCost = {
input: 0,
Expand Down Expand Up @@ -55,6 +55,7 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
"inclusionai/ling-3.1-flash": { input: 0.3, output: 0.9, cacheRead: 0.06, cacheWrite: 0 },
"mistral/mistral-large-4": { input: 1.36, output: 4.18, cacheRead: 0.14, cacheWrite: 0 },
"tencent/hy3-paid": { input: 0.14, output: 0.58, cacheRead: 0.035, cacheWrite: 0 },
"tencent/hy4-flash": { input: 0.07, output: 0.281, cacheRead: 0.003, cacheWrite: 0 },
"tencent/hy4-preview": { input: 0.834, output: 2.501, cacheRead: 0.042, cacheWrite: 0 },
"moonshotai/Kimi-K3.1-Pro": { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 0 },
"moonshotai/Kimi-K3": { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 0 },
Expand Down Expand Up @@ -123,6 +124,7 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
cacheRead: 0.048,
cacheWrite: 0,
},
"Qwen/Qwen4-Max": { input: 1.5, output: 4.5, cacheRead: 0.075, cacheWrite: 1.875 },
"Qwen/Qwen3.8-Max-Prime": { input: 4, output: 12, cacheRead: 0.5, cacheWrite: 5 },
"Qwen/Qwen3.8-Max": { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 2.5 },
"Qwen/Qwen3.8-Max-0902": { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 0 },
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/commandcode-model-ids.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"fetchedAt": "2026-11-13T07:12:48.985Z",
"fetchedAt": "2026-11-16T09:22:58.757Z",
"source": "https://api.commandcode.ai/provider/v1/models",
"modelIds": [
"claude-sonnet-5-5",
Expand Down Expand Up @@ -54,6 +54,7 @@
"xiaomi/mimo-v2.6-pro",
"xiaomi/mimo-v2.6-pro-ultraspeed",
"xiaomi/mimo-v2.6-flash",
"Qwen/Qwen4-Max",
"Qwen/Qwen3.8-Omni-Flash",
"Qwen/Qwen3.8-Max-Prime",
"Qwen/Qwen3.8-Max-0902",
Expand All @@ -70,6 +71,7 @@
"stepfun/Step-3.7-Flash",
"stepfun/Step-3.5-Flash",
"tencent/hy3-paid",
"tencent/hy4-flash",
"tencent/hy4-preview",
"google/gemini-4-carbon",
"google/gemini-4-argon",
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/commandcode-pricing.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"verifiedAt": "2026-11-13",
"verifiedAt": "2026-11-16",
"source": "https://commandcode.ai/docs/resources/pricing-limits",
"tierPolicy": "Use request-wide input tiers; the highest threshold exceeded by input plus cache tokens applies to the full request.",
"tiers": {
Expand Down Expand Up @@ -29,6 +29,7 @@
"inclusionai/ling-3.1-flash": [0.3, 0.9, 0.06, 0],
"mistral/mistral-large-4": [1.36, 4.18, 0.14, 0],
"tencent/hy3-paid": [0.14, 0.58, 0.035, 0],
"tencent/hy4-flash": [0.07, 0.281, 0.003, 0],
"tencent/hy4-preview": [0.834, 2.501, 0.042, 0],
"moonshotai/Kimi-K3.1-Pro": [2, 10, 0.2, 0],
"moonshotai/Kimi-K3": [3, 15, 0.3, 0],
Expand All @@ -54,6 +55,7 @@
"deepseek/deepseek-v4.1-flash": [0.15, 0.6, 0.003, 0],
"deepseek/deepseek-v4.1-flash-fast": [0.16, 0.58, 0.016, 0],
"deepseek/deepseek-v4.1-flash-ultrafast": [2.4, 9.6, 0.048, 0],
"Qwen/Qwen4-Max": [1.5, 4.5, 0.075, 1.875],
"Qwen/Qwen3.8-Max-Prime": [4, 12, 0.5, 5],
"Qwen/Qwen3.8-Max": [2, 6, 0.25, 2.5],
"Qwen/Qwen3.8-Max-0902": [2, 6, 0.25, 0],
Expand Down
14 changes: 13 additions & 1 deletion tests/test-pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,18 @@ describe("MODEL_COSTS pricing overlay", () => {
cacheRead: 0.004,
cacheWrite: 0,
})
assertCost("Qwen/Qwen4-Max", {
input: 1.5,
output: 4.5,
cacheRead: 0.075,
cacheWrite: 1.875,
})
assertCost("tencent/hy4-flash", {
input: 0.07,
output: 0.281,
cacheRead: 0.003,
cacheWrite: 0,
})
})

it("prices Inkling 2 Small free as free during its undated free tier", () => {
Expand Down Expand Up @@ -463,7 +475,7 @@ describe("MODEL_COSTS pricing overlay", () => {

it("tracks pricing provenance", () => {
assert.equal(PRICING_SOURCE_URL, "https://commandcode.ai/docs/resources/pricing-limits")
assert.equal(PRICING_LAST_VERIFIED, "2026-11-13")
assert.equal(PRICING_LAST_VERIFIED, "2026-11-16")
})

it("fails once temporary pricing needs review", () => {
Expand Down
Loading