diff --git a/packages/web/src/render.tsx b/packages/web/src/render.tsx index 27740dde..599cb2e2 100644 --- a/packages/web/src/render.tsx +++ b/packages/web/src/render.tsx @@ -174,6 +174,10 @@ const getModalityIcon = (modality: string) => { const renderCost = (cost?: number) => { return cost === undefined ? "-" : `$${cost.toFixed(2)}`; }; +const renderUsageBasedCost = (cost?: number) => { + return cost === undefined ? "-" : `${cost.toFixed(2)}x`; +}; + export const Rendered = renderToString( @@ -413,8 +417,8 @@ export const Rendered = renderToString( )} - {renderCost(model.cost?.input)} - {renderCost(model.cost?.output)} + {providerId == "github-copilot" ? renderUsageBasedCost(model.cost?.input) : renderCost(model.cost?.input)} + {providerId == "github-copilot" ? renderUsageBasedCost(model.cost?.output) : renderCost(model.cost?.output)} {renderCost(model.cost?.reasoning)} {renderCost(model.cost?.cache_read)} {renderCost(model.cost?.cache_write)} diff --git a/providers/github-copilot/models/claude-3.5-sonnet.toml b/providers/github-copilot/models/claude-3.5-sonnet.toml index bee01a26..b3b77c2d 100644 --- a/providers/github-copilot/models/claude-3.5-sonnet.toml +++ b/providers/github-copilot/models/claude-3.5-sonnet.toml @@ -15,3 +15,7 @@ output = 8_192 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 1 +output = 1 diff --git a/providers/github-copilot/models/claude-3.7-sonnet-thought.toml b/providers/github-copilot/models/claude-3.7-sonnet-thought.toml index 8bffc246..ca2c336d 100644 --- a/providers/github-copilot/models/claude-3.7-sonnet-thought.toml +++ b/providers/github-copilot/models/claude-3.7-sonnet-thought.toml @@ -15,3 +15,7 @@ output = 16_384 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 1 +output = 1 diff --git a/providers/github-copilot/models/claude-3.7-sonnet.toml b/providers/github-copilot/models/claude-3.7-sonnet.toml index 0e16a8d8..066ec53d 100644 --- a/providers/github-copilot/models/claude-3.7-sonnet.toml +++ b/providers/github-copilot/models/claude-3.7-sonnet.toml @@ -15,3 +15,7 @@ output = 16_384 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 1 +output = 1 diff --git a/providers/github-copilot/models/claude-opus-4.toml b/providers/github-copilot/models/claude-opus-4.toml index fd385ef6..e7236ff1 100644 --- a/providers/github-copilot/models/claude-opus-4.toml +++ b/providers/github-copilot/models/claude-opus-4.toml @@ -15,3 +15,7 @@ output = 16_000 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 10 +output = 10 diff --git a/providers/github-copilot/models/claude-opus-41.toml b/providers/github-copilot/models/claude-opus-41.toml index 8ee30bf2..7ff7f2bf 100644 --- a/providers/github-copilot/models/claude-opus-41.toml +++ b/providers/github-copilot/models/claude-opus-41.toml @@ -15,3 +15,7 @@ output = 16_000 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 10 +output = 10 diff --git a/providers/github-copilot/models/claude-sonnet-4.5.toml b/providers/github-copilot/models/claude-sonnet-4.5.toml index 962fb694..a298fa91 100644 --- a/providers/github-copilot/models/claude-sonnet-4.5.toml +++ b/providers/github-copilot/models/claude-sonnet-4.5.toml @@ -15,3 +15,7 @@ output = 16_000 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 1 +output = 1 diff --git a/providers/github-copilot/models/claude-sonnet-4.toml b/providers/github-copilot/models/claude-sonnet-4.toml index 3515f243..c8b7030c 100644 --- a/providers/github-copilot/models/claude-sonnet-4.toml +++ b/providers/github-copilot/models/claude-sonnet-4.toml @@ -15,3 +15,7 @@ output = 16_000 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 1 +output = 1 diff --git a/providers/github-copilot/models/gemini-2.5-pro.toml b/providers/github-copilot/models/gemini-2.5-pro.toml index 7282d594..6bed683f 100644 --- a/providers/github-copilot/models/gemini-2.5-pro.toml +++ b/providers/github-copilot/models/gemini-2.5-pro.toml @@ -15,3 +15,7 @@ output = 64_000 [modalities] input = ["text", "image", "audio", "video"] output = ["text"] + +[cost] +input = 1 +output = 1 diff --git a/providers/github-copilot/models/gpt-4.1.toml b/providers/github-copilot/models/gpt-4.1.toml index 72d90f30..996e0f00 100644 --- a/providers/github-copilot/models/gpt-4.1.toml +++ b/providers/github-copilot/models/gpt-4.1.toml @@ -15,3 +15,7 @@ output = 16_384 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 0 +output = 0 diff --git a/providers/github-copilot/models/gpt-4o.toml b/providers/github-copilot/models/gpt-4o.toml index 7398929f..3689ffbc 100644 --- a/providers/github-copilot/models/gpt-4o.toml +++ b/providers/github-copilot/models/gpt-4o.toml @@ -15,3 +15,7 @@ output = 16_384 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 0 +output = 0 diff --git a/providers/github-copilot/models/gpt-5-codex.toml b/providers/github-copilot/models/gpt-5-codex.toml index 0cd0dcb2..38cb3978 100644 --- a/providers/github-copilot/models/gpt-5-codex.toml +++ b/providers/github-copilot/models/gpt-5-codex.toml @@ -15,3 +15,7 @@ output = 64_000 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 1 +output = 1 diff --git a/providers/github-copilot/models/gpt-5-mini.toml b/providers/github-copilot/models/gpt-5-mini.toml index ac648345..29540847 100644 --- a/providers/github-copilot/models/gpt-5-mini.toml +++ b/providers/github-copilot/models/gpt-5-mini.toml @@ -15,3 +15,7 @@ output = 64_000 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 0 +output = 0 diff --git a/providers/github-copilot/models/gpt-5.toml b/providers/github-copilot/models/gpt-5.toml index 94f5ed57..8a480b1b 100644 --- a/providers/github-copilot/models/gpt-5.toml +++ b/providers/github-copilot/models/gpt-5.toml @@ -15,3 +15,7 @@ output = 64_000 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 1 +output = 1 diff --git a/providers/github-copilot/models/grok-code-fast-1.toml b/providers/github-copilot/models/grok-code-fast-1.toml index 8472133a..2a2f66dd 100644 --- a/providers/github-copilot/models/grok-code-fast-1.toml +++ b/providers/github-copilot/models/grok-code-fast-1.toml @@ -15,3 +15,7 @@ output = 10_000 [modalities] input = ["text"] output = ["text"] + +[cost] +input = 0 +output = 0 diff --git a/providers/github-copilot/models/o3-mini.toml b/providers/github-copilot/models/o3-mini.toml index d009ab47..13754dfb 100644 --- a/providers/github-copilot/models/o3-mini.toml +++ b/providers/github-copilot/models/o3-mini.toml @@ -15,3 +15,7 @@ output = 65_536 [modalities] input = ["text"] output = ["text"] + +[cost] +input = 0.33 +output = 0.33 diff --git a/providers/github-copilot/models/o3.toml b/providers/github-copilot/models/o3.toml index 25c421f3..5974066d 100644 --- a/providers/github-copilot/models/o3.toml +++ b/providers/github-copilot/models/o3.toml @@ -15,3 +15,7 @@ output = 16_384 [modalities] input = ["text", "image"] output = ["text"] + +[cost] +input = 1 +output = 1 diff --git a/providers/github-copilot/models/o4-mini.toml b/providers/github-copilot/models/o4-mini.toml index f8cab5a5..b324232c 100644 --- a/providers/github-copilot/models/o4-mini.toml +++ b/providers/github-copilot/models/o4-mini.toml @@ -15,3 +15,7 @@ output = 65_536 [modalities] input = ["text"] output = ["text"] + +[cost] +input = 0.33 +output = 0.33