Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions components/apipie_ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Overview

[APIpie.ai](https://apipie.ai) connects developers with open-source and commercial LLMs via a unified API. With zero infrastructure setup, you can send requests to popular models, switch providers instantly, and explore a growing catalog of AI models—all through one endpoint. Here's an overview of the services offered by [APIpie's API](https://apipie.ai):

- **Model Discovery**: List and explore available LLM models from various providers as seen on the [APIpie Dashboard](https://apipie.ai/dashboard)
- **Chat Completions**: Send messages to any supported model and receive AI-generated responses

Use Python or Node.js code to make fully authenticated API requests with your APIpie account, enabling you to prototype, test, or integrate LLM responses into apps, emails, alerts, dashboards, and more.

# Example Use Cases

The [APIpie API](https://apipie.ai) can be leveraged in a wide range of business contexts to drive efficiency, enhance customer experiences, and innovate product offerings through unified access to multiple AI models. Here are some specific business use cases for utilizing the APIpie API:

### **Customer Support Automation**

Significantly reduce response times and free up human agents to tackle more complex issues by automating customer support ticket responses. Use the List Models action to dynamically select the most appropriate AI model based on ticket complexity or language requirements, then leverage Chat Completions to generate contextual, helpful responses that can be reviewed before sending to customers.

### **Content Creation and Management**

Utilize AI to generate high-quality content for blogs, articles, product descriptions, and marketing material. Create workflows that automatically test different models using the same prompt to compare writing styles, then select the best output for your brand voice. APIpie's unified interface lets you experiment with various open-source and commercial models without managing multiple API integrations.

### **Multi-Model AI Experimentation Framework**

Build intelligent systems that automatically compare AI model performance across different use cases. Set up workflows that send identical prompts to multiple models simultaneously, collect responses in databases, and analyze quality, cost, and latency differences. This enables data-driven decisions about which AI models work best for specific business scenarios while maintaining the flexibility to switch providers as new models become available.

# Getting Started

First, sign up for an APIpie account, then in a new workflow step open the APIpie app and select one of the available actions:

- **List Models**: Fetch the current catalog of available AI models
- **Chat**: Send messages to any supported model and receive responses

Then connect your APIpie account to Pipedream. Visit [APIpie.ai](https://apipie.ai) and navigate to your profile to generate your [API key.](https://apipie.ai/profile/api-keys)

Copy your API key and paste it into Pipedream when prompted. Now you're all set to use pre-built actions like `Chat` or `List Models`, or use your APIpie API key directly in Node.js or Python code to access the unified AI model interface.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import fs from "fs";
import apipieAi from "../../apipie_ai.app.mjs";

export default {
key: "apipie_ai-convert-text-to-speech",
name: "Convert Text to Speech (TTS)",
description: "Generates audio from the input text. [See the documentation](https://apipie.ai/docs/Features/Voices)",
version: "0.0.1",
type: "action",
props: {
apipieAi,
model: {
propDefinition: [
apipieAi,
"ttsModelId",
],
},
input: {
propDefinition: [
apipieAi,
"input",
],
},
voice: {
propDefinition: [
apipieAi,
"voice",
],
},
responseFormat: {
propDefinition: [
apipieAi,
"audioResponseFormat",
],
},
speed: {
propDefinition: [
apipieAi,
"speed",
],
},
outputFile: {
type: "string",
label: "Output Filename",
description: "The filename of the output audio file that will be written to the `/tmp` folder, e.g. `/tmp/myFile.mp3`",
},
},
async run({ $ }) {
const response = await this.apipieAi.createSpeech({
$,
data: {
model: this.model,
input: this.input,
voice: this.voice,
response_format: this.responseFormat,
speed: Number(this.speed),
},
responseType: "arraybuffer",
});

const outputFilePath = this.outputFile.includes("tmp/")
? this.outputFile
: `/tmp/${this.outputFile}`;

await fs.promises.writeFile(outputFilePath, Buffer.from(response));

$.export("$summary", "Generated audio successfully");
return {
outputFilePath,
response,
};
},
};
78 changes: 78 additions & 0 deletions components/apipie_ai/actions/create-image/create-image.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import apipieAi from "../../apipie_ai.app.mjs";

export default {
name: "Create Image",
version: "0.0.1",
key: "apipie_ai-create-image",
description: "Creates an image given a prompt returning a URL to the image. [See the documentation](https://apipie.ai/docs/Features/Images)",
type: "action",
props: {
apipieAi,
model: {
propDefinition: [
apipieAi,
"imageModelId",
],
},
prompt: {
propDefinition: [
apipieAi,
"prompt",
],
},
responseFormat: {
propDefinition: [
apipieAi,
"imageResponseFormat",
],
},
size: {
propDefinition: [
apipieAi,
"size",
],
},
n: {
propDefinition: [
apipieAi,
"n",
],
},
quality: {
propDefinition: [
apipieAi,
"quality",
],
},
style: {
propDefinition: [
apipieAi,
"style",
],
},
},
async run({ $ }) {
const response = await this.apipieAi.createImage({
$,
data: {
prompt: this.prompt,
n: this.n,
size: this.size,
response_format: this.responseFormat === "url"
? this.responseFormat
: "b64_json",
model: this.model,
quality: this.quality,
style: this.style,
},
});

if (response.data.length) {
$.export("$summary", `Successfully created ${response.data.length} image${response.data.length === 1
? ""
: "s"}`);
}

return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import apipieAi from "../../apipie_ai.app.mjs";

export default {
key: "apipie_ai-retrieve-available-image-models",
name: "Retrieve Available Image Models",
version: "0.0.1",
description: "Returns a list of Image models available through the API. [See the dashboard](https://apipie.ai/dashboard)",
type: "action",
props: {
apipieAi,
},
async run({ $ }) {
const response = await this.apipieAi.listImageModels({
$,
});

$.export("$summary", `Successfully retrieved ${response.data.length} available Image model(s)!`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import apipieAi from "../../apipie_ai.app.mjs";

export default {
key: "apipie_ai-retrieve-available-llm-models",
name: "Retrieve Available LLM Models",
version: "0.0.1",
description: "Returns a list of LLM models available through the API. [See the dashboard](https://apipie.ai/dashboard)",
type: "action",
props: {
apipieAi,
},
async run({ $ }) {
const response = await this.apipieAi.listLlmModels({
$,
});

$.export("$summary", `Successfully retrieved ${response.data.length} available LLM model(s)!`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import apipieAi from "../../apipie_ai.app.mjs";

export default {
key: "apipie_ai-retrieve-available-tts-models",
name: "Retrieve Available TTS Models",
version: "0.0.1",
description: "Returns a list of TTS models available through the API. [See the dashboard](https://apipie.ai/dashboard)",
type: "action",
props: {
apipieAi,
},
async run({ $ }) {
const response = await this.apipieAi.listTtsModels({
$,
});

$.export("$summary", `Successfully retrieved ${response.data.length} available TTS model(s)!`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import apipieAi from "../../apipie_ai.app.mjs";

export default {
key: "apipie_ai-retrieve-available-tts-voices-models",
name: "Retrieve Available TTS Voices",
version: "0.0.1",
description: "Returns a list of TTS Voices available through the API. [See the dashboard](https://apipie.ai/dashboard)",
type: "action",
props: {
apipieAi,
},
async run({ $ }) {
const response = await this.apipieAi.listVoices({
$,
});

$.export("$summary", `Successfully retrieved ${response.data.length} available TTS Voices!`);
return response;
},
};
Loading