CONNECT APP
Build with OpenAI (ChatGPT)
Artificial Intelligence (AI)
- API key
MCP
Give your agent OpenAI (ChatGPT) tools
Every OpenAI (ChatGPT) action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's OpenAI (ChatGPT) account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "openai",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Chat:
const result = await mcp.callTool({
name: "openai-chat",
arguments: {
modelId: "Model",
userMessage: "User Message",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "openai",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Chat:
result = await session.call_tool("openai-chat", {
"modelId": "Model",
"userMessage": "User Message",
})API PROXY
Call the OpenAI (ChatGPT) API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the OpenAI (ChatGPT) API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.openai.com/v1/models",
})
// Any allowed OpenAI (ChatGPT) endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.openai.com/v1/models
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkub3BlbmFpLmNvbS92MS9tb2RlbHM?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run OpenAI (ChatGPT) actions from your backend
Connect a user's OpenAI (ChatGPT) account once, then run Chat on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "openai-chat",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
openai: { authProvisionId: "apn_xxxxxxx" },
modelId: "Model",
userMessage: "User Message",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="openai-chat",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"openai": {"authProvisionId": "apn_xxxxxxx"},
"modelId": "Model",
"userMessage": "User Message",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "openai-chat",
"configured_props": {
"openai": { "authProvisionId": "apn_xxxxxxx" },
"modelId": "Model",
"userMessage": "User Message"
}
}'TOOLS
OpenAI (ChatGPT) actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Chat
actionThe Chat API, using thegpt-3.5-turboorgpt-4model. See the documentationWritev0.3.6 -
Chat using Web Search
actionChat using the web search tool. See the documentationRead-onlyv0.0.10 -
Chat using Functions
actionChat with your models and allow them to invoke functions. Optionally, you can build and invoke workflows as functions. See the documentationWritev0.0.11 -
Chat using File Search
actionChat with your files knowledge base (vector stores). See the documentationRead-onlyv0.0.10 -
Summarize Text
actionSummarizes text using the Chat API. See the documentationRead-onlyv0.1.12 -
Classify Items into Categories
actionClassify items into specific categories using the Chat API. See the documentationRead-onlyv0.1.12 -
Translate Text (Whisper)
actionTranslate text from one language to another using the Chat API. See the documentationRead-onlyv0.1.12 -
Create Transcription
actionTranscribes audio into the input language. See the documentationWritev0.3.6 -
Create Image (Dall-E)
actionCreates an image given a prompt returning a URL to the image. See the documentationWritev0.1.27 -
Create Embeddings
actionGet a vector representation of a given input that can be easily consumed by machine learning models and algorithms. See the documentationRead-onlyv0.0.24 -
Create Completion (Send Prompt)
actionOpenAI recommends using the Chat action for the latestgpt-3.5-turboAPI, since it's faster and 10x cheaper. This action creates a completion for the provided prompt and parameters using the older/completionsAPI. See the documentationWritev0.1.24 -
Analyze Image Content
actionSend a message or question about an image and receive a response. See the documentationWritev1.2.0 -
Cancel Run (Assistants)
actionCancels a run that is in progress. See the documentationWritev0.0.19 -
Chat with Assistant
actionSends a message and generates a response, storing the message history for a continuous conversation. See the documentationWritev0.0.15 -
Chat With Responses API
actionSend a chat via the Responses API, mixing built-in tools and MCP server tools. See the documentation.Writev0.0.5 -
Convert Text to Speech (TTS)
actionGenerates audio from the input text. See the documentationWritev0.0.19 -
Create Assistant
actionCreates an assistant with a model and instructions. See the documentationWritev0.1.17 -
Create Batch
actionCreates and executes a batch from an uploaded file of requests. See the documentationWritev0.1.5 -
Create Fine Tuning Job
actionCreates a job that fine-tunes a specified model from a given dataset. See the documentationWritev0.0.19 -
Create Moderation
actionClassifies if text is potentially harmful. See the documentationWritev0.0.13 -
Create Thread (Assistants)
actionCreates a thread with optional messages and metadata, and optionally runs the thread using the specified assistant. See the documentationWritev0.0.19 -
Create Vector Store
actionCreate a vector store. See the documentationWritev0.0.9 -
Create Vector Store File
actionCreate a vector store file. See the documentationWritev0.0.9 -
Delete File
actionDeletes a specified file from OpenAI. See the documentationWritev0.0.19 -
Delete Vector Store
actionDelete a vector store. See the documentationWritev0.0.9 -
Delete Vector Store File
actionDeletes a vector store file. See the documentationWritev0.0.9 -
List Files
actionReturns a list of files that belong to the user's organization. See the documentationRead-onlyv0.0.19 -
List Messages (Assistants)
actionLists the messages for a given thread. See the documentationRead-onlyv0.0.20 -
List Model Options
actionRetrieves available options for the Model field.Read-onlyv0.0.1 -
List Model Options
actionRetrieves available options for the Model field.Read-onlyv0.0.1 -
List Model Options
actionRetrieves available options for the Model field.Read-onlyv0.0.1 -
List Model Options
actionRetrieves available options for the Model field.Read-onlyv0.0.1 -
List Model Options
actionRetrieves available options for the Model field.Read-onlyv0.0.1 -
List Run Steps (Assistants)
actionReturns a list of run steps belonging to a run. See the documentationRead-onlyv0.0.19 -
List Runs (Assistants)
actionReturns a list of runs belonging to a thread. See the documentationRead-onlyv0.0.20 -
List Vector Store Files
actionReturns a list of vector store file. See the documentationRead-onlyv0.0.9 -
List Vector Stores
actionReturns a list of vector stores. See the documentationRead-onlyv0.0.9 -
Modify an Assistant
actionModifies an existing OpenAI assistant. See the documentationWritev0.1.17 -
Retrieve File
actionRetrieves a specific file from OpenAI. See the documentationRead-onlyv0.0.19 -
Retrieve File Content
actionRetrieves the contents of the specified file. See the documentationRead-onlyv0.0.20 -
Retrieve Run (Assistants)
actionRetrieves a specific run within a thread. See the documentationRead-onlyv0.0.19 -
Retrieve Run Step (Assistants)
actionRetrieve a specific run step in a thread. See the documentationRead-onlyv0.0.19 -
Retrieve Vector Store
actionRetrieve a vector store. See the documentationRead-onlyv0.0.9 -
Retrieve Vector Store File
actionRetrieve a vector store file. See the documentationRead-onlyv0.0.9 -
Submit Tool Outputs to Run (Assistants)
actionSubmits tool outputs to a run that requires action. See the documentationWritev0.0.19 -
Upload File
actionUpload a file that can be used across various endpoints/features. The size of individual files can be a maximum of 512mb. See the documentationWritev0.1.5
EVENTS
OpenAI (ChatGPT) triggers
Event sources your backend can deploy for users and receive through a webhook.
-
New Batch Completed
triggerEmit new event when a new batch is completed in OpenAI. See the documentationv0.0.12 -
New File Created
triggerEmit new event when a new file is created in OpenAI. See the documentationv0.1.2 -
New Fine Tuning Job Created
triggerEmit new event when a new fine-tuning job is created in OpenAI. See the documentationv0.0.17 -
New Run State Changed
triggerEmit new event every time a run changes its status. See the documentationv0.0.13
MULTI-APP
Use OpenAI (ChatGPT) with other popular apps
Most products don't stop at one integration. Pair OpenAI (ChatGPT) with the other apps your users rely on, and ship use cases that span both.
REFERENCE
App details
Reference metadata for the OpenAI (ChatGPT) connector in the Pipedream registry.
- App slug
- openai
- Authentication
- API key
- Categories
- Artificial Intelligence (AI)
- Actions
- 46
- Triggers
- 4
- API proxy
- Available