@acedatacloud/sdk 2026.1009.1 → 2026.1012.0

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
@@ -1,9 +1,25 @@
1
1
  # AceDataCloud TypeScript SDK
2
2
 
3
- Official TypeScript/Node.js client for the [AceDataCloud API](https://platform.acedata.cloud).
3
+ Official TypeScript/Node.js client for the [AceDataCloud API](https://platform.acedata.cloud?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=sdk_typescript_readme_platform).
4
4
 
5
5
  Requires Node.js 18+ (uses native `fetch`).
6
6
 
7
+ ## Get your Ace Data Cloud API key
8
+
9
+ 1. Open [Ace Data Cloud → Applications](https://platform.acedata.cloud/console/applications?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=sdk_typescript_readme_api_key). Sign in, or register an account first.
10
+ 2. Find **General application**. If it has not been created, choose **Initialize General Application**. A general key can use the services available to your account; a dedicated application's key is limited to its service. Check the required service/model access and [current pricing](https://platform.acedata.cloud/models?utm_source=opensource&utm_medium=referral&utm_campaign=evergreen&utm_content=sdk_typescript_readme_pricing).
11
+ 3. Copy the **API Key** from the application card, or open **Keys / Manage Keys → Create** to create a separate key for this integration. Give it a recognizable name so you can revoke or rotate it independently.
12
+ 4. When creating a key, review **Expiration Time**, **Set Usage Limitation**, and **Allowed APIs**. Enable only the restrictions you need, allow the operations you will call, then click **Create** and copy the token from the key list. Task lookup does not grant permission to submit a generation. Confirm the application's balance can cover your first request; any trial allowance is whatever your account currently displays.
13
+ 5. Copy only the token value, without quotation marks, spaces, or `Bearer `. An API Key / API Token field expects this raw value; only a manually configured HTTP `Authorization` header needs the `Bearer ` prefix. A `platform-...` account-management token cannot replace a generation API key.
14
+
15
+ ![Copy an application API key or open Manage Keys](https://raw.githubusercontent.com/AceDataCloud/NanoBananaDify/2522b2f57210597af2db866445319334a1677a23/_assets/tutorial/get-api-key-en.png)
16
+
17
+ ![Create a separately named key with optional restrictions](https://raw.githubusercontent.com/AceDataCloud/NanoBananaDify/2522b2f57210597af2db866445319334a1677a23/_assets/tutorial/create-api-key-en.png)
18
+
19
+ Save the key in the client's credential store or the environment variable shown below. Never put it in a prompt, shared workflow, screenshot, or Git commit. If authentication fails, check the full copied value, application/service access, expiration, usage limit, and balance before creating another key.
20
+
21
+ Use this application key for API requests. SDK account-management methods require the separate credential described in their management documentation; do not interchange it with the API key. The optional x402 payment flow below is a separate way to pay for supported requests.
22
+
7
23
  ## Installation
8
24
 
9
25
  ```bash
@@ -139,6 +155,32 @@ The public model ID also works with `client.openai.images.generate(...)` and
139
155
  `client.openai.images.edit(...)`; those use the OpenAI-compatible fields
140
156
  (`image` for editing) and return response objects, not task handles.
141
157
 
158
+ ## Maestro Video Production
159
+
160
+ Use the provider client to request one finished video in one language:
161
+
162
+ ```typescript
163
+ const task = await client.maestro.generate({
164
+ prompt: 'Explain vector databases to beginners in 20 seconds',
165
+ langs: ['en'],
166
+ aspect: '9:16',
167
+ duration: 20,
168
+ scenario: 'narrated',
169
+ });
170
+ const result = await task.wait();
171
+ ```
172
+
173
+ `langs` defaults to `['zh-cn']` and must contain exactly one language; create
174
+ separate tasks for other languages. The completed result contains one video in
175
+ `response.data.variants`. To revise a video, use `action: 'remix'`, `'edit'`, or
176
+ `'extend'` with `refTaskId: task.id`.
177
+
178
+ There is no quality tier: all videos use 1080p/30fps and target durations of
179
+ 5–300 seconds. Successful tasks cost **0.7 Credits per actual delivered second**,
180
+ with integer billed seconds capped at the requested duration (falling back to
181
+ that duration if it cannot be read). All scenarios, actions, and languages have
182
+ the same rate; failed tasks and `/maestro/tasks` polling are free.
183
+
142
184
  ## Multi-Provider Support
143
185
 
144
186
  Image, video, and audio resources support a `provider` parameter to switch between services:
package/dist/index.js CHANGED
@@ -1876,7 +1876,7 @@ var Maestro = class {
1876
1876
  this.transport = transport;
1877
1877
  }
1878
1878
  transport;
1879
- /** Call /maestro/videos. */
1879
+ /** Maestro Videos */
1880
1880
  async generate(options) {
1881
1881
  const body = {};
1882
1882
  body["prompt"] = options.prompt;
@@ -1886,15 +1886,17 @@ var Maestro = class {
1886
1886
  body["langs"] = options.langs ?? ["zh-cn"];
1887
1887
  body["aspect"] = options.aspect ?? "9:16";
1888
1888
  body["duration"] = options.duration ?? 30;
1889
- body["quality"] = options.quality ?? "standard";
1890
1889
  body["scenario"] = options.scenario ?? "auto";
1891
1890
  body["style"] = options.style ?? "auto";
1892
1891
  body["voice"] = options.voice ?? "auto";
1893
1892
  for (const [key, value] of Object.entries(options)) {
1894
- if (!["action", "aspect", "async", "callbackUrl", "duration", "fileUrls", "langs", "maxWait", "pollInterval", "prompt", "quality", "refTaskId", "scenario", "style", "voice", "wait"].includes(key) && value !== void 0) {
1893
+ if (!["action", "aspect", "async", "callbackUrl", "duration", "fileUrls", "langs", "maxWait", "pollInterval", "prompt", "refTaskId", "scenario", "style", "voice", "wait"].includes(key) && value !== void 0) {
1895
1894
  body[key] = value;
1896
1895
  }
1897
1896
  }
1897
+ if (body["langs"].length !== 1) {
1898
+ throw new Error("langs must contain exactly one item");
1899
+ }
1898
1900
  if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
1899
1901
  body.async = options.async ?? true;
1900
1902
  const result = await this.transport.request("POST", "/maestro/videos", { json: body });