# feat\(web\): edit usage prices across selected environments · PR \#9861 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/9861)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: t3code/usage-environment-prices

Target branch: t3code/stream-usage-environment-data

Head commit: 6afb81c2f22d14c086b2605ada8a0b053a7e287e

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/9861)

[Commits](https://git.cafe/pingdotgg/t3code/pull/9861/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/9861/diffs?format=markdown)

## Description

---

Custom prices had to be edited one model and environment at a time, even when Usage combined several servers. Move Model prices into the Usage environment dropdown and edit prices in a table scoped to the selected environments.

Add or reset rows locally, then explicitly save all changed cells in one settings patch per environment. Mixed cells retain each environment’s own untouched rates. Each destination reports its result, and retry writes only to failed destinations.

Validation: focused form, table, and fan-out tests; web typecheck and scoped lint; real browser saves against two isolated environments, including mixed rates, reset/undo, no save on blur, and a 320px viewport. Regression coverage includes unavailable destinations and model IDs matching object prototype properties, and empty new rows alongside valid edits.

Both captures use the actual base/head at 1440×1000 with the same synthetic prices on two environments. The old editor initially shows one environment; the table starts with all environments selected.

| Before | After |
| --- | --- |
| ![Before: model cards and separate price form](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/399c5dc689627109/prices-before.png) | ![After: editable price table with environment selection](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/d37bdc8edb987af3/prices-after.png) |

[Recording: environment filtering and staged table edits](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bb6fda485199e020/usage-flow.mp4)

Implemented with GPT-6 in Codex.

