Skip to content

Expose OpenAI token detail fields in response metadata#2140

Open
Soulkey Kim (soulkeykim) wants to merge 1 commit into
JetBrains:developfrom
soulkeykim:openai-token-metadata-openai-base
Open

Expose OpenAI token detail fields in response metadata#2140
Soulkey Kim (soulkeykim) wants to merge 1 commit into
JetBrains:developfrom
soulkeykim:openai-token-metadata-openai-base

Conversation

@soulkeykim

Copy link
Copy Markdown

Summary

  • Populate OpenAILLMClientBase ResponseMetaInfo.metadata from OpenAI usage detail fields.
  • Expose cached prompt tokens as \cachedInputTokens\ and completion reasoning as \reasoningTokens.
  • Also propagate accepted/rejected prediction tokens and audio token details when present.
  • Add regression test in DashScope client test to assert metadata values from usage details.

Closes #1275

@soulkeykim
Soulkey Kim (soulkeykim) force-pushed the openai-token-metadata-openai-base branch from cebf582 to 892c49b Compare June 14, 2026 09:33
@soulkeykim
Soulkey Kim (soulkeykim) force-pushed the openai-token-metadata-openai-base branch from 892c49b to 25675ac Compare June 14, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose cached token counts in ResponseMetaInfo

1 participant