Split token display for OpenAI (#46829)

This feature cost $15.

Up -> Tokens we're sending to the model
Down -> Tokens we've received from the model.

<img width="377" height="69" alt="Screenshot 2026-01-14 at 12 31 01 PM"
src="https://github.com/user-attachments/assets/fc15824f-de5d-466b-8cc1-329f3c1940bb"
/>



Release Notes:

- Changed the display of tokens for OpenAI models to reflect the
input/output limits.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mikayla MakiandClaude Opus 4.5 authored and GitHub committed 2026-01-14 14:29:56 -08:00
1 parent b5b13d1f4d
commit 9c5fc6ecbd
8 files changed
+137 -37

No files matched your search

@@ -624,6 +624,11 @@ impl LanguageModel for CloudLanguageModel {
self.model.supports_max_mode
}
fn supports_split_token_display(&self) -> bool {
use cloud_llm_client::LanguageModelProvider::*;
matches!(self.model.provider, OpenAi)
}
fn telemetry_id(&self) -> String {
format!("zed.dev/{}", self.model.id)
}
@@ -652,6 +657,10 @@ impl LanguageModel for CloudLanguageModel {
.map(|max_token_count| max_token_count as u64)
}
fn max_output_tokens(&self) -> Option<u64> {
Some(self.model.max_output_tokens as u64)
}
fn cache_configuration(&self) -> Option<LanguageModelCacheConfiguration> {
match &self.model.provider {
cloud_llm_client::LanguageModelProvider::Anthropic => {
@@ -329,6 +329,10 @@ impl LanguageModel for OpenAiLanguageModel {
}
}
fn supports_split_token_display(&self) -> bool {
true
}
fn telemetry_id(&self) -> String {
format!("openai/{}", self.model.id())
}
@@ -319,6 +319,10 @@ impl LanguageModel for OpenAiCompatibleLanguageModel {
}
}
fn supports_split_token_display(&self) -> bool {
true
}
fn telemetry_id(&self) -> String {
format!("openai/{}", self.model.name)
}