记录 token 消耗情况。
stream 模式同时开启stream_options:{"include_usage':true}
使用 4o-mini ,调用image_url
分析图片时,发现不返回 usage 信息。怎么破
1
zhhmax 5 天前
你用的 API 来源是正规的吗?我试了一下没问题的:
data: {"id":"","object":"chat.completion.chunk","created":1733456998,"model":"gpt-4o-mini-2024-07-18","system_fingerprint":"","choices":[],"usage":{"prompt_tokens":8525,"completion_tokens":80,"total_tokens":8605,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}} |