OpenAI Component
Interact with OpenAI models, including Chat GPT and DALL·E
Component key: openaiDescription
OpenAI is an artifical intelligence research laboratory that conducts AI research. It has notably produced the chat AI ChatGPT and the image generator DALL·E.
This component wraps some of OpenAI's REST API endpoints. Additional endpoints can be referenced in their API documentation. You can use the Raw Request action to interact with endpoints that are not convered by other actions.
Connections
OpenAI API Key
Integrations can authenticate with OpenAI using API keys. Generate an API key at platform.openai.com/account/api-keys.
If your user is associate with one organization, you can leave the connection's organization field blank. Otherwise, specify your organization's ID.
Actions
Create Chat Completion
Create a completion for the chat message | key: createChatCompletion
Output Example Payload
{
"data": {
"id": "chatcmpl-6vf993Onyn1Bwq67AYDTR6fIjzvBu",
"object": "chat.completion",
"created": 1679200883,
"model": "gpt-3.5-turbo-0301",
"usage": {
"prompt_tokens": 56,
"completion_tokens": 21,
"total_tokens": 77
},
"choices": [
{
"message": {
"role": "assistant",
"content": "The 2020 World Series was played at the Globe Life Field in Arlington, Texas, USA."
},
"finish_reason": "stop",
"index": 0
}
]
}
}
Create Image
Create image(s) given a prompt | key: createImage
Output Example Payload
{
"data": {
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}
}
Get Model by ID
Get model by ID | key: getModelById
Output Example Payload
{
"data": {
"id": "davinci",
"object": "model",
"created": 1649359874,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-U6ZwlyAd0LyMk4rcMdz33Yc3",
"object": "model_permission",
"created": 1669066355,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "davinci",
"parent": null
}
}
List Models
List all available models | key: listModels
Output Example Payload
{
"data": {
"object": "list",
"data": [
{
"id": "davinci",
"object": "model",
"created": 1649359874,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-U6ZwlyAd0LyMk4rcMdz33Yc3",
"object": "model_permission",
"created": 1669066355,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "davinci",
"parent": null
}
]
}
}
Raw Request
Send raw HTTP request to OpenAI | key: rawRequest