Activepieces
Activepieces is an open-source automation platform similar to Zapier, with a visual workflow builder for connecting apps and services.
Prerequisites
An Activepieces instance (self-hosted or cloud)
Your TensorX API key from app.tensorx.ai
Configuration
Since the built-in OpenAI piece uses a hardcoded endpoint, you'll use the HTTP Request piece to connect to TensorX's OpenAI-compatible API.
Method: HTTP Request Piece
Step 1: Add HTTP Request Piece
Open your Activepieces flow
Click + to add a new piece
Search for HTTP and select HTTP Request (Advanced)
Step 2: Configure the Request
Set up the HTTP request with these parameters:
Method
POST
URL
https://api.tensorx.ai/v1/chat/completions
Step 3: Add Headers
Click Add Header and add the following:
Authorization
Bearer YOUR_TENSORX_API_KEY
Content-Type
application/json
Step 4: Configure the Body
Set Body Type to Raw (JSON) and enter:
Step 5: Parse the Response
The API returns a JSON response. To extract the assistant's message:
Add a Code piece after the HTTP Request
Use JavaScript to parse the response:
Example Flows
Email Summarizer
Trigger: New Email (Gmail piece)
HTTP Request: Send email body to TensorX for summarization
Action: Save summary to Notion or send to Slack
Request body:
Customer Support Classifier
Trigger: New Support Ticket (webhook or integration)
HTTP Request: Classify ticket category
Branch: Route based on category
Action: Assign to appropriate team
Request body:
Content Generator
Trigger: New Row in Google Sheets
HTTP Request: Generate content based on topic
Action: Update sheet with generated content
Request body:
Model selection
Call GET /v1/models with your TensorX API key and use one of the returned IDs. If the integration depends on a capability or token limit, query GET /v1/model/info before selecting the model. See Models for examples.
Handling Streaming Responses
For long responses, you may want to handle streaming:
The TensorX API supports streaming with
"stream": trueHowever, HTTP Request piece may not handle SSE well
For streaming, consider using a webhook-based approach or the Code piece with fetch
Error Handling
Add Error Handling
Click on your HTTP Request piece
Enable Handle Errors
Add a branch to handle failed requests
Common Errors
401
Invalid API key
Check your API key
400
Malformed request
Verify JSON body format
404
Wrong endpoint
Use /v1/chat/completions
429
Rate limit
Add delays between requests
Creating a Reusable Template
To reuse your TensorX configuration:
Create a flow template with the HTTP Request piece configured
Use flow variables for dynamic content
Duplicate the template for new automations
Storing API Key Securely
Instead of hardcoding your API key:
Go to Settings → Connections
Create a new Custom Connection
Store your API key securely
Reference it in your flows using
{{connections.tensorx.apiKey}}
Troubleshooting
"Request Failed" Error
Check the URL is exactly
https://api.tensorx.ai/v1/chat/completionsVerify headers are correctly formatted
Test your API key with a simple curl command
Empty Response
Check the response body parsing
Verify the model ID is correct
Look at the raw response for error messages
Timeout Errors
Increase the timeout setting in HTTP Request piece
Use a faster model for time-sensitive flows
Consider breaking long operations into smaller chunks
Support
Need help? Contact us at support@tensorx.ai
Last updated
Was this helpful?

