Skip to content

OpenAI

OpenAI

OpenAI is the company behind the GPT, DALL-E, Whisper, and TTS models — some of the most advanced artificial intelligence models in the world. With the OpenAI integration in SquadOS, your agents can create chat completions, generate and edit images, transcribe audio, convert text to speech, generate embeddings, fine-tune models, manage assistants, threads, and vector stores for RAG, and much more.

This tool uses an API key (API_KEY) to connect.

You will need the following fields:

FieldRequiredDescription
api_keyYesAPI key generated in the OpenAI dashboard, used to authenticate all requests.
  1. Go to platform.openai.com and log in or create an account.
  2. In the side menu, click API keys.
  3. Click Create new secret key, give it a name, and copy the generated value.
  4. Store the key in a safe place — it will not be shown again.
  1. Go to Tools in the side menu (/admin/tools).
  2. Open the Available tab and search for OpenAI.
  3. Click the card to open the details and hit Connect.
  4. You’re taken to the secure connection page hosted by Composio, where you enter the API key obtained above.
  5. Once done, you’re sent back to SquadOS with the account connected and the tool available to agents. (Connection-flow details in Organization Tools.)

OPENAI_CREATE_CHAT_COMPLETION

Tool to create a chat completion response from OpenAI models. Use for conversational AI, text generation, function calling, multimodal tasks with vision/audio, and structured JSON outputs. Supports advanced features like reasoning models, tool use, and streaming responses.

NameTypeRequiredDescription
messagesarrayYesA list of messages comprising the conversation so far. Each message has a role and content.
modelstringYesID of the model to use. Supported models include gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo, o1, o1-mini, o3-mini, and others.
nintegerNoHow many chat completion choices to generate for each input message. Default is 1.
temperaturenumberNoSampling temperature between 0 and 2. Higher values like 0.8 make output more random, lower values like 0.2 make it more focused and deterministic. Mutually exclusive with top_p.
toolsarrayNoA list of tools the model may call. Use this for function calling.
response_formatobjectNoResponse format specification for structured outputs.
max_completion_tokensintegerNoAn upper bound for the number of tokens that can be generated, including reasoning tokens. Preferred over max_tokens for newer models.
streambooleanNoIf set to true, partial message deltas will be sent as server-sent events as they become available.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_RESPONSE

Tool to generate a one-shot model response via the Responses API. Use for multimodal analysis (image + text), OCR/text extraction from images, or structured JSON outputs. For structured outputs, configure text.format with type=‘json_schema’ and your schema.

NameTypeRequiredDescription
inputstringYesInput as a string for simple text prompts, or array of message objects for conversations or multimodal inputs with images.
modelstringYesModel to use for the response.
toolsarrayNoList of tools the model can call. Supports function, code_interpreter, file_search, and web_search.
temperaturenumberNoSampling temperature between 0 and 2. Not supported with reasoning models.
max_output_tokensintegerNoMaximum number of tokens the model can generate in the response.
streambooleanNoWhether to stream the response. Returns a stream of events during generation.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_IMAGE

Tool to generate an image via the OpenAI Images API and return hosted image asset URL and metadata. Use when you need to create images from text descriptions for single-shot image generation.

NameTypeRequiredDescription
promptstringYesA text description of the desired image. Maximum length: 32000 characters for GPT image models, 4000 characters for dall-e-3, 1000 characters for dall-e-2.
modelstringYesID of the model to use for image generation. Supported models include: ‘gpt-image-2’ (newest), ‘dall-e-3’, ‘dall-e-2’.
sizestringNoSize of the generated image. E.g., ‘1024x1024’, ‘1792x1024’.
qualitystringNoQuality of the image. Options: ‘standard’, ‘hd’, ‘auto’, ‘high’, ‘medium’, ‘low’.
nintegerNoThe number of images to generate. For dall-e-3, only n=1 is supported.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_IMAGE_EDIT

Tool to create edited or extended images via OpenAI Images Edit API. Use when you need to modify existing images based on a text prompt, with optional mask support for targeted edits.

