Commit Graph
34 Commits
Author SHA1 Message Date
Ethan feea5ab959 feat: add GPT-6.2 Astra and GPT-6.2 Sol to Agents and AI Gateway (#32370)
Closes CODAGT-1608

This adds `gpt-6.2-astra` and `gpt-6.2-sol` to the Agents known models
catalog, so they're suggested when an admin adds a chat model, and
regenerates the AI Gateway price book from models.dev so the gateway can
price them.

| Model | Input | Output | Cache read | Cache write |
|---|---|---|---|---|
| GPT-6.2 Astra | $8 | $40 | $0.40 | $10 |
| GPT-6.2 Sol | $2 | $10 | $0.10 | $2.50 |

Prices are per 1M tokens, and both models have a 1,050,000 token context
window and 128,000 max output tokens. They're in the catalog for OpenAI
(with a suggested effort of `medium`, same as `gpt-6-astra` and
`gpt-6.1-sol`), OpenRouter and Vercel. models.dev doesn't list them on
Azure or Bedrock yet, so I've left those out for now.

Both models also reject the `none` and `minimal` reasoning efforts. A
model config only sets a default and a maximum effort, so the picker
always offers both, and picking either one fails the turn:

```
Unsupported value: 'none' is not supported with the 'gpt-6.2-astra' model. Supported values are: 'low', 'medium', 'high', 'xhigh', and 'max'.
```

We already send `low` instead for `gpt-6-astra` and `gpt-6.1-sol`, so to
fix, we'll just do the same for the two new models. All four now live in
one list of model ID prefixes, rather than a helper each. I checked this
against the real models: all four return a 400 like the one above for
`none` and `minimal`, and accept `low`. `gpt-6-sol` and `gpt-6.1-terra`
still accept `none`, so they're left alone.

Regenerating the price book also brings in everything else models.dev
changed since the last weekly refresh, mostly on OpenRouter and Vercel:
22 other new entries (4 of them `-pro` and `-fast` variants of these
two), 29 it dropped and 51 price changes. 6 existing catalog entries get
new prices or limits the same way.
2026-11-19 00:33:46 +11:00
cdrciandgithub-actions[bot] eb6094979b chore: refresh AI model price book (#32072)
## Price book changes

32 models added, 18 models removed, 42 models changed.

<details>
<summary>Added</summary>

- anthropic/claude-fable-5-2
- azure/claude-fable-5-2
- bedrock/anthropic.claude-fable-5-2
- bedrock/global.anthropic.claude-fable-5-2
- bedrock/global.moonshotai.kimi-k3.1
- bedrock/us.anthropic.claude-fable-5-2
- bedrock/us.moonshotai.kimi-k3.1
- copilot/claude-fable-5.2
- copilot/gemini-4-carbon
- google/gemini-4-carbon
- openrouter/anthropic/claude-fable-5.2
- openrouter/baidu/ernie-5.5-flash-preview:free
- openrouter/baidu/ernie-light-dt-1.0-intl
- openrouter/google/gemini-4-carbon
- openrouter/google/gemini-omni-1.1-flash
- openrouter/google/gemini-omni-1.2-flash
- openrouter/kt/midm-k-3.0-pro
- openrouter/liquid/lfm-3-1.7b
- openrouter/liquid/lfm-3-1.7b:free
- openrouter/meta/muse-ember
- openrouter/motif-technologies/motif-3
- openrouter/nex-agi/nex-n2.6
- openrouter/thinkingmachines/inkling-2-small:free
- openrouter/unbiased/pareto-26.10-preview
- vercel/alibaba/qwen3.6-35b-a3b
- vercel/anthropic/claude-fable-5.2
- vercel/anthropic/claude-fable-5.2-fast
- vercel/deepseek/deepseek-v4.1-flash-1017-ultrafast
- vercel/google/gemini-4-carbon
- vercel/google/gemini-omni-1.2-flash
- vercel/humansand/ampersand-v0.1
- vercel/meta/muse-ember
</details>

<details>
<summary>Removed</summary>

- openrouter/bytedance-seed/seed-1.6
- openrouter/bytedance-seed/seed-1.6-flash
- openrouter/bytedance-seed/seed-2.0-code
- openrouter/inception/mercury-2
- openrouter/inception/mercury-2.5
- openrouter/inception/mercury-3
- openrouter/minimax/minimax-01
- openrouter/minimax/minimax-m1
- openrouter/minimax/minimax-m2
- openrouter/minimax/minimax-m2-her
- openrouter/minimax/minimax-m2.1
- openrouter/nvidia/nemotron-3.5-content-safety:free
- openrouter/qwen/qwen-2.5-7b-instruct
- openrouter/stealth/crouton-alpha
- openrouter/xingchen-agi/xing4.0-29b-a4b:free
- vercel/bytedance/seed-1.6
- vercel/bytedance/seed-1.8
- vercel/google/gemini-3.1-flash-image-preview
</details>

<details>
<summary>Changed</summary>

- openrouter/anthracite-org/magnum-v4-72b
- openrouter/deepseek/deepseek-chat
- openrouter/deepseek/deepseek-v4-flash
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4-flash-vision-exp
- openrouter/deepseek/deepseek-v4-pro
- openrouter/deepseek/deepseek-v4-pro-0813
- openrouter/deepseek/deepseek-v4.1-flash
- openrouter/google/gemma-4-26b-a4b-it
- openrouter/ibm-granite/granite-4.2-8b
- openrouter/inclusionai/ling-3.1-flash
- openrouter/mancer/weaver
- openrouter/meta-llama/llama-3.1-8b-instruct
- openrouter/meta-llama/llama-3.2-3b-instruct
- openrouter/meta-llama/llama-3.3-70b-instruct
- openrouter/minimax/minimax-m2.5
- openrouter/minimax/minimax-m2.7
- openrouter/mistralai/mistral-small-3.2-24b-instruct
- openrouter/moonshotai/kimi-k2.5
- openrouter/moonshotai/kimi-k2.7-code
- openrouter/moonshotai/kimi-k3.1-pro
- openrouter/nvidia/nemotron-3-super-120b-a12b
- openrouter/nvidia/nemotron-3.5-super-vl
- openrouter/openai/gpt-oss-120b
- openrouter/qwen/qwen3-14b
- openrouter/qwen/qwen3-next-80b-a3b-instruct
- openrouter/qwen/qwen3.5-397b-a17b
- openrouter/qwen/qwen3.5-9b
- openrouter/qwen/qwen3.6-27b
- openrouter/reflection/beam-1.0-501b-a23b
- openrouter/undi95/remm-slerp-l2-13b
- openrouter/z-ai/glm-4.5-air
- openrouter/z-ai/glm-5.2
- openrouter/z-ai/glm-5.3-flash
- openrouter/~anthropic/claude-fable-latest
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-pro-latest
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~z-ai/glm-flash-latest
- vercel/alibaba/qwen3.8-27b
- vercel/nvidia/nemotron-3.5-lightning
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/43188102112).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-12 09:58:58 +00:00
cdrciandgithub-actions[bot] f820cba82a chore: refresh AI model price book (#31775)
## Price book changes

9 models added, 14 models removed, 40 models changed.

<details>
<summary>Added</summary>

- openrouter/inclusionai/ling-3.0-tiny
- openrouter/ricursiveai/ripple-65b-preview
- openrouter/stealth/crouton-alpha
- openrouter/tencent/hy4
- openrouter/z-ai/glm-5.3-flashx-legal
- vercel/inclusionai/ling-3.1-flash-1019
- vercel/meituan/longcat-2.5
- vercel/tencent/hy4
- vercel/zai/glm-5.3-flashx-legal
</details>

<details>
<summary>Removed</summary>

- openrouter/nousresearch/hermes-3-llama-3.1-405b
- openrouter/nousresearch/hermes-3-llama-3.1-70b
- openrouter/poolside/laguna-s-2.1
- openrouter/poolside/laguna-s-2.1:free
- openrouter/poolside/laguna-xs-2.1
- openrouter/poolside/laguna-xs-2.1:free
- openrouter/thinkingmachines/inkling-small:free
- openrouter/thinkingmachines/inkling:free
- openrouter/upstage/solar-pro-3
- vercel/arcee-ai/trinity-large-thinking
- vercel/meituan/longcat-2.5-preview
- vercel/poolside/laguna-s-2.1-free
- vercel/xiaomi/mimo-v2.5
- vercel/xiaomi/mimo-v2.5-pro
</details>

<details>
<summary>Changed</summary>

- openrouter/deepseek/deepseek-v3.2
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4-pro
- openrouter/deepseek/deepseek-v4-pro-0813
- openrouter/deepseek/deepseek-v4.1-flash
- openrouter/google/gemma-4-26b-a4b-it
- openrouter/ibm-granite/granite-4.2-8b
- openrouter/meta-llama/llama-3.1-70b-instruct
- openrouter/meta-llama/llama-3.2-3b-instruct
- openrouter/meta-llama/llama-3.3-70b-instruct
- openrouter/meta-llama/llama-4-maverick
- openrouter/minimax/minimax-m2.5
- openrouter/mistralai/mistral-large-4-0
- openrouter/moonshotai/kimi-k2.7-code
- openrouter/moonshotai/kimi-k3
- openrouter/openai/gpt-oss-120b
- openrouter/openai/gpt-oss-20b
- openrouter/particle-ai/particle-1
- openrouter/qwen/qwen3-235b-a22b-2507
- openrouter/qwen/qwen3-coder-30b-a3b-instruct
- openrouter/qwen/qwen3-next-80b-a3b-instruct
- openrouter/qwen/qwen3.8-27b
- openrouter/z-ai/glm-4.6v
- openrouter/z-ai/glm-4.7
- openrouter/z-ai/glm-5.2
- openrouter/z-ai/glm-5.3-flash
- openrouter/z-ai/glm-5.3-flashx
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-pro-latest
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~x-ai/grok-latest
- openrouter/~z-ai/glm-flash-latest
- vercel/deepseek/deepseek-v4-flash-0731
- vercel/deepseek/deepseek-v4-pro
- vercel/deepseek/deepseek-v4.1-flash
- vercel/deepseek/deepseek-v4.1-flash-1017
- vercel/mistral/mistral-large-4
- vercel/moonshotai/kimi-k3.1-pro
- vercel/zai/glm-5.2
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/41999352102).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-05 09:48:48 +00:00
cdrciandgithub-actions[bot] 5c691c82c9 chore: refresh AI model price book (#31474)
## Price book changes

19 models added, 27 models removed, 37 models changed.

<details>
<summary>Added</summary>

- azure/gpt-6.1-terra
- bedrock/au.anthropic.claude-sonnet-5-5
- bedrock/global.openai.gpt-6.1-terra
- bedrock/openai.gpt-6.1-terra
- bedrock/us.openai.gpt-6.1-terra
- copilot/gpt-6.1-terra
- openai/gpt-6.1-terra
- openrouter/liquid/lfm-2.5-2.6b
- openrouter/minimax/minimax-m3.1-flash
- openrouter/moonshotai/kimi-k3.1-pro
- openrouter/openai/gpt-6.1-terra
- openrouter/openai/gpt-6.1-terra-pro
- openrouter/particle-ai/particle-1
- openrouter/prism-ml/ternary-bonsai-2-9b
- vercel/moonshotai/kimi-k3.1-pro
- vercel/moonshotai/kimi-k3.1-pro-highspeed
- vercel/openai/gpt-6.1-terra
- vercel/openai/gpt-6.1-terra-fast
- vercel/particle/particle-1
</details>

<details>
<summary>Removed</summary>

- azure/claude-opus-4-1
- azure/deepseek-r1
- copilot/mai-code-1-flash-picker
- google/gemini-3-pro-image-preview
- google/gemini-3.1-flash-image-preview
- openrouter/arcee-ai/trinity-large-thinking
- openrouter/ibm-granite/granite-4.0-h-micro
- openrouter/minimax/minimax-m3.1-flash:free
- openrouter/nvidia/nemotron-3-super-120b-a12b:free
- openrouter/openai/gpt-3.5-turbo
- openrouter/openai/gpt-3.5-turbo-instruct
- openrouter/openai/gpt-4-turbo
- openrouter/openai/gpt-5.2-chat
- openrouter/openai/o1
- openrouter/openai/o1-pro
- openrouter/openai/o3-mini
- openrouter/openai/o3-mini-high
- openrouter/openai/o4-mini
- openrouter/openai/o4-mini-high
- openrouter/qwen/qwen3-next-80b-a3b-thinking
- vercel/openai/gpt-3.5-turbo
- vercel/openai/gpt-4-turbo
- vercel/openai/gpt-4.1-nano-fast
- vercel/openai/gpt-image-1
- vercel/openai/o4-mini-fast
- vercel/spacexai/grok-4.1-fast-non-reasoning
- vercel/spacexai/grok-4.1-fast-reasoning
</details>

<details>
<summary>Changed</summary>

- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4.1-flash
- openrouter/google/gemini-3.8-flash
- openrouter/google/gemma-3-4b-it
- openrouter/ibm-granite/granite-4.2-8b
- openrouter/meta-llama/llama-3.2-3b-instruct
- openrouter/minimax/minimax-m2.5
- openrouter/mistralai/mistral-small-3.2-24b-instruct
- openrouter/moonshotai/kimi-k2.7-code
- openrouter/moonshotai/kimi-k3
- openrouter/nousresearch/hermes-4-405b
- openrouter/nvidia/nemotron-3-nano-30b-a3b
- openrouter/openai/gpt-4.1-nano
- openrouter/qwen/qwen3-30b-a3b-instruct-2507
- openrouter/qwen/qwen3.5-122b-a10b
- openrouter/qwen/qwen3.5-27b
- openrouter/qwen/qwen3.5-9b
- openrouter/qwen/qwen3.6-27b
- openrouter/qwen/qwen3.6-35b-a3b
- openrouter/qwen/qwen3.8-27b
- openrouter/reflection/beam-1.0-501b-a23b
- openrouter/xiaomi/mimo-v2.5
- openrouter/xiaomi/mimo-v2.5-pro
- openrouter/z-ai/glm-4.6
- openrouter/z-ai/glm-4.6v
- openrouter/z-ai/glm-5.2
- openrouter/z-ai/glm-5.3
- openrouter/z-ai/glm-5.3-flash
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-pro-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~openai/gpt-terra-latest
- openrouter/~z-ai/glm-flash-latest
- openrouter/~z-ai/glm-latest
- vercel/amazon/nova-2-lite
- vercel/minimax/minimax-m3.1-flash
- vercel/openai/gpt-4.1-nano
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/40846801723).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-29 15:39:30 +00:00
Sas Swart 837c2e1af1 feat(coderd): price token usage with organization prices (#30719)
Prices token usage by the most specific match: the organization's price
for the configured provider, then a site-wide custom price, then the
price book. The requested model is still preferred over the model the
provider reports.

- `GetAIModelPriceForProvider` replaces
`GetAIModelPriceByProviderModel`, which is removed. It is one `UNION
ALL` of primary-key lookups, ordered by requested model first, then by
specificity. dbauthz checks `ResourceAiModelPrice`, scoped to the org
when one is given.
- `coderd/aibridge/prices` tests read seeded prices through
`GetAIModelPrices`.

Interceptions don't carry an organization yet, so
`resolveTokenUsageCost` passes none and only site-wide prices apply at
runtime for now (AIGOV-716). Org matching is covered by database tests
with explicit org IDs. For the same reason, the unpriced-models report
still counts only site-wide prices.

**Used later:** prices set through the API in #30720 take effect here
once interceptions carry an organization.

---

*This PR was generated by Coder Agents on behalf of @SasSwart.*
2026-10-22 15:13:24 +00:00
cdrciandgithub-actions[bot] 04d7d4da9c chore: refresh AI model price book (#31162)
## Price book changes

26 models added, 8 models removed, 56 models changed.

<details>
<summary>Added</summary>

- azure/deepseek-v4.1-flash
- google/gemini-pro-latest
- openrouter/deepseek/deepseek-v4.1-flash-1017
- openrouter/elorian/glimpse
- openrouter/inception/mercury-3
- openrouter/meta/muse-spark-open
- openrouter/minimax/minimax-m3.1-flash:free
- openrouter/moondream/moondream3-preview
- openrouter/moondream/moondream3.1-9b-a2b
- openrouter/nvidia/nemotron-3.5-super-vl
- openrouter/nvidia/nemotron-3.5-super-vl:free
- openrouter/recursive/flint-v1.0:free
- openrouter/reflection/beam-1.0-501b-a23b
- openrouter/unbiased/pareto-26.10
- openrouter/xingchen-agi/xing4.0-29b-a4b:free
- vercel/deepseek/deepseek-v4.1-flash-1017
- vercel/deepseek/deepseek-v4.1-flash-1017-fast
- vercel/elorian/glimpse
- vercel/inception/mercury-3
- vercel/meta/muse-spark-open
- vercel/minimax/minimax-m3.1-flash
- vercel/nvidia/nemotron-3.5-super-vl
- vercel/reflection/beam
- vercel/reflection/beam-free
- vercel/scaledown/scaledown-extract-1
- vercel/scaledown/scaledown-summarize-1
</details>

<details>
<summary>Removed</summary>

- openai/gpt-5.2-chat-latest
- openai/gpt-5.3-chat-latest
- openrouter/anthropic/claude-sonnet-4
- openrouter/deepseek/deepseek-r1
- openrouter/microsoft/wizardlm-2-8x22b
- openrouter/sao10k/l3.3-euryale-70b
- openrouter/unbiased/pareto-26.10-preview
- vercel/anthropic/claude-sonnet-4
</details>

<details>
<summary>Changed</summary>

- azure/gpt-5
- azure/gpt-5-codex
- azure/gpt-5-mini
- azure/gpt-5-nano
- azure/gpt-5.2
- azure/gpt-5.6-sol
- openrouter/deepseek/deepseek-chat
- openrouter/deepseek/deepseek-v3.2
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4.1-flash
- openrouter/google/gemini-3.8-flash
- openrouter/google/gemma-3-27b-it
- openrouter/google/gemma-3-4b-it
- openrouter/meta-llama/llama-3.2-3b-instruct
- openrouter/meta-llama/llama-3.3-70b-instruct
- openrouter/meta-llama/llama-4-scout
- openrouter/mistralai/mistral-large-4-0
- openrouter/mistralai/mistral-small-3.2-24b-instruct
- openrouter/moonshotai/kimi-k3
- openrouter/nvidia/nemotron-3-super-120b-a12b
- openrouter/qwen/qwen3-30b-a3b-instruct-2507
- openrouter/qwen/qwen3-next-80b-a3b-instruct
- openrouter/qwen/qwen3.5-122b-a10b
- openrouter/qwen/qwen3.5-27b
- openrouter/qwen/qwen3.5-35b-a3b
- openrouter/qwen/qwen3.5-9b
- openrouter/qwen/qwen3.6-27b
- openrouter/qwen/qwen3.6-35b-a3b
- openrouter/qwen/qwen3.8-27b
- openrouter/stepfun/step-5-preview
- openrouter/upstage/solar-pro4
- openrouter/xiaomi/mimo-v2.5
- openrouter/xiaomi/mimo-v2.5-pro
- openrouter/z-ai/glm-4.6
- openrouter/z-ai/glm-4.7
- openrouter/z-ai/glm-5.1
- openrouter/z-ai/glm-5.2
- openrouter/z-ai/glm-5.3
- openrouter/z-ai/glm-5.3-flash
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-pro-latest
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~unbiased/pareto-latest
- openrouter/~z-ai/glm-flash-latest
- openrouter/~z-ai/glm-latest
- vercel/arcee-ai/trinity-large-thinking
- vercel/deepseek/deepseek-v4.1-flash
- vercel/meta/llama-3.3-70b
- vercel/meta/llama-4-maverick
- vercel/meta/llama-4-scout
- vercel/mistral/ministral-3b
- vercel/mistral/ministral-8b
- vercel/mistral/mistral-large-4
- vercel/stepfun/step-5-preview
- vercel/xiaomi/mimo-v2.5
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/39752842140).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-22 10:57:06 +01:00
cdrciandgithub-actions[bot] 7e69cd0af7 chore: refresh AI model price book (#30828)
## Price book changes

0 models added, 0 models removed, 24 models changed.

<details>
<summary>Changed</summary>

- openrouter/deepseek/deepseek-v4-pro
- openrouter/deepseek/deepseek-v4-pro-0813
- openrouter/deepseek/deepseek-v4.1-flash
- openrouter/google/gemma-4-31b-it
- openrouter/minimax/minimax-m2.5
- openrouter/mistralai/mistral-small-3.2-24b-instruct
- openrouter/moonshotai/kimi-k3
- openrouter/openai/gpt-5.6-sol
- openrouter/openai/gpt-5.6-sol-pro
- openrouter/openai/gpt-oss-120b
- openrouter/qwen/qwen3.6-35b-a3b
- openrouter/qwen/qwen3.8-27b
- openrouter/tencent/hy3
- openrouter/tencent/hy4-preview
- openrouter/z-ai/glm-5
- openrouter/z-ai/glm-5.1
- openrouter/z-ai/glm-5.2
- openrouter/z-ai/glm-5.3
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-pro-latest
- openrouter/~google/gemini-pro-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~z-ai/glm-flash-latest
- openrouter/~z-ai/glm-latest
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/38710433812).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-15 12:01:26 +01:00
Michael Suchacz e7c2fd5d2e feat: add Gemini 4 Argon to Agents and AI Gateway (#30780)
Add Gemini 4 Argon to the Agents known models catalog, so it appears as
a suggestion when an admin adds a chat model, and regenerate the AI
Gateway price book from models.dev.

| Provider | Model ID | Placed before |
|---|---|---|
| google | `gemini-4-argon` | `gemini-3.1-pro-preview` |
| openrouter, vercel | `google/gemini-4-argon` |
`google/gemini-3.8-flash` |

**Pricing.** The price book carries Google's launch rates on google,
openrouter, vercel, and copilot: $2 per 1M input tokens, $10 per 1M
output tokens, and $0.10 per 1M cached input tokens. Google doubles them
on 2026-12-01 ($4, $20, $0.20); the weekly refresh picks that up once
models.dev changes. The google entry keeps models.dev's 32,768 max
output tokens, the cap Google enforces on non-streaming
`generateContent` calls (larger values return HTTP 400 there).

**Thinking levels.** `googleSupportedThinkingLevels` did not recognize
the `argon` name token and failed closed, so chatd sent Argon no
`thinking_level` and no `include_thoughts`: the native Google path
dropped the reasoning effort, and neither path showed thought summaries.
Argon accepts LOW, MEDIUM, and HIGH like Gemini 3.1 Pro and rejects
MINIMAL, so the map now treats it like the Pro family.

**Upstream drift.** `prices.json` covers every model of its 8 providers,
so the regeneration also brings the changes since the last weekly
refresh, all on OpenRouter and Vercel: 14 other new entries, 26 entries
models.dev delisted, and 51 price changes. The catalog picks up the same
changes for 8 curated OpenRouter entries (DeepSeek, Kimi, Qwen, and
GLM).

## Testing

- Live requests to `gemini-4-argon` through the AI Gateway's Google
provider (Google's OpenAI-compatible endpoint): `reasoning_effort` and
`thinking_level` values `low`, `medium`, and `high` return 200 and
`minimal` returns 400; `include_thoughts` returns thought text in
streaming and non-streaming responses.
- Red-green: removing the `argon` token fails
`TestGoogleSupportedThinkingLevels/gemini-4-argon` (expected LOW,
MEDIUM, HIGH; got nil).
- Regenerating from the saved models.dev snapshot reproduces both
generated files byte for byte.
- `go test ./scripts/aibridgepricesgen/... ./coderd/aibridge/prices/...
./coderd/x/chatd/chatprovider/...` and `pnpm exec vitest run
--project=unit src/modules/aiModels/` pass. The pre-commit hook passed;
local pre-push checks were skipped, so CI is the first full run.

## Review record

- Frontend review: the only `site/` change is the generated
`knownModelsGenerated.json`, so the FE1 to FE10 checklist does not
apply; no hand-written frontend code changed.

> Xum opened this PR on behalf of @ibetitsmike.
2026-10-14 22:39:00 +02:00
cdrciandgithub-actions[bot] 315789c6bf chore: refresh AI model price book (#30498)
## Price book changes

27 models added, 8 models removed, 46 models changed.

<details>
<summary>Added</summary>

- anthropic/claude-haiku-5-5
- azure/claude-haiku-5-5
- azure/grok-4.6
- bedrock/anthropic.claude-haiku-5-5
- bedrock/au.anthropic.claude-haiku-5-5
- bedrock/eu.anthropic.claude-haiku-5-5
- bedrock/eu.anthropic.claude-sonnet-5-5
- bedrock/global.anthropic.claude-haiku-5-5
- bedrock/global.zai.glm-5.3
- bedrock/in.anthropic.claude-haiku-4-5-20251001-v1:0
- bedrock/in.anthropic.claude-opus-5
- bedrock/in.anthropic.claude-sonnet-5
- bedrock/jp.anthropic.claude-haiku-5-5
- bedrock/us.anthropic.claude-haiku-5-5
- bedrock/us.anthropic.claude-sonnet-5-5
- bedrock/us.zai.glm-5.3
- copilot/claude-haiku-5.5
- openrouter/anthropic/claude-haiku-5.5
- openrouter/apodex/apodex-1.1-mini:free
- openrouter/google/gemini-nano-banana-2.1
- openrouter/inclusionai/ling-3.1-flash
- openrouter/mistralai/mistral-large-4-0
- openrouter/unbiased/pareto-26.10-preview
- vercel/anthropic/claude-haiku-5.5
- vercel/google/gemini-nano-banana-2.1
- vercel/mistral/mistral-large-4
- vercel/stealth/glyph-cluster
</details>

<details>
<summary>Removed</summary>

- openrouter/kwaipilot/kat-coder-pro-v2.5
- openrouter/qwen/qwen3.8-27b:free
- openrouter/stealth/space-bunny-alpha
- vercel/deepseek/deepseek-v3.1-terminus
- vercel/inclusionai/ling-3.0-flash-sante-free
- vercel/liquid/d1
- vercel/moonshotai/kimi-k2-thinking
- vercel/stepfun/step-3.5-flash
</details>

<details>
<summary>Changed</summary>

- anthropic/claude-sonnet-5-5
- bedrock/anthropic.claude-sonnet-5-5
- bedrock/global.anthropic.claude-sonnet-5-5
- copilot/claude-sonnet-5.5
- openrouter/anthropic/claude-sonnet-5.5
- openrouter/deepseek/deepseek-v3.1-terminus
- openrouter/deepseek/deepseek-v3.2
- openrouter/deepseek/deepseek-v4-flash
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4-pro
- openrouter/deepseek/deepseek-v4.1-flash
- openrouter/inclusionai/ling-3.0-flash-fin
- openrouter/meta-llama/llama-4-maverick
- openrouter/meta/muse-glimmer-30b
- openrouter/moonshotai/kimi-k2.6
- openrouter/moonshotai/kimi-k3
- openrouter/nvidia/nemotron-3-nano-30b-a3b
- openrouter/nvidia/nemotron-3-super-120b-a12b
- openrouter/nvidia/nemotron-3-ultra-550b-a55b
- openrouter/nvidia/nemotron-3.5-lightning
- openrouter/openai/gpt-5.6-sol-pro
- openrouter/qwen/qwen3-235b-a22b-2507
- openrouter/qwen/qwen3-next-80b-a3b-instruct
- openrouter/qwen/qwen3.5-27b
- openrouter/qwen/qwen3.5-35b-a3b
- openrouter/qwen/qwen3.5-397b-a17b
- openrouter/qwen/qwen3.6-27b
- openrouter/qwen/qwen3.8-27b
- openrouter/z-ai/glm-5.1
- openrouter/z-ai/glm-5.2
- openrouter/z-ai/glm-5.3
- openrouter/~anthropic/claude-haiku-latest
- openrouter/~anthropic/claude-sonnet-latest
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-pro-latest
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~z-ai/glm-flash-latest
- openrouter/~z-ai/glm-latest
- vercel/anthropic/claude-sonnet-5.5
- vercel/arcee-ai/trinity-large-thinking
- vercel/google/gemini-3.8-flash-lite-tts
- vercel/google/gemini-3.8-flash-tts
- vercel/inclusionai/ling-3.0-flash-sante
- vercel/poolside/laguna-s-2.1
- vercel/xiaomi/mimo-v2.6-flash
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/37754651010).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-08 15:20:44 +01:00
cdrciandgithub-actions[bot] b530f0154d chore: refresh AI model price book (#30233)
## Price book changes

3 models added, 1 model removed, 23 models changed.

<details>
<summary>Added</summary>

- bedrock/global.openai.gpt-6.1-sol
- bedrock/openai.gpt-6.1-sol
- bedrock/us.openai.gpt-6.1-sol
</details>

<details>
<summary>Removed</summary>

- vercel/stealth/pixel-canary
</details>

<details>
<summary>Changed</summary>

- openrouter/deepseek/deepseek-v4-flash
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4-pro
- openrouter/deepseek/deepseek-v4-pro-0813
- openrouter/deepseek/deepseek-v4.1-flash
- openrouter/google/gemma-4-26b-a4b-it
- openrouter/meta/muse-glimmer-30b
- openrouter/minimax/minimax-m1
- openrouter/moonshotai/kimi-k2-thinking
- openrouter/moonshotai/kimi-k2.6
- openrouter/moonshotai/kimi-k2.7-code
- openrouter/moonshotai/kimi-k3
- openrouter/nvidia/nemotron-3.5-lightning
- openrouter/qwen/qwen3.8-27b
- openrouter/tencent/hy3
- openrouter/z-ai/glm-5.2
- openrouter/z-ai/glm-5.3
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-pro-latest
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~z-ai/glm-latest
- vercel/liquid/d1
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/36847028712).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-01 11:20:33 +01:00
Michael Suchacz 1e9dd0abbc feat: add Claude Sonnet 5.5 and GPT-6.1 Sol to Agents and AI Gateway (#30159)
Add Claude Sonnet 5.5 and GPT-6.1 Sol to the Agents known models
catalog, so they appear as suggestions when an admin adds a chat model,
and regenerate the AI Gateway price book from models.dev.

| Model | Added to |
|---|---|
| Claude Sonnet 5.5 | anthropic (`reasoningEffort: high`), azure,
bedrock (`global.anthropic.claude-sonnet-5-5`), openrouter, vercel |
| GPT-6.1 Sol | openai (`reasoningEffort: medium`), azure, openrouter,
vercel |

**Bedrock.** bedrock-runtime serves Sonnet 5.5 only through its global
inference profile, so the catalog curates the `global.` ID without a
bare alias: fantasy's Bedrock client prefixes a bare `anthropic.*` ID
with a regional profile (`us.`, `eu.`, `apac.`) that this model lacks.
bedrock-mantle takes the bare ID and the gateway looks prices up by
exact provider and model, so `overrides.jq` injects the bare ID as a
copy of the global price entry. The two GPT Daybreak alias injections
are gone: models.dev now lists both aliases, and their guards error out
once it does.

**Reasoning effort.** Sonnet 5.5 rejects the `thinking: {"type":
"disabled"}` that fantasy sends for effort `none`, and GPT-6.1 Sol
rejects `none` outright, both with HTTP 400. `applyReasoningEffort` now
maps `none` to `low` for Sonnet 5.5 on the Anthropic and Bedrock
providers, next to the Opus 5.5 clamp, and maps `none` and `minimal` to
`low` for GPT-6.1 Sol on OpenAI and Azure through a new
`chatopenai.IsGPT61Sol`, next to the GPT-6 Astra clamp. GPT-6 Sol
accepts `none` and stays unclamped; the test pins that. AI Gateway's
Bedrock adaptive-thinking allowlist already matched Sonnet 5.5 through
its `anthropic.claude-sonnet-5` substring; a table case now covers it.

**Price book drift.** `prices.json` includes every model of its 8
providers, so the regeneration also brings in upstream changes since the
last refresh: 28 new entries (such as Grok 4.7 on Bedrock and Mistral
Large 2512 on OpenRouter), 7 entries models.dev delisted (mostly free
variants on OpenRouter and Vercel), and 49 price changes (39 OpenRouter,
10 Vercel). Other uncurated upstream models, such as `-pro` and `-fast`
variants and `openai.*` on Bedrock, stay out of the catalog, matching
how earlier releases were curated.

The Reasoning effort section of `coderd/x/chatd/ARCHITECTURE.md`
documents only the GPT-6 Astra clamp and should gain Sonnet 5.5 and
GPT-6.1 Sol. That doc edit is left to a human author.

Validation: regenerating from a fresh models.dev fetch reproduces both
generated files byte for byte. Go tests pass for
`scripts/aibridgepricesgen`, `coderd/aibridge/prices`,
`coderd/x/chatd/chatprovider`, `coderd/x/chatd/chatopenai`, and
`aibridge/intercept/messages`. Removing either clamp with `go test
-overlay` fails the new cases on exactly the Sonnet 5.5 and GPT-6.1 Sol
inputs. Vitest passes for `src/modules/aiModels` (176 tests) and the
Models and Coder Agents settings pages (24 tests). The pre-commit hook
passed; local pre-push checks were skipped, so CI is the first full run.

Review record: no reviews yet. No remote UAT was run; the tested head is
`78abe17e69d`.

> Xum opened this PR on behalf of @ibetitsmike.
2026-09-29 18:46:41 -07:00
deafad29cc chore: refresh AI model price book (#29835)
## Price book changes

22 models added, 5 models removed, 21 models changed.

<details>
<summary>Added</summary>

- bedrock/global.moonshotai.kimi-k3
- bedrock/global.openai.gpt-6-luna
- bedrock/global.openai.gpt-6-sol
- bedrock/openai.gpt-6-luna
- bedrock/openai.gpt-6-sol
- bedrock/us.moonshotai.kimi-k3
- bedrock/us.openai.gpt-6-luna
- bedrock/us.openai.gpt-6-sol
- copilot/claude-opus-5.5
- copilot/gpt-6-luna
- copilot/gpt-6-sol
- openrouter/aion-labs/aion-3.5
- openrouter/aion-labs/aion-3.5-mini
- openrouter/cohere/command-a-plus
- openrouter/fireworks/ember-1
- openrouter/qwen/qwen3.8-max-prime
- openrouter/stealth/space-bunny-alpha
- openrouter/upstage/solar-mini4
- openrouter/z-ai/glm-5.3-prime
- vercel/alibaba/qwen3.8-max-prime
- vercel/google/gemini-3.8-flash-lite-tts
- vercel/google/gemini-3.8-flash-tts
</details>

<details>
<summary>Removed</summary>

- openrouter/inclusionai/ling-3.0-flash-vl:free
- openrouter/mistralai/devstral-2512
- openrouter/nex-agi/nex-n2.5-mini
- openrouter/nex-agi/nex-n2.5-pro
- vercel/inclusionai/ling-3.0-flash-vl-free
</details>

<details>
<summary>Changed</summary>

- openrouter/deepseek/deepseek-v4-flash
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4-pro
- openrouter/deepseek/deepseek-v4-pro-0813
- openrouter/deepseek/deepseek-v4.1-flash
- openrouter/minimax/minimax-m2
- openrouter/moonshotai/kimi-k2.7-code
- openrouter/nvidia/nemotron-3.5-lightning
- openrouter/qwen/qwen3-30b-a3b-instruct-2507
- openrouter/qwen/qwen3-next-80b-a3b-instruct
- openrouter/tencent/hy3
- openrouter/z-ai/glm-5.3
- openrouter/z-ai/glm-5.3-flashx
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-pro-latest
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~z-ai/glm-flash-latest
- openrouter/~z-ai/glm-latest
- vercel/inclusionai/ling-3.0-flash-vl
- vercel/openai/gpt-oss-120b
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/35979133021).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cian Johnston <cian@coder.com>
2026-09-24 10:48:28 +01:00
Michael Suchacz 5b5432ce73 feat: add GPT-6 Sol, GPT-6 Luna, and Claude Opus 5.5 to Agents and AI Gateway (#29762)
Add the models released on 2026-09-22 (GPT-6 Sol, GPT-6 Luna, and Claude
Opus 5.5) plus Grok 4.7 to the Agents known models catalog, so they
appear as suggestions when an admin adds a chat model in `/agents`
settings, and pick up their prices in the AI Gateway price book. chatd
and AI Gateway's Bedrock path also stop producing Opus 5.5 thinking
shapes it rejects.

| Model | Added to |
|---|---|
| GPT-6 Sol, GPT-6 Luna | openai, azure, openrouter, vercel |
| Claude Opus 5.5 | anthropic, azure, bedrock (plus `global.` alias),
openrouter, vercel |
| Grok 4.7 | openrouter (`x-ai/grok-4.7`), vercel (`spacexai/grok-4.7`)
|
| Qwen3.8 Max | vercel (`alibaba/qwen3.8-max-0902`; already curated on
openrouter) |

Every model is already on models.dev, so `overrides.jq` is unchanged.
Sol and Luna use `reasoningEffort: medium` like GPT-6 Astra and the
GPT-5.6 models. Opus 5.5 uses `high` like every other Opus, Fable, and
Mythos entry, and joins the Anthropic thinking-mode pin in
`knownModelsGenerated.test.ts`. Anthropic documents `medium` as the Opus
5.5 default, but the catalog value seeds both the default and the max
effort in the admin form (`applyKnownModelDefaults.ts`), so `medium`
would also stop users from picking `high`. Gateway entries follow the
existing convention of no reasoning default and upstream display names;
Qwen3.8 Max reuses its openrouter display name. New entries sort ahead
of the models they supersede.

**chatd.** Opus 5.5 always runs adaptive thinking and rejects `thinking:
{"type": "disabled"}` with HTTP 400. The pinned fantasy fork sends
exactly that for the `none` effort on Claude 5+ models (it exempts only
Mythos and Fable), and the effort picker offers `none` whenever a model
config sets a max effort. `applyReasoningEffort` now maps `none` to
`low` for Opus 5.5 on the Anthropic and Bedrock providers, next to the
existing GPT-6 Astra clamp. The new `ClampsNoneForClaudeOpus55` subtest
fails without the fix. The Reasoning effort section of
`coderd/x/chatd/ARCHITECTURE.md` documents the Astra clamp and should
gain a line for this one; that doc edit is left to a human author.

**AI Gateway on Bedrock.** Opus 5.5 also rejects `thinking: {"type":
"enabled", "budget_tokens": N}`. On the Bedrock InvokeModel path,
`augmentRequestForBedrockInvokeModel` in
`aibridge/intercept/messages/base.go` rewrote adaptive thinking into
that legacy shape for every model outside its adaptive-only allowlist.
`bedrockModelRequiresAdaptiveThinking` now includes Opus 5.5, so
adaptive requests pass through, legacy requests (Claude Code falls back
to them behind the gateway) convert to adaptive, and
`output_config.effort` is kept. `output_config.format` is still
stripped, as for the other adaptive-only models; before this change the
whole `output_config` was dropped. Two new
`TestAugmentRequestForBedrock_AdaptiveThinking` cases fail without the
fix.

Deliberately not added: the `-pro` (openrouter) and `-fast` (vercel)
variants, matching how Astra and the GPT-5.6 models are curated;
`openai.*` models on Bedrock; regional Bedrock profiles; `~` rolling
aliases; `copilot`; `azure/grok-4.6`, which models.dev lists without
pricing; vendors not curated on the gateways (Xiaomi MiMo V2.6, Nex
N2.5, and others); and variants of curated models (GLM 5.3 FlashX,
Qwen3.8 Omni Flash). All of these that have prices are still in the
price book.

Known gaps, unchanged by this PR:

- The price book stores one flat price per model, so the long-context
tier for Sol and Luna (above 272K input tokens) is not applied, as for
Astra.
- The Bedrock adaptive-only allowlist still lacks the already curated
Opus 5, Fable 5, and Fable 5.1, plus Mythos 5 and 5.1, which also reject
`budget_tokens`, so their adaptive requests still take the legacy
conversion. They predate this PR and need the same allowlist entry.
- AI Gateway forwards a client's explicit `thinking: {"type":
"disabled"}` unchanged on every path, so Opus 5.5 answers it with its
documented 400, as the direct API does.

`knownModelsGenerated.json` and
`coderd/aibridge/prices/data/prices.json` are regenerated with `make
gen/aibridge-prices` from one models.dev snapshot. Besides the rows
above, both carry the upstream drift the weekly scheduled refresh would
produce. The catalog has nine repriced gateway rows, including vercel
`openai/gpt-5.6-sol`, which moves from $2/$10 to $4/$20 per 1M
input/output tokens and now matches OpenAI's direct price. `prices.json`
gains 41 rows (26 for the models above across every listed provider, 15
for other new upstream models), drops 4 that upstream delisted, and
reprices 30.

Validation: `go test ./scripts/aibridgepricesgen/...
./coderd/aibridge/prices/... ./coderd/x/chatd/chatprovider/...
./aibridge/...`, `pnpm test src/modules/aiModels/` (176 tests),
`golangci-lint` on `chatprovider` and `aibridge/intercept/messages`, and
`biome check` on `knownModels/` pass.

Review log (4 completed review passes):

- Codex round 1 on `03decfde855`: two P1 findings. Bedrock adaptive
thinking for Opus 5.5 was confirmed by a failing test and fixed. The
request to add a TODO to `coderd/x/chatd/ARCHITECTURE.md` was declined;
the chatd paragraph above flags that section for a human.
- Codex round 2 on `0156b3e5997`: one P2 finding, that the chatd clamp
misses opaque Bedrock application inference profile ARNs and fantasy
then sends disabled thinking. Refuted: fantasy omits the thinking field
when it cannot parse a Claude version from the model ID, so Opus 5.5
keeps its default adaptive thinking.
- Codex round 3 on `0156b3e5997`: two P1 findings. The claim that
`minimal` reaches Opus 5.5 verbatim was refuted: fantasy normalizes it
to `low`. The request to rewrite a client's explicit `disabled` thinking
for Opus 5.5 on Bedrock was declined: the gateway forwards it unchanged
on every path, before and after this PR (see Known gaps).
- Codex round 4 on `0156b3e5997`: no findings ("Didn't find any major
issues").

> Xum opened this PR on behalf of @ibetitsmike.
2026-09-23 14:10:24 +02:00
Michael Suchacz ceed0df682 chore: add DeepSeek V4.1 Flash and other missed models to the known models catalog (#29585)
Add the models that landed on models.dev since the September 4 curation
pass (#28955), plus cross-provider gaps where a model was curated on one
provider but not on the others that serve it, so they appear as
suggestions when an admin adds a chat model in `/agents` settings.

| Model | Added to |
|---|---|
| GPT-6 Astra | azure, openrouter, vercel (already curated on openai) |
| Claude Mythos 5.1 | anthropic. Not on models.dev, so injected in
`overrides.jq` as a copy of `claude-fable-5-1`, mirroring the existing
`claude-mythos-5` injection. Anthropic's pricing page lists Mythos 5.1
at the same rates as Fable 5.1, including the reduced cache-read rate. |
| DeepSeek V4.1 Flash | openrouter, vercel |
| Gemini 3.8 / 3.7 / 3.6 Flash | openrouter, vercel (no Google models
were curated on either gateway) |
| Gemini 3.1 Pro Preview, Gemini Flash-Lite Latest, Gemini 3.5 Flash
Lite | google (the catalog had no Pro or Lite tier) |
| Claude Mythos 5 | azure (left pending in #28887) |
| Claude Opus 4.7 | azure, bedrock (plus `global.` alias), openrouter,
vercel |
| GPT-5.5, GPT-5.4 mini | openrouter, vercel |
| GPT-5.4, GPT-5.4 mini, GPT-5.3 Codex | azure |
| Grok 4.6, Qwen3.8 Flash, GLM 5.3 Flash, MiniMax M3, Kimi K2.7 Code |
openrouter, vercel |

Mythos 5.1 uses `reasoningEffort: high` like Fable 5.1 and is added to
the Anthropic thinking-mode pin in `knownModelsGenerated.test.ts`.
Gateway entries follow the existing convention: no reasoning default and
upstream display names. New entries sort ahead of the models they
supersede.

Deliberately not added: `openai.*` models on Bedrock (chatd's Bedrock
provider wraps the Anthropic client, so they cannot be used from Coder
Agents), models.dev's `~`-prefixed rolling aliases on OpenRouter, and
`copilot` (unsupported in chatd).

`knownModelsGenerated.json` and
`coderd/aibridge/prices/data/prices.json` are regenerated with `make
gen/aibridge-prices` from the same models.dev snapshot. Apart from the
`claude-mythos-5-1` row, the `prices.json` changes are upstream drift
since the last weekly refresh, the same content the scheduled refresh PR
would produce.

Validation: `go test ./scripts/aibridgepricesgen/...
./coderd/aibridge/prices/...` and `pnpm test src/modules/aiModels/` (174
tests) pass.

> Xum opened this PR on behalf of @ibetitsmike.
2026-09-18 21:04:59 +02:00
cdrciandgithub-actions[bot] b36311eae8 chore: refresh AI model price book (#29471)
## Price book changes

36 models added, 13 models removed, 96 models changed.

<details>
<summary>Added</summary>

- bedrock/apac.anthropic.claude-sonnet-4-20250514-v1:0
- bedrock/eu.anthropic.claude-sonnet-4-20250514-v1:0
- bedrock/global.anthropic.claude-sonnet-4-20250514-v1:0
- bedrock/google.gemma-4-26b-a4b
- bedrock/google.gemma-4-31b
- bedrock/google.gemma-4-e2b
- bedrock/in.openai.gpt-5.6-luna
- bedrock/in.openai.gpt-5.6-terra
- bedrock/us-gov.openai.gpt-oss-120b-1:0
- bedrock/us-gov.openai.gpt-oss-20b-1:0
- bedrock/us.amazon.nova-premier-v1:0
- bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0
- openrouter/inclusionai/ling-3.0-flash-vl
- openrouter/inclusionai/ling-3.0-flash-vl:free
- openrouter/inference-net/schematron-v2-small
- openrouter/inference-net/schematron-v2-turbo
- openrouter/sakana/fugu-max
- openrouter/sakana/fugu-ultra-v2
- openrouter/stealth/union-alpha
- openrouter/z-ai/glm-5.2:free
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-pro-latest
- openrouter/~openai/gpt-astra-latest
- openrouter/~openai/gpt-luna-latest
- openrouter/~openai/gpt-sol-latest
- openrouter/~openai/gpt-terra-latest
- vercel/bytedance/seed-2.1-turbo
- vercel/deepseek/deepseek-v4.1-flash
- vercel/google/gemini-3.8-live
- vercel/google/gemini-3.8-live-extended-thinking
- vercel/inclusionai/ling-3.0-flash-vl
- vercel/inclusionai/ling-3.0-flash-vl-free
- vercel/inference-net/schematron-v2-small
- vercel/inference-net/schematron-v2-turbo
- vercel/sakana/fugu-max
- vercel/sakana/fugu-ultra-v2
</details>

<details>
<summary>Removed</summary>

- openrouter/google/gemini-2.5-pro-preview-05-06
- openrouter/openai/gpt-4-turbo-preview
- openrouter/~openai/gpt-latest
- vercel/alibaba/qwen3.8-flash-next
- vercel/deepseek/deepseek-v4.1-flash-beta
- vercel/kwaipilot/kat-coder-air-v2.5
- vercel/kwaipilot/kat-coder-pro-v1
- vercel/kwaipilot/kat-coder-pro-v2
- vercel/kwaipilot/kat-coder-pro-v2.5
- vercel/mistral/devstral-2
- vercel/mistral/devstral-small-2
- vercel/mistral/mistral-medium
- vercel/mistral/pixtral-12b
</details>

<details>
<summary>Changed</summary>

- bedrock/amazon.nova-2-lite-v1:0
- bedrock/amazon.nova-lite-v1:0
- bedrock/amazon.nova-micro-v1:0
- bedrock/amazon.nova-pro-v1:0
- bedrock/anthropic.claude-opus-4-6-v1
- bedrock/anthropic.claude-sonnet-4-6
- bedrock/apac.amazon.nova-lite-v1:0
- bedrock/apac.amazon.nova-micro-v1:0
- bedrock/apac.amazon.nova-pro-v1:0
- bedrock/au.anthropic.claude-haiku-4-5-20251001-v1:0
- bedrock/au.anthropic.claude-opus-4-6-v1
- bedrock/au.anthropic.claude-opus-4-8
- bedrock/au.anthropic.claude-opus-5
- bedrock/au.anthropic.claude-sonnet-4-5-20250929-v1:0
- bedrock/au.anthropic.claude-sonnet-5
- bedrock/ca.amazon.nova-lite-v1:0
- bedrock/eu.amazon.nova-2-lite-v1:0
- bedrock/eu.amazon.nova-lite-v1:0
- bedrock/eu.amazon.nova-micro-v1:0
- bedrock/eu.amazon.nova-pro-v1:0
- bedrock/global.amazon.nova-2-lite-v1:0
- bedrock/google.gemma-3-12b-it
- bedrock/google.gemma-3-27b-it
- bedrock/jp.amazon.nova-2-lite-v1:0
- bedrock/jp.anthropic.claude-haiku-4-5-20251001-v1:0
- bedrock/jp.anthropic.claude-opus-4-7
- bedrock/jp.anthropic.claude-opus-4-8
- bedrock/jp.anthropic.claude-opus-5
- bedrock/jp.anthropic.claude-sonnet-4-5-20250929-v1:0
- bedrock/jp.anthropic.claude-sonnet-4-6
- bedrock/jp.anthropic.claude-sonnet-5
- bedrock/mistral.voxtral-small-24b-2507
- bedrock/qwen.qwen3-coder-480b-a35b-v1:0
- bedrock/qwen.qwen3-coder-next
- bedrock/qwen.qwen3-next-80b-a3b
- bedrock/qwen.qwen3-vl-235b-a22b
- bedrock/us.amazon.nova-2-lite-v1:0
- bedrock/us.amazon.nova-lite-v1:0
- bedrock/us.amazon.nova-micro-v1:0
- bedrock/us.amazon.nova-pro-v1:0
- bedrock/us.anthropic.claude-fable-5
- bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0
- bedrock/us.anthropic.claude-opus-4-5-20251101-v1:0
- bedrock/us.anthropic.claude-opus-4-6-v1
- bedrock/us.anthropic.claude-opus-4-7
- bedrock/us.anthropic.claude-opus-4-8
- bedrock/us.anthropic.claude-opus-5
- bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0
- bedrock/us.anthropic.claude-sonnet-4-6
- bedrock/us.anthropic.claude-sonnet-5
- openrouter/deepseek/deepseek-chat-v3-0324
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4-pro
- openrouter/deepseek/deepseek-v4-pro-0813
- openrouter/google/gemma-4-26b-a4b-it
- openrouter/gryphe/mythomax-l2-13b
- openrouter/meta-llama/llama-4-maverick
- openrouter/meta/muse-glimmer-30b
- openrouter/minimax/minimax-m1
- openrouter/minimax/minimax-m2.5
- openrouter/mistralai/mistral-small-3.2-24b-instruct
- openrouter/moonshotai/kimi-k2.7-code
- openrouter/nvidia/nemotron-3-nano-30b-a3b
- openrouter/nvidia/nemotron-3-super-120b-a12b
- openrouter/qwen/qwen3-14b
- openrouter/qwen/qwen3-235b-a22b-2507
- openrouter/qwen/qwen3-30b-a3b-instruct-2507
- openrouter/qwen/qwen3-vl-30b-a3b-instruct
- openrouter/qwen/qwen3.5-35b-a3b
- openrouter/qwen/qwen3.8-27b
- openrouter/upstage/solar-pro4
- openrouter/z-ai/glm-4.6
- openrouter/z-ai/glm-5.2
- openrouter/z-ai/glm-5.3-flash
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~z-ai/glm-latest
- vercel/alibaba/qwen-3.6-max-preview
- vercel/alibaba/qwen3.5-flash
- vercel/alibaba/qwen3.5-plus
- vercel/alibaba/qwen3.6-plus
- vercel/alibaba/qwen3.8-flash
- vercel/alibaba/qwen3.8-max
- vercel/amazon/nova-lite
- vercel/amazon/nova-micro
- vercel/amazon/nova-pro
- vercel/deepseek/deepseek-v3.2
- vercel/inclusionai/ling-3.0-flash
- vercel/mistral/ministral-14b
- vercel/mistral/mistral-large-3
- vercel/mistral/mistral-medium-3.5
- vercel/mistral/mistral-nemo
- vercel/mistral/mistral-small
- vercel/moonshotai/kimi-k2.5
- vercel/nvidia/nemotron-3-nano-30b-a3b
- vercel/openai/gpt-oss-20b
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/35203280221).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-17 10:28:05 +01:00
Susana Ferreira e8682044cf fix: price Copilot utility model calls at zero (#29226)
Add zero-price entries for Copilot’s GPT-4o mini, GPT-4o, and GPT-4.1,
based on GitHub’s [utility-model
documentation](https://docs.github.com/en/copilot/concepts/models/utility-models#list-of-utility-models).

Keep GPT-5.4 nano’s existing rates: background utility calls are
unbilled, but GitHub also publishes [Copilot prices specifically for
GPT-5.4 nano’s billable
usage](https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing#openai).
AI Gateway cannot distinguish utility calls from billable usage by model
ID, so we retain Nano’s published rates. This overestimates costs for
its unbilled utility calls. No existing model prices are changed.

> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
2026-09-11 15:27:25 +01:00
Susana Ferreira b3f43513a8 fix: add OpenAI Daybreak alias pricing (#29218)
Add pricing for `gpt-daybreak-blue-latest` (alias of `gpt-5.6-sol`) and
`gpt-daybreak-red-latest` (alias of `gpt-5.6-cyber`), as documented on
[OpenAI’s pricing
page](https://developers.openai.com/api/docs/pricing#cyber-models).

Blue copies models.dev pricing; Red uses OpenAI’s published rates
because Cyber is missing from models.dev. Comments link to the source
and note that alias targets can change. Only these two price entries are
added.

> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
2026-09-11 12:17:30 +01:00
Susana Ferreira 3ed8548e78 fix: unblock AI price book refresh for gpt-6-astra and qwen3.8-max (#29170)
The weekly `aigateway-prices-refresh` job
[failed](https://github.com/coder/coder/actions/runs/34458761592)
because two upstream-guard assertions in the generator tripped:
models.dev now lists OpenAI's `gpt-6-astra` (so its `overrides.jq`
injection must be dropped), and the curated OpenRouter
`qwen/qwen3.8-max` identifier was renamed upstream to
`qwen/qwen3.8-max-0902`.

This removes the `gpt-6-astra` injection, repoints the qwen curation
entry to `qwen/qwen3.8-max-0902` (with a `displayName` override to keep
the clean "Qwen3.8 Max" label in the UI), and regenerates `prices.json`
and `knownModelsGenerated.json`.

Note: because the artifacts regenerate from live models.dev, this diff
also carries unrelated upstream drift, the same content the scheduled
refresh PR would produce.

> [!NOTE]
> Generated with Coder Agents on behalf of @ssncferreira.
2026-09-10 11:31:23 +01:00
Jake Howell 257c6f1dca refactor: move shared AI model UI into modules/aiModels (#29040)
> 🤖 Refactoring with Cursor.

AI settings was importing model form fields, ModelSelector, and
ProviderIcon from AgentsPage. Those now live in
`site/src/modules/aiModels`.

No user-facing behavior change.

- Move ProviderIcon, ModelSelector, and the model admin form fields into
`modules/aiModels`
- Point AgentsPage and AI settings at the new paths
- Drop the leftover ChatModelAdminPanel ProviderIcon duplicate and the
knownModels barrel
- Update the known-models catalog generator paths
2026-09-08 14:34:51 +10:00
Michael Suchacz 9cd66d3773 feat: add GPT-6 Astra to the known models catalog, price book, and chatd (#28955) 2026-09-04 11:19:29 +02:00
cdrciandgithub-actions[bot] b938495bf5 chore: refresh AI model price book (#28939)
## Price book changes

7 models added, 0 models removed, 15 models changed.

<details>
<summary>Added</summary>

- openrouter/meta/muse-spark-1.3
- openrouter/meta/muse-spark-1.3-contributor
- vercel/alibaba/qwen3.8-max-0902
- vercel/google/gemini-3.8-flash
- vercel/meta/muse-spark-1.3
- vercel/meta/muse-spark-1.3-contributor
- vercel/zai/glm-5.3-promo-50
</details>

<details>
<summary>Changed</summary>

- azure/gpt-5.6-sol
- openrouter/deepseek/deepseek-v4-flash
- openrouter/deepseek/deepseek-v4-flash-vision-exp
- openrouter/deepseek/deepseek-v4-pro
- openrouter/deepseek/deepseek-v4-pro-0813
- openrouter/meta-llama/llama-3.3-70b-instruct
- openrouter/meta/muse-glimmer-30b
- openrouter/nvidia/nemotron-3-nano-30b-a3b
- openrouter/nvidia/nemotron-3-ultra-550b-a55b
- openrouter/qwen/qwen3.5-397b-a17b
- openrouter/qwen/qwen3.8-2.4t-a95b
- openrouter/tencent/hy3
- openrouter/z-ai/glm-4.6
- openrouter/z-ai/glm-5.3
- openrouter/~z-ai/glm-latest
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
-
`site/src/pages/AgentsPage/components/ChatModelAdminPanel/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/33736992948).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-03 13:41:16 +02:00
Michael Suchacz a8f7591627 chore: add Gemini 3.8 Flash to the known models catalog and price book (#28909) 2026-09-02 18:35:51 +00:00
Michael Suchacz 560ef00c15 chore: add Claude Fable 5.1 and other new models to the known models catalog (#28887)
Add the models that landed on models.dev since the August curation pass
to the Agents-page known models list, so they appear as suggestions when
an admin adds a chat model in `/agents` settings.

| Model | Providers |
|---|---|
| Claude Fable 5.1 | anthropic, azure, bedrock (plus `global.` alias),
openrouter, vercel |
| Claude Opus 5 | anthropic (already curated on the other providers) |
| Gemini 3.7 Flash | google |
| GLM 5.3 | openrouter, vercel |

Fable 5.1 and Opus 5 use `reasoningEffort: high` like their curated
siblings, and new entries sort ahead of the models they supersede.
`knownModelsGenerated.json` and
`coderd/aibridge/prices/data/prices.json` are both regenerated with
`make gen/aibridge-prices` from the same models.dev snapshot; the
`prices.json` changes are upstream drift since the last weekly refresh.

Left out pending a decision: azure now lists `claude-mythos-5` upstream
but it is not curated for azure here, and `copilot` has no curation
entries at all.

> Xum opened this PR on behalf of @ibetitsmike.
2026-09-02 09:50:57 +02:00
cdrciandgithub-actions[bot] debe8e51bb chore: refresh AI model price book (#28711)
## Price book changes

36 models added, 27 models removed, 47 models changed.

<details>
<summary>Added</summary>

- openrouter/deepseek/deepseek-v4-flash-vision-exp
- openrouter/mancer/weaver
- openrouter/meta/muse-spark-1.2-contributor
- openrouter/minimax/minimax-m2.7:free
- openrouter/minimax/minimax-m3:free
- openrouter/mistralai/devstral-2512
- openrouter/mistralai/ministral-8b
- openrouter/qwen/qwen3.8-flash
- openrouter/tencent/hy-mt2-1.8b
- openrouter/tencent/hy-mt2-30b-a3b
- openrouter/tencent/hy-mt2-7b
- openrouter/thinkingmachines/inkling-small:free
- openrouter/thinkingmachines/inkling:free
- openrouter/z-ai/glm-5.3-flash
- vercel/alibaba/qwen3.8-flash
- vercel/deepseek/deepseek-v4-flash-vision-exp
- vercel/google/gemini-3.5-transcribe
- vercel/minimax/minimax-m2.7-free
- vercel/minimax/minimax-m3-free
- vercel/openai/gpt-oss-safeguard-120b
- vercel/spacexai/grok-4.1-fast-non-reasoning
- vercel/spacexai/grok-4.1-fast-reasoning
- vercel/spacexai/grok-4.20-multi-agent
- vercel/spacexai/grok-4.20-multi-agent-beta
- vercel/spacexai/grok-4.20-non-reasoning
- vercel/spacexai/grok-4.20-non-reasoning-beta
- vercel/spacexai/grok-4.20-reasoning
- vercel/spacexai/grok-4.20-reasoning-beta
- vercel/spacexai/grok-4.3
- vercel/spacexai/grok-4.5
- vercel/spacexai/grok-4.6
- vercel/spacexai/grok-build-0.1
- vercel/tencent/hy-mt2-lite
- vercel/tencent/hy-mt2-plus
- vercel/tencent/hy-mt2-pro
- vercel/zai/glm-5.3-flash
</details>

<details>
<summary>Removed</summary>

- openrouter/deepcogito/cogito-v2.1-671b
- openrouter/google/gemma-3n-e4b-it
- openrouter/inclusionai/ling-2.6-1t
- openrouter/inclusionai/ling-2.6-flash
- openrouter/inclusionai/ring-2.6-1t
- openrouter/nvidia/nemotron-3-nano-30b-a3b:free
- openrouter/nvidia/nemotron-nano-12b-v2-vl:free
- openrouter/nvidia/nemotron-nano-9b-v2:free
- openrouter/openai/gpt-oss-20b:free
- openrouter/qwen/qwen-plus-2025-07-28:thinking
- vercel/arcee-ai/trinity-mini
- vercel/mistral/magistral-medium
- vercel/mistral/magistral-small
- vercel/openai/gpt-4o-mini-search-preview
- vercel/openai/o3-deep-research
- vercel/xai/grok-4.1-fast-non-reasoning
- vercel/xai/grok-4.1-fast-reasoning
- vercel/xai/grok-4.20-multi-agent
- vercel/xai/grok-4.20-multi-agent-beta
- vercel/xai/grok-4.20-non-reasoning
- vercel/xai/grok-4.20-non-reasoning-beta
- vercel/xai/grok-4.20-reasoning
- vercel/xai/grok-4.20-reasoning-beta
- vercel/xai/grok-4.3
- vercel/xai/grok-4.5
- vercel/xai/grok-4.6
- vercel/xai/grok-build-0.1
</details>

<details>
<summary>Changed</summary>

- bedrock/global.openai.gpt-5.6-luna
- bedrock/global.openai.gpt-5.6-sol
- bedrock/global.openai.gpt-5.6-terra
- bedrock/openai.gpt-5.6-sol
- copilot/gpt-5.6-sol
- google/gemini-3.6-flash
- google/gemini-flash-latest
- google/gemini-flash-lite-latest
- openai/gpt-5.6
- openai/gpt-5.6-sol
- openrouter/deepseek/deepseek-chat-v3.1
- openrouter/deepseek/deepseek-v3.1-terminus
- openrouter/deepseek/deepseek-v3.2
- openrouter/deepseek/deepseek-v4-flash
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4-pro
- openrouter/deepseek/deepseek-v4-pro-0813
- openrouter/meta-llama/llama-3.3-70b-instruct
- openrouter/meta-llama/llama-4-scout
- openrouter/minimax/minimax-m2.5
- openrouter/mistralai/mistral-small-3.2-24b-instruct
- openrouter/moonshotai/kimi-k2.5
- openrouter/moonshotai/kimi-k2.7-code
- openrouter/nvidia/nemotron-3-nano-30b-a3b
- openrouter/openai/gpt-5.6-sol
- openrouter/openai/gpt-5.6-sol-pro
- openrouter/openai/gpt-oss-120b
- openrouter/qwen/qwen2.5-vl-72b-instruct
- openrouter/qwen/qwen3-235b-a22b-2507
- openrouter/qwen/qwen3-30b-a3b
- openrouter/qwen/qwen3-next-80b-a3b-instruct
- openrouter/qwen/qwen3.6-27b
- openrouter/qwen/qwen3.6-35b-a3b
- openrouter/qwen/qwen3.8-27b
- openrouter/z-ai/glm-4.6
- openrouter/z-ai/glm-5.1
- openrouter/z-ai/glm-5.2
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~openai/gpt-latest
- vercel/deepseek/deepseek-v4-flash-0731
- vercel/deepseek/deepseek-v4-pro-0813
- vercel/nvidia/nemotron-3.5-lightning
- vercel/openai/gpt-5.6-sol
- vercel/openai/gpt-5.6-sol-fast
- vercel/openai/gpt-oss-safeguard-20b
- vercel/tencent/hy3
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
-
`site/src/pages/AgentsPage/components/ChatModelAdminPanel/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/33072075172).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-27 15:03:51 +01:00
Yevhenii Shcherbina 211f490910 refactor: share the AI Gateway price book contract (#28310)
Follow-up to the review discussion on the price book refresh automation:
https://github.com/coder/coder/pull/28146#discussion_r3806439966

## Problem

The price seed row struct was duplicated three times, so a JSON tag
change had to be repeated in each copy:

- `scripts/aibridgepricesgen.priceRow`
- `scripts/aibridgepricesdiff.priceRow`
- `coderd/aibridge/prices.seedRow`

The `(provider, model)` key and its parsing were duplicated too.

## Change

Add `coderd/aibridge/prices/pricebook` holding the shared contract:
`Row`, `Key`, `Row.Key()`, and `Parse`. The package depends only on the
standard library, so the scripts can import it without pulling in the
database layer that `coderd/aibridge/prices` brings.

Consumer-specific behaviour stays where it is: upstream conversion and
validation in the generator, comparison and Markdown rendering in the
diff tool, DB seeding and runtime lookup in the seeder.

The batch SQL upsert still extracts JSON fields by name, so it remains a
separate contract boundary. The note about keeping it in sync now lives
on the shared `Row`.

No generated artifacts change; the serialized schema is identical.

---

<sub>Opened by Coder Agents on behalf of @evgeniy-scherbina.</sub>
2026-08-20 14:04:23 -04:00
Susana Ferreira 19d1ee9fc8 feat: support custom prices for models in the price book (#28328)
## Description

The experimental CLI could only price models the price book does not cover, so an operator with a negotiated rate for a model Coder already prices had no way to record it. The restriction existed because a single row served both the price book and prices set through the API, and the startup seeder would overwrite an override on the next restart.

Each source now keeps its own row (https://github.com/coder/coder/pull/28204), so that no longer applies. This removes the restriction: a price set through the CLI takes effect over the price book for any model, and the book stays underneath it.

## Changes

- Remove the validation that rejected models the price book covers.
- Delete `prices.IsDefaultPriced` and the index behind it, which existed only for that check.
- Generalize the `coder exp ai-model-prices update` help.
- Document that a custom price overrides the price book and does not follow its updates.
- Rework the spend approximation callout around what a custom price can and cannot correct.

Closes https://linear.app/codercom/issue/AIGOV-594

> [!NOTE]
> Initially generated by Claude Opus 5, modified and reviewed by @ssncferreira
2026-08-20 11:46:38 +01:00
Susana Ferreira 9390e51422 feat: distinguish default and custom AI model prices (#28204)
## Description

Prices in `ai_model_prices` come from two places: the price book embedded in each Coder release, and prices set through the experimental CLI (https://github.com/coder/coder/pull/27926). Until now, they were indistinguishable, so the startup seeder re-applied the book over every row, and a price someone set would silently revert on the next restart.

This adds a `source` column with values `default` and `custom`, and keeps a row for each. Readers resolve a model to its custom price when one exists and fall back to the book, including the cost path that prices an interception.

Keeping both rows means the price book stays current underneath an override, so a future delete can restore it.

Note: the endpoint still only accepts models the price book does not cover. Overriding a price the book already carries is handled by the follow-up issue https://linear.app/codercom/issue/AIGOV-594.

## Changes

- Add a migration for the `ai_model_price_source` enum and a `source` column, backfilled to `default` and then `NOT NULL`. `source` joins the primary key, so a model can hold one row per source.
- Take a `source` parameter on `UpsertAIModelPrices`. Each source keeps its own row, so the price book and a custom price never overwrite each other.
- Resolve to the custom price in `GetAIModelPriceByProviderModel` and `GetAIModelPrices`, so both the interception cost snapshot and the list endpoint use it.
- Seed the price book as `default`, and write prices set through the endpoint as `custom`.

Closes https://linear.app/codercom/issue/AIGOV-592

> [!NOTE]
> Initially generated by Claude Opus 5, modified and reviewed by @ssncferreira
2026-08-20 11:36:58 +01:00
cdrciandgithub-actions[bot] 5e0710de92 chore: refresh AI model price book (#28365)
## Price book changes

61 models added, 14 models removed, 51 models changed.

<details>
<summary>Added</summary>

- azure/claude-mythos-5
- azure/claude-opus-4-7
- azure/kimi-k2.7-code
- bedrock/global.openai.gpt-5.6-luna
- bedrock/global.openai.gpt-5.6-sol
- bedrock/global.openai.gpt-5.6-terra
- bedrock/xai.grok-4.6
- copilot/gemini-3.7-flash
- copilot/grok-4.6
- copilot/kimi-k3
- copilot/mai-code-1.1-flash
- google/gemini-3.7-flash
- openrouter/bytedance-seed/seed-2-1-turbo
- openrouter/bytedance-seed/seed-2.0-code
- openrouter/deepseek/deepseek-v4-pro-0813
- openrouter/dots-studio/dots-3-note-preview:free
- openrouter/google/gemini-3.7-flash
- openrouter/inclusionai/ling-3.0-flash
- openrouter/liquid/lfm-2.5-2.6b:free
- openrouter/meta/muse-glimmer-30b
- openrouter/meta/muse-spark-1.2
- openrouter/nvidia/nemotron-3.5-lightning
- openrouter/nvidia/nemotron-3.5-lightning:free
- openrouter/qwen/qwen3.8-2.4t-a95b
- openrouter/qwen/qwen3.8-27b
- openrouter/sakana/sakana-namazu
- openrouter/upstage/solar-pro4
- openrouter/x-ai/grok-4.6
- openrouter/z-ai/glm-5.2:free
- openrouter/z-ai/glm-5.3
- openrouter/~z-ai/glm-latest
- vercel/alibaba/qwen3.8-2.4t-a95b
- vercel/alibaba/qwen3.8-27b
- vercel/deepseek/deepseek-v4-pro-0813
- vercel/google/gemini-3.7-flash
- vercel/inclusionai/ling-3.0-flash
- vercel/meta/muse-glimmer-30b
- vercel/meta/muse-spark-1.2
- vercel/meta/muse-spark-1.2-contributor
- vercel/nvidia/nemotron-3.5-lightning
- vercel/openai/gpt-4.1-fast
- vercel/openai/gpt-4.1-mini-fast
- vercel/openai/gpt-4.1-nano-fast
- vercel/openai/gpt-4o-fast
- vercel/openai/gpt-4o-mini-fast
- vercel/openai/gpt-5-fast
- vercel/openai/gpt-5-mini-fast
- vercel/openai/gpt-5.1-thinking-fast
- vercel/openai/gpt-5.2-fast
- vercel/openai/gpt-5.3-codex-fast
- vercel/openai/gpt-5.4-fast
- vercel/openai/gpt-5.4-mini-fast
- vercel/openai/gpt-5.5-fast
- vercel/openai/gpt-5.6-luna-fast
- vercel/openai/gpt-5.6-sol-fast
- vercel/openai/gpt-5.6-terra-fast
- vercel/openai/o3-fast
- vercel/openai/o4-mini-fast
- vercel/sakana/namazu
- vercel/xai/grok-4.6
- vercel/zai/glm-5.3
</details>

<details>
<summary>Removed</summary>

- anthropic/claude-opus-4-1
- anthropic/claude-opus-4-1-20250805
- google/gemini-2.0-flash
- google/gemini-2.0-flash-lite
- google/gemini-3-pro-preview
- openrouter/ai21/jamba-large-1.7
- openrouter/inclusionai/ling-3.0-flash:free
- openrouter/mancer/weaver
- openrouter/openai/gpt-5.3-chat
- vercel/anthropic/claude-opus-4.1
- vercel/inclusionai/ling-3.0-flash-free
- vercel/openai/gpt-5.1-instant
- vercel/openai/gpt-5.3-chat
- vercel/zai/glm-4.6v
</details>

<details>
<summary>Changed</summary>

- azure/gpt-5.6-luna
- azure/gpt-5.6-sol
- azure/gpt-5.6-terra
- bedrock/openai.gpt-5.6-sol
- openrouter/deepseek/deepseek-chat-v3-0324
- openrouter/deepseek/deepseek-v3.1-terminus
- openrouter/deepseek/deepseek-v4-flash
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4-pro
- openrouter/google/gemini-3.6-flash
- openrouter/google/gemma-4-31b-it
- openrouter/gryphe/mythomax-l2-13b
- openrouter/minimax/minimax-m2.5
- openrouter/minimax/minimax-m2.7
- openrouter/mistralai/mistral-small-3.2-24b-instruct
- openrouter/moonshotai/kimi-k2.5
- openrouter/moonshotai/kimi-k2.6
- openrouter/moonshotai/kimi-k2.7-code
- openrouter/openai/gpt-5.6-luna
- openrouter/openai/gpt-5.6-luna-pro
- openrouter/openai/gpt-5.6-sol
- openrouter/openai/gpt-5.6-sol-pro
- openrouter/openai/gpt-5.6-terra
- openrouter/openai/gpt-5.6-terra-pro
- openrouter/openai/gpt-oss-120b
- openrouter/qwen/qwen-plus-2025-07-28:thinking
- openrouter/qwen/qwen2.5-vl-72b-instruct
- openrouter/qwen/qwen3-14b
- openrouter/qwen/qwen3-235b-a22b-2507
- openrouter/qwen/qwen3-30b-a3b
- openrouter/qwen/qwen3-coder-30b-a3b-instruct
- openrouter/qwen/qwen3-vl-235b-a22b-thinking
- openrouter/qwen/qwen3-vl-30b-a3b-instruct
- openrouter/qwen/qwen3.5-35b-a3b
- openrouter/qwen/qwen3.6-27b
- openrouter/qwen/qwen3.6-35b-a3b
- openrouter/tencent/hy3-preview
- openrouter/thinkingmachines/inkling
- openrouter/thinkingmachines/inkling-small
- openrouter/z-ai/glm-5
- openrouter/z-ai/glm-5.2
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~google/gemini-flash-latest
- openrouter/~moonshotai/kimi-latest
- openrouter/~openai/gpt-latest
- openrouter/~x-ai/grok-latest
- vercel/deepseek/deepseek-v4-flash
- vercel/deepseek/deepseek-v4-pro
- vercel/google/gemini-3.6-flash
- vercel/openai/gpt-5.6-sol
- vercel/zai/glm-5.2
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
-
`site/src/pages/AgentsPage/components/ChatModelAdminPanel/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/32352560765).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-20 10:46:48 +01:00
Susana Ferreira 2d9b6eda8f feat: add experimental CLI to price unpriced AI models (#27926)
## Description

AI Gateway computes the cost of an interception from `ai_model_prices`,
which is seeded on every server start from a price book embedded in the
binary. A model the price book does not cover records a NULL cost, so
its spend is invisible to cost reporting and is not enforced against
budgets. The only fix was to wait for a Coder release that added the
model.

This adds an experimental CLI, backed by an experimental HTTP endpoint,
for pricing those models. Models the price book already covers are
rejected, because the seeder re-applies the book on every start and
would overwrite an operator price. Support for custom pricing will be
handled in
https://linear.app/codercom/issue/AIGOV-589/extend-experimental-cli-command-to-set-custom-ai-model-prices.

## Commands

```
coder exp ai-model-prices list [--provider] [--model]
coder exp ai-model-prices update [file|-] [--provider] [--model] [--input-price] [--output-price] [--cache-read-price] [--cache-write-price] [--yes]
```

## Changes

- Add `GET` and `POST /api/experimental/ai/model-prices`, gated behind
the AI Bridge entitlement and the existing `ai_model_price` RBAC
resource.
- Add a `GetAIModelPrices` query with optional `provider` and `model`
filters applied in SQL.
- Validate the whole request before writing anything, so one bad entry
cannot leave the table half updated, and report every problem at once.
- Reject prices for models the embedded price book already covers,
through a new `prices.IsDefaultPriced`.
- Add the `coder exp ai-model-prices` command with `list` and `update`.
`update` accepts a JSON document or the single-model flags and prints a
plan, asking to confirm unless the document is piped in or `--yes` is
passed.
- Consolidate the supported provider list into
`coderd/aibridge/prices/providers` so the price generator and the server
share one definition.
- Add `codersdk` types and client methods for both endpoints, and bound
the request body at 1 MiB.
- Document the command in the AI Gateway cost controls page.

Closes
https://linear.app/codercom/issue/AIGOV-567/experimental-cli-command-to-set-prices-for-unpriced-ai-models

> [!NOTE]
> Initially generated by Claude Opus 5, modified and reviewed by
@ssncferreira
2026-08-13 15:00:36 +01:00
Susana Ferreira 5efa7abe7d fix: only write AI model prices that changed (#27923)
Previously, the AI Gateway price seeder rewrote every row of
`ai_model_prices` on each server start, because `ON CONFLICT` fires on a
key conflict rather than on a value difference. `updated_at` therefore
recorded when the server last restarted rather than when a price last
changed.

Guard the `DO UPDATE` branch so a conflicting row is only rewritten when
one of its four prices differs. The comparison uses `IS DISTINCT FROM`
rather than `<>` because the price columns are nullable, and `<>` yields
NULL when either side is NULL, which would skip the update and leave a
stale price in place.

Related to
https://linear.app/codercom/issue/AIGOV-567/experimental-cli-command-to-set-prices-for-unpriced-ai-models

> [!NOTE]
> Initially generated by Claude Opus 5, modified and reviewed by
@ssncferreira
2026-08-10 16:33:48 +01:00
Cian JohnstonandSusana Ferreira 60161fd375 chore: update model prices to include more providers (#27837)
Adds the full set of supported provider types to
`scripts/aibridgepricesgen` and updates stored model prices.

Notes:
* We need to rename a few keys from models.dev JSON to match our
internal provider types.
* `prices.json` is now marked as generated.

---------

Co-authored-by: Susana Ferreira <susana@coder.com>
2026-08-04 14:17:50 +01:00
Yevhenii Shcherbina d57965ee7f chore: regenerate prices.json from models.dev (#27549)
Implements:
https://linear.app/codercom/issue/AIGOV-493/update-pricesjson-with-current-model-rates-before-cost-control-release

Run `make gen/aibridge-prices` to regenerate `prices.json` from
`models.dev`.

This update:
- adds support for the upstream `claude-opus-5` model;
- removes older `openai` models that have been removed upstream, keeping
us in sync with `models.dev`.
2026-07-27 23:45:22 +02:00
Cian JohnstonandCopilot Autofix powered by AI 8eaf4f507b feat: generate the known-models catalog and aigateway prices (#27146)
- Regenerates `prices.json` from models.dev. The seeder only upserts, so
existing deployments keep delisted models.
- Generate the frontend known-models catalog instead of hand-writing it.
`make gen/aibridge-prices` fetches models.dev once
- Moved patches to model definitions to separate `overrides.jq` which 
  handles both `claude-sonnet-4-5` 200k context and 'aliasing' Fable 5
  as Mythos 5.
- Editorial choices of selection, order, aliases, and reasoning defaults 
  live in `curation.json`.
- Adds golden join tests with one error case per validation, a
no-network drift test comparing curation to the checked-in artifact, and
pinned invariants for the Anthropic thinking-mode split (the wrong side
returns HTTP 400) and the sonnet-4-5 context pin.

Adding a model is now one `curation.json` entry plus `make
gen/aibridge-prices`, assuming it is present on models.dev.

> This PR was authored by Coder Agents on Cian's behalf.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-14 19:36:27 +00:00
Yevhenii Shcherbina 4124d1137d feat: add ai_model_prices table (#24932)
# Summary

Implements
https://linear.app/codercom/issue/AIGOV-282/add-ai-model-price-table-and-seed-generator

This PR lays the groundwork for AI Bridge cost controls (per the AI
Governance RFC). It adds the foundation needed for future cost tracking:
a place to store per-model token prices, a way to keep those prices in
sync with upstream pricing data, and a startup mechanism that ensures
every deployment has prices loaded before AI Bridge starts processing
requests.

The price data comes from [models.dev](https://models.dev/), a
community-maintained catalogue of AI provider pricing. A generator
script fetches the latest prices, filters to Anthropic and OpenAI for
now, and produces a seed file checked into the repository.

On every server startup the seed is applied to the database, so new
releases automatically pick up any price corrections that landed since
the previous one. Existing rows are overwritten with the latest prices;
rows for models no longer in the seed are left untouched.

# Batching the AI model price seed: three approaches

Context: at server startup we seed the `ai_model_prices` table from an
embedded JSON price book (~70 rows today, will grow as we add providers,
potentially 4000+).

Each row is:

```text
(provider, model, input_price, output_price, cache_read_price, cache_write_price)
```

Any of the four price columns can be:

- `NULL` → “price unknown for this dimension”
- explicit `0` → “free”

The batch must be an UPSERT so re-running is idempotent and existing
rows pick up new prices.

We considered three implementations.

---

## Approach 1 — Per-row UPSERT in a Go loop

```go
for _, row := range rows {
    if err := db.UpsertAIModelPrice(ctx, database.UpsertAIModelPriceParams{
        Provider:   row.Provider,
        Model:      row.Model,
        InputPrice: nullInt64(row.InputPrice),
        // ...
    }); err != nil {
        return err
    }
}
```

### Pros

- Trivial.
- NULL handling falls out naturally from `sql.NullInt64`.

### Cons

- `N` round-trips per seed.
- With ~70 rows that means ~70 statement executions on every startup,
even inside a transaction.
- Doesn't scale gracefully as the price book grows, potentially 4000+.

---

## Approach 2 — `UNNEST` with parallel arrays

Pass each column as a separate Go slice. Postgres unnests them in
parallel into a virtual table, then `INSERT ... SELECT`.

```sql
INSERT INTO ai_model_prices (
    provider,
    model,
    input_price,
    output_price,
    cache_read_price,
    cache_write_price
)
SELECT
    UNNEST(@providers::text[]),
    UNNEST(@models::text[]),
    NULLIF(UNNEST(@input_prices::bigint[]), -1),
    NULLIF(UNNEST(@output_prices::bigint[]), -1),
    NULLIF(UNNEST(@cache_read_prices::bigint[]), -1),
    NULLIF(UNNEST(@cache_write_prices::bigint[]), -1)
ON CONFLICT (provider, model) DO UPDATE SET
    input_price       = EXCLUDED.input_price,
    output_price      = EXCLUDED.output_price,
    cache_read_price  = EXCLUDED.cache_read_price,
    cache_write_price = EXCLUDED.cache_write_price,
    updated_at        = NOW();
```

Go side: flatten rows into six parallel slices.

Use a sentinel (`-1`) for “missing”, since `lib/pq` can't encode `NULL`
into a `bigint[]` element.

```go
providers := make([]string, len(rows))
models    := make([]string, len(rows))
inputs    := make([]int64,  len(rows))
outputs   := make([]int64,  len(rows))
cacheR    := make([]int64,  len(rows))
cacheW    := make([]int64,  len(rows))

for i, r := range rows {
    providers[i] = r.Provider
    models[i]    = r.Model

    inputs[i] = -1
    if r.InputPrice != nil {
        inputs[i] = *r.InputPrice
    }

    outputs[i] = -1
    if r.OutputPrice != nil {
        outputs[i] = *r.OutputPrice
    }

    cacheR[i] = -1
    if r.CacheReadPrice != nil {
        cacheR[i] = *r.CacheReadPrice
    }

    cacheW[i] = -1
    if r.CacheWritePrice != nil {
        cacheW[i] = *r.CacheWritePrice
    }
}

return db.UpsertAIModelPrices(ctx, database.UpsertAIModelPricesParams{
    Providers:        providers,
    Models:           models,
    InputPrices:      inputs,
    OutputPrices:     outputs,
    CacheReadPrices:  cacheR,
    CacheWritePrices: cacheW,
})
```

### Pros

- Single round-trip.

### Cons

- The generated `sqlc` params become plain `[]int64`, which can't
represent `NULL`.

---

## Approach 3 — `jsonb_array_elements` over a single `@seed::jsonb`
(chosen)

Pass the raw seed JSON as one parameter; let Postgres expand and parse
it.

```sql
INSERT INTO ai_model_prices (
    provider,
    model,
    input_price,
    output_price,
    cache_read_price,
    cache_write_price
)
SELECT
    elem->>'provider',
    elem->>'model',
    (elem->>'input_price')::bigint,
    (elem->>'output_price')::bigint,
    (elem->>'cache_read_price')::bigint,
    (elem->>'cache_write_price')::bigint
FROM jsonb_array_elements(@seed::jsonb) AS elem
ON CONFLICT (provider, model) DO UPDATE SET
    input_price       = EXCLUDED.input_price,
    output_price      = EXCLUDED.output_price,
    cache_read_price  = EXCLUDED.cache_read_price,
    cache_write_price = EXCLUDED.cache_write_price,
    updated_at        = NOW();
```

Go side reduces to:

```go
return db.UpsertAIModelPrices(ctx, seedJSON)
```

### Pros

- Single round-trip.
- NULLs fall out naturally:
  - `(elem->>'cache_write_price')::bigint` becomes `NULL`
  - no sentinels
- The seed is already JSON:
- Existing precedent:
  - `jsonb_array_elements` is already used elsewhere in the codebase

### Cons

- Less type-safe at the SQL boundary than `UNNEST`
- Slightly less standard than `UNNEST`
- Readers need familiarity with:
  - `jsonb_array_elements`
  - `->>` extraction syntax
- Postgres pays JSON parse cost
  - negligible at our scale

---

---

# Decision

We picked Approach 3.

It collapses the round-trips like `UNNEST` does, but without:

- nullable-array workarounds
- sentinel values
2026-05-08 16:45:14 -04:00