Skip to content

Fix pre-request cost estimation for base64 media inputs - #135

Open
Lupc9102 wants to merge 2 commits into
hackclub:mainfrom
Lupc9102:main
Open

Fix pre-request cost estimation for base64 media inputs#135
Lupc9102 wants to merge 2 commits into
hackclub:mainfrom
Lupc9102:main

Conversation

@Lupc9102

@Lupc9102 Lupc9102 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Estimate media (video/image/audio) cost from base64 payload size using provider tokenization rates and the model's actual OpenRouter per-token pricing instead of counting raw base64 as input tokens, which inflated estimates and rejected legitimate video requests with a 429 quota error. (Fix written by Qwen 3.8 Max, Im not confident in js so please double check everything 馃ス )

Estimate media (video/image/audio) cost from base64 payload size using
provider tokenization rates and the model's actual OpenRouter per-token
pricing instead of counting raw base64 as input tokens, which inflated
estimates and rejected legitimate video requests with a 429 quota error.
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.

1 participant