NameTypeRequiredDescription
imagesarrayYesInput image references to edit. For GPT image models, you can provide up to 16 images.
promptstringYesA text description of the desired image edit. Maximum 32000 characters.
modelstringNoThe model to use for image editing. Supported models: ‘gpt-image-2’, ‘gpt-image-1.5’ (default), ‘dall-e-2’.
sizestringNoRequested output image size. Examples: ‘1024x1024’, ‘1024x1536’, ‘auto’.
nintegerNoThe number of edited images to generate. Default is 1.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_AUDIO_TRANSCRIPTION

Tool to transcribe audio files to text via OpenAI Audio Transcriptions API. Use when you need to convert speech in audio files to written text, optionally with timestamps or speaker diarization.

NameTypeRequiredDescription
modelstringYesID of the model to use for transcription. Options: ‘whisper-1’, ‘gpt-4o-transcribe’, ‘gpt-4o-mini-transcribe’.
fileobjectNoAudio file to transcribe. Supported formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
languagestringNoLanguage of the input audio in ISO-639-1 format (e.g., ‘en’ for English, ‘es’ for Spanish).
response_formatstringNoFormat of the transcription output. Options: ‘json’, ‘text’, ‘srt’, ‘vtt’, ‘verbose_json’.
temperaturenumberNoSampling temperature between 0 and 1.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_SPEECH

Tool to generate text-to-speech audio using OpenAI’s Audio API. Use when you need to convert text to natural-sounding speech with a choice of voices and models. Returns a hosted audio file URL with metadata, not raw bytes.

NameTypeRequiredDescription
inputstringYesText to convert to speech. Maximum 4096 characters.
modelstringYesTTS model to use. Options: ‘gpt-4o-mini-tts’, ‘tts-1’ (standard quality, faster), ‘tts-1-hd’ (high quality, slower).
voicestringYesVoice to use for audio generation. Available voices: ‘alloy’, ‘ash’, ‘ballad’, ‘coral’, ‘echo’, ‘fable’, ‘onyx’, ‘nova’, ‘sage’, ‘shimmer’, ‘verse’.
response_formatstringNoAudio format for the output. Supported formats: ‘mp3’ (default), ‘opus’, ‘aac’, ‘flac’, ‘wav’, ‘pcm’.
speednumberNoPlayback speed of the audio. Range: 0.25 to 4.0. Default is 1.0.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_EMBEDDINGS

Tool to generate text embeddings via the OpenAI embeddings endpoint. Use for search, clustering, recommendations, and vector database storage workflows.

NameTypeRequiredDescription
inputstringYesInput text to embed, encoded as a string or array of tokens. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models).
modelstringYesID of the model to use. Supported models include text-embedding-ada-002, text-embedding-3-small, and text-embedding-3-large.
dimensionsintegerNoThe number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.
encoding_formatstringNoThe format to return the embeddings in. Can be either ‘float’ or ‘base64’. Defaults to ‘float’.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_MODERATION

Tool to classify text and/or image inputs for potentially harmful content via the OpenAI Moderation API. Use for content safety checks, filtering user-generated content, or monitoring for policy violations across 13 harm categories including harassment, hate, violence, sexual content, self-harm, and illicit activities.

NameTypeRequiredDescription
inputstringYesInput (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects with text and images.
modelstringNoThe content moderation model to use. Options include: ‘omni-moderation-latest’ (default, supports text and images), ‘text-moderation-latest’ (text-only, latest version).
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_ASSISTANT

Tool to create an OpenAI assistant. Use when you need to instantiate a new assistant with a specific model, instructions, tools, and tool resources. Required before creating threads and runs.

NameTypeRequiredDescription
modelstringYesID of the model to use.
namestringNoThe name of the assistant. The maximum length is 256 characters.
instructionsstringNoThe system instructions that the assistant uses. The maximum length is 256,000 characters.
toolsarrayNoA list of tools enabled on the assistant. There can be a maximum of 128 tools per assistant.
descriptionstringNoThe description of the assistant. The maximum length is 512 characters.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_THREAD

Tool to create a new thread. Use when initializing a conversation with optional starter messages. Returns a thread_id that must be persisted and passed to all subsequent calls.

NameTypeRequiredDescription
messagesarrayNoOptional initial messages to start the thread with. Each message must include ‘role’ (‘user’ or ‘assistant’) and a non-empty string content.
metadataobjectNoOptional metadata key-value pairs to attach to the thread.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_MESSAGE

Tool to create a message in a thread. Use to add user (or assistant) messages to an existing thread before creating a run.

NameTypeRequiredDescription
rolestringYesThe role of the entity creating the message. Allowed values: ‘user’ or ‘assistant’.
contentstringYesThe content of the message. Can be a text string or an array of content parts.
thread_idstringYesThe ID of the thread to which this message belongs.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_RUN

Tool to create a run on a thread with an assistant. Use when you need to execute an assistant to generate responses. Creating a message alone does not cause the assistant to respond; a run is the execution primitive.

NameTypeRequiredDescription
thread_idstringYesID of the thread to run. A thread can only have one active run at a time.
assistant_idstringYesID of the assistant to use for this run.
modelstringNoOverride the model used for this run.
instructionsstringNoOverride the assistant’s instructions for this run.
streambooleanNoIf true, returns a stream of events during the run.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_THREAD_AND_RUN

Tool to create a thread and run it in one request. Use when you need to start a new conversation and immediately execute the assistant to generate a response. This is more efficient than calling create_thread and create_run separately.

NameTypeRequiredDescription
assistant_idstringYesID of the assistant to use for this run.
threadobjectNoParameters for creating a new thread.
modelstringNoOverride the model used for this run.
instructionsstringNoOverride the assistant’s instructions for this run.
streambooleanNoIf true, returns a stream of events during the run as server-sent events.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_LIST_MESSAGES

Tool to list messages from a thread. Use to retrieve all messages from a thread after a run completes, including the assistant’s replies.

NameTypeRequiredDescription
thread_idstringYesID of the thread whose messages to list.
limitintegerNoLimit on the number of messages to return (1–100). Default is 20.
orderstringNoSort order by created_at timestamp: ‘asc’ for ascending, ‘desc’ for descending.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_RETRIEVE_RUN

Tool to retrieve an Assistants run by ID to check status, errors, and usage. Use when polling run status until it reaches a terminal state (completed, failed, cancelled, incomplete, expired) before reading thread messages.

NameTypeRequiredDescription
run_idstringYesID of the run to retrieve.
thread_idstringYesID of the thread that was run.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_SUBMIT_TOOL_OUTPUTS_TO_RUN

Tool to submit tool call outputs to continue a run that requires action. Use when a run has status ‘requires_action’ and required_action.type is ‘submit_tool_outputs’. All tool outputs must be submitted together in a single request.

NameTypeRequiredDescription
run_idstringYesThe ID of the run that requires the tool output submission.
thread_idstringYesThe ID of the thread to which this run belongs.
tool_outputsarrayYesA list of tools for which the outputs are being submitted. All tool outputs must be submitted in a single request.
streambooleanNoIf true, returns a stream of events during the run execution after submitting tool outputs.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_VECTOR_STORE

Tool to create a new vector store. Use when you need to create a collection of processed files for file_search tools.

NameTypeRequiredDescription
namestringNoThe name of the vector store. If not provided, the vector store will have no name.
file_idsarrayNoA list of File IDs that the vector store should use. Maximum 500 file IDs allowed.
expires_afterobjectNoExpiration policy for a vector store.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_SEARCH_VECTOR_STORE

Tool to search a vector store for relevant content. Use to retrieve text chunks semantically similar to the query for feeding context into LLM prompts.

NameTypeRequiredDescription
querystringYesSearch query used to find relevant chunks in the vector store.
vector_store_idstringYesThe ID of the vector store to search.
max_num_resultsintegerNoMaximum number of results to return. Default is 10.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_UPLOAD_FILE

Tool to upload a file for use across OpenAI endpoints. Use before referencing the file in tasks like fine-tuning. Returns a file_id that must be explicitly passed to endpoints like OPENAI_CREATE_ASSISTANT or OPENAI_CREATE_MESSAGE.

NameTypeRequiredDescription
filestringYesBinary content of the file to upload.
purposestringYesIntended purpose of the uploaded file. Currently only ‘fine-tune’ is supported.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_LIST_FILES

Tool to list files available in your OpenAI account. Use to verify uploads before referencing file_ids in other calls, or to identify files to delete in order to free up storage quota.

NameTypeRequiredDescription
purposestringNoFilter by file purpose. E.g., ‘fine-tune’, ‘assistants’.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_FINE_TUNING_JOB

Tool to create a fine-tuning job which begins the process of creating a new model from a given dataset. Use when you need to start fine-tuning a model with your training data.

NameTypeRequiredDescription
modelstringYesThe name of the model to fine-tune.
training_filestringYesThe ID of an uploaded file that contains training data. Your dataset must be formatted as a JSONL file and uploaded with the purpose ‘fine-tune’.
validation_filestringNoThe ID of an uploaded file that contains validation data.
suffixstringNoA string of up to 64 characters that will be added to your fine-tuned model name.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_LIST_MODELS

Tool to list available models scoped to the current account/organization — some public models may be absent due to permissions. Use when you need to discover which models you can call.

NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_RETRIEVE_MODEL

Tool to retrieve details of a specific model, confirming its metadata (ownership, created date) and verifying access under your org — a model appearing in OPENAI_LIST_MODELS does not guarantee access.

NameTypeRequiredDescription
modelstringYesIdentifier of the model to retrieve. Case-sensitive; use exact IDs as returned by OPENAI_LIST_MODELS.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_BATCH

Tool to create and execute a batch from an uploaded file of requests. Use after uploading a JSONL file with purpose ‘batch’ to process multiple API requests in a single batch operation.

NameTypeRequiredDescription
endpointstringYesThe endpoint to be used for all requests in the batch. Supported endpoints include /v1/responses, /v1/chat/completions, /v1/embeddings, /v1/completions, /v1/images/generations.
input_file_idstringYesID of an uploaded file containing requests for the batch. The file must be formatted as JSONL and uploaded with purpose ‘batch’.
completion_windowstringYesTime frame within which the batch should be processed. Currently only ‘24h’ is supported.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_CREATE_AUDIO_TRANSLATION

Tool to translate audio files to English text via OpenAI Audio Translations API. Use when you need to convert speech in audio files (any language) to English text.

NameTypeRequiredDescription
modelstringYesID of the model to use for translation. Only ‘whisper-1’ is currently available.
fileobjectNoAudio file to translate to English. Supported formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
promptstringNoOptional text to guide the model’s style. The prompt should be in English.
response_formatstringNoFormat of the translation output. Options: ‘json’, ‘text’, ‘srt’, ‘vtt’, ‘verbose_json’.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_MODIFY_ASSISTANT

Tool to modify an existing assistant. Use when you need to update an assistant’s configuration, model, instructions, tools, or metadata.

NameTypeRequiredDescription
assistant_idstringYesThe ID of the assistant to modify.
modelstringNoID of the model to use.
namestringNoThe name of the assistant. The maximum length is 256 characters.
instructionsstringNoThe system instructions that the assistant uses. The maximum length is 256,000 characters.
toolsarrayNoA list of tools enabled on the assistant. There can be a maximum of 128 tools per assistant.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_RETRIEVE_ASSISTANT

Tool to retrieve details of a specific assistant. Use when you need to confirm assistant metadata before performing further operations. Prefer this over repeated OPENAI_CREATE_ASSISTANT calls to avoid cluttering assistant configurations.

NameTypeRequiredDescription
assistant_idstringYesIdentifier of the assistant to retrieve. Must be a valid, stored OpenAI assistant ID.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.

OPENAI_LIST_ASSISTANTS

Tool to list assistants to discover the correct assistant_id by name or metadata. Use when assistant_id is unknown to avoid 404 errors.

NameTypeRequiredDescription
limitintegerNoLimit on the number of assistants to return (1-100). Default is 20.
orderstringNoSort order by created_at timestamp: ‘asc’ for ascending, ‘desc’ for descending. Default is ‘desc’.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError if any occurred during the execution of the action.
successfulbooleanYesWhether or not the action execution was successful.