feat: add cost details to chat completion usage#196
feat: add cost details to chat completion usage#196akicool wants to merge 1 commit intoOpenRouterTeam:mainfrom
Conversation
akicool
commented
Mar 1, 2026
- Extend ChatGenerationTokenUsage with cost, isByok, and costDetails fields to expose pricing information returned by the OpenRouter API. Matches the actual API response shape (upstream_inference_prompt_cost / upstream_inference_completions_cost).
- Extend ChatGenerationTokenUsage with cost, isByok, and costDetails fields to expose pricing information returned by the OpenRouter API. Matches the actual API response shape (upstream_inference_prompt_cost / upstream_inference_completions_cost).
|
Is it possible to extend this to return costs for the embedding endpoints as well? |
Yep, it make sense btw, I'll try to add this |
As far as I understand, we can't get information about costs_details in the response data, but we do have a cost field in the response from the embeddings endpoint. |
Yes, this is true. The |