@acedatacloud/sdk 2026.1101.0 → 2026.1103.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 +140 -0
- package/dist/index.d.mts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +25 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/resources/aichat.ts +1 -0
- package/src/resources/openai.ts +2 -0
- package/src/resources/providers/maestro.ts +3 -3
- package/src/resources/providers/producer.ts +7 -7
- package/src/resources/providers/suno.ts +26 -2
- package/src/resources/webextrator.ts +25 -2
package/README.md
CHANGED
|
@@ -71,8 +71,55 @@ for await (const chunk of stream) {
|
|
|
71
71
|
| `client.files` | File uploads |
|
|
72
72
|
| `client.platform` | Applications, credentials, models management |
|
|
73
73
|
|
|
74
|
+
## Chat usage and billing
|
|
75
|
+
|
|
76
|
+
Accepted model requests through Chat Completions, Responses, and Messages are
|
|
77
|
+
billed by the selected model's input, output, and cache usage, not a fixed fee
|
|
78
|
+
per request. Switching protocol formats does not change this to per-call billing
|
|
79
|
+
or guarantee that a model accepts that format. Consult current model prices and
|
|
80
|
+
`usage.cost` for the charge; the SDK preserves reported usage without recalculating it.
|
|
81
|
+
|
|
82
|
+
- Chat Completions `prompt_tokens` includes reported cached tokens.
|
|
83
|
+
- Responses `input_tokens` includes reported cached tokens.
|
|
84
|
+
- Messages `input_tokens` excludes separately reported `cache_read_input_tokens`
|
|
85
|
+
and `cache_creation_input_tokens`; those dimensions are charged separately.
|
|
86
|
+
|
|
87
|
+
Do not add cached tokens to the input total again for Chat Completions or
|
|
88
|
+
Responses, or treat Messages input alone as the full input/cache usage.
|
|
89
|
+
|
|
90
|
+
## Public Chat Completions models
|
|
91
|
+
|
|
92
|
+
Pass these public IDs to `client.openai.chat.completions.create({ model, messages })`;
|
|
93
|
+
use `stream: true` for streaming. The SDK passes model-specific fields through
|
|
94
|
+
without rewriting model IDs or enforcing a catalog.
|
|
95
|
+
|
|
96
|
+
- `gpt-6.1-terra`: supports text/image input, streaming, function tools, and
|
|
97
|
+
structured output. Use `reasoning_effort: 'low'` initially; supported levels are
|
|
98
|
+
`low`, `medium`, `high`, `xhigh`, and `max`, not `none` or `minimal`. Responses uses
|
|
99
|
+
`reasoning: { effort: 'low' }` instead. Inputs over 272,000 tokens use long-context
|
|
100
|
+
pricing; consult current prices and reported usage.
|
|
101
|
+
- `claude-opus-5-5`: supports text and streaming Chat Completions with `n: 1`.
|
|
102
|
+
Omit `temperature` and `top_p` to use model defaults; do not set temperature below
|
|
103
|
+
1 or a non-default top-p. Use `tool_choice: 'auto'`, not forced tools. For native
|
|
104
|
+
thinking blocks, signatures, and native tool semantics, use `client.chat.messages`.
|
|
105
|
+
- `gemini-4-argon`: supports text and streaming Chat Completions. Thinking can
|
|
106
|
+
consume output budget; Google recommends at least `max_tokens: 32768` for ordinary
|
|
107
|
+
tasks. This does not expose Interactions background long-output functionality.
|
|
108
|
+
- `kimi-k3.1-pro`: always reasons; pass `reasoning_effort: 'low'`, `'high'`, or `'max'`.
|
|
109
|
+
Do not disable reasoning. Keep the full assistant message, including
|
|
110
|
+
`reasoning_content` and `tool_calls`, in multi-turn and tool-call history.
|
|
111
|
+
The existing `kimi-k3` alias remains available; use `reasoning_effort: 'max'` for it.
|
|
112
|
+
|
|
113
|
+
Check current account access and prices before calling. A model's advertised
|
|
114
|
+
context size does not guarantee the platform's per-request limit.
|
|
115
|
+
|
|
74
116
|
## Native Claude Messages
|
|
75
117
|
|
|
118
|
+
For structured output, pass
|
|
119
|
+
`output_config: { format: { type: 'json_schema', schema: yourSchema } }` to
|
|
120
|
+
`client.chat.messages.create(...)`. Read the generated JSON from Messages `content`
|
|
121
|
+
text blocks; this does not change the response envelope or increase `maxTokens`.
|
|
122
|
+
|
|
76
123
|
Thinking and output configuration are passed through without SDK model-specific
|
|
77
124
|
enum or combination checks. The selected model determines which values it accepts.
|
|
78
125
|
For the beta `display: 'updates'` mode, set the required header on a dedicated
|
|
@@ -155,6 +202,23 @@ The public model ID also works with `client.openai.images.generate(...)` and
|
|
|
155
202
|
`client.openai.images.edit(...)`; those use the OpenAI-compatible fields
|
|
156
203
|
(`image` for editing) and return response objects, not task handles.
|
|
157
204
|
|
|
205
|
+
### GPT Image 2.5 quality
|
|
206
|
+
|
|
207
|
+
`client.openai.images.generate(...)` and `.edit(...)` pass `quality` through
|
|
208
|
+
unchanged. GPT Image models accept `auto`, `low`, `medium`, and `high`;
|
|
209
|
+
only `gpt-image-2.5-flare` and `gpt-image-2.5-sunburst` (including `:reverse`
|
|
210
|
+
and `:official` variants) additionally accept `xhigh` and `max`.
|
|
211
|
+
|
|
212
|
+
For both methods, `gpt-image-2.5-flare:reverse` and
|
|
213
|
+
`gpt-image-2.5-sunburst:reverse` are explicit aliases of their unsuffixed names.
|
|
214
|
+
Pass the complete model ID unchanged; the SDK does not select a fallback.
|
|
215
|
+
The server may use GPT Image 2.5 Flare during automatic recovery for reverse
|
|
216
|
+
models, while preserving the requested model and per-successful-image billing.
|
|
217
|
+
`gpt-image-2`, both 2.5 models, and their `:reverse` aliases have a base price
|
|
218
|
+
of **0.19 Credits per successful image**; check current account pricing and
|
|
219
|
+
usage records for final charges. Official-channel requests are billed by actual
|
|
220
|
+
token usage, not a fixed fee per image.
|
|
221
|
+
|
|
158
222
|
## Maestro Video Production
|
|
159
223
|
|
|
160
224
|
Use the provider client to request one finished video in one language:
|
|
@@ -181,8 +245,74 @@ with integer billed seconds capped at the requested duration (falling back to
|
|
|
181
245
|
that duration if it cannot be read). All scenarios, actions, and languages have
|
|
182
246
|
the same rate; failed tasks and `/maestro/tasks` polling are free.
|
|
183
247
|
|
|
248
|
+
`style` accepts a freeform visual hint as well as named presets. `voice` accepts
|
|
249
|
+
named voice presets or a 32-character hexadecimal voice `reference_id`; pass it unchanged.
|
|
250
|
+
|
|
251
|
+
## Producer action-specific inputs
|
|
252
|
+
|
|
253
|
+
`await client.producer.generate({ action: 'generate', prompt: 'A jazz song' })`
|
|
254
|
+
uses inspiration mode (`custom: false` by default). For custom vocals, set
|
|
255
|
+
`custom: true` and provide `lyric`; for custom instrumental music, set
|
|
256
|
+
`custom: true, instrumental: true` without inventing lyrics or a prompt.
|
|
257
|
+
Extensions require `audioId`, positive `continueAt` (seconds, including fractions),
|
|
258
|
+
and `lyric` unless instrumental. Covers, variations, section replacement,
|
|
259
|
+
vocal/instrument swaps, and stems require the source `audioId`. `lyric` and `prompt`
|
|
260
|
+
are no longer required for every action; generation still returns a task handle.
|
|
261
|
+
|
|
262
|
+
## WebExtrator navigation and cache
|
|
263
|
+
|
|
264
|
+
`client.webextrator.extract(...)` and `.render(...)` accept `cookies`,
|
|
265
|
+
`bypassCache`, and `cacheTtlSeconds`, mapped to the API's snake_case cache fields.
|
|
266
|
+
Each cookie requires `name`, `value`, and `domain`; optional fields are `path`,
|
|
267
|
+
`expires` (Unix seconds), `httpOnly`, `secure`, and `sameSite` (`Strict`, `Lax`,
|
|
268
|
+
or `None`). Keep cookie values out of logs and Git.
|
|
269
|
+
|
|
270
|
+
The server defaults `waitUntil` to `load`, navigation `timeout` to 30 seconds,
|
|
271
|
+
and cache TTL to 3600 seconds. `timeout` must be a positive integer; `delay` and
|
|
272
|
+
`cacheTtlSeconds` must be nonnegative integers. `bypassCache: true` skips cache
|
|
273
|
+
reads but can still cache the fresh result; `cacheTtlSeconds: 0` disables caching
|
|
274
|
+
that result. Omitted options remain omitted.
|
|
275
|
+
|
|
276
|
+
## Kling reference-video billing
|
|
277
|
+
|
|
278
|
+
Pass `videoList: [{ videoUrl: referenceUrl, referType: 'feature' }]`
|
|
279
|
+
to `client.kling.generate` with `model: 'kling-o1'` or `'kling-v3-omni'`.
|
|
280
|
+
Reference videos use a separate billing tier: **1.202 Credits/second** in `std`
|
|
281
|
+
mode and **1.602 Credits/second** in `pro` mode. For a 5-second O1 result,
|
|
282
|
+
`std` / `pro` cost **4.005 / 5.340 Credits** without a reference video, or
|
|
283
|
+
**6.010 / 8.010 Credits** with one.
|
|
284
|
+
|
|
285
|
+
`referType: 'base'` (the default) edits may follow the reference video's length;
|
|
286
|
+
billing uses the actual output duration rounded to the nearest integer second.
|
|
287
|
+
`referType: 'feature'` uses the requested `duration`. Read
|
|
288
|
+
`response.usage.reference_video_seconds` for the final billed seconds;
|
|
289
|
+
the request-time estimate can differ from the final charge. This is response
|
|
290
|
+
usage, not a request parameter. Image references and first/last frames alone do
|
|
291
|
+
not trigger reference-video billing. Do not combine `videoList` with
|
|
292
|
+
`generateAudio: true`.
|
|
293
|
+
|
|
184
294
|
## Suno music processing
|
|
185
295
|
|
|
296
|
+
For a private voice created by `client.suno.voices(...)`, upload the original
|
|
297
|
+
song with `await client.suno.upload({ audioUrl: sourceUrl, personaId })`.
|
|
298
|
+
This field is supported only for standard uploads (the default), not
|
|
299
|
+
`mode: 'enhanced'`. After upload succeeds, use the returned `data.audio_id` as
|
|
300
|
+
`audioId` and the same `personaId` in
|
|
301
|
+
`await client.suno.generate({ action: 'upload_cover', audioId, personaId })`.
|
|
302
|
+
Do not reuse a song ID uploaded without that voice association. Voice creation,
|
|
303
|
+
upload, and cover must use the same service channel. `vocalGender` is not
|
|
304
|
+
required and cannot replace `personaId`.
|
|
305
|
+
|
|
306
|
+
Before a cover or extension, optionally call
|
|
307
|
+
`await client.suno.availability({ audioId })`. Use the song's `audio_id` from a
|
|
308
|
+
completed task, not its `task_id`. This is a synchronous API-token-authenticated
|
|
309
|
+
check, currently without a Credits charge; it returns the response object
|
|
310
|
+
directly, not a task handle to poll. `result.data.available` is only `true` on
|
|
311
|
+
success: it is positive evidence on the current channel, not a guarantee that
|
|
312
|
+
a subsequent operation will work. An inconclusive check returns an error,
|
|
313
|
+
including `503 availability_unknown`; never convert an error into `false`.
|
|
314
|
+
Preserve the error code and trace ID.
|
|
315
|
+
|
|
186
316
|
Use `client.suno.generate({ custom: true, lyric, style, negativeTags })` for
|
|
187
317
|
custom-mode music. `negativeTags` describes styles or genres to exclude; there
|
|
188
318
|
is currently no fixed character limit, but overly long input may still fail,
|
|
@@ -194,6 +324,9 @@ for covers, extensions or stem separation. If processing returns
|
|
|
194
324
|
`id`, when available) and the error's `traceId` for support. The related codes
|
|
195
325
|
`suno_model_unavailable` and `suno_processing_failed` mean the selected model is
|
|
196
326
|
unavailable for that operation or processing returned no audio, respectively.
|
|
327
|
+
Suno can also return `api_error` with the message
|
|
328
|
+
`the account may have been offline`; this is a server error, not an SDK
|
|
329
|
+
authentication error.
|
|
197
330
|
These HTTP 500 errors retain their `code`, `traceId` and `body` on `APIError`.
|
|
198
331
|
Retrieve an existing task rather than submitting a replacement generation just
|
|
199
332
|
to check its result.
|
|
@@ -282,6 +415,13 @@ const client = new AceDataCloud({
|
|
|
282
415
|
|
|
283
416
|
The token can also be set via the `ACEDATACLOUD_API_TOKEN` environment variable.
|
|
284
417
|
|
|
418
|
+
`await client.platform.config.get()` returns `features` and `region`. `region`
|
|
419
|
+
is the lowercase country/region code detected from the request IP, or `null`
|
|
420
|
+
when unknown. The endpoint accepts no country/region override. Keep any
|
|
421
|
+
user-selected display region in your own application; it does not change
|
|
422
|
+
server-side availability or security policies. Feature keys may change; use
|
|
423
|
+
safe defaults for missing keys and do not share cached config across users.
|
|
424
|
+
|
|
285
425
|
## Paying with X402 Instead of a Bearer Token
|
|
286
426
|
|
|
287
427
|
The SDK supports a pluggable `paymentHandler` that is invoked when the
|
package/dist/index.d.mts
CHANGED
|
@@ -131,7 +131,7 @@ declare class Transport {
|
|
|
131
131
|
|
|
132
132
|
/** AI Chat resources — aichat/conversations endpoint. */
|
|
133
133
|
|
|
134
|
-
type AiChatModel = 'mimo-v2.6-pro' | 'mimo-v2.6-flash' | 'gpt-5.6-sol-fast' | 'gpt-5.5' | 'gpt-5.5-pro' | 'gpt-5.4' | 'gpt-5.4-pro' | 'gpt-5.2' | 'gpt-5.1' | 'gpt-5.1-all' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-all' | 'gpt-4' | 'gpt-4-all' | 'gpt-4-turbo' | 'gpt-4-turbo-preview' | 'gpt-4-vision-preview' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-all' | 'gpt-4o-image' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'o1' | 'o1-2024-12-17' | 'o1-all' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-mini-all' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-preview-all' | 'o1-pro' | 'o1-pro-2025-03-19' | 'o1-pro-all' | 'o3' | 'o3-2025-04-16' | 'o3-all' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3-mini-2025-01-31-high' | 'o3-mini-2025-01-31-low' | 'o3-mini-2025-01-31-medium' | 'o3-mini-all' | 'o3-mini-high' | 'o3-mini-high-all' | 'o3-mini-low' | 'o3-mini-medium' | 'o3-pro' | 'o3-pro-2025-06-10' | 'o4-mini' | 'o4-mini-2025-04-16' | 'o4-mini-all' | 'o4-mini-high-all' | 'deepseek-r1' | 'deepseek-r1-0528' | 'deepseek-v3' | 'deepseek-v3-250324' | 'deepseek-v4-flash' | 'grok-3' | 'glm-5.1' | 'glm-4.7' | 'glm-4.6' | 'glm-3-turbo' | (string & {});
|
|
134
|
+
type AiChatModel = 'mimo-v2.6-pro' | 'mimo-v2.6-flash' | 'gpt-6.1-terra' | 'gpt-5.6-sol-fast' | 'gpt-5.5' | 'gpt-5.5-pro' | 'gpt-5.4' | 'gpt-5.4-pro' | 'gpt-5.2' | 'gpt-5.1' | 'gpt-5.1-all' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-all' | 'gpt-4' | 'gpt-4-all' | 'gpt-4-turbo' | 'gpt-4-turbo-preview' | 'gpt-4-vision-preview' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-all' | 'gpt-4o-image' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'o1' | 'o1-2024-12-17' | 'o1-all' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-mini-all' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-preview-all' | 'o1-pro' | 'o1-pro-2025-03-19' | 'o1-pro-all' | 'o3' | 'o3-2025-04-16' | 'o3-all' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3-mini-2025-01-31-high' | 'o3-mini-2025-01-31-low' | 'o3-mini-2025-01-31-medium' | 'o3-mini-all' | 'o3-mini-high' | 'o3-mini-high-all' | 'o3-mini-low' | 'o3-mini-medium' | 'o3-pro' | 'o3-pro-2025-06-10' | 'o4-mini' | 'o4-mini-2025-04-16' | 'o4-mini-all' | 'o4-mini-high-all' | 'deepseek-r1' | 'deepseek-r1-0528' | 'deepseek-v3' | 'deepseek-v3-250324' | 'deepseek-v4-flash' | 'grok-3' | 'glm-5.1' | 'glm-4.7' | 'glm-4.6' | 'glm-3-turbo' | (string & {});
|
|
135
135
|
declare class AiChat {
|
|
136
136
|
private transport;
|
|
137
137
|
constructor(transport: Transport);
|
|
@@ -418,7 +418,7 @@ declare class Platform {
|
|
|
418
418
|
|
|
419
419
|
/** OpenAI-compatible facade resources. */
|
|
420
420
|
|
|
421
|
-
type OpenAIImageModel = '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-2.1' | 'nano-banana-pro' | (string & {});
|
|
421
|
+
type OpenAIImageModel = '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:reverse' | 'gpt-image-2.5-flare:official' | 'gpt-image-2.5-sunburst' | 'gpt-image-2.5-sunburst:reverse' | '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-2.1' | 'nano-banana-pro' | (string & {});
|
|
422
422
|
declare class Completions$1 {
|
|
423
423
|
private transport;
|
|
424
424
|
constructor(transport: Transport);
|
|
@@ -693,6 +693,16 @@ declare class Kling {
|
|
|
693
693
|
|
|
694
694
|
/** WebExtrator web render & extract resources. */
|
|
695
695
|
|
|
696
|
+
interface WebExtratorCookie {
|
|
697
|
+
name: string;
|
|
698
|
+
value: string;
|
|
699
|
+
domain: string;
|
|
700
|
+
path?: string;
|
|
701
|
+
expires?: number;
|
|
702
|
+
httpOnly?: boolean;
|
|
703
|
+
secure?: boolean;
|
|
704
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
705
|
+
}
|
|
696
706
|
declare class WebExtrator {
|
|
697
707
|
private transport;
|
|
698
708
|
constructor(transport: Transport);
|
|
@@ -709,6 +719,9 @@ declare class WebExtrator {
|
|
|
709
719
|
userAgent?: string;
|
|
710
720
|
callbackUrl?: string;
|
|
711
721
|
async?: boolean;
|
|
722
|
+
cookies?: WebExtratorCookie[];
|
|
723
|
+
bypassCache?: boolean;
|
|
724
|
+
cacheTtlSeconds?: number;
|
|
712
725
|
[key: string]: unknown;
|
|
713
726
|
}): Promise<Record<string, unknown>>;
|
|
714
727
|
render(opts: {
|
|
@@ -722,6 +735,9 @@ declare class WebExtrator {
|
|
|
722
735
|
userAgent?: string;
|
|
723
736
|
callbackUrl?: string;
|
|
724
737
|
async?: boolean;
|
|
738
|
+
cookies?: WebExtratorCookie[];
|
|
739
|
+
bypassCache?: boolean;
|
|
740
|
+
cacheTtlSeconds?: number;
|
|
725
741
|
[key: string]: unknown;
|
|
726
742
|
}): Promise<Record<string, unknown>>;
|
|
727
743
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -131,7 +131,7 @@ declare class Transport {
|
|
|
131
131
|
|
|
132
132
|
/** AI Chat resources — aichat/conversations endpoint. */
|
|
133
133
|
|
|
134
|
-
type AiChatModel = 'mimo-v2.6-pro' | 'mimo-v2.6-flash' | 'gpt-5.6-sol-fast' | 'gpt-5.5' | 'gpt-5.5-pro' | 'gpt-5.4' | 'gpt-5.4-pro' | 'gpt-5.2' | 'gpt-5.1' | 'gpt-5.1-all' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-all' | 'gpt-4' | 'gpt-4-all' | 'gpt-4-turbo' | 'gpt-4-turbo-preview' | 'gpt-4-vision-preview' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-all' | 'gpt-4o-image' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'o1' | 'o1-2024-12-17' | 'o1-all' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-mini-all' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-preview-all' | 'o1-pro' | 'o1-pro-2025-03-19' | 'o1-pro-all' | 'o3' | 'o3-2025-04-16' | 'o3-all' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3-mini-2025-01-31-high' | 'o3-mini-2025-01-31-low' | 'o3-mini-2025-01-31-medium' | 'o3-mini-all' | 'o3-mini-high' | 'o3-mini-high-all' | 'o3-mini-low' | 'o3-mini-medium' | 'o3-pro' | 'o3-pro-2025-06-10' | 'o4-mini' | 'o4-mini-2025-04-16' | 'o4-mini-all' | 'o4-mini-high-all' | 'deepseek-r1' | 'deepseek-r1-0528' | 'deepseek-v3' | 'deepseek-v3-250324' | 'deepseek-v4-flash' | 'grok-3' | 'glm-5.1' | 'glm-4.7' | 'glm-4.6' | 'glm-3-turbo' | (string & {});
|
|
134
|
+
type AiChatModel = 'mimo-v2.6-pro' | 'mimo-v2.6-flash' | 'gpt-6.1-terra' | 'gpt-5.6-sol-fast' | 'gpt-5.5' | 'gpt-5.5-pro' | 'gpt-5.4' | 'gpt-5.4-pro' | 'gpt-5.2' | 'gpt-5.1' | 'gpt-5.1-all' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-all' | 'gpt-4' | 'gpt-4-all' | 'gpt-4-turbo' | 'gpt-4-turbo-preview' | 'gpt-4-vision-preview' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-all' | 'gpt-4o-image' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'o1' | 'o1-2024-12-17' | 'o1-all' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-mini-all' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-preview-all' | 'o1-pro' | 'o1-pro-2025-03-19' | 'o1-pro-all' | 'o3' | 'o3-2025-04-16' | 'o3-all' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3-mini-2025-01-31-high' | 'o3-mini-2025-01-31-low' | 'o3-mini-2025-01-31-medium' | 'o3-mini-all' | 'o3-mini-high' | 'o3-mini-high-all' | 'o3-mini-low' | 'o3-mini-medium' | 'o3-pro' | 'o3-pro-2025-06-10' | 'o4-mini' | 'o4-mini-2025-04-16' | 'o4-mini-all' | 'o4-mini-high-all' | 'deepseek-r1' | 'deepseek-r1-0528' | 'deepseek-v3' | 'deepseek-v3-250324' | 'deepseek-v4-flash' | 'grok-3' | 'glm-5.1' | 'glm-4.7' | 'glm-4.6' | 'glm-3-turbo' | (string & {});
|
|
135
135
|
declare class AiChat {
|
|
136
136
|
private transport;
|
|
137
137
|
constructor(transport: Transport);
|
|
@@ -418,7 +418,7 @@ declare class Platform {
|
|
|
418
418
|
|
|
419
419
|
/** OpenAI-compatible facade resources. */
|
|
420
420
|
|
|
421
|
-
type OpenAIImageModel = '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-2.1' | 'nano-banana-pro' | (string & {});
|
|
421
|
+
type OpenAIImageModel = '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:reverse' | 'gpt-image-2.5-flare:official' | 'gpt-image-2.5-sunburst' | 'gpt-image-2.5-sunburst:reverse' | '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-2.1' | 'nano-banana-pro' | (string & {});
|
|
422
422
|
declare class Completions$1 {
|
|
423
423
|
private transport;
|
|
424
424
|
constructor(transport: Transport);
|
|
@@ -693,6 +693,16 @@ declare class Kling {
|
|
|
693
693
|
|
|
694
694
|
/** WebExtrator web render & extract resources. */
|
|
695
695
|
|
|
696
|
+
interface WebExtratorCookie {
|
|
697
|
+
name: string;
|
|
698
|
+
value: string;
|
|
699
|
+
domain: string;
|
|
700
|
+
path?: string;
|
|
701
|
+
expires?: number;
|
|
702
|
+
httpOnly?: boolean;
|
|
703
|
+
secure?: boolean;
|
|
704
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
705
|
+
}
|
|
696
706
|
declare class WebExtrator {
|
|
697
707
|
private transport;
|
|
698
708
|
constructor(transport: Transport);
|
|
@@ -709,6 +719,9 @@ declare class WebExtrator {
|
|
|
709
719
|
userAgent?: string;
|
|
710
720
|
callbackUrl?: string;
|
|
711
721
|
async?: boolean;
|
|
722
|
+
cookies?: WebExtratorCookie[];
|
|
723
|
+
bypassCache?: boolean;
|
|
724
|
+
cacheTtlSeconds?: number;
|
|
712
725
|
[key: string]: unknown;
|
|
713
726
|
}): Promise<Record<string, unknown>>;
|
|
714
727
|
render(opts: {
|
|
@@ -722,6 +735,9 @@ declare class WebExtrator {
|
|
|
722
735
|
userAgent?: string;
|
|
723
736
|
callbackUrl?: string;
|
|
724
737
|
async?: boolean;
|
|
738
|
+
cookies?: WebExtratorCookie[];
|
|
739
|
+
bypassCache?: boolean;
|
|
740
|
+
cacheTtlSeconds?: number;
|
|
725
741
|
[key: string]: unknown;
|
|
726
742
|
}): Promise<Record<string, unknown>>;
|
|
727
743
|
}
|
package/dist/index.js
CHANGED
|
@@ -1408,7 +1408,7 @@ var WebExtrator = class {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
transport;
|
|
1410
1410
|
async extract(opts) {
|
|
1411
|
-
const { url, expectedType, enableLlm, waitUntil, timeout, delay, waitForSelector, blockResources, headers, userAgent, callbackUrl, ...rest } = opts;
|
|
1411
|
+
const { url, expectedType, enableLlm, waitUntil, timeout, delay, waitForSelector, blockResources, headers, userAgent, callbackUrl, cookies, bypassCache, cacheTtlSeconds, ...rest } = opts;
|
|
1412
1412
|
const body = { url, ...rest };
|
|
1413
1413
|
if (expectedType !== void 0) body.expected_type = expectedType;
|
|
1414
1414
|
if (enableLlm !== void 0) body.enable_llm = enableLlm;
|
|
@@ -1420,10 +1420,13 @@ var WebExtrator = class {
|
|
|
1420
1420
|
if (headers !== void 0) body.headers = headers;
|
|
1421
1421
|
if (userAgent !== void 0) body.user_agent = userAgent;
|
|
1422
1422
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
1423
|
+
if (cookies !== void 0) body.cookies = cookies;
|
|
1424
|
+
if (bypassCache !== void 0) body.bypass_cache = bypassCache;
|
|
1425
|
+
if (cacheTtlSeconds !== void 0) body.cache_ttl_seconds = cacheTtlSeconds;
|
|
1423
1426
|
return this.transport.request("POST", "/webextrator/extract", { json: body });
|
|
1424
1427
|
}
|
|
1425
1428
|
async render(opts) {
|
|
1426
|
-
const { url, waitUntil, timeout, delay, waitForSelector, blockResources, headers, userAgent, callbackUrl, ...rest } = opts;
|
|
1429
|
+
const { url, waitUntil, timeout, delay, waitForSelector, blockResources, headers, userAgent, callbackUrl, cookies, bypassCache, cacheTtlSeconds, ...rest } = opts;
|
|
1427
1430
|
const body = { url, ...rest };
|
|
1428
1431
|
if (waitUntil !== void 0) body.wait_until = waitUntil;
|
|
1429
1432
|
if (timeout !== void 0) body.timeout = timeout;
|
|
@@ -1433,6 +1436,9 @@ var WebExtrator = class {
|
|
|
1433
1436
|
if (headers !== void 0) body.headers = headers;
|
|
1434
1437
|
if (userAgent !== void 0) body.user_agent = userAgent;
|
|
1435
1438
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
1439
|
+
if (cookies !== void 0) body.cookies = cookies;
|
|
1440
|
+
if (bypassCache !== void 0) body.bypass_cache = bypassCache;
|
|
1441
|
+
if (cacheTtlSeconds !== void 0) body.cache_ttl_seconds = cacheTtlSeconds;
|
|
1436
1442
|
return this.transport.request("POST", "/webextrator/render", { json: body });
|
|
1437
1443
|
}
|
|
1438
1444
|
};
|
|
@@ -2034,13 +2040,13 @@ var Producer = class {
|
|
|
2034
2040
|
/** Producer AI music generation API, generates 1 song per request. */
|
|
2035
2041
|
async generate(options) {
|
|
2036
2042
|
const body = {};
|
|
2037
|
-
body["lyric"] = options.lyric;
|
|
2038
2043
|
body["action"] = options.action;
|
|
2039
|
-
body["prompt"] = options.prompt;
|
|
2040
2044
|
if (options.seed !== void 0) body["seed"] = options.seed;
|
|
2045
|
+
if (options.lyric !== void 0) body["lyric"] = options.lyric;
|
|
2041
2046
|
if (options.model !== void 0) body["model"] = options.model;
|
|
2042
2047
|
if (options.title !== void 0) body["title"] = options.title;
|
|
2043
|
-
|
|
2048
|
+
body["custom"] = options.custom ?? false;
|
|
2049
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
2044
2050
|
if (options.audioId !== void 0) body["audio_id"] = options.audioId;
|
|
2045
2051
|
body["weirdness"] = options.weirdness ?? false;
|
|
2046
2052
|
body["continue_at"] = options.continueAt ?? false;
|
|
@@ -2423,8 +2429,9 @@ var Suno = class {
|
|
|
2423
2429
|
async upload(options) {
|
|
2424
2430
|
const body = {};
|
|
2425
2431
|
body["audio_url"] = options.audioUrl;
|
|
2432
|
+
if (options.personaId !== void 0) body["persona_id"] = options.personaId;
|
|
2426
2433
|
for (const [key, value] of Object.entries(options)) {
|
|
2427
|
-
if (!["async", "audioUrl", "callbackUrl", "maxWait", "pollInterval", "wait"].includes(key) && value !== void 0) {
|
|
2434
|
+
if (!["async", "audioUrl", "callbackUrl", "maxWait", "personaId", "pollInterval", "wait"].includes(key) && value !== void 0) {
|
|
2428
2435
|
body[key] = value;
|
|
2429
2436
|
}
|
|
2430
2437
|
}
|
|
@@ -2449,6 +2456,18 @@ var Suno = class {
|
|
|
2449
2456
|
}
|
|
2450
2457
|
return handle;
|
|
2451
2458
|
}
|
|
2459
|
+
/** Check Suno audio availability. */
|
|
2460
|
+
async availability(options) {
|
|
2461
|
+
const body = {};
|
|
2462
|
+
body["audio_id"] = options.audioId;
|
|
2463
|
+
for (const [key, value] of Object.entries(options)) {
|
|
2464
|
+
if (!["async", "audioId", "callbackUrl", "maxWait", "pollInterval", "wait"].includes(key) && value !== void 0) {
|
|
2465
|
+
body[key] = value;
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2469
|
+
return await this.transport.request("POST", "/suno/availability", { json: body });
|
|
2470
|
+
}
|
|
2452
2471
|
};
|
|
2453
2472
|
|
|
2454
2473
|
// src/resources/providers/wan.ts
|