@acedatacloud/openclaw-provider 2026.5.33 → 2026.10.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 +72 -59
- package/assets/icon.png +0 -0
- package/dist/index.d.ts +4 -10
- package/dist/index.js +34 -20
- package/dist/src/chat/generated-catalog.d.ts +9 -7
- package/dist/src/chat/generated-catalog.js +3893 -65
- package/dist/src/chat/onboard.d.ts +1 -1
- package/dist/src/chat/onboard.js +13 -2
- package/dist/src/chat/provider-catalog.d.ts +4 -2
- package/dist/src/chat/provider-catalog.js +2 -51
- package/dist/src/chat/runtime.d.ts +4 -0
- package/dist/src/chat/runtime.js +77 -0
- package/dist/src/constants.d.ts +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/search/acedata-search-config.js +6 -4
- package/dist/src/search/acedata-search-provider.d.ts +1 -1
- package/dist/src/search/acedata-search-shared.d.ts +2 -1
- package/dist/src/search/acedata-search-shared.js +37 -6
- package/dist/src/services/catalog.d.ts +46 -0
- package/dist/src/services/catalog.js +24 -0
- package/dist/src/services/client.d.ts +36 -0
- package/dist/src/services/client.js +315 -0
- package/dist/src/services/contracts/face.json +16 -0
- package/dist/src/services/contracts/fish-audio.json +15 -0
- package/dist/src/services/contracts/flux.json +13 -0
- package/dist/src/services/contracts/google-search.json +9 -0
- package/dist/src/services/contracts/gpt-image.json +13 -0
- package/dist/src/services/contracts/grok.json +12 -0
- package/dist/src/services/contracts/happyhorse.json +11 -0
- package/dist/src/services/contracts/kling.json +20 -0
- package/dist/src/services/contracts/midjourney.json +17 -0
- package/dist/src/services/contracts/minimax.json +13 -0
- package/dist/src/services/contracts/nano-banana.json +12 -0
- package/dist/src/services/contracts/qwen-image.json +11 -0
- package/dist/src/services/contracts/seedance.json +11 -0
- package/dist/src/services/contracts/seedream.json +13 -0
- package/dist/src/services/contracts/suno.json +27 -0
- package/dist/src/services/contracts/veo.json +15 -0
- package/dist/src/services/contracts/wan.json +12 -0
- package/dist/src/services/media.d.ts +25 -0
- package/dist/src/services/media.js +350 -0
- package/dist/src/services/parameters.d.ts +6 -0
- package/dist/src/services/parameters.js +165 -0
- package/dist/src/services/tools.d.ts +6 -0
- package/dist/src/services/tools.js +59 -0
- package/docs/architecture.md +58 -0
- package/docs/capabilities.md +75 -0
- package/docs/cookbook.md +77 -0
- package/docs/model-catalog.md +126 -0
- package/openclaw.plugin.json +5680 -9
- package/package.json +31 -23
- package/skills/acedata-face/SKILL.md +14 -0
- package/skills/acedata-fish-audio/SKILL.md +20 -0
- package/skills/acedata-flux/SKILL.md +18 -0
- package/skills/acedata-google-search/SKILL.md +14 -0
- package/skills/acedata-gpt-image/SKILL.md +18 -0
- package/skills/acedata-grok/SKILL.md +17 -0
- package/skills/acedata-happyhorse/SKILL.md +16 -0
- package/skills/acedata-kling/SKILL.md +25 -0
- package/skills/acedata-midjourney/SKILL.md +22 -0
- package/skills/acedata-minimax/SKILL.md +18 -0
- package/skills/acedata-nano-banana/SKILL.md +17 -0
- package/skills/acedata-qwen-image/SKILL.md +16 -0
- package/skills/acedata-seedance/SKILL.md +16 -0
- package/skills/acedata-seedream/SKILL.md +18 -0
- package/skills/acedata-suno/SKILL.md +32 -0
- package/skills/acedata-veo/SKILL.md +20 -0
- package/skills/acedata-wan/SKILL.md +17 -0
- package/index.ts +0 -110
- package/src/chat/generated-catalog.ts +0 -77
- package/src/chat/model-overrides.json +0 -93
- package/src/chat/onboard.ts +0 -33
- package/src/chat/provider-catalog.ts +0 -73
- package/src/constants.ts +0 -3
- package/src/search/acedata-search-client.ts +0 -160
- package/src/search/acedata-search-config.ts +0 -76
- package/src/search/acedata-search-provider.ts +0 -80
- package/src/search/acedata-search-shared.ts +0 -29
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { Ajv2020 } from "ajv/dist/2020.js";
|
|
2
|
+
import { adaptParameters, finalizePayload } from "./parameters.js";
|
|
3
|
+
const BASE = "https://api.acedata.cloud";
|
|
4
|
+
const ajv = new Ajv2020({ strict: false, allErrors: false, validateFormats: false });
|
|
5
|
+
const validators = new WeakMap();
|
|
6
|
+
const FAILED = new Set(["failed", "error", "cancelled", "canceled", "rejected"]);
|
|
7
|
+
const COMPLETE = new Set(["complete", "completed", "succeeded", "succeed", "success", "finished"]);
|
|
8
|
+
const sensitive = /^(request|request_body|headers|user_id|actor_user_id|credential_id|authorization_id|application_id|api_key|access_token|refresh_token|authorization|actual_model|provider_route)$|supplier|upstream|(?:^|_)secret(?:_|$)|^internal/i;
|
|
9
|
+
export const record = (x) => x && typeof x === "object" && !Array.isArray(x) ? x : {};
|
|
10
|
+
export function cleanResult(x) {
|
|
11
|
+
if (Array.isArray(x))
|
|
12
|
+
return x.map(cleanResult);
|
|
13
|
+
if (x && typeof x === "object")
|
|
14
|
+
return Object.fromEntries(Object.entries(x).filter(([k]) => !sensitive.test(k)).map(([k, v]) => [k, k === "error" && v ? { code: "api_error", message: "Operation failed; inspect its task or trace ID." } : cleanResult(v)]));
|
|
15
|
+
return x;
|
|
16
|
+
}
|
|
17
|
+
export function mediaUrls(x) {
|
|
18
|
+
const result = new Set();
|
|
19
|
+
function walk(n) {
|
|
20
|
+
if (Array.isArray(n)) {
|
|
21
|
+
n.forEach(walk);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
for (const [key, value] of Object.entries(record(n))) {
|
|
25
|
+
if (["url", "image_url", "audio_url", "video_url", "file_url", "raw_image_url"].includes(key) && typeof value === "string" && /^https:\/\//.test(value))
|
|
26
|
+
result.add(value);
|
|
27
|
+
else if (typeof value === "object")
|
|
28
|
+
walk(value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
walk(x);
|
|
32
|
+
return [...result];
|
|
33
|
+
}
|
|
34
|
+
function validate(value, schema, context) {
|
|
35
|
+
let fn = validators.get(schema);
|
|
36
|
+
if (!fn) {
|
|
37
|
+
fn = ajv.compile(schema);
|
|
38
|
+
validators.set(schema, fn);
|
|
39
|
+
}
|
|
40
|
+
if (!fn(value))
|
|
41
|
+
throw new Error(`Invalid ${context}${fn.errors?.[0]?.instancePath ?? ""}: ${fn.errors?.[0]?.keyword ?? "schema"} constraint.`);
|
|
42
|
+
}
|
|
43
|
+
function coerce(value, schema) {
|
|
44
|
+
const type = schema.type;
|
|
45
|
+
if (typeof value !== "string")
|
|
46
|
+
return value;
|
|
47
|
+
const alternatives = [...(Array.isArray(schema.oneOf) ? schema.oneOf : []), ...(Array.isArray(schema.anyOf) ? schema.anyOf : [])].map(s => record(s).type);
|
|
48
|
+
const types = [...(Array.isArray(type) ? type : [type]), ...alternatives];
|
|
49
|
+
if (types.some(t => t === "array" || t === "object") && /^[\[{]/.test(value.trim())) {
|
|
50
|
+
try {
|
|
51
|
+
return JSON.parse(value);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
throw new Error("Object/array parameters must contain valid JSON.");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (["array", "object"].includes(String(type))) {
|
|
58
|
+
try {
|
|
59
|
+
return JSON.parse(value);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
if (type === "array" && record(schema.items).type === "string")
|
|
63
|
+
return value.split("\n").map(s => s.trim()).filter(Boolean);
|
|
64
|
+
throw new Error("Object/array parameters must contain valid JSON.");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if ((type === "number" || type === "integer") && value.trim() !== "")
|
|
68
|
+
return Number(value);
|
|
69
|
+
if (types.some(t => t === "number" || t === "integer") && /^[-+]?\d+(\.\d+)?$/.test(value))
|
|
70
|
+
return Number(value);
|
|
71
|
+
if (type === "boolean" && ["true", "false"].includes(value))
|
|
72
|
+
return value === "true";
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
function permits(schema, name, values) {
|
|
76
|
+
if (name in record(schema.properties))
|
|
77
|
+
return true;
|
|
78
|
+
for (const group of ["oneOf", "anyOf", "allOf"]) {
|
|
79
|
+
for (const s of Array.isArray(schema[group]) ? schema[group] : []) {
|
|
80
|
+
const props = record(s.properties);
|
|
81
|
+
if (["action", "mode"].every(k => {
|
|
82
|
+
const d = record(props[k]);
|
|
83
|
+
return values[k] === undefined || (!d.enum && d.const === undefined) || (Array.isArray(d.enum) ? d.enum : [d.const]).includes(values[k]);
|
|
84
|
+
}) && permits(s, name, values))
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
export function prepare(service, tool, parameters) {
|
|
91
|
+
let endpoint = service.endpoints[tool];
|
|
92
|
+
if (!endpoint)
|
|
93
|
+
throw new Error("Unknown service operation.");
|
|
94
|
+
if (endpoint.selector) {
|
|
95
|
+
const selection = endpoint.selector[String(parameters.action ?? endpoint.selector_default)];
|
|
96
|
+
if (!selection)
|
|
97
|
+
throw new Error("Unsupported operation.");
|
|
98
|
+
endpoint = service.endpoints[selection];
|
|
99
|
+
}
|
|
100
|
+
const params = adaptParameters(service.id, Object.fromEntries(Object.entries(parameters).filter(([, v]) => v !== undefined && v !== null)), endpoint);
|
|
101
|
+
const values = { ...endpoint.defaults, ...params, ...endpoint.fixed };
|
|
102
|
+
const allowed = new Set([...Object.keys(endpoint.properties), ...(endpoint.parameters ?? []).map(p => p.name.toLowerCase() === "idempotency-key" ? "idempotency_key" : p.name), ...Object.keys(endpoint.defaults ?? {}), "confirm", "wait_seconds", "task_id"]);
|
|
103
|
+
if (service.endpoints[tool].selector)
|
|
104
|
+
allowed.add("action");
|
|
105
|
+
for (const name of Object.keys(params))
|
|
106
|
+
if (!allowed.has(name))
|
|
107
|
+
throw new Error(`Unsupported parameter: ${name}`);
|
|
108
|
+
const body = {};
|
|
109
|
+
for (const [key, schema] of Object.entries(endpoint.properties)) {
|
|
110
|
+
if (values[key] !== undefined && (values[key] !== "" || endpoint.allow_empty?.includes(key)))
|
|
111
|
+
body[key] = coerce(values[key], schema);
|
|
112
|
+
}
|
|
113
|
+
const queryAction = endpoint.query_actions?.includes(String(values.action));
|
|
114
|
+
if (!queryAction && permits(endpoint.schema, "async", values))
|
|
115
|
+
body.async = true;
|
|
116
|
+
if (permits(endpoint.schema, "stream", values))
|
|
117
|
+
body.stream = false;
|
|
118
|
+
if (endpoint.properties.response_format && endpoint.media_response)
|
|
119
|
+
body.response_format = "url";
|
|
120
|
+
let path = endpoint.path;
|
|
121
|
+
const query = {}, headers = {};
|
|
122
|
+
for (const p of endpoint.parameters ?? []) {
|
|
123
|
+
const key = p.name.toLowerCase() === "idempotency-key" ? "idempotency_key" : p.name;
|
|
124
|
+
if (values[key] === undefined || values[key] === "") {
|
|
125
|
+
if (p.required)
|
|
126
|
+
throw new Error(`${key} is required.`);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const value = coerce(values[key], p.schema);
|
|
130
|
+
validate(value, p.schema, key);
|
|
131
|
+
if (p.in === "path")
|
|
132
|
+
path = path.replace(`{${p.name}}`, encodeURIComponent(String(value)));
|
|
133
|
+
else if (p.in === "query")
|
|
134
|
+
query[p.name] = value;
|
|
135
|
+
else if (p.in === "header")
|
|
136
|
+
headers[p.name] = String(value);
|
|
137
|
+
}
|
|
138
|
+
finalizePayload(service.id, body, endpoint);
|
|
139
|
+
validate(body, endpoint.schema, tool);
|
|
140
|
+
if ((endpoint.destructive || ["delete", "archive"].includes(String(body.action))) && params.confirm !== true)
|
|
141
|
+
throw new Error("Set confirm=true only after approving this deletion/archive.");
|
|
142
|
+
if (!path.startsWith("/") || path.startsWith("//") || path.includes("{") || new URL(path, BASE).origin !== BASE)
|
|
143
|
+
throw new Error("Invalid service endpoint.");
|
|
144
|
+
return { method: endpoint.method, path, body, query, headers, asynchronous: endpoint.asynchronous === true || body.async === true, readOnly: endpoint.method === "GET" || endpoint.read_only === true || !!queryAction, endpoint };
|
|
145
|
+
}
|
|
146
|
+
export function normalize(body, taskId = "", retrieved = false, synchronous = false, allowPartial = false) {
|
|
147
|
+
const envelope = record(body);
|
|
148
|
+
let result = retrieved && "response" in envelope ? envelope.response : body;
|
|
149
|
+
if (typeof result === "string") {
|
|
150
|
+
try {
|
|
151
|
+
result = JSON.parse(result);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
result = {};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const clean = cleanResult(result), obj = record(result);
|
|
158
|
+
const id = String(taskId || envelope.task_id || record(envelope.task).id || "");
|
|
159
|
+
const trace = String(obj.trace_id || envelope.trace_id || "");
|
|
160
|
+
const urls = mediaUrls(clean);
|
|
161
|
+
const states = [];
|
|
162
|
+
let failed = false;
|
|
163
|
+
function visit(n) {
|
|
164
|
+
if (Array.isArray(n)) {
|
|
165
|
+
n.forEach(visit);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const row = record(n);
|
|
169
|
+
if (row.success === false || row.error)
|
|
170
|
+
failed = true;
|
|
171
|
+
for (const k of ["state", "status"])
|
|
172
|
+
if (typeof row[k] === "string")
|
|
173
|
+
states.push(row[k].toLowerCase());
|
|
174
|
+
for (const k of ["data", "content", "task"])
|
|
175
|
+
if (row[k])
|
|
176
|
+
visit(row[k]);
|
|
177
|
+
}
|
|
178
|
+
if (!(synchronous && !id))
|
|
179
|
+
visit(result);
|
|
180
|
+
else if (obj.error || obj.success === false)
|
|
181
|
+
failed = true;
|
|
182
|
+
failed ||= states.some(s => FAILED.has(s));
|
|
183
|
+
const unfinished = retrieved && "finished_at" in envelope && envelope.finished_at === null;
|
|
184
|
+
const empty = result == null || (retrieved && typeof result === "object" && !Object.keys(result).length);
|
|
185
|
+
const partial = allowPartial && failed && urls.length > 0 && states.every(s => COMPLETE.has(s) || FAILED.has(s));
|
|
186
|
+
const done = !unfinished && !empty && (partial || (synchronous && !id) || (states.length > 0 && states.every(s => COMPLETE.has(s))) || (!states.length && (urls.length > 0 || retrieved && !!envelope.finished_at)));
|
|
187
|
+
if (failed && !unfinished && !partial)
|
|
188
|
+
throw new Error(`Ace Data Cloud task failed${id ? ` (${id})` : ""}${trace ? `; trace ${trace}` : ""}.`);
|
|
189
|
+
if (!done && !id)
|
|
190
|
+
throw new Error(`No task ID or completed result; inspect request history before resubmitting${trace ? ` (trace ${trace})` : ""}.`);
|
|
191
|
+
return { status: done ? partial ? "partial" : "succeeded" : "pending", success: done && !partial, task_id: id, trace_id: trace, media_urls: done ? urls : [], data: done ? cleanResult(obj.data ?? obj.content ?? result) : {}, result: done ? clean : {} };
|
|
192
|
+
}
|
|
193
|
+
export async function readLimited(response, limit) {
|
|
194
|
+
if (Number(response.headers.get("content-length")) > limit)
|
|
195
|
+
throw new Error("Response exceeds the configured size limit.");
|
|
196
|
+
const reader = response.body?.getReader();
|
|
197
|
+
if (!reader)
|
|
198
|
+
throw new Error("Empty response body.");
|
|
199
|
+
const chunks = [];
|
|
200
|
+
let size = 0;
|
|
201
|
+
try {
|
|
202
|
+
for (;;) {
|
|
203
|
+
const item = await reader.read();
|
|
204
|
+
if (item.done)
|
|
205
|
+
break;
|
|
206
|
+
size += item.value.length;
|
|
207
|
+
if (size > limit)
|
|
208
|
+
throw new Error("Response exceeds the configured size limit.");
|
|
209
|
+
chunks.push(item.value);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
finally {
|
|
213
|
+
await reader.cancel().catch(() => { });
|
|
214
|
+
}
|
|
215
|
+
return Buffer.concat(chunks);
|
|
216
|
+
}
|
|
217
|
+
export class ServiceClient {
|
|
218
|
+
apiKey;
|
|
219
|
+
fetchFn;
|
|
220
|
+
constructor(apiKey, fetchFn = fetch) {
|
|
221
|
+
this.apiKey = apiKey;
|
|
222
|
+
this.fetchFn = fetchFn;
|
|
223
|
+
if (!apiKey.trim())
|
|
224
|
+
throw new Error("Configure an Ace Data Cloud API key.");
|
|
225
|
+
}
|
|
226
|
+
async request(request, signal) {
|
|
227
|
+
const url = new URL(request.path, BASE);
|
|
228
|
+
for (const [k, v] of Object.entries(request.query))
|
|
229
|
+
url.searchParams.set(k, typeof v === "object" ? JSON.stringify(v) : String(v));
|
|
230
|
+
const timeout = AbortSignal.timeout(60_000);
|
|
231
|
+
let response;
|
|
232
|
+
try {
|
|
233
|
+
response = await this.fetchFn(url, { method: request.method, headers: { ...request.headers, Authorization: `Bearer ${this.apiKey.replace(/^Bearer\s+/i, "").trim()}`, Accept: "application/json", "Content-Type": "application/json" }, body: ["GET", "DELETE"].includes(request.method) ? undefined : JSON.stringify(request.body), redirect: "error", signal: signal ? AbortSignal.any([signal, timeout]) : timeout });
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
signal?.throwIfAborted();
|
|
237
|
+
throw new Error("Ace Data Cloud request did not return a response. Inspect task/request history before retrying a creation request.");
|
|
238
|
+
}
|
|
239
|
+
if (!response.ok) {
|
|
240
|
+
await response.body?.cancel();
|
|
241
|
+
throw new Error(`Ace Data Cloud HTTP ${response.status}.`);
|
|
242
|
+
}
|
|
243
|
+
const bytes = await readLimited(response, 8 * 1024 * 1024);
|
|
244
|
+
try {
|
|
245
|
+
return JSON.parse(bytes.toString("utf8"));
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
throw new Error("Ace Data Cloud returned invalid JSON.");
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
async invoke(service, tool, params, signal) {
|
|
252
|
+
const endpoint = service.endpoints[tool];
|
|
253
|
+
if (!endpoint)
|
|
254
|
+
throw new Error("Unknown service operation.");
|
|
255
|
+
if (endpoint.operation === "task") {
|
|
256
|
+
const id = params.task_id ?? params.id;
|
|
257
|
+
const trace = endpoint.properties.trace_id ? params.trace_id : undefined;
|
|
258
|
+
if (!(typeof id === "string" && id.trim()) && !(typeof trace === "string" && trace.trim()))
|
|
259
|
+
throw new Error("A task ID or supported trace ID is required.");
|
|
260
|
+
const wait = Number(params.wait_seconds ?? 0);
|
|
261
|
+
if (!Number.isInteger(wait) || wait < 0 || wait > 240)
|
|
262
|
+
throw new Error("wait_seconds must be between 0 and 240.");
|
|
263
|
+
const end = Date.now() + wait * 1000;
|
|
264
|
+
for (;;) {
|
|
265
|
+
signal?.throwIfAborted();
|
|
266
|
+
const request = prepare(service, tool, { ...params, action: "retrieve", ...(id ? { id } : {}), ...(trace ? { trace_id: trace } : {}) });
|
|
267
|
+
const body = await this.request(request, signal);
|
|
268
|
+
const result = normalize(body, String(id || record(body).id || ""), true, false, service.id === "seedream");
|
|
269
|
+
if (result.status !== "pending" || Date.now() >= end)
|
|
270
|
+
return result;
|
|
271
|
+
await delay(Math.min(5000, end - Date.now()), signal);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
const req = prepare(service, tool, params);
|
|
275
|
+
const body = await this.request(req, signal);
|
|
276
|
+
if (endpoint.operation === "batch") {
|
|
277
|
+
const obj = record(body);
|
|
278
|
+
const items = Array.isArray(body) ? body : obj.items ?? obj.tasks ?? obj.data;
|
|
279
|
+
if (!Array.isArray(items))
|
|
280
|
+
throw new Error("Invalid task batch response.");
|
|
281
|
+
const results = items.map(item => { const id = String(record(item).id ?? record(item).task_id ?? ""); try {
|
|
282
|
+
return normalize(item, id, true, false, service.id === "seedream");
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
return { status: "failed", success: false, task_id: id, trace_id: "", media_urls: [], data: {}, result: {} };
|
|
286
|
+
} });
|
|
287
|
+
const status = results.some(r => r.status === "pending") ? "pending" : results.some(r => r.status === "failed") ? "failed" : results.some(r => r.status === "partial") ? "partial" : "succeeded";
|
|
288
|
+
return { status, success: status === "succeeded", task_id: "", trace_id: "", media_urls: results.flatMap(r => r.media_urls), data: results, result: { items: results } };
|
|
289
|
+
}
|
|
290
|
+
return normalize(body, "", false, !req.asynchronous, service.id === "seedream");
|
|
291
|
+
}
|
|
292
|
+
async complete(service, tool, params, timeoutMs = 600_000) {
|
|
293
|
+
const signal = AbortSignal.timeout(timeoutMs);
|
|
294
|
+
let result = await this.invoke(service, tool, params, signal);
|
|
295
|
+
const task = Object.keys(service.endpoints).find(k => service.endpoints[k].operation === "task");
|
|
296
|
+
while (result.status === "pending") {
|
|
297
|
+
if (!task || !result.task_id)
|
|
298
|
+
throw new Error("Pending generation has no supported task retrieval contract.");
|
|
299
|
+
try {
|
|
300
|
+
await delay(3000, signal);
|
|
301
|
+
result = await this.invoke(service, task, { task_id: result.task_id }, signal);
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
if (signal.aborted)
|
|
305
|
+
throw new Error(`Generation is still pending: ${service.id} task ${result.task_id}. Retrieve this task; do not submit again.`);
|
|
306
|
+
throw error;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return result;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
async function delay(ms, signal) {
|
|
313
|
+
signal?.throwIfAborted();
|
|
314
|
+
await new Promise((resolve, reject) => { const stop = () => { clearTimeout(timer); reject(signal?.reason); }; const timer = setTimeout(() => { signal?.removeEventListener("abort", stop); resolve(); }, ms); signal?.addEventListener("abort", stop, { once: true }); });
|
|
315
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "face",
|
|
3
|
+
"label": "Face Transform",
|
|
4
|
+
"source": { "repository": "https://github.com/AceDataCloud/FaceDify", "commit": "c9657ca88182d128418d60e68a82f5dd8640cb98", "path": "tools/api_contracts.py" },
|
|
5
|
+
"taskPath": null,
|
|
6
|
+
"endpoints": {
|
|
7
|
+
"face_transform": { "method": "POST", "path": "/face/analyze", "operation": "face", "schema": { "type": "object", "required": ["image_url"], "properties": { "mode": { "type": "number" }, "image_url": { "type": "string" }, "face_model_version": { "type": "string" }, "need_rotate_detection": { "type": "number" } } }, "properties": { "mode": { "type": "number" }, "image_url": { "type": "string" }, "face_model_version": { "type": "string" }, "need_rotate_detection": { "type": "number" } }, "parameters": [], "defaults": { "action": "keypoints" }, "fixed": {}, "allow_empty": [], "query_actions": [], "media_response": false, "selector": { "keypoints": "face:keypoints", "beautify": "face:beautify", "age": "face:age", "gender": "face:gender", "swap": "face:swap", "cartoon": "face:cartoon", "liveness": "face:liveness" }, "selector_default": "keypoints", "tool": { "label": "Face Transform", "description": "Analyze or transform faces with the Ace Data Cloud Face Transform API. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "mode", "required": false, "schema": { "type": "number", "description": "For keypoints only. 0 analyzes all faces; 1 analyzes the largest face." } }, { "name": "image_url", "required": false, "schema": { "type": "string", "description": "$t(face_detect_live_image_url)" } }, { "name": "face_model_version", "required": false, "schema": { "type": "number", "description": "$t(face_detect_live_face_model_version)" } }, { "name": "need_rotate_detection", "required": false, "schema": { "type": "number", "description": "For keypoints only. 0 disables and 1 enables rotate detection." } }, { "name": "smoothing", "required": false, "schema": { "type": "number", "description": "$t(face_beautify_smoothing)" } }, { "name": "whitening", "required": false, "schema": { "type": "number", "description": "$t(face_beautify_whitening)" } }, { "name": "face_lifting", "required": false, "schema": { "type": "number", "description": "$t(face_beautify_face_lifting)" } }, { "name": "eye_enlarging", "required": false, "schema": { "type": "number", "description": "$t(face_beautify_eye_enlarging)" } }, { "name": "age_infos", "required": false, "schema": { "type": "string", "description": "Required for age. JSON array such as [{\"age\": 30}]. Enter a JSON array. Enter a JSON array or object where applicable." } }, { "name": "gender_infos", "required": false, "schema": { "type": "string", "description": "Required for gender. JSON array such as [{\"gender\": 1}]. Enter a JSON array. Enter a JSON array or object where applicable." } }, { "name": "timeout", "required": false, "schema": { "type": "number", "description": "$t(face_swap_timeout)" } }, { "name": "callback_url", "required": false, "schema": { "type": "string", "description": "$t(face_swap_callback_url)" } }, { "name": "source_image_url", "required": false, "schema": { "type": "string", "description": "$t(face_swap_source_image_url)" } }, { "name": "target_image_url", "required": false, "schema": { "type": "string", "description": "$t(face_swap_target_image_url)" } }, { "name": "action", "required": false, "schema": { "type": "string", "description": "Which face operation to perform.", "enum": ["keypoints", "beautify", "age", "gender", "swap", "cartoon", "liveness"], "default": "keypoints" } }] } },
|
|
8
|
+
"face:keypoints": { "method": "POST", "path": "/face/analyze", "schema": { "type": "object", "required": ["image_url"], "properties": { "mode": { "type": "number" }, "image_url": { "type": "string" }, "face_model_version": { "type": "string" }, "need_rotate_detection": { "type": "number" } } }, "parameters": [], "properties": { "mode": { "type": "number" }, "image_url": { "type": "string" }, "face_model_version": { "type": "string" }, "need_rotate_detection": { "type": "number" } }, "operation": "face", "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": [] },
|
|
9
|
+
"face:beautify": { "method": "POST", "path": "/face/beautify", "schema": { "type": "object", "required": ["image_url"], "properties": { "image_url": { "type": "string" }, "smoothing": { "type": "number" }, "whitening": { "type": "number" }, "face_lifting": { "type": "number" }, "eye_enlarging": { "type": "number" } } }, "parameters": [], "properties": { "image_url": { "type": "string" }, "smoothing": { "type": "number" }, "whitening": { "type": "number" }, "face_lifting": { "type": "number" }, "eye_enlarging": { "type": "number" } }, "operation": "face", "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": [] },
|
|
10
|
+
"face:age": { "method": "POST", "path": "/face/change-age", "schema": { "type": "object", "required": ["image_url", "age_infos"], "properties": { "age_infos": { "type": "array", "items": { "type": "object", "required": ["age"], "properties": { "age": { "type": "number" } } } }, "image_url": { "type": "string" } } }, "parameters": [], "properties": { "age_infos": { "type": "array", "items": { "type": "object", "required": ["age"], "properties": { "age": { "type": "number" } } } }, "image_url": { "type": "string" } }, "operation": "face", "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": [] },
|
|
11
|
+
"face:gender": { "method": "POST", "path": "/face/change-gender", "schema": { "type": "object", "required": ["image_url", "gender_infos"], "properties": { "image_url": { "type": "string" }, "gender_infos": { "type": "array", "items": { "type": "object", "properties": { "gender": { "type": "number" }, "face_rect": { "type": "object", "properties": { "x": { "type": "number" }, "y": { "type": "number" }, "width": { "type": "number" }, "height": { "type": "number" } } } } } } } }, "parameters": [], "properties": { "image_url": { "type": "string" }, "gender_infos": { "type": "array", "items": { "type": "object", "properties": { "gender": { "type": "number" }, "face_rect": { "type": "object", "properties": { "x": { "type": "number" }, "y": { "type": "number" }, "width": { "type": "number" }, "height": { "type": "number" } } } } } } }, "operation": "face", "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": [] },
|
|
12
|
+
"face:swap": { "method": "POST", "path": "/face/swap", "schema": { "type": "object", "properties": { "timeout": { "type": "number" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" }, "source_image_url": { "type": "string" }, "target_image_url": { "type": "string" } } }, "parameters": [], "properties": { "timeout": { "type": "number" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" }, "source_image_url": { "type": "string" }, "target_image_url": { "type": "string" } }, "operation": "face", "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": [] },
|
|
13
|
+
"face:cartoon": { "method": "POST", "path": "/face/cartoon", "schema": { "type": "object", "required": ["image_url"], "properties": { "image_url": { "type": "string" } } }, "parameters": [], "properties": { "image_url": { "type": "string" } }, "operation": "face", "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": [] },
|
|
14
|
+
"face:liveness": { "method": "POST", "path": "/face/detect-live", "schema": { "type": "object", "required": ["image_url"], "properties": { "image_url": { "type": "string" }, "face_model_version": { "type": "number" } } }, "parameters": [], "properties": { "image_url": { "type": "string" }, "face_model_version": { "type": "number" } }, "operation": "face", "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": [] }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "fish-audio",
|
|
3
|
+
"label": "Fish Audio",
|
|
4
|
+
"source": { "repository": "https://github.com/AceDataCloud/FishAudioDify", "commit": "c931c587bb0dadb81d8b816f74c394dcd798ecba", "path": "tools/api_contracts.py" },
|
|
5
|
+
"taskPath": "/fish/tasks",
|
|
6
|
+
"endpoints": {
|
|
7
|
+
"fish_generate_audio": { "method": "POST", "path": "/fish/tts", "operation": "generate", "schema": { "type": "object", "required": ["text"], "properties": { "text": { "type": "string" }, "reference_id": { "oneOf": [{ "type": "string" }, { "type": "array", "minItems": 1, "items": { "type": "string" } }] }, "format": { "enum": ["mp3", "wav", "pcm"], "type": "string" }, "sample_rate": { "type": "integer" }, "mp3_bitrate": { "enum": [64, 128, 192], "type": "integer" }, "latency": { "enum": ["normal", "balanced"], "type": "string" }, "chunk_length": { "type": "integer" }, "min_chunk_length": { "type": "integer" }, "temperature": { "type": "number" }, "top_p": { "type": "number" }, "repetition_penalty": { "type": "number" }, "max_new_tokens": { "type": "integer" }, "normalize": { "type": "boolean" }, "prosody": { "type": "object", "additionalProperties": true }, "references": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["audio", "text"], "properties": { "audio": { "type": "string", "format": "uri", "maxLength": 2048 }, "text": { "type": "string", "minLength": 1, "maxLength": 10000 } } } }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } } }, "properties": { "text": { "type": "string" }, "reference_id": { "oneOf": [{ "type": "string" }, { "type": "array", "minItems": 1, "items": { "type": "string" } }] }, "format": { "enum": ["mp3", "wav", "pcm"], "type": "string" }, "sample_rate": { "type": "integer" }, "mp3_bitrate": { "enum": [64, 128, 192], "type": "integer" }, "latency": { "enum": ["normal", "balanced"], "type": "string" }, "chunk_length": { "type": "integer" }, "min_chunk_length": { "type": "integer" }, "temperature": { "type": "number" }, "top_p": { "type": "number" }, "repetition_penalty": { "type": "number" }, "max_new_tokens": { "type": "integer" }, "normalize": { "type": "boolean" }, "prosody": { "type": "object", "additionalProperties": true }, "references": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["audio", "text"], "properties": { "audio": { "type": "string", "format": "uri", "maxLength": 2048 }, "text": { "type": "string", "minLength": 1, "maxLength": 10000 } } } }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } }, "parameters": [{ "in": "header", "name": "model", "schema": { "enum": ["s1", "s2-pro", "s2.1-pro"], "type": "string" }, "required": false }], "defaults": { "model": "s2-pro", "format": "mp3" }, "fixed": {}, "allow_empty": [], "query_actions": [], "media_response": false, "tool": { "label": "Fish Generate Audio", "description": "Generate text-to-speech audio with the Ace Data Cloud Fish Audio API. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "text", "required": true, "schema": { "type": "string", "description": "Text to synthesize as speech." } }, { "name": "reference_id", "required": false, "schema": { "type": "string", "description": "Optional public voice ID from Search voices; omit to use the service default. Enter a JSON array or object where applicable." } }, { "name": "format", "required": false, "schema": { "type": "string", "description": "Output audio file format.", "enum": ["mp3", "wav", "pcm"], "default": "mp3" } }, { "name": "sample_rate", "required": false, "schema": { "type": "number", "description": "Set sample rate for this operation." } }, { "name": "mp3_bitrate", "required": false, "schema": { "type": "string", "description": "Set mp3 bitrate for this operation.", "enum": [64, 128, 192] } }, { "name": "latency", "required": false, "schema": { "type": "string", "description": "Set latency for this operation.", "enum": ["normal", "balanced"] } }, { "name": "chunk_length", "required": false, "schema": { "type": "number", "description": "Set chunk length for this operation." } }, { "name": "min_chunk_length", "required": false, "schema": { "type": "number", "description": "Set min chunk length for this operation." } }, { "name": "temperature", "required": false, "schema": { "type": "number", "description": "Set temperature for this operation." } }, { "name": "top_p", "required": false, "schema": { "type": "number", "description": "Set top p for this operation." } }, { "name": "repetition_penalty", "required": false, "schema": { "type": "number", "description": "Set repetition penalty for this operation." } }, { "name": "max_new_tokens", "required": false, "schema": { "type": "number", "description": "Set max new tokens for this operation." } }, { "name": "normalize", "required": false, "schema": { "type": "boolean", "description": "Set normalize for this operation." } }, { "name": "prosody", "required": false, "schema": { "type": "string", "description": "Set prosody for this operation. Enter a JSON array or object where applicable." } }, { "name": "references", "required": false, "schema": { "type": "string", "description": "Set references for this operation. Enter a JSON array or object where applicable." } }, { "name": "callback_url", "required": false, "schema": { "type": "string", "description": "Set callback url for this operation." } }, { "name": "model", "required": false, "schema": { "type": "string", "description": "Select a model currently supported by this API. Availability and pricing depend on the chosen model.", "enum": ["s1", "s2-pro", "s2.1-pro"], "default": "s2-pro" } }] } },
|
|
8
|
+
"fish_search_voices": { "method": "GET", "path": "/fish/model", "operation": "voices", "schema": { "type": "object", "properties": {} }, "properties": {}, "parameters": [{ "in": "query", "name": "page_size", "schema": { "type": "integer" }, "required": false }, { "in": "query", "name": "page_number", "schema": { "type": "integer" }, "required": false }, { "in": "query", "name": "title", "schema": { "type": "string" }, "required": false }, { "in": "query", "name": "tag", "schema": { "type": "string" }, "required": false }, { "in": "query", "name": "self", "schema": { "type": "boolean" }, "required": false }, { "in": "query", "name": "author_id", "schema": { "type": "string" }, "required": false }, { "in": "query", "name": "language", "schema": { "type": "string" }, "required": false }, { "in": "query", "name": "title_language", "schema": { "type": "string" }, "required": false }, { "in": "query", "name": "sort_by", "schema": { "type": "string" }, "required": false }], "defaults": { "page_size": 10, "page_number": 1 }, "fixed": {}, "allow_empty": [], "query_actions": [], "media_response": false, "tool": { "label": "Fish Search Voices", "description": "Fish Search Voices via Ace Data Cloud. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "limit", "required": false, "schema": { "type": "number", "description": "Return between 1 and 50 public voices.", "default": 10 } }, { "name": "page_number", "required": false, "schema": { "type": "number", "description": "Set page number for this operation.", "default": 1 } }, { "name": "query", "required": false, "schema": { "type": "string", "description": "Search public voices by title; leave empty to list public voices." } }, { "name": "tag", "required": false, "schema": { "type": "string", "description": "Set tag for this operation." } }, { "name": "self", "required": false, "schema": { "type": "boolean", "description": "Set self for this operation." } }, { "name": "author_id", "required": false, "schema": { "type": "string", "description": "Set author id for this operation." } }, { "name": "language", "required": false, "schema": { "type": "string", "description": "Set language for this operation." } }, { "name": "title_language", "required": false, "schema": { "type": "string", "description": "Set title language for this operation." } }, { "name": "sort_by", "required": false, "schema": { "type": "string", "description": "Set sort by for this operation." } }] } },
|
|
9
|
+
"fish_get_voice": { "method": "GET", "path": "/fish/model/{id}", "operation": "request", "schema": { "type": "object", "properties": {} }, "properties": {}, "parameters": [{ "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }], "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": [], "media_response": false, "tool": { "label": "Fish Audio Get Voice", "description": "Get Voice through the Ace Data Cloud Fish Audio API. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "id", "required": true, "schema": { "type": "string", "description": "Set id for this operation." } }] } },
|
|
10
|
+
"fish_create_model": { "method": "POST", "path": "/fish/model", "operation": "request", "schema": { "type": "object", "required": ["title", "voices"], "properties": { "title": { "type": "string" }, "voices": { "type": "string" }, "description": { "type": "string" }, "cover_image": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "texts": { "type": "array", "items": { "type": "string" } }, "enhance_audio_quality": { "type": "boolean" }, "generate_sample": { "type": "boolean" } } }, "properties": { "title": { "type": "string" }, "voices": { "type": "string" }, "description": { "type": "string" }, "cover_image": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "texts": { "type": "array", "items": { "type": "string" } }, "enhance_audio_quality": { "type": "boolean" }, "generate_sample": { "type": "boolean" } }, "parameters": [], "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": [], "media_response": false, "tool": { "label": "Fish Audio Create Model", "description": "Create Model through the Ace Data Cloud Fish Audio API. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "title", "required": true, "schema": { "type": "string", "description": "Set title for this operation." } }, { "name": "voices", "required": true, "schema": { "type": "string", "description": "Set voices for this operation." } }, { "name": "description", "required": false, "schema": { "type": "string", "description": "Set description for this operation." } }, { "name": "cover_image", "required": false, "schema": { "type": "string", "description": "Set cover image for this operation." } }, { "name": "tags", "required": false, "schema": { "type": "string", "description": "Set tags for this operation. Enter a JSON array or object where applicable." } }, { "name": "texts", "required": false, "schema": { "type": "string", "description": "Set texts for this operation. Enter a JSON array or object where applicable." } }, { "name": "enhance_audio_quality", "required": false, "schema": { "type": "boolean", "description": "Set enhance audio quality for this operation." } }, { "name": "generate_sample", "required": false, "schema": { "type": "boolean", "description": "Set generate sample for this operation." } }] } },
|
|
11
|
+
"fish_create_voice": { "method": "POST", "path": "/fish/voices", "operation": "request", "schema": { "type": "object", "required": ["voice_url"], "properties": { "voice_url": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "image_url": { "type": "string" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } } }, "properties": { "voice_url": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "image_url": { "type": "string" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } }, "parameters": [], "defaults": {}, "fixed": {}, "allow_empty": [], "query_actions": ["retrieve", "retrieve_batch", "list", "presets"], "media_response": false, "tool": { "label": "Fish Audio Create Voice", "description": "Create Voice through the Ace Data Cloud Fish Audio API. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "voice_url", "required": true, "schema": { "type": "string", "description": "Set voice url for this operation." } }, { "name": "title", "required": false, "schema": { "type": "string", "description": "Set title for this operation." } }, { "name": "description", "required": false, "schema": { "type": "string", "description": "Set description for this operation." } }, { "name": "image_url", "required": false, "schema": { "type": "string", "description": "Set image url for this operation." } }, { "name": "callback_url", "required": false, "schema": { "type": "string", "description": "Set callback url for this operation." } }] } },
|
|
12
|
+
"fish_task_retrieve": { "method": "POST", "path": "/fish/tasks", "operation": "task", "schema": { "type": "object", "properties": { "id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" } }, "action": { "enum": ["retrieve", "retrieve_batch"], "type": "string" } } }, "properties": { "id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" } }, "action": { "enum": ["retrieve", "retrieve_batch"], "type": "string" } }, "parameters": [], "defaults": { "wait_seconds": 0 }, "fixed": {}, "allow_empty": [], "query_actions": ["retrieve", "retrieve_batch", "list", "presets"], "media_response": false, "tool": { "label": "Fish Audio Retrieve Task", "description": "Query the existing task ID; do not repeat generation while it is pending.", "input": [{ "name": "task_id", "required": true, "schema": { "type": "string", "description": "Use the task ID or IDs returned by earlier submissions." } }, { "name": "wait_seconds", "required": false, "schema": { "type": "number", "description": "0 queries once; 1–240 waits for the same task to finish. Pending is not complete.", "default": 0, "minimum": 0, "maximum": 240 } }] } },
|
|
13
|
+
"fish_tasks_retrieve_batch": { "method": "POST", "path": "/fish/tasks", "operation": "batch", "schema": { "type": "object", "properties": { "id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "action": { "enum": ["retrieve", "retrieve_batch"], "type": "string" } }, "required": ["action", "ids"] }, "properties": { "id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "action": { "enum": ["retrieve", "retrieve_batch"], "type": "string" } }, "parameters": [], "defaults": {}, "fixed": { "action": "retrieve_batch" }, "allow_empty": [], "query_actions": ["retrieve", "retrieve_batch", "list", "presets"], "media_response": false, "tool": { "label": "Fish Audio Retrieve Tasks", "description": "Query existing task IDs. Each item retains its own terminal or pending status.", "input": [{ "name": "ids", "required": true, "schema": { "type": "string", "description": "Use the task ID or IDs returned by earlier submissions. Enter a JSON array or object where applicable." } }] } }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "flux",
|
|
3
|
+
"label": "Flux",
|
|
4
|
+
"source": { "repository": "https://github.com/AceDataCloud/FluxDify", "commit": "c12e4db63d3e917efb38defb3b62da56a1468086", "path": "tools/api_contracts.py" },
|
|
5
|
+
"taskPath": "/flux/tasks",
|
|
6
|
+
"endpoints": {
|
|
7
|
+
"flux_generate_image": { "method": "POST", "path": "/flux/images", "operation": "generate", "schema": { "type": "object", "required": ["action", "prompt", "size"], "properties": { "size": { "type": "string" }, "count": { "type": "number" }, "model": { "enum": ["flux-dev", "flux-pro", "flux-kontext-pro", "flux-kontext-max", "flux-2-flex", "flux-2-pro", "flux-2-max", "flux-2-klein"], "type": "string" }, "action": { "enum": ["generate", "edit"], "type": "string" }, "prompt": { "type": "string" }, "image_url": { "type": "string" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } } }, "properties": { "size": { "type": "string" }, "count": { "type": "number" }, "model": { "enum": ["flux-dev", "flux-pro", "flux-kontext-pro", "flux-kontext-max", "flux-2-flex", "flux-2-pro", "flux-2-max", "flux-2-klein"], "type": "string" }, "action": { "enum": ["generate", "edit"], "type": "string" }, "prompt": { "type": "string" }, "image_url": { "type": "string" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } }, "parameters": [], "defaults": { "model": "flux-dev", "size": "1024x1024", "count": 1 }, "fixed": { "action": "generate" }, "allow_empty": [], "query_actions": [], "media_response": true, "tool": { "label": "Flux Generate Image", "description": "Generate images with Ace Data Cloud Flux Images Generation API. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "size", "required": false, "schema": { "type": "string", "description": "Optional output size (e.g., 1024x1024).", "default": "1024x1024" } }, { "name": "count", "required": false, "schema": { "type": "number", "description": "Optional number of images to generate. Default is 1.", "default": 1 } }, { "name": "model", "required": false, "schema": { "type": "string", "description": "Select a model currently supported by this API. Availability and pricing depend on the chosen model.", "enum": ["flux-dev", "flux-pro", "flux-kontext-pro", "flux-kontext-max", "flux-2-flex", "flux-2-pro", "flux-2-max", "flux-2-klein"], "default": "flux-dev" } }, { "name": "prompt", "required": true, "schema": { "type": "string", "description": "Text prompt used to generate the images." } }, { "name": "image_url", "required": false, "schema": { "type": "string", "description": "Set image url." } }, { "name": "callback_url", "required": false, "schema": { "type": "string", "description": "Set callback url for this operation." } }] } },
|
|
8
|
+
"flux_edit_image": { "method": "POST", "path": "/flux/images", "operation": "edit", "schema": { "type": "object", "required": ["action", "prompt", "size"], "properties": { "size": { "type": "string" }, "count": { "type": "number" }, "model": { "enum": ["flux-dev", "flux-pro", "flux-kontext-pro", "flux-kontext-max", "flux-2-flex", "flux-2-pro", "flux-2-max", "flux-2-klein"], "type": "string" }, "action": { "enum": ["generate", "edit"], "type": "string" }, "prompt": { "type": "string" }, "image_url": { "type": "string" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } } }, "properties": { "size": { "type": "string" }, "count": { "type": "number" }, "model": { "enum": ["flux-dev", "flux-pro", "flux-kontext-pro", "flux-kontext-max", "flux-2-flex", "flux-2-pro", "flux-2-max", "flux-2-klein"], "type": "string" }, "action": { "enum": ["generate", "edit"], "type": "string" }, "prompt": { "type": "string" }, "image_url": { "type": "string" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } }, "parameters": [], "defaults": { "model": "flux-kontext-pro", "size": "1:1", "count": 1 }, "fixed": { "action": "edit" }, "allow_empty": [], "query_actions": [], "media_response": true, "tool": { "label": "Flux Edit Image", "description": "Edit an image with Ace Data Cloud Flux Images Generation API. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "size", "required": false, "schema": { "type": "string", "description": "Optional output size (e.g., 1024x1024).", "default": "1:1" } }, { "name": "count", "required": false, "schema": { "type": "number", "description": "Set count.", "default": 1 } }, { "name": "model", "required": false, "schema": { "type": "string", "description": "Select a model currently supported by this API. Availability and pricing depend on the chosen model.", "enum": ["flux-dev", "flux-pro", "flux-kontext-pro", "flux-kontext-max", "flux-2-flex", "flux-2-pro", "flux-2-max", "flux-2-klein"], "default": "flux-kontext-pro" } }, { "name": "prompt", "required": true, "schema": { "type": "string", "description": "Text prompt describing how to edit the image." } }, { "name": "image_url", "required": false, "schema": { "type": "string", "description": "Public URL of the image to edit." } }, { "name": "callback_url", "required": false, "schema": { "type": "string", "description": "Set callback url for this operation." } }] } },
|
|
9
|
+
"flux_generate_video": { "method": "POST", "path": "/flux/videos", "operation": "video", "schema": { "oneOf": [{ "oneOf": [{ "properties": { "prompt": { "type": "string" }, "aspect_ratio": { "anyOf": [{ "type": "string", "enum": ["21:9", "2:1", "16:9", "4:3", "1:1", "3:4", "9:16", "9:21"] }, { "type": "string", "const": "auto" }] }, "duration": { "anyOf": [{ "type": "integer", "maximum": 20, "minimum": 5 }, { "type": "string", "const": "auto" }] }, "resolution": { "type": "string", "enum": ["hd", "fhd", "qhd", "uhd"] }, "version": { "type": "string", "const": "latest" }, "generate_audio": { "type": "boolean" }, "safety_tolerance": { "type": "integer", "maximum": 4, "minimum": 0 }, "draft": { "type": "boolean" }, "mode": { "type": "string", "const": "t2v" }, "async": { "type": "boolean" }, "callback_url": { "type": "string", "format": "uri" }, "model": { "type": "string", "enum": ["flux-3"] }, "action": { "type": "string", "enum": ["generate"] } }, "additionalProperties": false, "type": "object", "required": ["prompt", "mode"] }, { "properties": { "prompt": { "type": "string" }, "aspect_ratio": { "anyOf": [{ "type": "string", "enum": ["21:9", "2:1", "16:9", "4:3", "1:1", "3:4", "9:16", "9:21"] }, { "type": "string", "const": "auto" }] }, "duration": { "anyOf": [{ "type": "integer", "maximum": 20, "minimum": 5 }, { "type": "string", "const": "auto" }] }, "resolution": { "type": "string", "enum": ["hd", "fhd", "qhd", "uhd"] }, "version": { "type": "string", "const": "latest" }, "generate_audio": { "type": "boolean" }, "safety_tolerance": { "type": "integer", "maximum": 4, "minimum": 0 }, "draft": { "type": "boolean" }, "mode": { "type": "string", "const": "i2v" }, "keyframes": { "anyOf": [{ "type": "string" }, { "prefixItems": [{ "type": "number" }, { "type": "string" }], "type": "array", "maxItems": 2, "minItems": 2, "items": { "anyOf": [{ "type": "number" }, { "type": "string" }] } }, { "items": { "type": "string" }, "type": "array" }, { "items": { "prefixItems": [{ "type": "number" }, { "type": "string" }], "type": "array", "maxItems": 2, "minItems": 2, "items": { "anyOf": [{ "type": "number" }, { "type": "string" }] } }, "type": "array" }] }, "async": { "type": "boolean" }, "callback_url": { "type": "string", "format": "uri" }, "model": { "type": "string", "enum": ["flux-3"] }, "action": { "type": "string", "enum": ["generate"] } }, "additionalProperties": false, "type": "object", "required": ["prompt", "mode", "keyframes"] }, { "properties": { "prompt": { "type": "string" }, "aspect_ratio": { "anyOf": [{ "type": "string", "enum": ["21:9", "2:1", "16:9", "4:3", "1:1", "3:4", "9:16", "9:21"] }, { "type": "string", "const": "auto" }] }, "duration": { "anyOf": [{ "type": "integer", "maximum": 15, "minimum": 5 }, { "type": "string", "const": "auto" }] }, "resolution": { "type": "string", "enum": ["hd", "fhd", "qhd", "uhd"] }, "version": { "type": "string", "const": "latest" }, "generate_audio": { "type": "boolean" }, "safety_tolerance": { "type": "integer", "maximum": 4, "minimum": 0 }, "draft": { "type": "boolean" }, "mode": { "type": "string", "const": "v2v" }, "start_video": { "type": "string" }, "async": { "type": "boolean" }, "callback_url": { "type": "string", "format": "uri" }, "model": { "type": "string", "enum": ["flux-3"] }, "action": { "type": "string", "enum": ["generate"] } }, "additionalProperties": false, "type": "object", "required": ["prompt", "mode", "start_video"] }, { "properties": { "mode": { "type": "string", "const": "draft_enhance" }, "resolution": { "type": "string", "enum": ["hd", "fhd", "qhd", "uhd"] }, "safety_tolerance": { "type": "integer", "maximum": 4, "minimum": 0 }, "draft_task_id": { "type": "string" }, "async": { "type": "boolean" }, "callback_url": { "type": "string", "format": "uri" }, "model": { "type": "string", "enum": ["flux-3"] }, "action": { "type": "string", "enum": ["generate"] } }, "additionalProperties": false, "type": "object", "required": ["mode", "draft_task_id"] }], "discriminator": { "propertyName": "mode", "mapping": { "draft_enhance": "#/components/schemas/Flux3VideoDraftEnhanceInputs", "i2v": "#/components/schemas/Flux3VideoI2VInputs", "t2v": "#/components/schemas/Flux3VideoT2VInputs", "v2v": "#/components/schemas/Flux3VideoV2VInputs" } } }], "properties": { "action": { "type": "string", "enum": ["generate"] } } }, "properties": { "action": { "type": "string", "enum": ["generate"] }, "prompt": { "type": "string" }, "aspect_ratio": { "anyOf": [{ "type": "string", "enum": ["21:9", "2:1", "16:9", "4:3", "1:1", "3:4", "9:16", "9:21"] }, { "type": "string", "const": "auto" }] }, "duration": { "anyOf": [{ "type": "integer", "maximum": 20, "minimum": 5 }, { "type": "string", "const": "auto" }] }, "resolution": { "type": "string", "enum": ["hd", "fhd", "qhd", "uhd"] }, "version": { "type": "string", "enum": ["latest"] }, "generate_audio": { "type": "boolean" }, "safety_tolerance": { "type": "integer", "maximum": 4, "minimum": 0 }, "draft": { "type": "boolean" }, "mode": { "type": "string", "enum": ["t2v", "i2v", "v2v", "draft_enhance"] }, "async": { "type": "boolean" }, "callback_url": { "type": "string", "format": "uri" }, "model": { "type": "string", "enum": ["flux-3"] }, "keyframes": { "anyOf": [{ "type": "string" }, { "prefixItems": [{ "type": "number" }, { "type": "string" }], "type": "array", "maxItems": 2, "minItems": 2, "items": { "anyOf": [{ "type": "number" }, { "type": "string" }] } }, { "items": { "type": "string" }, "type": "array" }, { "items": { "prefixItems": [{ "type": "number" }, { "type": "string" }], "type": "array", "maxItems": 2, "minItems": 2, "items": { "anyOf": [{ "type": "number" }, { "type": "string" }] } }, "type": "array" }] }, "start_video": { "type": "string" }, "draft_task_id": { "type": "string" } }, "parameters": [], "defaults": { "model": "flux-3", "action": "generate", "mode": "t2v" }, "fixed": {}, "allow_empty": [], "query_actions": [], "media_response": false, "tool": { "label": "Flux Video", "description": "Use the Ace Data Cloud Flux APIs in Dify workflows. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "action", "required": false, "schema": { "type": "string", "description": "Set action.", "enum": ["generate"], "default": "generate" } }, { "name": "prompt", "required": false, "schema": { "type": "string", "description": "Set prompt." } }, { "name": "aspect_ratio", "required": false, "schema": { "type": "string", "description": "Set aspect ratio." } }, { "name": "duration", "required": false, "schema": { "type": "string", "description": "Set duration." } }, { "name": "resolution", "required": false, "schema": { "type": "string", "description": "Set resolution.", "enum": ["hd", "fhd", "qhd", "uhd"] } }, { "name": "version", "required": false, "schema": { "type": "string", "description": "Set version.", "enum": ["latest"] } }, { "name": "generate_audio", "required": false, "schema": { "type": "boolean", "description": "Set generate audio." } }, { "name": "safety_tolerance", "required": false, "schema": { "type": "number", "description": "Set safety tolerance.", "minimum": 0, "maximum": 4 } }, { "name": "draft", "required": false, "schema": { "type": "boolean", "description": "Set draft." } }, { "name": "mode", "required": false, "schema": { "type": "string", "description": "Set mode.", "enum": ["t2v", "i2v", "v2v", "draft_enhance"], "default": "t2v" } }, { "name": "callback_url", "required": false, "schema": { "type": "string", "description": "Set callback url for this operation." } }, { "name": "model", "required": false, "schema": { "type": "string", "description": "Select a model currently supported by this API. Availability and pricing depend on the chosen model.", "enum": ["flux-3"], "default": "flux-3" } }, { "name": "keyframes", "required": false, "schema": { "type": "string", "description": "Set keyframes. Enter a JSON array or object where applicable." } }, { "name": "start_video", "required": false, "schema": { "type": "string", "description": "Set start video." } }, { "name": "draft_task_id", "required": false, "schema": { "type": "string", "description": "Set draft task id." } }] } },
|
|
10
|
+
"flux_task_retrieve": { "method": "POST", "path": "/flux/tasks", "operation": "task", "schema": { "type": "object", "properties": { "id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" } }, "action": { "enum": ["retrieve", "retrieve_batch"], "type": "string" } } }, "properties": { "id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" } }, "action": { "enum": ["retrieve", "retrieve_batch"], "type": "string" } }, "parameters": [], "defaults": { "wait_seconds": 0 }, "fixed": {}, "allow_empty": [], "query_actions": ["retrieve", "retrieve_batch", "list", "presets"], "media_response": false, "tool": { "label": "Flux Retrieve Task", "description": "Query the existing task ID; do not repeat generation while it is pending.", "input": [{ "name": "task_id", "required": true, "schema": { "type": "string", "description": "Use the task ID or IDs returned by earlier submissions." } }, { "name": "wait_seconds", "required": false, "schema": { "type": "number", "description": "0 queries once; 1–240 waits for the same task to finish. Pending is not complete.", "default": 0, "minimum": 0, "maximum": 240 } }] } },
|
|
11
|
+
"flux_tasks_retrieve_batch": { "method": "POST", "path": "/flux/tasks", "operation": "batch", "schema": { "type": "object", "properties": { "id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "action": { "enum": ["retrieve", "retrieve_batch"], "type": "string" } }, "required": ["action", "ids"] }, "properties": { "id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "action": { "enum": ["retrieve", "retrieve_batch"], "type": "string" } }, "parameters": [], "defaults": {}, "fixed": { "action": "retrieve_batch" }, "allow_empty": [], "query_actions": ["retrieve", "retrieve_batch", "list", "presets"], "media_response": false, "tool": { "label": "Flux Retrieve Tasks", "description": "Query existing task IDs. Each item retains its own terminal or pending status.", "input": [{ "name": "ids", "required": true, "schema": { "type": "string", "description": "Use the task ID or IDs returned by earlier submissions. Enter a JSON array or object where applicable." } }] } }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "google-search",
|
|
3
|
+
"label": "Google Search",
|
|
4
|
+
"source": { "repository": "https://github.com/AceDataCloud/GoogleSearchDify", "commit": "b6291ea9f07ddf5e45c5887ab2982a78cbaa305c", "path": "tools/api_contracts.py" },
|
|
5
|
+
"taskPath": null,
|
|
6
|
+
"endpoints": {
|
|
7
|
+
"serp_google": { "method": "POST", "path": "/serp/google", "operation": "search", "schema": { "type": "object", "required": ["query"], "properties": { "page": { "type": "integer", "minimum": 1, "maximum": 100 }, "type": { "enum": ["search", "images", "news", "maps", "places", "videos"], "type": "string" }, "query": { "type": "string", "minLength": 1, "maxLength": 2048, "pattern": ".*\\S.*" }, "range": { "type": "string", "enum": ["h", "d", "w", "m", "y", "qdr:h", "qdr:d", "qdr:w", "qdr:m", "qdr:y"] }, "number": { "type": "integer", "minimum": 1, "maximum": 100 }, "country": { "type": "string", "minLength": 1, "maxLength": 32 }, "language": { "type": "string", "minLength": 1, "maxLength": 32 }, "image_size": { "type": "string", "enum": ["large", "medium", "icon", "2mp", "4mp", "6mp", "8mp", "10mp", "12mp", "15mp", "20mp", "40mp", "70mp"] } }, "additionalProperties": false, "oneOf": [{ "properties": { "type": { "type": "string", "enum": ["images"] } }, "required": ["type"] }, { "properties": { "type": { "type": "string", "enum": ["search", "news", "maps", "places", "videos"] } }, "not": { "required": ["image_size"] } }] }, "properties": { "page": { "type": "integer", "minimum": 1, "maximum": 100 }, "type": { "enum": ["search", "images", "news", "maps", "places", "videos"], "type": "string" }, "query": { "type": "string", "minLength": 1, "maxLength": 2048, "pattern": ".*\\S.*" }, "range": { "type": "string", "enum": ["h", "d", "w", "m", "y", "qdr:h", "qdr:d", "qdr:w", "qdr:m", "qdr:y"] }, "number": { "type": "integer", "minimum": 1, "maximum": 100 }, "country": { "type": "string", "minLength": 1, "maxLength": 32 }, "language": { "type": "string", "minLength": 1, "maxLength": 32 }, "image_size": { "type": "string", "enum": ["large", "medium", "icon", "2mp", "4mp", "6mp", "8mp", "10mp", "12mp", "15mp", "20mp", "40mp", "70mp"] } }, "parameters": [], "defaults": { "type": "search", "number": 3, "page": 1 }, "fixed": {}, "allow_empty": [], "query_actions": [], "media_response": false, "tool": { "label": "Google SERP", "description": "Get structured Google SERP results via Ace Data Cloud Google SERP API. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "page", "required": false, "schema": { "type": "number", "description": "Page number. Default is 1.", "default": 1, "minimum": 1, "maximum": 100 } }, { "name": "type", "required": false, "schema": { "type": "string", "description": "Search resource type. Default is search.", "enum": ["search", "images", "news", "maps", "places", "videos"], "default": "search" } }, { "name": "query", "required": true, "schema": { "type": "string", "description": "Search query string." } }, { "name": "range", "required": false, "schema": { "type": "string", "description": "Date range constraint of the search results.", "enum": ["h", "d", "w", "m", "y", "qdr:h", "qdr:d", "qdr:w", "qdr:m", "qdr:y"] } }, { "name": "number", "required": false, "schema": { "type": "number", "description": "Number of results per page. Default is 10.", "default": 3, "minimum": 1, "maximum": 100 } }, { "name": "country", "required": false, "schema": { "type": "string", "description": "Country code (e.g., US, CN). Default is US." } }, { "name": "language", "required": false, "schema": { "type": "string", "description": "Language code (e.g., en, zh-CN). Default is en." } }, { "name": "image_size", "required": false, "schema": { "type": "string", "description": "Set image size.", "enum": ["large", "medium", "icon", "2mp", "4mp", "6mp", "8mp", "10mp", "12mp", "15mp", "20mp", "40mp", "70mp"] } }] } }
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "gpt-image",
|
|
3
|
+
"label": "GPT Image",
|
|
4
|
+
"source": { "repository": "https://github.com/AceDataCloud/GPTImageDify", "commit": "2a9207f7f472405662b1a824895046f54c0fbba2", "path": "tools/api_contracts.py" },
|
|
5
|
+
"taskPath": "/openai/tasks",
|
|
6
|
+
"endpoints": {
|
|
7
|
+
"gpt_image_generate_image": { "method": "POST", "path": "/openai/images/generations", "operation": "generate", "schema": { "type": "object", "required": ["prompt", "model"], "properties": { "prompt": { "type": "string" }, "background": { "enum": ["transparent", "opaque", "auto"], "type": "string" }, "model": { "enum": ["dall-e-2", "dall-e-3", "gpt-image-1", "gpt-image-1.5", "gpt-image-2", "gpt-image-2.5-flare", "gpt-image-2.5-flare:official", "gpt-image-2.5-sunburst", "gpt-image-2.5-sunburst:official", "gpt-image-2:reverse", "gpt-image-2:official", "nano-banana", "nano-banana-2-lite", "nano-banana-2", "nano-banana-pro"], "type": "string" }, "moderation": { "enum": ["low", "auto"], "type": "string" }, "n": { "type": "integer", "minimum": 1, "maximum": 10 }, "output_compression": { "type": "integer", "minimum": 0, "maximum": 100 }, "output_format": { "enum": ["png", "jpeg", "webp"], "type": "string" }, "partial_images": { "type": "integer", "minimum": 0, "maximum": 3 }, "size": { "type": ["string", "null"], "pattern": "^(auto|\\d+x\\d+)$" }, "quality": { "enum": ["auto", "high", "medium", "low", "hd", "standard"], "type": "string" }, "response_format": { "enum": ["url", "b64_json"], "type": ["string", "null"] }, "style": { "enum": ["vivid", "natural"], "type": "string" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } } }, "properties": { "prompt": { "type": "string" }, "background": { "enum": ["transparent", "opaque", "auto"], "type": "string" }, "model": { "enum": ["dall-e-2", "dall-e-3", "gpt-image-1", "gpt-image-1.5", "gpt-image-2", "gpt-image-2.5-flare", "gpt-image-2.5-flare:official", "gpt-image-2.5-sunburst", "gpt-image-2.5-sunburst:official", "gpt-image-2:reverse", "gpt-image-2:official", "nano-banana", "nano-banana-2-lite", "nano-banana-2", "nano-banana-pro"], "type": "string" }, "moderation": { "enum": ["low", "auto"], "type": "string" }, "n": { "type": "integer", "minimum": 1, "maximum": 10 }, "output_compression": { "type": "integer", "minimum": 0, "maximum": 100 }, "output_format": { "enum": ["png", "jpeg", "webp"], "type": "string" }, "partial_images": { "type": "integer", "minimum": 0, "maximum": 3 }, "size": { "type": ["string", "null"], "pattern": "^(auto|\\d+x\\d+)$" }, "quality": { "enum": ["auto", "high", "medium", "low", "hd", "standard"], "type": "string" }, "response_format": { "enum": ["url", "b64_json"], "type": ["string", "null"] }, "style": { "enum": ["vivid", "natural"], "type": "string" }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } }, "parameters": [], "defaults": { "model": "gpt-image-2", "size": "1024x1024", "quality": "auto", "n": 1 }, "fixed": {}, "allow_empty": [], "query_actions": [], "media_response": true, "tool": { "label": "GPT Image Generate Image", "description": "GPT Image Generate Image via Ace Data Cloud. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "prompt", "required": true, "schema": { "type": "string", "description": "Prompt" } }, { "name": "background", "required": false, "schema": { "type": "string", "description": "Set background for this operation.", "enum": ["transparent", "opaque", "auto"] } }, { "name": "model", "required": false, "schema": { "type": "string", "description": "Select a model currently supported by this API. Availability and pricing depend on the chosen model.", "enum": ["dall-e-2", "dall-e-3", "gpt-image-1", "gpt-image-1.5", "gpt-image-2", "gpt-image-2.5-flare", "gpt-image-2.5-flare:official", "gpt-image-2.5-sunburst", "gpt-image-2.5-sunburst:official", "gpt-image-2:reverse", "gpt-image-2:official", "nano-banana", "nano-banana-2-lite", "nano-banana-2", "nano-banana-pro"], "default": "gpt-image-2" } }, { "name": "moderation", "required": false, "schema": { "type": "string", "description": "Set moderation for this operation.", "enum": ["low", "auto"] } }, { "name": "count", "required": false, "schema": { "type": "number", "description": "Number of images to generate; each image is billed at the current service rate.", "default": 1, "minimum": 1, "maximum": 10 } }, { "name": "output_compression", "required": false, "schema": { "type": "number", "description": "Set output compression for this operation.", "minimum": 0, "maximum": 100 } }, { "name": "output_format", "required": false, "schema": { "type": "string", "description": "Set output format for this operation.", "enum": ["png", "jpeg", "webp"] } }, { "name": "partial_images", "required": false, "schema": { "type": "number", "description": "Set partial images for this operation.", "minimum": 0, "maximum": 3 } }, { "name": "size", "required": false, "schema": { "type": "string", "description": "auto or WIDTHxHEIGHT; valid sizes depend on the model.", "default": "1024x1024" } }, { "name": "quality", "required": false, "schema": { "type": "string", "description": "Quality", "enum": ["auto", "high", "medium", "low", "hd", "standard"], "default": "auto" } }, { "name": "style", "required": false, "schema": { "type": "string", "description": "Set style for this operation.", "enum": ["vivid", "natural"] } }, { "name": "callback_url", "required": false, "schema": { "type": "string", "description": "Set callback url for this operation." } }] } },
|
|
8
|
+
"gpt_image_edit_image": { "method": "POST", "path": "/openai/images/edits", "operation": "edit", "schema": { "type": "object", "required": ["image", "prompt"], "properties": { "image": { "oneOf": [{ "type": "string", "format": "uri" }, { "type": "array", "items": { "type": "string", "format": "uri" }, "maxItems": 16 }] }, "prompt": { "type": "string" }, "model": { "enum": ["dall-e-2", "dall-e-3", "gpt-image-1", "gpt-image-1.5", "gpt-image-2", "gpt-image-2.5-flare", "gpt-image-2.5-flare:official", "gpt-image-2.5-sunburst", "gpt-image-2.5-sunburst:official", "gpt-image-2:reverse", "gpt-image-2:official", "nano-banana", "nano-banana-2-lite", "nano-banana-2", "nano-banana-pro"], "type": "string" }, "n": { "type": "integer", "minimum": 1, "maximum": 10 }, "background": { "enum": ["transparent", "opaque", "auto"], "type": "string" }, "input_fidelity": { "enum": ["high", "low"], "type": "string" }, "output_format": { "enum": ["png", "jpeg", "webp"], "type": "string" }, "output_compression": { "type": "integer", "minimum": 0, "maximum": 100 }, "quality": { "enum": ["auto", "high", "medium", "low", "standard"], "type": "string" }, "size": { "type": ["string", "null"], "pattern": "^(auto|\\d+x\\d+)$" }, "response_format": { "enum": ["url", "b64_json"], "type": ["string", "null"] }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } } }, "properties": { "image": { "oneOf": [{ "type": "string", "format": "uri" }, { "type": "array", "items": { "type": "string", "format": "uri" }, "maxItems": 16 }] }, "prompt": { "type": "string" }, "model": { "enum": ["dall-e-2", "dall-e-3", "gpt-image-1", "gpt-image-1.5", "gpt-image-2", "gpt-image-2.5-flare", "gpt-image-2.5-flare:official", "gpt-image-2.5-sunburst", "gpt-image-2.5-sunburst:official", "gpt-image-2:reverse", "gpt-image-2:official", "nano-banana", "nano-banana-2-lite", "nano-banana-2", "nano-banana-pro"], "type": "string" }, "n": { "type": "integer", "minimum": 1, "maximum": 10 }, "background": { "enum": ["transparent", "opaque", "auto"], "type": "string" }, "input_fidelity": { "enum": ["high", "low"], "type": "string" }, "output_format": { "enum": ["png", "jpeg", "webp"], "type": "string" }, "output_compression": { "type": "integer", "minimum": 0, "maximum": 100 }, "quality": { "enum": ["auto", "high", "medium", "low", "standard"], "type": "string" }, "size": { "type": ["string", "null"], "pattern": "^(auto|\\d+x\\d+)$" }, "response_format": { "enum": ["url", "b64_json"], "type": ["string", "null"] }, "callback_url": { "type": "string" }, "async": { "type": "boolean" } }, "parameters": [], "defaults": { "model": "gpt-image-2", "size": "1024x1024", "quality": "auto", "n": 1 }, "fixed": {}, "allow_empty": [], "query_actions": [], "media_response": true, "tool": { "label": "GPT Image Edit Image", "description": "GPT Image Edit Image via Ace Data Cloud. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "image_urls", "required": true, "schema": { "type": "string", "description": "Public HTTPS image URLs, one per line or a JSON array. Only submit images you may use. Enter a JSON array or object where applicable." } }, { "name": "prompt", "required": true, "schema": { "type": "string", "description": "Prompt" } }, { "name": "model", "required": false, "schema": { "type": "string", "description": "Select a model currently supported by this API. Availability and pricing depend on the chosen model.", "enum": ["dall-e-2", "dall-e-3", "gpt-image-1", "gpt-image-1.5", "gpt-image-2", "gpt-image-2.5-flare", "gpt-image-2.5-flare:official", "gpt-image-2.5-sunburst", "gpt-image-2.5-sunburst:official", "gpt-image-2:reverse", "gpt-image-2:official", "nano-banana", "nano-banana-2-lite", "nano-banana-2", "nano-banana-pro"], "default": "gpt-image-2" } }, { "name": "count", "required": false, "schema": { "type": "number", "description": "Number of images to generate; each image is billed at the current service rate.", "default": 1, "minimum": 1, "maximum": 10 } }, { "name": "background", "required": false, "schema": { "type": "string", "description": "Set background for this operation.", "enum": ["transparent", "opaque", "auto"] } }, { "name": "input_fidelity", "required": false, "schema": { "type": "string", "description": "Set input fidelity for this operation.", "enum": ["high", "low"] } }, { "name": "output_format", "required": false, "schema": { "type": "string", "description": "Set output format for this operation.", "enum": ["png", "jpeg", "webp"] } }, { "name": "output_compression", "required": false, "schema": { "type": "number", "description": "Set output compression for this operation.", "minimum": 0, "maximum": 100 } }, { "name": "quality", "required": false, "schema": { "type": "string", "description": "Quality", "enum": ["auto", "high", "medium", "low", "standard"], "default": "auto" } }, { "name": "size", "required": false, "schema": { "type": "string", "description": "auto or WIDTHxHEIGHT; valid sizes depend on the model.", "default": "1024x1024" } }, { "name": "callback_url", "required": false, "schema": { "type": "string", "description": "Set callback url for this operation." } }] } },
|
|
9
|
+
"gpt_image_list_tasks": { "method": "POST", "path": "/openai/tasks", "operation": "request", "schema": { "type": "object", "properties": { "action": { "type": "string", "enum": ["retrieve", "retrieve_batch"] }, "id": { "type": "string" }, "trace_id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" } }, "trace_ids": { "type": "array", "items": { "type": "string" } }, "application_id": { "type": "string" }, "user_id": { "type": "string" }, "type": { "type": "string", "enum": ["images", "images_generations", "images_edits"] }, "offset": { "type": "integer" }, "limit": { "type": "integer" }, "created_at_min": { "type": "number" }, "created_at_max": { "type": "number" }, "count_mode": { "type": "string", "enum": ["none", "exact"] } } }, "properties": { "action": { "type": "string", "enum": ["retrieve", "retrieve_batch"] }, "id": { "type": "string" }, "trace_id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" } }, "trace_ids": { "type": "array", "items": { "type": "string" } }, "application_id": { "type": "string" }, "user_id": { "type": "string" }, "type": { "type": "string", "enum": ["images", "images_generations", "images_edits"] }, "offset": { "type": "integer" }, "limit": { "type": "integer" }, "created_at_min": { "type": "number" }, "created_at_max": { "type": "number" }, "count_mode": { "type": "string", "enum": ["none", "exact"] } }, "parameters": [], "defaults": { "action": "retrieve_batch" }, "fixed": {}, "allow_empty": [], "query_actions": ["retrieve", "retrieve_batch", "list", "presets"], "media_response": false, "tool": { "label": "GPT Image List Tasks", "description": "List Tasks through the Ace Data Cloud GPT Image API. For asynchronous results, preserve task_id and use the task retrieval tool until completion. A successful submission is not completed output.", "input": [{ "name": "action", "required": false, "schema": { "type": "string", "description": "Set action for this operation.", "enum": ["retrieve", "retrieve_batch"], "default": "retrieve_batch" } }, { "name": "id", "required": false, "schema": { "type": "string", "description": "Set id for this operation." } }, { "name": "trace_id", "required": false, "schema": { "type": "string", "description": "Set trace id for this operation." } }, { "name": "ids", "required": false, "schema": { "type": "string", "description": "Use the task ID or IDs returned by earlier submissions. Enter a JSON array or object where applicable." } }, { "name": "trace_ids", "required": false, "schema": { "type": "string", "description": "Set trace ids for this operation. Enter a JSON array or object where applicable." } }, { "name": "application_id", "required": false, "schema": { "type": "string", "description": "Set application id for this operation." } }, { "name": "user_id", "required": false, "schema": { "type": "string", "description": "Set user id for this operation." } }, { "name": "type", "required": false, "schema": { "type": "string", "description": "Set type for this operation.", "enum": ["images", "images_generations", "images_edits"] } }, { "name": "offset", "required": false, "schema": { "type": "number", "description": "Set offset for this operation." } }, { "name": "limit", "required": false, "schema": { "type": "number", "description": "Set limit for this operation." } }, { "name": "created_at_min", "required": false, "schema": { "type": "number", "description": "Set created at min for this operation." } }, { "name": "created_at_max", "required": false, "schema": { "type": "number", "description": "Set created at max for this operation." } }, { "name": "count_mode", "required": false, "schema": { "type": "string", "description": "Set count mode for this operation.", "enum": ["none", "exact"] } }] } },
|
|
10
|
+
"gpt_image_task_retrieve": { "method": "POST", "path": "/openai/tasks", "operation": "task", "schema": { "type": "object", "properties": { "action": { "type": "string", "enum": ["retrieve", "retrieve_batch"] }, "id": { "type": "string" }, "trace_id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" } }, "trace_ids": { "type": "array", "items": { "type": "string" } }, "application_id": { "type": "string" }, "user_id": { "type": "string" }, "type": { "type": "string", "enum": ["images", "images_generations", "images_edits"] }, "offset": { "type": "integer" }, "limit": { "type": "integer" }, "created_at_min": { "type": "number" }, "created_at_max": { "type": "number" }, "count_mode": { "type": "string", "enum": ["none", "exact"] } } }, "properties": { "action": { "type": "string", "enum": ["retrieve", "retrieve_batch"] }, "id": { "type": "string" }, "trace_id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" } }, "trace_ids": { "type": "array", "items": { "type": "string" } }, "application_id": { "type": "string" }, "user_id": { "type": "string" }, "type": { "type": "string", "enum": ["images", "images_generations", "images_edits"] }, "offset": { "type": "integer" }, "limit": { "type": "integer" }, "created_at_min": { "type": "number" }, "created_at_max": { "type": "number" }, "count_mode": { "type": "string", "enum": ["none", "exact"] } }, "parameters": [], "defaults": { "wait_seconds": 0 }, "fixed": {}, "allow_empty": [], "query_actions": ["retrieve", "retrieve_batch", "list", "presets"], "media_response": false, "tool": { "label": "GPT Image Retrieve Task", "description": "Query the existing task ID; do not repeat generation while it is pending.", "input": [{ "name": "task_id", "required": false, "schema": { "type": "string", "description": "Use the task ID or IDs returned by earlier submissions." } }, { "name": "wait_seconds", "required": false, "schema": { "type": "number", "description": "0 queries once; 1–240 waits for the same task to finish. Pending is not complete.", "default": 0, "minimum": 0, "maximum": 240 } }, { "name": "trace_id", "required": false, "schema": { "type": "string", "description": "Set trace id for this operation." } }] } },
|
|
11
|
+
"gpt_image_tasks_retrieve_batch": { "method": "POST", "path": "/openai/tasks", "operation": "batch", "schema": { "type": "object", "properties": { "action": { "type": "string", "enum": ["retrieve", "retrieve_batch"] }, "id": { "type": "string" }, "trace_id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "trace_ids": { "type": "array", "items": { "type": "string" } }, "application_id": { "type": "string" }, "user_id": { "type": "string" }, "type": { "type": "string", "enum": ["images", "images_generations", "images_edits"] }, "offset": { "type": "integer" }, "limit": { "type": "integer" }, "created_at_min": { "type": "number" }, "created_at_max": { "type": "number" }, "count_mode": { "type": "string", "enum": ["none", "exact"] } }, "required": ["action"] }, "properties": { "action": { "type": "string", "enum": ["retrieve", "retrieve_batch"] }, "id": { "type": "string" }, "trace_id": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "trace_ids": { "type": "array", "items": { "type": "string" } }, "application_id": { "type": "string" }, "user_id": { "type": "string" }, "type": { "type": "string", "enum": ["images", "images_generations", "images_edits"] }, "offset": { "type": "integer" }, "limit": { "type": "integer" }, "created_at_min": { "type": "number" }, "created_at_max": { "type": "number" }, "count_mode": { "type": "string", "enum": ["none", "exact"] } }, "parameters": [], "defaults": {}, "fixed": { "action": "retrieve_batch" }, "allow_empty": [], "query_actions": ["retrieve", "retrieve_batch", "list", "presets"], "media_response": false, "tool": { "label": "GPT Image Retrieve Tasks", "description": "Query existing task IDs. Each item retains its own terminal or pending status.", "input": [{ "name": "trace_id", "required": false, "schema": { "type": "string", "description": "Set trace id for this operation." } }, { "name": "ids", "required": false, "schema": { "type": "string", "description": "Use the task ID or IDs returned by earlier submissions. Enter a JSON array or object where applicable." } }, { "name": "trace_ids", "required": false, "schema": { "type": "string", "description": "Set trace ids for this operation. Enter a JSON array or object where applicable." } }, { "name": "application_id", "required": false, "schema": { "type": "string", "description": "Set application id for this operation." } }, { "name": "user_id", "required": false, "schema": { "type": "string", "description": "Set user id for this operation." } }, { "name": "type", "required": false, "schema": { "type": "string", "description": "Set type for this operation.", "enum": ["images", "images_generations", "images_edits"] } }, { "name": "offset", "required": false, "schema": { "type": "number", "description": "Set offset for this operation." } }, { "name": "limit", "required": false, "schema": { "type": "number", "description": "Set limit for this operation." } }, { "name": "created_at_min", "required": false, "schema": { "type": "number", "description": "Set created at min for this operation." } }, { "name": "created_at_max", "required": false, "schema": { "type": "number", "description": "Set created at max for this operation." } }, { "name": "count_mode", "required": false, "schema": { "type": "string", "description": "Set count mode for this operation.", "enum": ["none", "exact"] } }] } }
|
|
12
|
+
}
|
|
13
|
+
}
|