Skip to content

feat: add support for API usage with multimodal models#4548

Merged
EmmonsCurse merged 6 commits intoPaddlePaddle:developfrom
sunlei1024:feat/api_usage
Oct 28, 2025
Merged

feat: add support for API usage with multimodal models#4548
EmmonsCurse merged 6 commits intoPaddlePaddle:developfrom
sunlei1024:feat/api_usage

Conversation

@sunlei1024
Copy link
Copy Markdown
Collaborator

概要

为 OpenAI 兼容接口 /chat/completions/completions 新增 文生图 usage 统计支持


主要改动

  • usage 中新增字段 completion_tokens_details.image_tokens
  • 支持在文生图请求中返回图像 token 的使用情况

示例:

"usage": {
  "prompt_tokens": 13,
  "total_tokens": 18,
  "completion_tokens": 5,
  "prompt_tokens_details": {
    "cached_tokens": 0
  },
  "completion_tokens_details": {
    "image_tokens": 0
  }
}

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Oct 22, 2025

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Oct 22, 2025
Copy link
Copy Markdown
Collaborator

@EmmonsCurse EmmonsCurse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@EmmonsCurse EmmonsCurse merged commit 2a9ed72 into PaddlePaddle:develop Oct 28, 2025
24 of 26 checks passed
@sunlei1024 sunlei1024 deleted the feat/api_usage branch December 3, 2025 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants