Skip to main content
Use the OpenAI integration to generate text or code based on a text prompt. Provide AI capabilities to end-users or leverage it within APIs to enrich your Superblocks APIs. Some examples include flagging fraudulent activities based on customer transaction history, suggesting potential fixes to customer issue tickets for support reps, or generating product descriptions for e-commerce products based on a text prompt.

Setting up OpenAI

1. Add integration

Select OpenAI from the in-app Integrations page.

2. Configure settings

Fill out the form with the following settings:
SettingRequiredDescription
NameName that will be displayed to users when selecting this integration in Superblocks
API KeyAPI key for your OpenAI account
Organization IDSpecify which organization should be used for requests

3. Test and save

Click Test Connection to check that Superblocks can connect to the data source.
If using Superblocks Cloud, add these Superblocks IPs to your allowlist (not necessary for Hybrid or Cloud-Prem deployments).

4. Set profiles

Optionally, configure different profiles for separate development environments.
OpenAI connected!
Now you can use OpenAI in any Application, Workflow, or Scheduled Job.

Actions

Generate ChatGPT Response

Given a prompt, the model will return a chat completion response.
FieldDescription
PromptThe user input or question used to prompt the OpenAI API to generate a response
Message HistoryPrevious conversation history between the user and OpenAI. This enables users to reference prior messages in their prompt
Advanced Tuning Parameters:
FieldDescription
AI ModelThe AI Model to use when generating responses
Max Tokens (optional)Maximum number of tokens (words or symbols) the generated response can contain
System Instruction (optional)Specific instruction to set the intended behavior of the AI language model, such as “Be a helpful assistant”, “Speak as F500 CEO”, “Make responses funny”

Generate Text

Given a prompt, the model will return a text completion response.
FieldDescription
TypeNew Text (Given a prompt, the model will return a predicted text completion.) or Edit Text (Given text, the model will edit the text based on the prompt.)
PromptThe text or question describing the text to generate or edit
Text to EditThe original text that requires editing. Used as the basis for generating a revised version of the text
Advanced Tuning Parameters:
FieldDescription
AI ModelThe AI Model to use when generating responses
Max Tokens (optional)Maximum number of tokens (words or symbols) the generated response can contain

Generate Code

Given a prompt or code, the model will return a code completion response.
FieldDescription
TypeNew Code (Given a prompt, the model will return code completion.) or Edit Code (Given a code snippet, the model will edit the code based on the prompt.)
PromptThe text or question describing the code to generate or edit
Code to EditThe original code that requires editing. Used as the basis for generating a revised version of the code
Advanced Tuning Parameters:
FieldDescription
AI ModelThe AI Model to use when generating responses
Max Tokens (optional)Maximum number of tokens (words or symbols) the generated response can contain

Generate Image

Given a prompt or image, the model will return a new image.
Generate from Prompt
Given a prompt, the model will generate a new image.
FieldDescription
PromptA text description of the desired image. The maximum length is 1000 characters
Image SizeThe size of the generated images, options are: 256x256, 512x512, or 1024x1024
Edit Image
Given an original image and a prompt, the model will create an edited or extended image.
FieldDescription
PromptA text description of the desired image. The maximum length is 1000 characters
Image File to EditThe image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask. Image URLs are not supported
Image Mask (optional)An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image
Generated Image SizeThe size of the generated images, options are: 256x256, 512x512, or 1024x1024
Vary Image
Given an original image, the model will create a variation of the image.
FieldDescription
Image FileThe image to use as the basis for the variation. Must be a valid PNG file, less than 4MB, and square. Image URLs are not supported
Image SizeThe size of the generated images, options are: 256x256, 512x512, or 1024x1024

Check Moderation

Given text, the model will check for hate, hate/threatening, self-harm, sexual, sexual/minors, violence, or violence/graphic content.
FieldDescription
TextThe text to run a moderation check on.
Advanced Tuning Parameters:
FieldDescription
AI ModelThe AI Model to use when generating responses

Transcribe Audio to Text

Given an audio file, convert to text.
FieldDescription
Audio FileThe audio file to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm
Translate to EnglishTranslates the input audio to English
Input LanguageThe language the input audio is in
Advanced Tuning Parameters:
FieldDescription
AI ModelThe AI Model to use when generating responses

Generate Text Embedding

Given text, will generate a vector representation of the text that can be consumed by ML models and algorithms.
FieldDescription
InputInput text to get embeddings for. Must not exceed 8,192 tokens
Advanced Tuning Parameters:
FieldDescription
AI ModelThe AI Model to use when generating responses