What Are Prompt Tokens?
Prompt tokens refer to the number of tokens you input into the model, that is, the number of tokens contained in your prompt.
What Are Completion Tokens?
Completion tokens are the number of any tokens generated by the model in response to your input. For standard requests, this is the number of tokens in the completion part.
Most models we provide have limits on the number of tokens they can receive (prompt tokens) and the number of tokens they can output (completion tokens or samples tokens).
The Difference Between Input and Output Tokens
Input tokens (prompt tokens): refer to the number of tokens you provide to the model. It includes all the content you input in the request, such as questions, instructions, context, etc.
Output tokens (completion tokens): refer to the number of tokens generated by the model in its response. This includes the answers, explanations, suggestions, etc. generated by the model.
This also includes any tokens generated when using a higher best_of or n value. For example, if best_of = 3 is used to generate 3 candidate completions, then the number of sampled tokens will be at most 3 * max_tokens. |