Feature has not been suggested before.
Describe the enhancement you want to request
Custom provider models cannot configure arbitrary context-pricing tiers. This prevents exact local cost estimates for OpenAI-compatible gateways that charge a long-context rate above 272K input tokens.
OpenCode runtime cost models support arbitrary context tiers, but custom models in opencode.json expose only the legacy context_over_200k field.
Allow provider.*.models.*.cost.tiers in config, using the existing internal and models.dev shape:
{
"cost": {
"input": 2,
"output": 10,
"cache_read": 0.2,
"cache_write": 2.5,
"tiers": [
{
"tier": { "type": "context", "size": 272000 },
"input": 4,
"output": 15,
"cache_read": 0.4,
"cache_write": 5
}
]
}
}
Expected behavior:
- Configured tiers are accepted and included in a custom model cost definition.
- A configured tier replaces a catalog tier with the same type and size.
- Unrelated catalog tiers are preserved.
- Cost estimation uses the base rate at or below 272K tokens and the configured tier above it.
This complements #44223 and #44292, which address runtime handling of catalog tiers but intentionally do not add arbitrary tiers to custom configuration.
Feature has not been suggested before.
Describe the enhancement you want to request
Custom provider models cannot configure arbitrary context-pricing tiers. This prevents exact local cost estimates for OpenAI-compatible gateways that charge a long-context rate above 272K input tokens.
OpenCode runtime cost models support arbitrary context tiers, but custom models in
opencode.jsonexpose only the legacycontext_over_200kfield.Allow
provider.*.models.*.cost.tiersin config, using the existing internal and models.dev shape:{ "cost": { "input": 2, "output": 10, "cache_read": 0.2, "cache_write": 2.5, "tiers": [ { "tier": { "type": "context", "size": 272000 }, "input": 4, "output": 15, "cache_read": 0.4, "cache_write": 5 } ] } }Expected behavior:
This complements #44223 and #44292, which address runtime handling of catalog tiers but intentionally do not add arbitrary tiers to custom configuration.