For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

The HTTP Request method gives you full control over the API call and works with any OpenAI-compatible endpoint.

Method: HTTP Request Piece

Step 1: Add HTTP Request Piece

  1. Open your Activepieces flow

  2. Click + to add a new piece

  3. Search for HTTP and select HTTP Request (Advanced)

Step 2: Configure the Request

Set up the HTTP request with these parameters:

Field
Value

Method

POST

URL

https://api.tensorx.ai/v1/chat/completions

Step 3: Add Headers

Click Add Header and add the following:

Header
Value

Authorization

Bearer YOUR_TENSORX_API_KEY

Content-Type

application/json

Step 4: Configure the Body

Set Body Type to Raw (JSON) and enter:

Replace {{trigger.message}} with your actual data source from previous pieces in your flow.

Step 5: Parse the Response

The API returns a JSON response. To extract the assistant's message:

  1. Add a Code piece after the HTTP Request

  2. Use JavaScript to parse the response:

Example Flows

Email Summarizer

  1. Trigger: New Email (Gmail piece)

  2. HTTP Request: Send email body to TensorX for summarization

  3. Action: Save summary to Notion or send to Slack

Request body:

Customer Support Classifier

  1. Trigger: New Support Ticket (webhook or integration)

  2. HTTP Request: Classify ticket category

  3. Branch: Route based on category

  4. Action: Assign to appropriate team

Request body:

Content Generator

  1. Trigger: New Row in Google Sheets

  2. HTTP Request: Generate content based on topic

  3. Action: Update sheet with generated content

Request body:

For Coding Tasks:

  • z-ai/glm-5.1 - Best for tool calling and structured outputs

  • minimax/minimax-m2.5 - Best for complex reasoning tasks

Model ID
Best For

deepseek/deepseek-chat-v3.1

General text generation

z-ai/glm-5.1

Classification, structured output

minimax/minimax-m2.5

Complex reasoning, analysis

moonshotai/kimi-k2.5

Vision, long context

Handling Streaming Responses

For long responses, you may want to handle streaming:

  1. The TensorX API supports streaming with "stream": true

  2. However, HTTP Request piece may not handle SSE well

  3. For streaming, consider using a webhook-based approach or the Code piece with fetch

Error Handling

Add Error Handling

  1. Click on your HTTP Request piece

  2. Enable Handle Errors

  3. Add a branch to handle failed requests

Common Errors

Error
Cause
Solution

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:

  1. Create a flow template with the HTTP Request piece configured

  2. Use flow variables for dynamic content

  3. Duplicate the template for new automations

Storing API Key Securely

Instead of hardcoding your API key:

  1. Go to SettingsConnections

  2. Create a new Custom Connection

  3. Store your API key securely

  4. Reference it in your flows using {{connections.tensorx.apiKey}}

Troubleshooting

"Request Failed" Error

  • Check the URL is exactly https://api.tensorx.ai/v1/chat/completions

  • Verify 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?