@inductiv/node-red-openai-api
Version:
Enhance your Node-RED projects with advanced AI capabilities.
375 lines (326 loc) • 14.5 kB
HTML
<section>
<details>
<summary style="font-weight: bold;">💬 Chat</summary>
<a href="https://developers.openai.com/api/reference/typescript/resources/chat/completions/" 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 href="https://developers.openai.com/api/reference/typescript/resources/chat/completions/" target="_blank">Full documentation.</a>
</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
messages
<span class="property-type">array</span>
</dt>
<dd>A list of messages comprising the conversation so far.</dd>
<dt>
model
<span class="property-type">string</span>
</dt>
<dd>ID of the model to use.</dd>
<dt class="optional">
store
<span class="property-type">boolean | null</span>
</dt>
<dd>Whether to store the output of this chat completion request.</dd>
<dt class="optional">
reasoning_effort
<span class="property-type">string</span>
</dt>
<dd>Constrains effort on reasoning for reasoning models.</dd>
<dt class="optional">
metadata
<span class="property-type">object or null</span>
</dt>
<dd>Developer-defined tags and values used for filtering completions in the dashboard.</dd>
<dt class="optional">
frequency_penalty
<span class="property-type">number</span>
</dt>
<dd>Number between -2.0 and 2.0.</dd>
<dt class="optional">
logit_bias
<span class="property-type">object</span>
</dt>
<dd>
Modify the likelihood of specified tokens appearing in the completion.
</dd>
<dt class="optional">
logprobs
<span class="property-type">boolean</span>
</dt>
<dd>Whether to return log probabilities of the output tokens or not.</dd>
<dt class="optional">
top_logprobs
<span class="property-type">integer</span>
</dt>
<dd>
An integer between 0 and 20 specifying the maximum number of most likely
tokens to return at each token position, each with an associated log
probability. In some cases, the number of returned tokens may be fewer
than requested. Set <code>logprobs</code> to <code>true</code> when using
this field.
</dd>
<dt class="optional">
max_tokens [Deprecated]
<span class="property-type">integer</span>
</dt>
<dd>
The maximum number of tokens that can be generated in the chat
completion. This value is now deprecated in favor of max_completion_tokens,
and is not compatible with o1 series models.
</dd>
<dt class="optional">
max_completion_tokens
<span class="property-type">integer</span>
</dt>
<dd>
An upper bound for the number of tokens that can be generated for a completion,
including visible output tokens and reasoning tokens.
</dd>
<dt class="optional">
n
<span class="property-type">integer</span>
</dt>
<dd>
How many chat completion choices to generate for each input message.
</dd>
<dt class="optional">
modalities
<span class="property-type">array or null</span>
</dt>
<dd>
Output types that you would like the model to generate for this request.
</dd>
<dt class="optional">
prediction
<span class="property-type">object</span>
</dt>
<dd>
Configuration for a Predicted Output.
</dd>
<dt class="optional">
prompt_cache_retention
<span class="property-type">string | null</span>
</dt>
<dd>
Prompt cache retention policy. Set <code>24h</code> for extended prompt caching.
For <code>gpt-5.5</code>, <code>gpt-5.5-pro</code>, and future models, only
<code>24h</code> is supported. For older models that support both <code>in_memory</code>
and <code>24h</code>, the default depends on the organization's data retention policy:
organizations without ZDR enabled default to <code>24h</code>, and organizations with
ZDR enabled default to <code>in_memory</code> when <code>prompt_cache_retention</code>
is not specified.
</dd>
<dt class="optional">
audio
<span class="property-type">object or null</span>
</dt>
<dd>
Parameters for audio output.
</dd>
<dt class="optional">
presence_penalty
<span class="property-type">number</span>
</dt>
<dd>Number between -2.0 and 2.0.</dd>
<dt class="optional">
response_format
<span class="property-type">object</span>
</dt>
<dd>An object specifying the format that the model must output.</dd>
<dt class="optional">
seed
<span class="property-type">integer</span>
</dt>
<dd>
This feature is in Beta. If specified, the system will make a best
effort to sample deterministically, such that repeated requests with the
same seed and parameters should return the same result.
</dd>
<dt class="optional">
service_tier
<span class="property-type">string or null</span>
</dt>
<dd>
Specifies the latency tier to use for processing the request.
</dd>
<dt class="optional">
stop
<span class="property-type">string | array</span>
</dt>
<dd>
Up to 4 sequences where the API will stop generating further tokens.
</dd>
<dt class="optional">
stream
<span class="property-type">boolean</span>
</dt>
<dd>If set, partial message deltas will be sent, like in ChatGPT.</dd>
<dt class="optional">
stream_options
<span class="property-type">object</span>
</dt>
<dd>Options for streaming response. Only set this when you set ```stream: true```.</dd>
<dt class="optional">
temperature
<span class="property-type">number</span>
</dt>
<dd>What sampling temperature to use, between 0 and 2.</dd>
<dt class="optional">
top_p
<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">
tools
<span class="property-type">array</span>
</dt>
<dd>A list of tools the model may call.</dd>
<dt class="optional">
tool_choice
<span class="property-type">string | object</span>
</dt>
<dd>Whether to enable parallel function calling during tool use.</dd>
<dt class="optional">
parallel_tool_calls
<span class="property-type">string | object</span>
</dt>
<dd>Whether to enable parallel function calling during tool use.</dd>
<dt class="optional">
user
<span class="property-type">string</span>
</dt>
<dd>
A unique identifier representing your end-user, which can help OpenAI to
monitor and detect abuse.
</dd>
</dl>
<h4 style="font-weight: bolder;"> ⋙ Get Chat Completion</h4>
<p>
Get a stored chat completion.
<a href="https://developers.openai.com/api/reference/typescript/resources/chat/completions/" target="_blank">Full documentation.</a>
</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
completion_id
<span class="property-type">string</span>
</dt>
<dd>The ID of the chat completion to retrieve.</dd>
</dl>
<!-- Begin Get Chat Messages -->
<h4 style="font-weight: bolder;"> ⋙ Get Chat Messages</h4>
<p>
Get the messages in a stored chat completion.
<a href="https://developers.openai.com/api/reference/typescript/resources/chat/completions/" target="_blank">Full
documentation.</a>
</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
completion_id
<span class="property-type">string</span>
</dt>
<dd>The ID of the chat completion to retrieve messages from.</dd>
<dt class="optional">
after
<span class="property-type">string</span>
</dt>
<dd>Identifier for the last message from the previous pagination request.</dd>
<dt class="optional">
limit
<span class="property-type">integer</span>
</dt>
<dd>Number of messages to retrieve.</dd>
<dt class="optional">
order
<span class="property-type">string</span>
</dt>
<dd>Sort order for messages by timestamp.</dd>
</dl>
<!-- END Get Chat Messages -->
<!-- Begin List Chat Completions -->
<dl>
<h4 style="font-weight: bolder;"> ⋙ List Chat Completions</h4>
<p>
List stored chat completions.
<a href="https://developers.openai.com/api/reference/typescript/resources/chat/completions/" target="_blank">Full
documentation.</a>
</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt class="optional">
model
<span class="property-type">string</span>
</dt>
<dd>The model used to generate the chat completions.</dd>
<dt class="optional">
metadata
<span class="property-type">object</span>
</dt>
<dd>A list of metadata keys to filter the chat completions by.</dd>
<dt class="optional">
after
<span class="property-type">string</span>
</dt>
<dd>Identifier for the last chat completion from the previous pagination request.</dd>
<dt class="optional">
limit
<span class="property-type">integer</span>
</dt>
<dd>Number of chat completions to retrieve.</dd>
<dt class="optional">
order
<span class="property-type">string</span>
</dt>
<dd>Sort order for chat completions by timestamp.</dd>
</dl>
<!-- END List Chat Completions -->
<!-- Begin Update Chat Completions -->
<dl>
<h4 style="font-weight: bolder;"> ⋙ Update Chat Completion</h4>
<p>
Modify a stored chat completion.
<a href="https://developers.openai.com/api/reference/typescript/resources/chat/completions/" target="_blank">Full
documentation.</a>
</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
completion_id
<span class="property-type">string</span>
</dt>
<dd>The ID of the chat completion to update.</dd>
<dt>
metadata
<span class="property-type">object</span>
</dt>
<dd>Set of 16 key-value pairs that can be attached to an object.</dd>
</dl>
<!-- END Update Chat Completion -->
<!-- Begin Delete Chat Completion -->
<dl>
<h4 style="font-weight: bolder;"> ⋙ Delete Chat Completion</h4>
<p>
Delete a stored chat completion.
<a href="https://developers.openai.com/api/reference/typescript/resources/chat/completions/" target="_blank">Full
documentation.</a>
</p>
<dl class="message-properties">
<h4>msg.payload Properties</h4>
<dt>
completion_id
<span class="property-type">string</span>
</dt>
<dd>The ID of the chat completion to delete.</dd>
</dl>
<!-- END Delete Chat Completion -->
</details>
</section>