TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

AiPrice – API for Accurate OpenAI Prompt Pricing

4 pointsby bubblehack3rover 1 year ago

4 comments

weird-eye-issueover 1 year ago
The API doesn&#x27;t even follow the format that OpenAI&#x27;s chat endpoints take. You don&#x27;t pass a single string to them. You pass an array of system&#x2F;user&#x2F;assistant messages. So this pricing won&#x27;t be accurate<p>Not to mention this would be better replaced with a tokenizer lib and a multiplication operation
评论 #37728487 未加载
msp26over 1 year ago
I don&#x27;t think a frontend for tiktoken is worth a monthly subscription
sleeyover 1 year ago
&gt; The calculating method is based on the latest available pricing data released by OpenAI at <a href="https:&#x2F;&#x2F;openai.com&#x2F;pricing" rel="nofollow noreferrer">https:&#x2F;&#x2F;openai.com&#x2F;pricing</a>. However, please note that actual costs may vary and we cannot guarantee the price.<p>I guess in that case we can just use this as reference and calculate it by yourself<p>From <a href="https:&#x2F;&#x2F;help.openai.com&#x2F;en&#x2F;articles&#x2F;4936856-what-are-tokens-and-how-to-count-them" rel="nofollow noreferrer">https:&#x2F;&#x2F;help.openai.com&#x2F;en&#x2F;articles&#x2F;4936856-what-are-tokens-...</a><p>1 token ~= 4 chars in English<p>1 token ~= ¾ words<p>100 tokens ~= 75 words<p>Or<p>1-2 sentence ~= 30 tokens<p>1 paragraph ~= 100 tokens<p>1,500 words ~= 2048 tokens
评论 #37733660 未加载
oefrhaover 1 year ago
To be honest, with an effectively anonymous website, this feels like an operation to gather other people’s prompts.