@acedatacloud/piece-gpt-image 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,18 +2,21 @@
2
2
 
3
3
  Create a GPT Image task and retrieve the **same task ID** through Ace Data Cloud. The Piece has two actions: **Create GPT Image task** and **Get GPT Image task**. Submission returns an ID; the image is ready only after the lookup reports `succeeded`.
4
4
 
5
- **Distribution:** Install `@acedatacloud/piece-gpt-image@0.1.0` as a custom Piece in your Activepieces instance. A public npm package does not automatically enter the shared Activepieces catalog. [中文指南](README.zh-CN.md)
5
+ **Distribution:** Install `@acedatacloud/piece-gpt-image@0.1.1` as a custom Piece in your Activepieces instance. A public npm package does not automatically enter the shared Activepieces catalog. [中文指南](README.zh-CN.md)
6
6
 
7
7
  ## Install and connect
8
8
 
9
- In Activepieces 0.92.2+, open **Platform Admin → Catalogue → Pieces → Install Piece → NPM Registry**. Enter `@acedatacloud/piece-gpt-image` and version `0.1.0`, then install it. Search for **GPT Image by Ace Data Cloud** when adding a flow action. Confirm the Ace Data Cloud logo and both actions.
9
+ In Activepieces 0.92.2+, open **Platform Admin → Catalogue → Pieces → Install Piece → NPM Registry**. Enter `@acedatacloud/piece-gpt-image` and version `0.1.1`, then install it. Search for **GPT Image by Ace Data Cloud** when adding a flow action. Confirm the Ace Data Cloud logo and both actions.
10
10
 
