This guide provides a streamlined process for integrating Portkey AI into ToolJet using the ToolJet Marketplace Plugin. Follow this guide to add AI-powered capabilities such as chat completions and automations into your ToolJet apps, helping developers create powerful, low-code applications backed by Portkey’s AI for chat-based interfaces and automated workflows.
Prerequisites
Portkey API Key and Virtual Key from your Portkey dashboard.
ToolJet Account with access to the Marketplace Plugin feature .
Basic familiarity with ToolJet UI components.
Watch Demo Watch this demo for a quick walkthrough on ToolJet’s UI components.
Before following this guide, ensure that you have completed the setup for using marketplace plugins in ToolJet.
Step-by-Step Onboarding
Install the Portkey Plugin from ToolJet Marketplace
Go to ToolJet Dashboard > Plugins > Marketplace .
Search for Portkey Plugin .
Click Install to add the plugin to your project.
If Portkey has already been added to your marketplace, you can skip this step.
Configure the Portkey Plugin
Navigate to Data Sources in your ToolJet workspace.
Open Plugins .
Click Add Portkey .
Add Portkey as a Datasource
Enter the following details:
Authorization: Your Portkey API Key
Default Virtual Key: Your Portkey Virtual Key
Test the connection to ensure the keys are configured correctly.
Use Portkey in Your ToolJet App
Go to Queries > Add Datasource > Select Portkey Plugin .
From the dropdown, Select an Operation (details in the next section).
Run the query to verify it responds correctly.
Link the Query to UI Components (Example)
Add Text Input and Button widgets to your app’s interface.
Configure the Button’s onClick action to Execute Query using the Portkey API.
Use a Text Box widget to display the query results.
Test and Deploy
Use Preview Mode to test the interaction between your app’s UI and the Portkey API.
Deploy the app from the ToolJet dashboard.
Supported Operations
Portkey supports the following operations within ToolJet:
Completion Chat Prompt Completion Create Embedding Completion Generates text completions based on a given prompt.
Parameters:
Prompt: Input text to generate completions for.
Model: The AI model to use.
Max Tokens: Maximum number of tokens to generate.
Temperature: Controls randomness.
Stop Sequences: Sequences where the API stops generating further tokens.
Metadata: Additional metadata for the request.
Other Parameters: Additional request parameters.
{
"id" : "cmpl-9vNUfM8OP0SwSqXcnPwkqzR7ep8Sy" ,
"object" : "text_completion" ,
"created" : 1723462033 ,
"model" : "gpt-3.5-turbo-instruct" ,
"choices" : [
{
"text" : "nn" Experience the perfect brew at Bean There . "" ,
"index" : 0 ,
"logprobs" : null ,
"finish_reason" : "stop"
}
],
"usage" : {
"prompt_tokens" : 13 ,
"completion_tokens" : 10 ,
"total_tokens" : 23
}
}
For all operations, you can optionally specify:
Config: Configuration options for the request.
Virtual Key: Override the default virtual key with a specific one.
Troubleshooting
- Authentication Error
Double-check your API key and configuration .
- Slow Response
Adjust the temperature or max_tokens to optimize performance.
- CORS Issues
Ensure your API settings allow access from ToolJet’s domain .