/openai-ai | Type: Application | PCID required: Yes
Tools
| Tool | Description |
|---|---|
openai_ai_create_chat_completion | Starting a new project? We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses. --- Creates a model response for the given chat conversation. Learn more in the text generation, vision, and audio guides. Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, refer to the reasoning guide. |
openai_ai_create_completion | Creates a completion for the provided prompt and parameters. |
openai_ai_create_embedding | Creates an embedding vector representing the input text. |
openai_ai_create_image | Creates an image given a prompt. Learn more. |
openai_ai_create_image_variation | Creates a variation of a given image. This endpoint only supports dall-e-2. |
openai_ai_create_moderation | Classifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide. |
openai_ai_create_realtime_session | Create an ephemeral API token for use in client-side applications with the Realtime API. Can be configured with the same session parameters as the session.update client event. It responds with a session object, plus a client_secret key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API. |
openai_ai_create_realtime_transcription_session | Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions. Can be configured with the same session parameters as the transcription_session.update client event. It responds with a session object, plus a client_secret key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API. |
openai_ai_create_response | Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response. |
openai_ai_create_speech | Generates audio from the input text. |
openai_ai_create_transcription | Transcribes audio into the input language. |
openai_ai_create_translation | Translates audio into English. |
openai_ai_delete_chat_completion | Delete a stored chat completion. Only Chat Completions that have been created with the store parameter set to true can be deleted. |
openai_ai_delete_model | Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. |
openai_ai_delete_response | Deletes a model response with the given ID. |
openai_ai_get_chat_completion | Get a stored chat completion. Only Chat Completions that have been created with the store parameter set to true will be returned. |
openai_ai_get_chat_completion_messages | Get the messages in a stored chat completion. Only Chat Completions that have been created with the store parameter set to true will be returned. |
openai_ai_get_response | Retrieves a model response with the given ID. |
openai_ai_list_chat_completions | List stored Chat Completions. Only Chat Completions that have been stored with the store parameter set to true will be returned. |
openai_ai_list_input_items | Returns a list of input items for a given response. |
openai_ai_list_models | Lists the currently available models, and provides basic information about each one such as the owner and availability. |
openai_ai_retrieve_model | Retrieves a model instance, providing basic information about the model such as the owner and permissioning. |
openai_ai_update_chat_completion | Modify a stored chat completion. Only Chat Completions that have been created with the store parameter set to true can be modified. Currently, the only supported modification is to update the metadata field. |
openai_ai_create_chat_completion
Starting a new project? We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses. --- Creates a model response for the given chat conversation. Learn more in the text generation, vision, and audio guides. Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, refer to the reasoning guide. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
audio | object | No | — | Parameters for audio output. Required when audio output is requested with modalities: ["audio"]. Learn more. |
frequency_penalty | number | No | — | 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. |
function_call | object | No | — | Deprecated in favor of tool_choice. Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. Specifying a particular function via {"name": "my_function"} forces the model to call that function. none is the default when no functions are present. auto is the default if functions are present. |
functions | object[] | No | — | Deprecated in favor of tools. A list of functions the model may generate JSON inputs for. |
logit_bias | object | No | — | Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. |
logprobs | boolean | No | — | Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message. |
max_completion_tokens | integer | No | — | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. |
max_tokens | integer | No | — | The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o-series models. |
messages | any[] | Yes | — | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. |
modalities | string[] | No | — | Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"] The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: ["text", "audio"] |
model | object | Yes | — | The model value |
n | integer | No | — | How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs. |
parallel_tool_calls | boolean | No | — | Whether to enable parallel function calling during tool use. |
prediction | object | No | — | Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time. This is most common when you are regenerating a file with only minor changes to most of the content. |
presence_penalty | number | No | — | 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. |
reasoning_effort | string | No | — | o-series models only Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. |
response_format | object | No | — | An object specifying the format that the model must output. Setting to { "type": "json_schema", "json_schema": {...} } enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide. Setting to { "type": "json_object" } enables the older JSON mode, which ensures the message the model generates is valid JSON. Using json_schema is preferred for models that support it. |
seed | integer | No | — | 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. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend. |
stop | string[] | No | — | Not supported with latest reasoning models o3 and o4-mini. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. |
store | boolean | No | — | Whether or not to store the output of this chat completion request for use in our model distillation or evals products. |
stream | boolean | No | — | If set to true, the model response data will be streamed to the client as it is generated using server-sent events. See the Streaming section below for more information, along with the streaming responses guide for more information on how to handle the streaming events. |
stream_options | object | No | — | Options for streaming response. Only set this when you set stream: true. |
temperature | number | No | — | 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. |
tool_choice | object | No | — | Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool. none is the default when no tools are present. auto is the default if tools are present. |
tools | object[] | No | — | A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported. |
top_logprobs | integer | No | — | 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. logprobs must be set to true if this parameter is used. |
top_p | number | No | — | 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. |
web_search_options | object | No | — | This tool searches the web for relevant results to use in a response. Learn more about the web search tool. |
openai_ai_create_completion
Creates a completion for the provided prompt and parameters. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
best_of | integer | No | — | Generates best_of completions server-side and returns the “best” (the one with the highest log probability per token). Results cannot be streamed. When used with n, best_of controls the number of candidate completions and n specifies how many to return – best_of must be greater than n. Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop. |
echo | boolean | No | — | Echo back the prompt in addition to the completion |
frequency_penalty | number | No | — | 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. See more information about frequency and presence penalties. |
logit_bias | object | No | — | Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this tokenizer tool to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass {"50256": -100} to prevent the <|endoftext|> token from being generated. |
logprobs | integer | No | — | Include the log probabilities on the logprobs most likely output tokens, as well the chosen tokens. For example, if logprobs is 5, the API will return a list of the 5 most likely tokens. The API will always return the logprob of the sampled token, so there may be up to logprobs+1 elements in the response. The maximum value for logprobs is 5. |
max_tokens | integer | No | — | The maximum number of tokens that can be generated in the completion. The token count of your prompt plus max_tokens cannot exceed the model’s context length. Example Python code for counting tokens. |
model | object | Yes | — | ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them. |
n | integer | No | — | How many completions to generate for each prompt. Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop. |
presence_penalty | number | No | — | 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. See more information about frequency and presence penalties. |
prompt | object | Yes | — | The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. |
seed | integer | No | — | 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. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend. |
stop | string[] | No | — | Not supported with latest reasoning models o3 and o4-mini. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. |
stream | boolean | No | — | Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Example Python code. |
stream_options | object | No | — | Options for streaming response. Only set this when you set stream: true. |
suffix | string | No | — | The suffix that comes after a completion of inserted text. This parameter is only supported for gpt-3.5-turbo-instruct. |
temperature | number | No | — | 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. We generally recommend altering this or top_p but not both. |
top_p | number | No | — | 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. We generally recommend altering this or temperature but not both. |
user | string | No | — | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more. |
openai_ai_create_embedding
Creates an embedding vector representing the input text. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
dimensions | integer | No | — | The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. |
encoding_format | string | No | — | The format to return the embeddings in. Can be either float or base64. |
input | object | Yes | — | Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for text-embedding-ada-002), cannot be an empty string, and any array must be 2048 dimensions or less. Example Python code for counting tokens. Some models may also impose a limit on total number of tokens summed across inputs. |
model | object | Yes | — | ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them. |
user | string | No | — | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more. |
openai_ai_create_image
Creates an image given a prompt. Learn more. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
background | string | No | — | Allows to set transparency for the background of the generated image(s). This parameter is only supported for gpt-image-1. Must be one of transparent, opaque or auto (default value). When auto is used, the model will automatically determine the best background for the image. If transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp. |
model | object | No | — | The model to use for image generation. One of dall-e-2, dall-e-3, or gpt-image-1. Defaults to dall-e-2 unless a parameter specific to gpt-image-1 is used. |
moderation | string | No | — | Control the content-moderation level for images generated by gpt-image-1. Must be either low for less restrictive filtering or auto (default value). |
n | integer | No | — | The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported. |
output_compression | integer | No | — | The compression level (0-100%) for the generated images. This parameter is only supported for gpt-image-1 with the webp or jpeg output formats, and defaults to 100. |
output_format | string | No | — | The format in which the generated images are returned. This parameter is only supported for gpt-image-1. Must be one of png, jpeg, or webp. |
prompt | string | Yes | — | A text description of the desired image(s). The maximum length is 32000 characters for gpt-image-1, 1000 characters for dall-e-2 and 4000 characters for dall-e-3. |
quality | string | No | — | The quality of the image that will be generated. - auto (default value) will automatically select the best quality for the given model. - high, medium and low are supported for gpt-image-1. - hd and standard are supported for dall-e-3. - standard is the only option for dall-e-2. |
response_format | string | No | — | The format in which generated images with dall-e-2 and dall-e-3 are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated. This parameter isn’t supported for gpt-image-1 which will always return base64-encoded images. |
size | string | No | — | The size of the generated images. Must be one of 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default value) for gpt-image-1, one of 256x256, 512x512, or 1024x1024 for dall-e-2, and one of 1024x1024, 1792x1024, or 1024x1792 for dall-e-3. |
style | string | No | — | The style of the generated images. This parameter is only supported for dall-e-3. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. |
user | string | No | — | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more. |
openai_ai_create_image_variation
Creates a variation of a given image. This endpoint only supportsdall-e-2.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image | string | Yes | — | The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. |
model | object | No | — | The model to use for image generation. Only dall-e-2 is supported at this time. |
n | integer | No | — | The number of images to generate. Must be between 1 and 10. |
response_format | string | No | — | The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated. |
size | string | No | — | The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024. |
user | string | No | — | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more. |
openai_ai_create_moderation
Classifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
input | object | Yes | — | Input (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models. |
model | object | No | — | The content moderation model you would like to use. Learn more in the moderation guide, and learn about available models here. |
openai_ai_create_realtime_session
Create an ephemeral API token for use in client-side applications with the Realtime API. Can be configured with the same session parameters as thesession.update client event. It responds with a session object, plus a client_secret key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
input_audio_format | string | No | — | The format of input audio. Options are pcm16, g711_ulaw, or g711_alaw. For pcm16, input audio must be 16-bit PCM at a 24kHz sample rate, single channel (mono), and little-endian byte order. |
input_audio_noise_reduction | object | No | — | Configuration for input audio noise reduction. This can be set to null to turn off. Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. |
input_audio_transcription | object | No | — | Configuration for input audio transcription, defaults to off and can be set to null to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through the /audio/transcriptions endpoint and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. |
instructions | string | No | — | The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. “be extremely succinct”, “act friendly”, “here are examples of good responses”) and on audio behavior (e.g. “talk quickly”, “inject emotion into your voice”, “laugh frequently”). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior. Note that the server sets default instructions which will be used if this field is not set and are visible in the session.created event at the start of the session. |
max_response_output_tokens | object | No | — | Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or inf for the maximum available tokens for a given model. Defaults to inf. |
modalities | object | No | — | The set of modalities the model can respond with. To disable audio, set this to [“text”]. |
model | string | No | — | The Realtime model used for this session. |
output_audio_format | string | No | — | The format of output audio. Options are pcm16, g711_ulaw, or g711_alaw. For pcm16, output audio is sampled at a rate of 24kHz. |
temperature | number | No | — | Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance. |
tool_choice | string | No | — | How the model chooses tools. Options are auto, none, required, or specify a function. |
tools | object[] | No | — | Tools (functions) available to the model. |
turn_detection | object | No | — | Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to null to turn off, in which case the client must manually trigger model response. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. Semantic VAD is more advanced and uses a turn detection model (in conjuction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with “uhhm”, the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. |
voice | object | No | — | The voice value |
openai_ai_create_realtime_transcription_session
Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions. Can be configured with the same session parameters as thetranscription_session.update client event. It responds with a session object, plus a client_secret key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
include | string[] | No | — | The set of items to include in the transcription. Current available items are: - item.input_audio_transcription.logprobs |
input_audio_format | string | No | — | The format of input audio. Options are pcm16, g711_ulaw, or g711_alaw. For pcm16, input audio must be 16-bit PCM at a 24kHz sample rate, single channel (mono), and little-endian byte order. |
input_audio_noise_reduction | object | No | — | Configuration for input audio noise reduction. This can be set to null to turn off. Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. |
input_audio_transcription | object | No | — | Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. |
modalities | object | No | — | The set of modalities the model can respond with. To disable audio, set this to [“text”]. |
turn_detection | object | No | — | Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to null to turn off, in which case the client must manually trigger model response. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. Semantic VAD is more advanced and uses a turn detection model (in conjuction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with “uhhm”, the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. |
openai_ai_create_response
Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
include | string[] | No | — | Specify additional output data to include in the model response. Currently supported values are: file_search_call.results, message.input_image.image_url, computer_call_output.output.image_url. |
input | object | Yes | — | Text, image, or file inputs to the model, used to generate a response. Learn more: - Text inputs and outputs - Image inputs - File inputs - Conversation state - Function calling |
instructions | string | No | — | Inserts a system (or developer) message as the first item in the model’s context. When using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. |
max_output_tokens | integer | No | — | An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens. |
model | object | Yes | — | The model value |
parallel_tool_calls | boolean | No | — | Whether to allow the model to run tool calls in parallel. |
previous_response_id | string | No | — | The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. |
reasoning | object | No | — | o-series models only Configuration options for reasoning models. |
store | boolean | No | — | Whether to store the generated model response for later retrieval via API. |
stream | boolean | No | — | If set to true, the model response data will be streamed to the client as it is generated using server-sent events. See the Streaming section below for more information. |
text | object | No | — | Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - Text inputs and outputs - Structured Outputs |
tool_choice | object | No | — | How the model should select which tool (or tools) to use when generating a response. See the tools parameter to see how to specify which tools the model can call. |
tools | any[] | No | — | An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter. The two categories of tools you can provide the model are: - Built-in tools: Tools that are provided by OpenAI that extend the model’s capabilities, like web search or file search. Learn more about built-in tools. - Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code. Learn more about function calling. |
truncation | string | No | — | The truncation strategy to use for the model response. - auto: If the context of this response and previous ones exceeds the model’s context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation. - disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error. |
openai_ai_create_speech
Generates audio from the input text. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
input | string | Yes | — | The text to generate audio for. The maximum length is 4096 characters. |
instructions | string | No | — | Control the voice of your generated audio with additional instructions. Does not work with tts-1 or tts-1-hd. |
model | object | Yes | — | One of the available TTS models: tts-1, tts-1-hd or gpt-4o-mini-tts. |
response_format | string | No | — | The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm. |
speed | number | No | — | The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default. |
voice | object | Yes | — | The voice value |
openai_ai_create_transcription
Transcribes audio into the input language. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | string | Yes | — | The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. |
include[] | string[] | No | — | Additional information to include in the transcription response. logprobs will return the log probabilities of the tokens in the response to understand the model’s confidence in the transcription. logprobs only works with response_format set to json and only with the models gpt-4o-transcribe and gpt-4o-mini-transcribe. |
language | string | No | — | The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency. |
model | object | Yes | — | ID of the model to use. The options are gpt-4o-transcribe, gpt-4o-mini-transcribe, and whisper-1 (which is powered by our open source Whisper V2 model). |
prompt | string | No | — | An optional text to guide the model’s style or continue a previous audio segment. The prompt should match the audio language. |
response_format | string | No | — | The format of the output, in one of these options: json, text, srt, verbose_json, or vtt. For gpt-4o-transcribe and gpt-4o-mini-transcribe, the only supported format is json. |
stream | boolean | No | — | If set to true, the model response data will be streamed to the client as it is generated using server-sent events. See the Streaming section of the Speech-to-Text guide for more information. Note: Streaming is not supported for the whisper-1 model and will be ignored. |
temperature | number | No | — | The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. |
timestamp_granularities[] | string[] | No | — | The timestamp granularities to populate for this transcription. response_format must be set verbose_json to use timestamp granularities. Either or both of these options are supported: word, or segment. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. |
openai_ai_create_translation
Translates audio into English. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | string | Yes | — | The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. |
model | object | Yes | — | ID of the model to use. Only whisper-1 (which is powered by our open source Whisper V2 model) is currently available. |
prompt | string | No | — | An optional text to guide the model’s style or continue a previous audio segment. The prompt should be in English. |
response_format | string | No | — | The format of the output, in one of these options: json, text, srt, verbose_json, or vtt. |
temperature | number | No | — | The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. |
openai_ai_delete_chat_completion
Delete a stored chat completion. Only Chat Completions that have been created with thestore parameter set to true can be deleted.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
completion_id | string | Yes | — | The ID of the chat completion to delete. |
openai_ai_delete_model
Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | The model to delete |
openai_ai_delete_response
Deletes a model response with the given ID. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
response_id | string | Yes | — | The ID of the response to delete. |
openai_ai_get_chat_completion
Get a stored chat completion. Only Chat Completions that have been created with thestore parameter set to true will be returned.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
completion_id | string | Yes | — | The ID of the chat completion to retrieve. |
openai_ai_get_chat_completion_messages
Get the messages in a stored chat completion. Only Chat Completions that have been created with thestore parameter set to true will be returned.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
completion_id | string | Yes | — | The ID of the chat completion to retrieve messages from. |
after | string | No | — | Identifier for the last message from the previous pagination request. |
limit | integer | No | — | Number of messages to retrieve. |
order | string | No | — | Sort order for messages by timestamp. Use asc for ascending order or desc for descending order. Defaults to asc. |
openai_ai_get_response
Retrieves a model response with the given ID. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
response_id | string | Yes | — | The ID of the response to retrieve. |
include | string[] | No | — | Additional fields to include in the response. See the include parameter for Response creation above for more information. |
openai_ai_list_chat_completions
List stored Chat Completions. Only Chat Completions that have been stored with thestore parameter set to true will be returned.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | No | — | The model used to generate the Chat Completions. |
metadata | object | No | — | A list of metadata keys to filter the Chat Completions by. Example: metadata[key1]=value1&metadata[key2]=value2 |
after | string | No | — | Identifier for the last chat completion from the previous pagination request. |
limit | integer | No | — | Number of Chat Completions to retrieve. |
order | string | No | — | Sort order for Chat Completions by timestamp. Use asc for ascending order or desc for descending order. Defaults to asc. |
openai_ai_list_input_items
Returns a list of input items for a given response. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
response_id | string | Yes | — | The ID of the response to retrieve input items for. |
limit | integer | No | — | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. |
order | string | No | — | The order to return the input items in. Default is asc. - asc: Return the input items in ascending order. - desc: Return the input items in descending order. |
after | string | No | — | An item ID to list items after, used in pagination. |
before | string | No | — | An item ID to list items before, used in pagination. |
include | string[] | No | — | Additional fields to include in the response. See the include parameter for Response creation above for more information. |
openai_ai_list_models
Lists the currently available models, and provides basic information about each one such as the owner and availability.openai_ai_retrieve_model
Retrieves a model instance, providing basic information about the model such as the owner and permissioning. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | The ID of the model to use for this request |
openai_ai_update_chat_completion
Modify a stored chat completion. Only Chat Completions that have been created with thestore parameter set to true can be modified. Currently, the only supported modification is to update the metadata field.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
completion_id | string | Yes | — | The ID of the chat completion to update. |
metadata | object | Yes | — | Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. |