11
- Create a connection using an Ace Data Cloud API key with access to both `/openai/images/generations` and `/openai/tasks`. Enter only the key, without `Bearer `. Keep it in the connection, never in a flow export. Check current [pricing](https://platform.acedata.cloud/models) and balance before generation.
11
+ 1. Register or sign in at [Ace Data Cloud Applications](https://platform.acedata.cloud/console/applications?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=gpt_image_activepieces_readme_api_key). If you have no General application, choose **Initialize General Application**.
12
+ 2. Open a General application or an application with **GPT Image** access. A General key can access the services your account is entitled to use; a service-specific key is limited to that service.
13
+ 3. Use the application's copy button, or choose **Manage Keys → Create** to create a separate key named `Activepieces GPT Image`. Set expiry and usage limits as needed. If you restrict **Allowed APIs**, include both `/openai/images/generations` and `/openai/tasks`, then copy the key.
14
+ 4. Create an Activepieces connection and enter only the API key, without `Bearer `. A `platform-...` management token is not a generation API key. Keep the key in the connection, never in a flow export. Check current [pricing](https://platform.acedata.cloud/models?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=gpt_image_activepieces_readme_pricing) and balance before generation.
12
15
 
13
16
  ## First flow
14
17
 
15
18
  1. Add **Create GPT Image task**. Enter a prompt, choose `gpt-image-2`, quality `low`, size `1024x1024`, and image count `1`.
16
- 2. Run creation **once** and save its `task_id`. The action uses `callback_url` to submit asynchronously and has no HTTP retry. If a timeout or 5xx occurs, inspect request history before submitting again: the task may already exist.
19
+ 2. Run creation **once** and save its `task_id`. The action uses `callback_url` to submit asynchronously and has no HTTP retry. If a timeout or 5xx occurs, inspect [request history](https://platform.acedata.cloud/console/usages?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=gpt_image_activepieces_readme_request_history) before submitting again: the task may already exist.
17
20
  3. Add **Get GPT Image task**. Map its **Task ID** from the creation output. Query this same ID until `status=succeeded` or `failed`. Pending media is never returned as final output.
18
21
  4. Open a URL from `media_urls` only after `success=true`. The lookup can alternatively use a trace ID if the original request supplied a custom trace ID and its task ID was lost. This creation action does not set a custom trace ID.
19
22
 
@@ -35,3 +38,13 @@ An isolated Activepieces CE 0.92.2 instance accepted the build archive and ran *
35
38
  | `failed` or missing task | Check the task or trace ID and retention window. |
36
39
 
37
40
  The Piece sends chosen inputs and the API key only to `https://api.acedata.cloud`. It returns final media URLs and removes internal routing fields from task results. [Source](https://github.com/AceDataCloud/GPTImageActivepieces) · [Support](https://github.com/AceDataCloud/GPTImageActivepieces/issues) · dev@acedata.cloud.
41
+
42
+ API requests verify HTTPS certificates and stay on `api.acedata.cloud`. Transport failures and HTTP errors are not retried automatically; inspect request history before resubmitting a creation. HTTPS proxy configuration is not supported by this transport.
43
+
44
+ ## Visual setup references
45
+
46
+ ![Copy a key or open Manage Keys: real redacted Ace console](docs/screenshots/get-api-key-en.png)
47
+ ![Create a dedicated key: real redacted Ace console](docs/screenshots/create-api-key-en.png)
48
+ ![Official Activepieces generic installation dialog](docs/screenshots/install-piece.png)
49
+
50
+ References reused on 2026-10-18; [fixed sources and limits](docs/screenshots/onboarding-source.json). The installation picture is an official generic reference, not proof this Piece is in the shared catalog. After administrator installation, search the service name, select **by Ace Data Cloud**, and keep the raw API key in the action connection. Source PR, immutable npm release, official shared-catalog acceptance and first use are separate stages.
package/README.zh-CN.md CHANGED
@@ -2,18 +2,21 @@
2
2
 
3
3
  通过 Ace Data Cloud 创建 GPT Image 任务,并按**同一个任务 ID**查询结果。Piece 提供 **Create GPT Image task** 和 **Get GPT Image task** 两个动作。提交返回 ID 并不代表图片已完成;查询到 `succeeded` 后才可使用成品。[English](README.md)
4
4
 
5
- **分发方式:**在 Activepieces 实例中将 `@acedatacloud/piece-gpt-image@0.1.0` 作为自定义 Piece 安装。公开 npm 包不会自动进入 Activepieces 共享目录。
5
+ **分发方式:**在 Activepieces 实例中将 `@acedatacloud/piece-gpt-image@0.1.1` 作为自定义 Piece 安装。公开 npm 包不会自动进入 Activepieces 共享目录。
6
6
 
7
7
  ## 安装与连接
8
8
 
9
- Activepieces 0.92.2+ 中进入 **Platform Admin → Catalogue → Pieces → Install Piece → NPM Registry**,填写 `@acedatacloud/piece-gpt-image` 和版本 `0.1.0`。在流程中搜索 **GPT Image by Ace Data Cloud**,核对 Ace Data Cloud Logo 和两个动作。
9
+ Activepieces 0.92.2+ 中进入 **Platform Admin → Catalogue → Pieces → Install Piece → NPM Registry**,填写 `@acedatacloud/piece-gpt-image` 和版本 `0.1.1`。在流程中搜索 **GPT Image by Ace Data Cloud**,核对 Ace Data Cloud Logo 和两个动作。
10
10
 
11
- 创建连接时使用同时有 `/openai/images/generations` 与 `/openai/tasks` 权限的 Ace Data Cloud API Key。只填写 Key 本身,不加 `Bearer `;Key 留在连接中,不写入流程导出。生成前查看当前[价格](https://platform.acedata.cloud/models)与余额。
11
+ 1. 在 [Ace Data Cloud Applications](https://platform.acedata.cloud/console/applications?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=gpt_image_activepieces_readme_api_key) 注册或登录。若没有通用应用,点击 **Initialize General Application**。
12
+ 2. 打开通用应用或具备 **GPT Image** 权限的应用。通用 Key 可访问账号已获授权的服务;专用 Key 仅限对应服务。
13
+ 3. 使用应用卡片的复制按钮,或通过 **Manage Keys → Create** 创建名为 `Activepieces GPT Image` 的独立 Key,按需设置有效期与用量限制。若启用 **Allowed APIs**,应同时包含 `/openai/images/generations` 与 `/openai/tasks`,创建后复制 Key。
14
+ 4. 创建 Activepieces 连接,只填写 API Key 本身,不加 `Bearer `。`platform-...` 管理 Token 不是生成 API Key。Key 留在连接中,不写入流程导出。生成前查看当前[价格](https://platform.acedata.cloud/models?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=gpt_image_activepieces_readme_pricing)与余额。
12
15
 
13
16
  ## 首次流程
14
17
 
15
18
  1. 添加 **Create GPT Image task**,填写提示词,选择 `gpt-image-2`、`low`、`1024x1024` 和图片数量 `1`。
16
- 2. **只运行一次**创建动作,保存输出的 `task_id`。动作使用 `callback_url` 异步提交,不设置 HTTP 重试。若超时或返回 5xx,先查请求历史再考虑重提,任务可能已被接收。
19
+ 2. **只运行一次**创建动作,保存输出的 `task_id`。动作使用 `callback_url` 异步提交,不设置 HTTP 重试。若超时或返回 5xx,先查[请求历史](https://platform.acedata.cloud/console/usages?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=gpt_image_activepieces_readme_request_history)再考虑重提,任务可能已被接收。
17
20
  3. 添加 **Get GPT Image task**,把 **Task ID** 映射为创建动作的输出。只查询同一个 ID,直至 `status=succeeded` 或 `failed`。pending 时不会把预览当作最终媒体。
18
21
  4. 仅当 `success=true` 时打开 `media_urls`。若原始请求自带自定义 Trace ID 且丢失任务 ID,也可按 Trace ID 查询;本 Piece 的创建动作不设置自定义 Trace ID。
19
22
 
@@ -35,3 +38,13 @@ Activepieces 0.92.2+ 中进入 **Platform Admin → Catalogue → Pieces → Ins
35
38
  | `failed` 或任务不存在 | 检查任务或 Trace ID 及保留期限。 |
36
39
 
37
40
  Piece 只向 `https://api.acedata.cloud` 发送所选输入和 API Key,仅在终态返回媒体 URL,并过滤内部路由字段。[源码](https://github.com/AceDataCloud/GPTImageActivepieces) · [支持](https://github.com/AceDataCloud/GPTImageActivepieces/issues) · dev@acedata.cloud。
41
+
42
+ API 请求验证 HTTPS 证书,且仅访问 `api.acedata.cloud`。网络失败与 HTTP 错误不自动重试;重新创建前先查请求历史。此传输方式不支持 HTTPS 代理配置。
43
+
44
+ ## 图文配置参考
45
+
46
+ ![复制 Key 或管理密钥:真实脱敏 Ace 控制台](docs/screenshots/get-api-key-en.png)
47
+ ![创建独立 Key:真实脱敏 Ace 控制台](docs/screenshots/create-api-key-en.png)
48
+ ![官方 Activepieces 通用安装弹窗](docs/screenshots/install-piece.png)
49
+
50
+ 2026-10-18 复用的真实/官方参考图,[固定来源与边界](docs/screenshots/onboarding-source.json)保留。安装图不是本 Piece 已被官方共享目录收录的证明。管理员安装后按服务名搜索并核对 **by Ace Data Cloud**;Key 只放动作连接。源码 PR、npm 发版、官方目录收录与真实首用分别验收。
@@ -4,6 +4,6 @@ exports.gptImageAuth = void 0;
4
4
  const pieces_framework_1 = require("@activepieces/pieces-framework");
5
5
  exports.gptImageAuth = pieces_framework_1.PieceAuth.SecretText({
6
6
  displayName: 'Ace Data Cloud API key',
7
- description: 'Use an API key with GPT Image access from https://platform.acedata.cloud/console/applications. Enter only the key, without Bearer.',
7
+ description: 'Register or sign in at [Applications](https://platform.acedata.cloud/console/applications?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=gpt_image_activepieces_connection_api_key). If needed choose Initialize General Application, then copy the key or use Manage Keys → Create for a dedicated Activepieces key. Check service permissions, balance, current pricing and Allowed APIs in the guide. Paste only the API key without Bearer; a platform management token is not a generation key.',
8
8
  required: true,
9
9
  });
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.gptImageClient = void 0;
4
4
  const pieces_common_1 = require("@activepieces/pieces-common");
5
+ const secure_http_1 = require("../secure-http");
5
6
  async function post({ token, path, body, }) {
6
- const response = await pieces_common_1.httpClient.sendRequest({
7
+ const response = await secure_http_1.httpClient.sendRequest({
7
8
  method: pieces_common_1.HttpMethod.POST,
8
9
  url: `https://api.acedata.cloud${path}`,
9
10
  headers: {
@@ -0,0 +1,14 @@
1
+ type Request = {
2
+ method: string;
3
+ url: string;
4
+ headers?: Record<string, string>;
5
+ body?: unknown;
6
+ retries?: number;
7
+ };
8
+ export declare const httpClient: {
9
+ sendRequest<T>(request: Request): Promise<{
10
+ status: number;
11
+ body: T;
12
+ }>;
13
+ };
14
+ export {};
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.httpClient = void 0;
37
+ const https = __importStar(require("node:https"));
38
+ // Keep credentials on the documented API host and verify TLS even if the host
39
+ // process or an unrelated Piece has changed NODE_TLS_REJECT_UNAUTHORIZED.
40
+ exports.httpClient = {
41
+ async sendRequest(request) {
42
+ const url = new URL(request.url);
43
+ if (url.protocol !== 'https:' || url.hostname !== 'api.acedata.cloud' || url.port) {
44
+ throw new Error('Unsupported Ace Data Cloud API host.');
45
+ }
46
+ const payload = request.body === undefined ? undefined : JSON.stringify(request.body);
47
+ return new Promise((resolve, reject) => {
48
+ const pending = https.request(url, {
49
+ method: request.method,
50
+ rejectUnauthorized: true,
51
+ headers: {
52
+ ...request.headers,
53
+ ...(payload === undefined ? {} : { 'Content-Length': String(Buffer.byteLength(payload)) }),
54
+ },
55
+ }, (response) => {
56
+ let body = '';
57
+ response.setEncoding('utf8');
58
+ response.on('data', (chunk) => { body += chunk; });
59
+ response.on('error', () => reject(new Error('Ace Data Cloud response interrupted. Inspect request history before resubmitting.')));
60
+ response.on('end', () => {
61
+ const status = response.statusCode ?? 0;
62
+ if (status < 200 || status >= 300) {
63
+ const error = new Error(`Ace Data Cloud HTTP ${status}. Inspect request history before resubmitting.`);
64
+ Object.assign(error, { response: { status } });
65
+ reject(error);
66
+ return;
67
+ }
68
+ try {
69
+ resolve({ status, body: JSON.parse(body) });
70
+ }
71
+ catch {
72
+ reject(new Error('Ace Data Cloud returned invalid JSON. Inspect request history before resubmitting.'));
73
+ }
74
+ });
75
+ });
76
+ pending.setTimeout(120_000, () => pending.destroy(new Error('Request timeout')));
77
+ pending.on('error', () => reject(new Error('Ace Data Cloud network or TLS error. Inspect request history before resubmitting.')));
78
+ pending.end(payload);
79
+ });
80
+ },
81
+ };
@@ -0,0 +1,6 @@
1
+ {
2
+ "checked_on": "2026-10-18 Asia/Shanghai",
3
+ "key_image_source": "https://github.com/AceDataCloud/SunoDify/tree/8d3d03570e73324220f111f7fe343da0792a8071/_assets/tutorial",
4
+ "installation_reference": "https://github.com/activepieces/activepieces/blob/860ce5b87c43856549586ee7b44007ba0937efdf/docs/resources/screenshots/install-piece.png",
5
+ "limits": "Real redacted Ace console references and official Activepieces generic install dialog. Not proof this service is in the official catalog or the current PR is published."
6
+ }
@@ -0,0 +1,126 @@
1
+ {
2
+ "name": "GPT Image quickstart",
3
+ "type": "SHARED",
4
+ "summary": "",
5
+ "description": "",
6
+ "tags": [],
7
+ "blogUrl": "",
8
+ "metadata": {
9
+ "externalId": "gpt-image-quickstart-20261012"
10
+ },
11
+ "author": "Ace Data Cloud",
12
+ "categories": [],
13
+ "pieces": [
14
+ "@activepieces/piece-manual-trigger",
15
+ "@acedatacloud/piece-gpt-image"
16
+ ],
17
+ "flows": [
18
+ {
19
+ "displayName": "GPT Image quickstart",
20
+ "trigger": {
21
+ "name": "trigger",
22
+ "valid": true,
23
+ "displayName": "Manual Trigger",
24
+ "nextAction": {
25
+ "name": "step_1",
26
+ "skip": false,
27
+ "type": "PIECE",
28
+ "valid": false,
29
+ "settings": {
30
+ "input": {
31
+ "auth": "",
32
+ "prompt": "A small red kite above a green meadow, watercolor illustration.",
33
+ "model": "gpt-image-2",
34
+ "quality": "low",
35
+ "size": "1024x1024",
36
+ "count": 1
37
+ },
38
+ "pieceName": "@acedatacloud/piece-gpt-image",
39
+ "actionName": "generate_image",
40
+ "sampleData": {},
41
+ "pieceVersion": "0.1.1",
42
+ "propertySettings": {
43
+ "prompt": {
44
+ "type": "MANUAL"
45
+ },
46
+ "model": {
47
+ "type": "MANUAL"
48
+ },
49
+ "quality": {
50
+ "type": "MANUAL"
51
+ },
52
+ "size": {
53
+ "type": "MANUAL"
54
+ },
55
+ "count": {
56
+ "type": "MANUAL"
57
+ }
58
+ },
59
+ "errorHandlingOptions": {
60
+ "retryOnFailure": {
61
+ "value": false
62
+ },
63
+ "continueOnFailure": {
64
+ "value": false
65
+ }
66
+ }
67
+ },
68
+ "nextAction": {
69
+ "name": "step_2",
70
+ "skip": false,
71
+ "type": "PIECE",
72
+ "valid": false,
73
+ "settings": {
74
+ "input": {
75
+ "auth": "",
76
+ "taskId": "{{step_1['output']['task_id']}}",
77
+ "traceId": ""
78
+ },
79
+ "pieceName": "@acedatacloud/piece-gpt-image",
80
+ "actionName": "get_task",
81
+ "sampleData": {},
82
+ "pieceVersion": "0.1.1",
83
+ "propertySettings": {
84
+ "taskId": {
85
+ "type": "MANUAL"
86
+ },
87
+ "traceId": {
88
+ "type": "MANUAL"
89
+ }
90
+ },
91
+ "errorHandlingOptions": {
92
+ "retryOnFailure": {
93
+ "value": false
94
+ },
95
+ "continueOnFailure": {
96
+ "value": false
97
+ }
98
+ }
99
+ },
100
+ "displayName": "Get GPT Image task",
101
+ "lastUpdatedDate": "2026-10-11T15:59:36.284Z"
102
+ },
103
+ "displayName": "Create GPT Image task",
104
+ "lastUpdatedDate": "2026-10-11T15:40:03.227Z"
105
+ },
106
+ "type": "PIECE_TRIGGER",
107
+ "settings": {
108
+ "propertySettings": {
109
+ "markdown": {
110
+ "type": "MANUAL"
111
+ }
112
+ },
113
+ "pieceName": "@activepieces/piece-manual-trigger",
114
+ "pieceVersion": "0.0.8",
115
+ "triggerName": "manual_trigger",
116
+ "input": {}
117
+ },
118
+ "lastUpdatedDate": "2026-10-11T15:29:17.786Z"
119
+ },
120
+ "valid": true,
121
+ "schemaVersion": "27",
122
+ "notes": []
123
+ }
124
+ ],
125
+ "status": "PUBLISHED"
126
+ }
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@acedatacloud/piece-gpt-image",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "GPT Image generation and task lookup through Ace Data Cloud for Activepieces",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/src/index.js",
7
7
  "types": "./dist/src/index.d.ts",
8
8
  "files": [
9
- "dist"
9
+ "dist",
10
+ "README.zh-CN.md",
11
+ "examples",
12
+ "docs/screenshots"
10
13
  ],
11
14
  "scripts": {
12
15
  "build": "tsc -p tsconfig.json",
@@ -25,6 +28,15 @@
25
28
  "@activepieces/pieces-framework": "0.32.0"
26
29
  },
27
30
  "devDependencies": {
31
+ "@types/node": "24.11.0",
28
32
  "typescript": "5.9.3"
29
- }
33
+ },
34
+ "keywords": [
35
+ "activepieces",
36
+ "piece",
37
+ "acedatacloud",
38
+ "gpt-image",
39
+ "gpt",
40
+ "image"
41
+ ]
30
42
  }