Demo
Installation
Cargo
Source
Usage
When using for the first time, pgpt will prompt you to enter an OpenAI API key.
The key is saved/encrypted in a local config file to be used later.
Alternatively, you can pass your API key to the environment variable OPENAI_API_KEY in order to not save it.
Question
Ask a question to ChatGPT (defaults to gpt-3.5-turbo)
pgpt <QUERY>...
-m, --model
Select a specific model to use for ChatGPT.
Available options for model:
| Option | ChatGPT Model |
|---|---|
gpt-3 |
gpt-3.5-turbo |
gpt-4 |
gpt-4-turbo |
gpt-4o |
gpt-4o |
--cost
Calculate the total cost associated with prompt and response:
ChatGPT API pricing is dependent on the model with different costs for the different models.
Costs are based on "tokens" used for input/output. Each "token" roughly translates to 4 characters of text.
You can see pricing details here
--clear
Clears the local config including the OpenAI API key
--help
)