Create completion
Body
Model name to use. See the model catalog on TokensMind AI for available names
Defaults to 1. Generates best_of completions on the server and returns the "best" one (highest per-token log probability). Cannot be used with streaming.
When used with n, best_of is the number of candidate completions and n is how many to return. best_of must be greater than n.
Note: This can consume your token quota quickly. Use with care and set max_tokens and stop reasonably.
An alternative to temperature, called nucleus sampling: the model considers tokens whose cumulative probability mass is top_p. So 0.1 means only the top 10% probability mass is considered. We generally recommend changing either this or temperature, not both.
0 < x <= 1Default 0. Positive values penalize new tokens based on their frequency in the text so far, reducing repetition.
For mild repetition reduction, try roughly 0.1 to 1. For strong suppression, you can increase toward 2, but quality may drop. Negative values encourage repetition.
See also presence_penalty for a fixed penalty on tokens that appear at least once
-2 < x < 2Default 0. Positive values penalize new tokens based on whether they appear in the text so far, encouraging new topics.
For mild repetition reduction, try roughly 0.1 to 1. For strong suppression, you can increase toward 2, but quality may drop significantly. Negative values encourage repetition.
See also frequency_penalty for frequency-based penalization
-2 < x < 2Penalty applied to repeated tokens to discourage or encourage repetition. 1.0 means no penalty and free repetition. Values above 1.0 penalize repetition. Values between 0.0 and 1.0 reward repetition. A balanced value is often around 1.2. On decoder-only models, the penalty applies to both the prompt and the generated output.
0 < x < 2
