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
1
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.
2
Configure the Portkey Plugin
- Navigate to Data Sources in your ToolJet workspace.
- Open Plugins.
- Click Add Portkey.

3
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.

4
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.

5
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.
6
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
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.

Response Example
Response Example
For all operations, you can optionally specify:
- Config: Configuration options for the request.
- Virtual Key: Override the default virtual key with a specific one.