SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

I asked ChatGPT how many times I can post to X with 1,000 yen of OpenAI API usage fees

I was curious about how much credit would be consumed if I used an automated X posting system with the ChatGPT API,
so I looked into it.

Since this API uses "gpt-3.5-turbo," the rates as of January 2024 are as follows.

Now that I know the price per 1,000 tokens,
I will calculate the number of tokens per tweet.

Since I found that "Japanese characters ≒ number of tokens" roughly holds true, I will assume a maximum of 140 tokens for input per tweet.
Inputs vary, but let's assume 140 tokens.
Based on this premise, I asked ChatGPT.

■ Prompt (Question)
There is a system that counts 140 tokens of input and 140 tokens of output as one process. If the API usage fee is as follows, please tell me in Japanese how many times I can process with 1,000 Japanese yen. Assume $1 = 145 yen. Also, please show the calculation formula.
API usage fee: Input $0.0015 / 1K tokens, Output $0.0020 / 1K tokens

■ ChatGPT Answer
You can process approximately 14,075 times with 1,000 yen. The calculation formula is as follows.
The processing cost per time (140 tokens input + 140 tokens output) is,

0.0015 USD/1000 tokens × 140 tokens + 0.0020 USD/1000 tokens × 140 tokens = $0.00049 USD

Then, converting 1,000 yen to USD at a rate of 145 yen/USD results in approximately 6.90 USD. Therefore, 6.90 USD / $0.00049 USD allows for approximately 14,075 processes.

# Updated costs and conversion rate
cost_per_input_1k_tokens = 0.0015  # in USD for 1000 tokens
cost_per_output_1k_tokens = 0.0020  # in USD for 1000 tokens

# Conversion rate (updated to 1 USD = 145 JPY)
conversion_rate_usd_to_jpy = 145

# Total cost for one process (Input 140 tokens + Output 140 tokens)
total_cost_per_140_tokens = (140 / 1000) * (cost_per_input_1k_tokens + cost_per_output_1k_tokens)

# Calculating how many times the process can run with 1000 JPY
jpy_budget = 1000
usd_budget = jpy_budget / conversion_rate_usd_to_jpy
number_of_processes = usd_budget / total_cost_per_140_tokens

number_of_processes, total_cost_per_140_tokens

It calculated it in an instant!
If you can post approximately 14,075 times for 1,000 yen,
then the operating cost is practically negligible if you are running an account with a few posts a day.

いいなと思ったら応援しよう!

ねね先生@スモールビジネスのAI相談室🎈 チップはnote拡充のために活用させていただきます。皆様から頂くチップがこのnoteを良くしていきます。記事内容のリクエスト大歓迎です。お気軽にメッセージ下さいませ。