$ cat ./awsome-prompt.txt | chatgpt --json | \
chatgpt 'Calculate the amount spent on tokens, given that you acted as a JSON parser and \
the cost is $0.0002 per 1k tokens. The total number of tokens used can be determined from \
the attribute .usage.total_tokens'
The total tokens used are 44.
Cost per 1k tokens is $0.0002.
So, the cost for 44 tokens can be calculated as:
(44/1000) * $0.0002 = $0.0000088
Therefore, the amount spent on tokens is $0.0000088.
Simply type chatgpt and hit enter to start the conversation
If you wanna use the ChatGPT command-line tool like a pro, just pipe your input into it and you're good to go.
even instead of
jq
Use heredoc to support multiple-line input.
proxy support 🪜