Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e868204

Browse files
authored
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.
1 parent b957e66 commit e868204

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

coderd/aibridge/prices/data/prices.json

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/aibridgepricesgen/overrides.jq

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,31 @@ end
6262
}
6363
end
6464

65+
# Copilot does not charge for background utility calls using GPT-4o mini,
66+
# GPT-4o, or GPT-4.1, so record zero prices for these models.
67+
# Ref: https://docs.github.com/en/copilot/concepts/models/utility-models#list-of-utility-models
68+
#
69+
# Keep GPT-5.4 nano's upstream rates: utility calls are unbilled, but other
70+
# usage has published prices. The model ID alone cannot distinguish them.
71+
# Ref: https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing#openai
72+
| if (has("github-copilot") | not) then
73+
error("overrides.jq: github-copilot missing upstream; update the utility model overrides")
74+
else
75+
reduce [
76+
{id: "gpt-4o-mini", name: "GPT-4o mini"},
77+
{id: "gpt-4o", name: "GPT-4o"},
78+
{id: "gpt-4.1", name: "GPT-4.1"}
79+
][] as $model (.;
80+
if (."github-copilot".models | has($model.id)) then
81+
error("overrides.jq: github-copilot/\($model.id) now present upstream; review and drop the injection")
82+
else
83+
."github-copilot".models[$model.id] = (
84+
$model | .cost = {input: 0, output: 0, cache_read: 0, cache_write: 0}
85+
)
86+
end
87+
)
88+
end
89+
6590
# Mapping of provider names on models.dev to our own names
6691
# Ref. table definition for ai_provider_type
6792
# amazon-bedrock -> bedrock

0 commit comments

Comments
 (0)