The content is

There are multiple models to choose from. Once decided, there are parameters to set:
in prompt, <|endoftext|> is the document separator that the model sees during training.
max_tokens, most lmit is 2048 tokens, news is 4096 tokens.
temperature higher means more risk/creativity. we can alter this or top_p but not both
top_p is an alternative to temperature, nucleus sampling, the results with top_p probability mass. 0.1 means only the tokens comprising the top 10% probability mass are considered.
n is how many completions to generate for each prompt. use it cautiously look at max_tokens and stop.
stream: whether to stream back partial progress…?
logprobs: 5 means API will return a list of the 5 most likely tokens.
echo: echo back the prompt in addition to the completion
stop: up to 4 sequences where the API will stop generating further tokens.?
presence_penalty:
frequency_penalty:
best_of
logit_bias
curl https://api.openai.com/v1/completions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"model": "text-davinci-003",
"prompt": "Say this is a test",
"max_tokens": 7,
"temperature": 0
}'
{
"model": "text-davinci-003",
"prompt": "Say this is a test",
"max_tokens": 7,
"temperature": 0,
"top_p": 1,
"n": 1,
"stream": false,
"logprobs": null,
"stop": "\n"
}
{
"id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
"object": "text_completion",
"created": 1589478378,
"model": "text-davinci-003",
"choices": [
{
"text": "\n\nThis is indeed a test",
"index": 0,
"logprobs": null,
"finish_reason": "length"
}
],
"usage": {
"prompt_tokens": 5,
"completion_tokens": 7,
"total_tokens": 12
}
}
Given completion, API also provides Edit function to “Given a prompt and an instruction, the model will return an edited version”.
of the prompt.
Similarly, API provides Image Completion, Edits and Create image Variation.
Embedding: to get vector representation of a given textual input, note Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length.

Files are used to upload documents that can be used with features like Fine-tuning. Functions include list file, upload file, delete file and retrieve file, retrieve file content. Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB.

Fine-tunes: Manage fine-tuning jobs to tailor a model to your specific training data. Related guide: Fine-tune models
