@inductiv/node-red-openai-api
Version:
Enhance your Node-RED projects with advanced AI capabilities.
1,098 lines (1,030 loc) โข 205 kB
HTML
<script type="text/javascript">
RED.nodes.registerType("OpenAI API", {
category: "AI",
color: "#B8B1FB",
defaults: {
name: { value: "" },
property: { value: "payload", required: true },
propertyType: { value: "msg" },
service: { value: "", type: "Service Host", required: true },
method: { value: "", required: true },
},
inputs: 1,
outputs: 1,
icon: "icon.png",
label: function () {
return this.name || this.method || "OpenAI API";
},
labelStyle: function () {
return this.name ? "node_label_italic" : "";
},
oneditprepare: function () {
var selectedMethod = $("#node-input-method option:selected");
if (!selectedMethod.val()) {
var methods = $("#node-input-method").children();
var firstMethod = methods.first();
$("#node-input-method").val(firstMethod.val());
};
// set the default property type value to "payload"
if (this.property === undefined) {
$("#node-input-property").val("payload");
}
$("#node-input-property").typedInput({
default: "msg",
value: "payload",
types: ["msg", "flow", "global"],
typeField: "#node-input-propertyType"
})
}
});
</script>
<script type="text/html" data-template-name="OpenAI API">
<div class="form-row">
<label for="node-input-name"
><i class="fa fa-tag"></i>
<span data-i18n="node-red:common.label.name"></span
></label>
<input
type="text"
id="node-input-name"
data-i18n="[placeholder]node-red:common.label.name"
/>
</div>
<hr />
<div class="form-row">
<label for="node-input-service"
><i class="fa fa-cloud"></i>
<span data-i18n="OpenaiApi.label.serviceHost"></span
></label>
<input type="text" id="node-input-service" />
</div>
<div class="form-row">
<label for="node-input-property"
><i class="fa fa-ellipsis-h"></i>
<span data-i18n="OpenaiApi.label.property"></span
></label>
<input type="text" id="node-input-property">
<input type="hidden" id="node-input-propertyType">
</div>
<div class="form-row">
<label for="node-input-method"
><i class="fa fa-tasks"></i>
<span data-i18n="OpenaiApi.label.method"></span
></label>
<select id="node-input-method">
<optgroup style="font-style: normal;" label="๐ค Assistants (Beta)">
<option
value="createAssistant"
data-i18n="OpenaiApi.parameters.createAssistant"
></option>
<option
value="getAssistant"
data-i18n="OpenaiApi.parameters.getAssistant"
></option>
<option
value="modifyAssistant"
data-i18n="OpenaiApi.parameters.modifyAssistant"
></option>
<option
value="deleteAssistant"
data-i18n="OpenaiApi.parameters.deleteAssistant"
></option>
<option
value="listAssistants"
data-i18n="OpenaiApi.parameters.listAssistants"
></option>
<option
value="listAssistantFiles"
data-i18n="OpenaiApi.parameters.listAssistantFiles"
></option>
<option
value="createAssistantFile"
data-i18n="OpenaiApi.parameters.createAssistantFile"
></option>
<option
value="getAssistantFile"
data-i18n="OpenaiApi.parameters.getAssistantFile"
></option>
<option
value="deleteAssistantFile"
data-i18n="OpenaiApi.parameters.deleteAssistantFile"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ Audio">
<option
value="createSpeech"
data-i18n="OpenaiApi.parameters.createSpeech"
></option>
<option
value="createTranscription"
data-i18n="OpenaiApi.parameters.createTranscription"
></option>
<option
value="createTranslation"
data-i18n="OpenaiApi.parameters.createTranslation"
></option>
</optgroup>
<!-- Batch Endpoint-->
<optgroup style="font-style: normal;" label="๐ฆ Batch">
<option
value="createBatch"
data-i18n="OpenaiApi.parameters.createBatch"
></option>
<option
value="retrieveBatch"
data-i18n="OpenaiApi.parameters.retrieveBatch"
></option>
<option
value="cancelBatch"
data-i18n="OpenaiApi.parameters.cancelBatch"
></option>
<option
value="listBatch"
data-i18n="OpenaiApi.parameters.listBatch"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ฌ Chat">
<option
value="createChatCompletion"
data-i18n="OpenaiApi.parameters.createChatCompletion"
></option>
<option
value="getChatCompletion"
data-i18n="OpenaiApi.parameters.getChatCompletion"
></option>
<option
value="getChatMessages"
data-i18n="OpenaiApi.parameters.getChatMessages"
></option>
<option
value="listChatCompletions"
data-i18n="OpenaiApi.parameters.listChatCompletions"
></option>
<option
value="updateChatCompletion"
data-i18n="OpenaiApi.parameters.updateChatCompletion"
></option>
<option
value="deleteChatCompletion"
data-i18n="OpenaiApi.parameters.deleteChatCompletion"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐๏ธ Container Files">
<option value="listContainerFiles" data-i18n="OpenaiApi.parameters.listContainerFiles"></option>
<option value="addContainerFile" data-i18n="OpenaiApi.parameters.addContainerFile"></option>
<option value="retrieveContainerFile" data-i18n="OpenaiApi.parameters.retrieveContainerFile"></option>
<option value="deleteContainerFile" data-i18n="OpenaiApi.parameters.deleteContainerFile"></option>
<option value="downloadContainerFileContent" data-i18n="OpenaiApi.parameters.downloadContainerFileContent"></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ซ Containers">
<option value="listContainers" data-i18n="OpenaiApi.parameters.listContainers"></option>
<option value="createContainer" data-i18n="OpenaiApi.parameters.createContainer"></option>
<option value="retrieveContainer" data-i18n="OpenaiApi.parameters.retrieveContainer"></option>
<option value="deleteContainer" data-i18n="OpenaiApi.parameters.deleteContainer"></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ Embeddings">
<option
value="createEmbedding"
data-i18n="OpenaiApi.parameters.createEmbedding"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ Files">
<option
value="listFiles"
data-i18n="OpenaiApi.parameters.listFiles"
></option>
<option
value="createFile"
data-i18n="OpenaiApi.parameters.uploadFile"
></option>
<option
value="deleteFile"
data-i18n="OpenaiApi.parameters.deleteFile"
></option>
<option
value="retrieveFile"
data-i18n="OpenaiApi.parameters.retrieveFile"
></option>
<option
value="downloadFile"
data-i18n="OpenaiApi.parameters.downloadFile"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ง Fine-tuning">
<option
value="createFineTuningJob"
data-i18n="OpenaiApi.parameters.createFineTuningJob"
></option>
<option
value="listPaginatedFineTuningJobs"
data-i18n="OpenaiApi.parameters.listPaginatedFineTuningJobs"
></option>
<option
value="retrieveFineTuningJob"
data-i18n="OpenaiApi.parameters.retrieveFineTuningJob"
></option>
<option
value="listFineTuningEvents"
data-i18n="OpenaiApi.parameters.listFineTuningEvents"
></option>
<option
value="listFineTuningCheckpoints"
data-i18n="OpenaiApi.parameters.listFineTuningCheckpoints"
></option>
<option
value="cancelFineTuningJob"
data-i18n="OpenaiApi.parameters.cancelFineTuningJob"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ผ๏ธ Images">
<option
value="createImage"
data-i18n="OpenaiApi.parameters.createImage"
></option>
<option
value="createImageEdit"
data-i18n="OpenaiApi.parameters.createImageEdit"
></option>
<option
value="createImageVariation"
data-i18n="OpenaiApi.parameters.createImageVariation"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ Messages (Beta)">
<option value="listMessages" data-i18n="OpenaiApi.parameters.listMessages"></option>
<option value="createMessage" data-i18n="OpenaiApi.parameters.createMessage"></option>
<option value="getMessage" data-i18n="OpenaiApi.parameters.getMessage"></option>
<option value="modifyMessage" data-i18n="OpenaiApi.parameters.modifyMessage"></option>
<option value="deleteMessage" data-i18n="OpenaiApi.parameters.deleteMessage"></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ง Models">
<option
value="listModels"
data-i18n="OpenaiApi.parameters.listModels"
></option>
<option
value="retrieveModel"
data-i18n="OpenaiApi.parameters.retrieveModel"
></option>
<option
value="deleteModel"
data-i18n="OpenaiApi.parameters.deleteModel"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="โ
Moderations">
<option
value="createModeration"
data-i18n="OpenaiApi.parameters.createModeration"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐จ๏ธ Responses">
<option
value="createModelResponse"
data-i18n="OpenaiApi.parameters.createModelResponse"
></option>
<option
value="getModelResponse"
data-i18n="OpenaiApi.parameters.getModelResponse"
></option>
<option
value="deleteModelResponse"
data-i18n="OpenaiApi.parameters.deleteModelResponse"
></option>
<option
value="listInputItems"
data-i18n="OpenaiApi.parameters.listInputItems"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ Runs (Beta)">
<option
value="createThreadAndRun"
data-i18n="OpenaiApi.parameters.createThreadAndRun"
></option>
<option
value="listRuns"
data-i18n="OpenaiApi.parameters.listRuns"
></option>
<option
value="createRun"
data-i18n="OpenaiApi.parameters.createRun"
></option>
<option value="getRun" data-i18n="OpenaiApi.parameters.getRun"></option>
<option
value="modifyRun"
data-i18n="OpenaiApi.parameters.modifyRun"
></option>
<option
value="submitToolOutputsToRun"
data-i18n="OpenaiApi.parameters.submitToolOutputsToRun"
></option>
<option
value="cancelRun"
data-i18n="OpenaiApi.parameters.cancelRun"
></option>
<option
value="listRunSteps"
data-i18n="OpenaiApi.parameters.listRunSteps"
></option>
<option
value="getRunStep"
data-i18n="OpenaiApi.parameters.getRunStep"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐งต Threads (Beta)">
<option
value="createThread"
data-i18n="OpenaiApi.parameters.createThread"
></option>
<option
value="getThread"
data-i18n="OpenaiApi.parameters.getThread"
></option>
<option
value="modifyThread"
data-i18n="OpenaiApi.parameters.modifyThread"
></option>
<option
value="deleteThread"
data-i18n="OpenaiApi.parameters.deleteThread"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="โ๏ธ Uploads">
<option
value="createUpload"
data-i18n="OpenaiApi.parameters.createUpload"
></option>
<option
value="addUploadPart"
data-i18n="OpenaiApi.parameters.addUploadPart"
></option>
<option
value="completeUpload"
data-i18n="OpenaiApi.parameters.completeUpload"
></option>
<option
value="cancelUpload"
data-i18n="OpenaiApi.parameters.cancelUpload"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐ข Vector Stores">
<option value="createVectorStore" data-i18n="OpenaiApi.parameters.createVectorStore"></option>
<option value="listVectorStores" data-i18n="OpenaiApi.parameters.listVectorStores"></option>
<option value="retrieveVectorStore" data-i18n="OpenaiApi.parameters.retrieveVectorStore"></option>
<option value="modifyVectorStore" data-i18n="OpenaiApi.parameters.modifyVectorStore"></option>
<option value="deleteVectorStore" data-i18n="OpenaiApi.parameters.deleteVectorStore"></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐๏ธ Vector Store Files (Beta)">
<option
value="createVectorStoreFile"
data-i18n="OpenaiApi.parameters.createVectorStoreFile"
></option>
<option
value="listVectorStoreFiles"
data-i18n="OpenaiApi.parameters.listVectorStoreFiles"
></option>
<option
value="retrieveVectorStoreFile"
data-i18n="OpenaiApi.parameters.retrieveVectorStoreFile"
></option>
<option
value="deleteVectorStoreFile"
data-i18n="OpenaiApi.parameters.deleteVectorStoreFile"
></option>
</optgroup>
<optgroup style="font-style: normal;" label="๐๏ธ Vector Store File Batches (Beta)">
<option
value="createVectorStoreFileBatch"
data-i18n="OpenaiApi.parameters.createVectorStoreFileBatch"
></option>
<option
value="retrieveVectorStoreFileBatch"
data-i18n="OpenaiApi.parameters.retrieveVectorStoreFileBatch"
></option>
<option
value="cancelVectorStoreFileBatch"
data-i18n="OpenaiApi.parameters.cancelVectorStoreFileBatch"
></option>
<option
value="listVectorStoreBatchFiles"
data-i18n="OpenaiApi.parameters.listVectorStoreBatchFiles"
></option>
<option
value="uploadAndPollVectorStoreFileBatch"
data-i18n="OpenaiApi.parameters.uploadAndPollVectorStoreFileBatch"
></option>
</optgroup>
</select>
</div>
</script>
<script type="text/html" data-help-name="OpenAI API">
<p>
OpenAI Platform Services API. Please see the
<a href="https://platform.openai.com/docs/api-reference" target="_blank"
>OpenAI API Reference</a
>
for more details.
</p>
<p><b>Reference</b></p>
<section>
<details>
<summary style="font-weight: bold;">๐ค Assistants</summary>
<a href="https://platform.openai.com/docs/api-reference/assistants" target="_blank">Official Documentation
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<h4 style="font-weight: bolder;"> โ Create Assistant</h4>
<p>Create an assistant with a model and instructions.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
model
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-model"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>ID of the model to use.</dd>
<dt class="optional">
name
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-name"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The name of the assistant.</dd>
<dt class="optional">
description
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-description"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The description of the assistant.</dd>
<dt class="optional">
instructions
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-instructions"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The system instructions that the assistant uses.</dd>
<dt class="optional">
tools
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-tools"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">array</span>
</dt>
<dd>A list of tool enabled on the assistant.</dd>
<dt class="optional">
tool_resources
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-tool_resources"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">object</span>
</dt>
<dd>A set of resources that are used by the assistant's tools. </dd>
<dt class="optional">
metadata
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-metadata"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">object</span>
</dt>
<dd>Set of 16 key-value pairs that can be attached to an object.</dd>
<dt class="optional">
temperature
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-temperature"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">number</span>
</dt>
<dd>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.</dd>
<dt class="optional">
top_p
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-top_p"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">number</span>
</dt>
<dd>An alternative to sampling with temperature, called nucleus sampling, where the model considers the
results of the tokens with top_p probability mass.</dd>
<dt class="optional">
response_format
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-response_format"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>Specifies the format that the model must output.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Retrieve Assistant</h4>
<p>Retrieves an assistant.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
assistant_id
<a href="https://platform.openai.com/docs/api-reference/assistants/getAssistant#assistants-getassistant-assistant_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the assistant to retrieve.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Modify Assistant</h4>
<p>Modifies an assistant.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
assistant_id
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-assistant_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the assistant to retrieve.</dd>
<dt class="optional">
model
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-model"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>ID of the model to use.</dd>
<dt class="optional">
name
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-name"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The name of the assistant.</dd>
<dt class="optional">
description
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-description"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The description of the assistant.</dd>
<dt class="optional">
instructions
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-instructions"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The system instructions that the assistant uses.</dd>
<dt class="optional">
tools
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-tools"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">array</span>
</dt>
<dd>A list of tool enabled on the assistant.</dd>
<dt class="optional">
tool_resources
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-tool_resources"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">object</span>
</dt>
<dd>A set of resources that are used by the assistant's tools. </dd>
<dt class="optional">
metadata
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-metadata"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">object</span>
</dt>
<dd>Set of 16 key-value pairs that can be attached to an object.</dd>
<dt class="optional">
temperature
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-temperature"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">number</span>
</dt>
<dd>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.</dd>
<dt class="optional">
top_p
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-top_p"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">number</span>
</dt>
<dd>An alternative to sampling with temperature, called nucleus sampling, where the model considers the
results of the tokens with top_p probability mass.</dd>
<dt class="optional">
response_format
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-response_format"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>Specifies the format that the model must output.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Delete Assistant</h4>
<p>Delete an assistant.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
assistant_id
<a href="https://platform.openai.com/docs/api-reference/assistants/deleteAssistant#assistants-deleteassistant-assistant_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the assistant to delete.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ List Assistants</h4>
<p>Returns a list of assistants.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt class="optional">
limit
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistants#assistants-listassistants-limit"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">integer</span>
</dt>
<dd>A limit on the number of objects to be returned.</dd>
<dt class="optional">
order
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistants#assistants-listassistants-order"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>Sort order by the created_at timestamp of the objects.</dd>
<dt class="optional">
after
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistants#assistants-listassistants-after"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>A cursor for use in pagination.</dd>
<dt class="optional">
before
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistants#assistants-listassistants-before"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>A cursor for use in pagination.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ List Assistant Files</h4>
<p>Returns a list of assistant files.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
assistant_id
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-assistant_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the assistant the file belongs to.</dd>
<dt class="optional">
limit
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-limit"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">integer</span>
</dt>
<dd>A limit on the number of objects to be returned.</dd>
<dt class="optional">
order
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-order"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>Sort order by the created_at timestamp of the objects.</dd>
<dt class="optional">
after
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-after"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>A cursor for use in pagination.</dd>
<dt class="optional">
before
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-before"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>A cursor for use in pagination.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Create Assistant File</h4>
<p>Create an assistant file by attaching a file to an assistant.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
assistant_id
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistantFile#assistants-createassistantfile-assistant_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the assistant for which to create a File.</dd>
<dt>
file_id
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistantFile#assistants-createassistantfile-file_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
A File ID (with purpose="assistants") that the assistant should use.
</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Retrieve Assistant File</h4>
<p>Retrieves an AssistantFile.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
assistant_id
<a href="https://platform.openai.com/docs/api-reference/assistants/getAssistantFile#assistants-getassistantfile-assistant_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the assistant who the file belongs to.</dd>
<dt>
file_id
<a href="https://platform.openai.com/docs/api-reference/assistants/getAssistantFile#assistants-getassistantfile-file_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the file we're getting.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Delete Assistant File</h4>
<p>Delete an assistant file.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
assistant_id
<a href="https://platform.openai.com/docs/api-reference/assistants/deleteAssistantFile#assistants-deleteassistantfile-assistant_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the assistant that the file belongs to.</dd>
<dt>
file_id
<a href="https://platform.openai.com/docs/api-reference/assistants/deleteAssistantFile#assistants-deleteassistantfile-file_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the file to delete.</dd>
</dl>
</details>
</section>
<section>
<details>
<summary style="font-weight: bold;">๐ Audio</summary>
<a href="https://platform.openai.com/docs/api-reference/audio" target="_blank">Official Documentation
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<h4 style="font-weight: bolder;"> โ Create Speech</h4>
<p>Generates audio from the input text.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
input
<a href="https://platform.openai.com/docs/api-reference/audio/createSpeech#audio-createspeech-input"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The text to generate audio for.</dd>
<dt>
model
<a href="https://platform.openai.com/docs/api-reference/audio/createSpeech#audio-createspeech-model"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>One of the available TTS models: <code>tts-1</code>, <code>tts-1-hd</code> or
<code>gpt-4o-mini-tts</code>.</dd>
<dt>
voice
<a href="https://platform.openai.com/docs/api-reference/audio/createSpeech#audio-createspeech-voice"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
The voice to use when generating the audio. Supported voices are <code>alloy</code>, <code>ash</code>,
<code>coral</code>, <code>echo</code>, <code>fable</code>, <code>onyx</code>, <code>nova</code>,
<code>sage</code> and <code>shimmer</code>.
</dd>
<dt class="optional">
instructions
<a href="https://platform.openai.com/docs/api-reference/audio/createSpeech#audio-createspeech-instructions"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
Control the voice of your generated audio with additional instructions. Does not work with
<code>tts-1</code> or <code>tts-1-hd</code>.
</dd>
<dt class="optional">
response_format
<a href="https://platform.openai.com/docs/api-reference/audio/createSpeech#audio-createspeech-response_format"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm.
</dd>
<dt class="optional">
speed
<a href="https://platform.openai.com/docs/api-reference/audio/createSpeech#audio-createspeech-speed"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">number</span>
</dt>
<dd>
The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0
is the default.
</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Create Transcription</h4>
<p>Transcribes audio into the input language.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
file
<a href="https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-file"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">file</span>
</dt>
<dd>
Absolute path to the file that's being transcribed, in one of these formats: flac, mp3, mp4, mpeg, mpga,
m4a, ogg, wav, or webm.
</dd>
<dt>
model
<a href="https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-model"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>ID of the model to use.</dd>
<dt class="optional">
language
<a href="https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-language"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The language of the input audio.</dd>
<dt class="optional">
prompt
<a href="https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-prompt"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
An optional text to guide the model's style or continue a previous audio
segment.
</dd>
<dt class="optional">
response_format
<a href="https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-response_format"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
The format of the transcript output, in one of these options: json,
text, srt, verbose_json, or vtt.
</dd>
<dt class="optional">
temperature
<a href="https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-temperature"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">number</span>
</dt>
<dd>The sampling temperature, between 0 and 1.</dd>
<dt class="optional">
timestamp_granularities
<a href="https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-timestamp_granularities"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">array</span>
</dt>
<dd>The timestamp granularities to populate for this transcription. <code>response_format</code> must be set
to <code>verbose_json</code> to use timestamp granularities. Either or both of these options are
supported: <code>word</code>, or <code>segment</code>.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Create Translation</h4>
<p>Translates audio into English.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
file
<a href="https://platform.openai.com/docs/api-reference/audio/createTranslation#audio-createtranslation-file"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">file</span>
</dt>
<dd>
Absolute path to the file that's being translated, in one of these formats: flac, mp3, mp4, mpeg, mpga,
m4a, ogg, wav, or webm.
</dd>
<dt>
model
<a href="https://platform.openai.com/docs/api-reference/audio/createTranslation#audio-createtranslation-model"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type"></span>
</dt>
<dd>ID of the model to use.</dd>
<dt class="optional">
prompt
<a href="https://platform.openai.com/docs/api-reference/audio/createTranslation#audio-createtranslation-prompt"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
An optional text to guide the model's style or continue a previous audio
segment.
</dd>
<dt class="optional">
response_format
<a href="https://platform.openai.com/docs/api-reference/audio/createTranslation#audio-createtranslation-response_format"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
The format of the transcript output, in one of these options: json,
text, srt, verbose_json, or vtt.
</dd>
<dt class="optional">
temperature
<a href="https://platform.openai.com/docs/api-reference/audio/createTranslation#audio-createtranslation-temperature"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">number</span>
</dt>
<dd>The sampling temperature, between 0 and 1.</dd>
</dl>
</details>
</section>
<section>
<details>
<summary style="font-weight: bold;">๐ฆ Batch</summary>
<a href="https://platform.openai.com/docs/api-reference/batch" target="_blank">Official Documentation
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<h4 style="font-weight: bolder;"> โ Create Batch</h4>
<p>Creates and executes a batch from an uploaded file of requests.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
input_file_id
<a href="https://platform.openai.com/docs/api-reference/batch/create#batch-create-input_file_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of an uploaded file that contains requests for the new batch.</dd>
<dt>
endpoint
<a href="https://platform.openai.com/docs/api-reference/batch/create#batch-create-endpoint"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The endpoint to be used for all requests in the batch. Currently only /v1/chat/completions is supported.
</dd>
<dt>
completion_window
<a href="https://platform.openai.com/docs/api-reference/batch/create#batch-create-completion_window"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
The time frame within which the batch should be processed. Currently only 24h is supported.
</dd>
<dt class="optional">
metadata
<a href="https://platform.openai.com/docs/api-reference/batch/create#batch-create-metadata"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>
Optional custom metadata for the batch.
</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Retrieve Batch</h4>
<p>Retrieves a batch.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
batch_id
<a href="https://platform.openai.com/docs/api-reference/batch/retrieve#batch-retrieve-batch_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the batch to retrieve.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ Cancel Batch</h4>
<p>Cancels an in-progress batch.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
batch_id
<a href="https://platform.openai.com/docs/api-reference/batch/cancel#batch-cancel-batch_id"
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>The ID of the batch to cancel.</dd>
</dl>
<h4 style="font-weight: bolder;"> โ List Batch</h4>
<p>List your organization's batches.</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt class="optional">
after
<a href="https://platform.openai.com/docs/api-reference/batch/list#batch-list-after" target="_blank"><i
class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">string</span>
</dt>
<dd>A cursor for use in pagination. after is an object ID that defines your place in the list.</dd>
<dt class="optional">
limit
<a href="https://platform.openai.com/docs/api-reference/batch/list#batch-list-limit" target="_blank"><i
class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<span class="property-type">integer</span>
</dt>
<dd>A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is
20.</dd>
</dl>
</details>
</section>
<section>
<details>
<summary style="font-weight: bold;">๐ฌ Chat</summary>
<a href="https://platform.openai.com/docs/api-reference/chat" target="_blank">Official Documentation
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
<h4 style="font-weight: bolder;"> โ Create Chat Completion</h4>
<p>
Creates a model response for the given chat conversation.
<a