API Documentation
Creates a model response for the given chat conversation.
ID of the model to use.
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
Modify the likelihood of specified tokens appearing in the completion.
Whether to return log probabilities of the output tokens or not.
The maximum number of tokens that can be generated in the chat completion.
How many chat completion choices to generate for each input message.
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
Up to 4 sequences where the API will stop generating further tokens.
If set, partial message deltas will be sent.
Options for streaming response. Only set this when you set stream: true.
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
A list of messages comprising the conversation so far.
Deprecated in favor of tool_choice. Controls which (if any) function is called by the model.
Deprecated in favor of tools. A list of functions the model may generate JSON inputs for.
An object specifying the format that the model must output.
Controls which (if any) tool is called by the model.
A list of tools the model may call.
An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.
Successful Response
Validation Error
No content
Creates a completion for the provided prompt and parameters.
ID of the model to use.
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
Modify the likelihood of specified tokens appearing in the completion.
Whether to return log probabilities of the output tokens or not.
The maximum number of tokens that can be generated in the chat completion.
How many chat completion choices to generate for each input message.
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
Up to 4 sequences where the API will stop generating further tokens.
If set, partial message deltas will be sent.
Options for streaming response. Only set this when you set stream: true.
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.
Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed.
Echo back the prompt in addition to the completion
The suffix that comes after a completion of inserted text.
Successful Response
Validation Error
No content
Creates an image given a prompt.
ID of the model to use.
A text description of the desired image(s).
The number of images to generate. Must be between 1 and 10.
1The format in which the generated images are returned. Must be one of url or b64_json.
urlThe size of the generated images.
1024*1024The number of inference steps to run for each image.
20The scale of the guidance loss.
7.5A negative prompt to help guide the model away from generating unwanted content.
Additional JSON properties to the request.
Successful Response
Validation Error
No content
Creates a variation of a given image.
ID of the model to use.
The image to use as the basis for the variation(s).
The prompt to use for generating the variation(s).
The negative prompt to use for generating the variation(s).
The number of variations to generate.
1The format in which the generated images are returned. Must be one of url or b64_json.
urlThe size of the generated images.
Additional JSON properties to the request.
Successful Response
Validation Error
No content
Creates an inpainted image given an image and a mask.
ID of the model to use.
The image to inpaint.
The mask image.
The prompt to use for inpainting.
The negative prompt to use for inpainting.
The number of inpainted images to generate.
1The format in which the generated images are returned.
urlThe size of the generated images.
The number of inference steps to take.
20Additional JSON properties to the request.
Successful Response
Validation Error
No content
Transcribes audio into the input language.
ID of the model to use.
The audio file object (not file name) to transcribe,
The language of the input audio.
An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
The format of the transcript output
jsonAdditional JSON properties to the request.
Successful Response
Validation Error
No content
Generates audio from the input text.
ID of the model to use.
The text to generate audio for.
The voice to use when generating the audio.
The format to audio in.
mp3The speed of the generated audio.
1Stream the response.
falseAdditional JSON properties to the request.
The audio file to use as prompt.
Successful Response
Validation Error
No content
Creates an embedding vector representing the input text.
ID of the model to use.
The input to embed.
A unique identifier representing your end-user
Successful Response
Validation Error
No content
Reranks a list of documents based on a query.
ID of the model to use.
The query to rerank the documents by.
The list of documents to rerank.
The number of documents to return in the reranked list.
Whether to return the reranked documents or not.
falseThe maximum number of chunks to use per document.
Successful Response
Validation Error
No content
Last updated