@spicyapi/sdk 0.1.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.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -0
  3. package/SECURITY.md +4 -0
  4. package/contracts/openapi.yaml +752 -0
  5. package/dist/src/docs/index.d.ts +10 -0
  6. package/dist/src/docs/index.d.ts.map +1 -0
  7. package/dist/src/docs/index.js +181 -0
  8. package/dist/src/docs/index.js.map +1 -0
  9. package/dist/src/generated/openapi.d.ts +888 -0
  10. package/dist/src/generated/openapi.d.ts.map +1 -0
  11. package/dist/src/generated/openapi.js +6 -0
  12. package/dist/src/generated/openapi.js.map +1 -0
  13. package/dist/src/index.d.ts +6 -0
  14. package/dist/src/index.d.ts.map +1 -0
  15. package/dist/src/index.js +5 -0
  16. package/dist/src/index.js.map +1 -0
  17. package/dist/src/openapi.d.ts +2 -0
  18. package/dist/src/openapi.d.ts.map +1 -0
  19. package/dist/src/openapi.js +18 -0
  20. package/dist/src/openapi.js.map +1 -0
  21. package/dist/src/sdk/client.d.ts +41 -0
  22. package/dist/src/sdk/client.d.ts.map +1 -0
  23. package/dist/src/sdk/client.js +407 -0
  24. package/dist/src/sdk/client.js.map +1 -0
  25. package/dist/src/sdk/errors.d.ts +36 -0
  26. package/dist/src/sdk/errors.d.ts.map +1 -0
  27. package/dist/src/sdk/errors.js +53 -0
  28. package/dist/src/sdk/errors.js.map +1 -0
  29. package/dist/src/sdk/index.d.ts +4 -0
  30. package/dist/src/sdk/index.d.ts.map +1 -0
  31. package/dist/src/sdk/index.js +3 -0
  32. package/dist/src/sdk/index.js.map +1 -0
  33. package/dist/src/sdk/types.d.ts +73 -0
  34. package/dist/src/sdk/types.d.ts.map +1 -0
  35. package/dist/src/sdk/types.js +2 -0
  36. package/dist/src/sdk/types.js.map +1 -0
  37. package/dist/src/webhooks/index.d.ts +28 -0
  38. package/dist/src/webhooks/index.d.ts.map +1 -0
  39. package/dist/src/webhooks/index.js +83 -0
  40. package/dist/src/webhooks/index.js.map +1 -0
  41. package/package.json +49 -0
@@ -0,0 +1,888 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export interface paths {
6
+ "/api/v1/jobs/createTask": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ get?: never;
14
+ put?: never;
15
+ /**
16
+ * Create an asynchronous generation task
17
+ * @description Validates the model input, reserves the estimated charge, chooses an
18
+ * available deployment, and creates a task in `queued` state. HTTP 202
19
+ * means the task was accepted; it does not mean generation has completed.
20
+ *
21
+ * An `Idempotency-Key` is optional but strongly recommended. For the same
22
+ * account **and the same API key**, repeating a key with the same normalized
23
+ * model, input, callback URL, and mature flag within 24 hours returns the
24
+ * original task and does not reserve funds twice. A sibling API key cannot
25
+ * replay the mapping: it receives `409 Conflict` without the original task
26
+ * ID. Reusing the key with different request semantics also returns
27
+ * `409 Conflict`. Callbacks are optional and are validated against
28
+ * private/loopback destinations before acceptance.
29
+ */
30
+ post: operations["createTask"];
31
+ delete?: never;
32
+ options?: never;
33
+ head?: never;
34
+ patch?: never;
35
+ trace?: never;
36
+ };
37
+ "/api/v1/jobs/recordInfo": {
38
+ parameters: {
39
+ query?: never;
40
+ header?: never;
41
+ path?: never;
42
+ cookie?: never;
43
+ };
44
+ /** Get a task created by the authenticated API key */
45
+ get: operations["recordInfo"];
46
+ put?: never;
47
+ post?: never;
48
+ delete?: never;
49
+ options?: never;
50
+ head?: never;
51
+ patch?: never;
52
+ trace?: never;
53
+ };
54
+ "/api/v1/jobs/retry": {
55
+ parameters: {
56
+ query?: never;
57
+ header?: never;
58
+ path?: never;
59
+ cookie?: never;
60
+ };
61
+ get?: never;
62
+ put?: never;
63
+ /**
64
+ * Create a new task from a failed or expired task
65
+ * @description The source terminal task is never modified. Current model schema,
66
+ * pricing, permissions, balance, and routing are evaluated again. An
67
+ * optional Idempotency-Key is scoped to the source task and retry action.
68
+ * The source task must have been created by the same API key; unknown,
69
+ * cross-account, and same-account cross-key task IDs all return 404.
70
+ */
71
+ post: operations["retryTask"];
72
+ delete?: never;
73
+ options?: never;
74
+ head?: never;
75
+ patch?: never;
76
+ trace?: never;
77
+ };
78
+ "/api/v1/models": {
79
+ parameters: {
80
+ query?: never;
81
+ header?: never;
82
+ path?: never;
83
+ cookie?: never;
84
+ };
85
+ /**
86
+ * List callable models and account-specific prices
87
+ * @description Returns all enabled models without pagination. The response is private
88
+ * because prices include the authenticated account's group multiplier.
89
+ * The server sends `Cache-Control: private, max-age=60`.
90
+ */
91
+ get: operations["listModels"];
92
+ put?: never;
93
+ post?: never;
94
+ delete?: never;
95
+ options?: never;
96
+ head?: never;
97
+ patch?: never;
98
+ trace?: never;
99
+ };
100
+ "/api/v1/models/{model}": {
101
+ parameters: {
102
+ query?: never;
103
+ header?: never;
104
+ path?: never;
105
+ cookie?: never;
106
+ };
107
+ /**
108
+ * Get one model, including its input JSON Schema
109
+ * @description `model` is the exact value used by `createTask.model` and may contain
110
+ * slashes. URL-encode embedded slashes when using clients that treat path
111
+ * parameters as one segment (for example `bytedance%2Fseedance-2-fast`).
112
+ */
113
+ get: operations["getModel"];
114
+ put?: never;
115
+ post?: never;
116
+ delete?: never;
117
+ options?: never;
118
+ head?: never;
119
+ patch?: never;
120
+ trace?: never;
121
+ };
122
+ "/api/v1/chat/credit": {
123
+ parameters: {
124
+ query?: never;
125
+ header?: never;
126
+ path?: never;
127
+ cookie?: never;
128
+ };
129
+ /** Get the account balance */
130
+ get: operations["getCreditBalance"];
131
+ put?: never;
132
+ post?: never;
133
+ delete?: never;
134
+ options?: never;
135
+ head?: never;
136
+ patch?: never;
137
+ trace?: never;
138
+ };
139
+ "/api/v1/common/upload-url": {
140
+ parameters: {
141
+ query?: never;
142
+ header?: never;
143
+ path?: never;
144
+ cookie?: never;
145
+ };
146
+ get?: never;
147
+ put?: never;
148
+ /**
149
+ * Create a presigned image upload ticket
150
+ * @description The server generates the object key. Upload the exact declared number of
151
+ * bytes with PUT and copy every returned header. Supported media types are
152
+ * JPEG, PNG, WebP, and GIF; the default maximum is 10 MiB. After PUT,
153
+ * call the file commit endpoint and use its spicy:// URI in task input.
154
+ */
155
+ post: operations["createUploadUrl"];
156
+ delete?: never;
157
+ options?: never;
158
+ head?: never;
159
+ patch?: never;
160
+ trace?: never;
161
+ };
162
+ "/api/v1/files/{fileId}/commit": {
163
+ parameters: {
164
+ query?: never;
165
+ header?: never;
166
+ path?: never;
167
+ cookie?: never;
168
+ };
169
+ get?: never;
170
+ put?: never;
171
+ /**
172
+ * Commit a completed direct upload
173
+ * @description Compares the stored byte count and media type with the ticket, checks
174
+ * the image signature, computes SHA-256, and copies the temporary object
175
+ * to an immutable private key. Only the returned spicy:// URI can be used
176
+ * in task input. Repeating a successful commit is idempotent.
177
+ */
178
+ post: operations["commitUploadedFile"];
179
+ delete?: never;
180
+ options?: never;
181
+ head?: never;
182
+ patch?: never;
183
+ trace?: never;
184
+ };
185
+ "/api/v1/common/download-url": {
186
+ parameters: {
187
+ query?: never;
188
+ header?: never;
189
+ path?: never;
190
+ cookie?: never;
191
+ };
192
+ get?: never;
193
+ put?: never;
194
+ /**
195
+ * Create a short-lived task output download URL
196
+ * @description The server verifies both task ownership and that the requested key is an
197
+ * output of that task. Leave `key` empty to select the first output.
198
+ */
199
+ post: operations["createDownloadUrl"];
200
+ delete?: never;
201
+ options?: never;
202
+ head?: never;
203
+ patch?: never;
204
+ trace?: never;
205
+ };
206
+ }
207
+ export type webhooks = Record<string, never>;
208
+ export interface components {
209
+ schemas: {
210
+ EnvelopeBase: {
211
+ code: number;
212
+ msg: string;
213
+ /** @description Correlation identifier. Include it in support requests. */
214
+ request_id: string;
215
+ };
216
+ ErrorEnvelope: components["schemas"]["EnvelopeBase"] & {
217
+ /** @enum {integer} */
218
+ code?: 400 | 401 | 40201 | 40202 | 403 | 40301 | 40302 | 40303 | 404 | 409 | 413 | 429 | 500 | 50301;
219
+ msg?: string;
220
+ };
221
+ CreateTaskRequest: {
222
+ /** @description Exact `model` value from the model catalog. */
223
+ model: string;
224
+ /** @description Validated against the selected model's `inputSchema`. */
225
+ input: {
226
+ [key: string]: unknown;
227
+ };
228
+ /**
229
+ * Format: uri
230
+ * @description Optional public HTTP(S) endpoint for terminal task delivery.
231
+ */
232
+ callBackUrl?: string;
233
+ /**
234
+ * @description Optional execution metadata passed through to the selected model. The platform applies no account, API-key, model-capability, channel-capability, or content-preflight gate to this field.
235
+ * @default false
236
+ */
237
+ mature: boolean;
238
+ };
239
+ CreateTaskResponse: {
240
+ taskId: string;
241
+ /**
242
+ * @description `queued` for a new submission; an idempotent replay reports the original task's current state.
243
+ * @enum {string}
244
+ */
245
+ state: "queued" | "running" | "succeeded" | "failed" | "canceled" | "expired";
246
+ /** @description Funds held when the task is accepted and the maximum amount charged for that task. Unused funds are released; provider overage is absorbed by the platform. */
247
+ estimatedCost: components["schemas"]["USDString"];
248
+ };
249
+ TaskActionRequest: {
250
+ taskId: string;
251
+ };
252
+ RetryTaskResponse: components["schemas"]["CreateTaskResponse"] & {
253
+ sourceTaskId: string;
254
+ };
255
+ RetryTaskEnvelope: components["schemas"]["EnvelopeBase"] & {
256
+ /** @constant */
257
+ code?: 200;
258
+ /** @constant */
259
+ msg?: "success";
260
+ data: components["schemas"]["RetryTaskResponse"];
261
+ };
262
+ CreateTaskEnvelope: components["schemas"]["EnvelopeBase"] & {
263
+ /** @constant */
264
+ code?: 200;
265
+ /** @constant */
266
+ msg?: "success";
267
+ data: components["schemas"]["CreateTaskResponse"];
268
+ };
269
+ TaskRecord: {
270
+ taskId: string;
271
+ /** @description Present when this task was created by explicit retry. */
272
+ sourceTaskId?: string;
273
+ model: string;
274
+ /** @enum {string} */
275
+ state: "queued" | "running" | "succeeded" | "failed" | "canceled" | "expired";
276
+ /** @description Normalized model input. Omitted after retention redaction. */
277
+ input?: {
278
+ [key: string]: unknown;
279
+ };
280
+ /** @description Normalized model output when available. Omitted after retention redaction. */
281
+ output?: {
282
+ [key: string]: unknown;
283
+ };
284
+ errorCode?: string;
285
+ errorMessage?: string;
286
+ cost: components["schemas"]["USDString"];
287
+ /** @description When false, `cost` is the held estimate. On success the final charge is capped at that hold; unused funds are released. Failed or expired tasks release the hold in full. */
288
+ settled: boolean;
289
+ /** Format: date-time */
290
+ createdAt: string;
291
+ /** Format: date-time */
292
+ completedAt?: string;
293
+ };
294
+ TaskRecordEnvelope: components["schemas"]["EnvelopeBase"] & {
295
+ /** @constant */
296
+ code?: 200;
297
+ /** @constant */
298
+ msg?: "success";
299
+ data: components["schemas"]["TaskRecord"];
300
+ };
301
+ /**
302
+ * @deprecated
303
+ * @description Version 1 compatibility callback. New integrations must use version 2.
304
+ */
305
+ LegacyWebhookPayload: {
306
+ task_id: string;
307
+ model: string;
308
+ /** @enum {string} */
309
+ state: "queued" | "running" | "succeeded" | "failed" | "canceled" | "expired";
310
+ output?: {
311
+ [key: string]: unknown;
312
+ };
313
+ error_code?: string;
314
+ error_message?: string;
315
+ cost: components["schemas"]["USDString"];
316
+ /** Format: date-time */
317
+ created_at: string;
318
+ };
319
+ Balance: {
320
+ available: components["schemas"]["USDString"];
321
+ held: components["schemas"]["USDString"];
322
+ total: components["schemas"]["USDString"];
323
+ };
324
+ BalanceEnvelope: components["schemas"]["EnvelopeBase"] & {
325
+ /** @constant */
326
+ code?: 200;
327
+ /** @constant */
328
+ msg?: "success";
329
+ data: components["schemas"]["Balance"];
330
+ };
331
+ APIModelPrice: {
332
+ /** @description Value used by `input.resolution`; empty when the model has one price tier. */
333
+ variant: string;
334
+ /** @enum {string} */
335
+ unit: "per_image" | "per_second" | "per_request" | "per_1k_tokens";
336
+ price: components["schemas"]["USDString"];
337
+ /** @constant */
338
+ currency: "USD";
339
+ };
340
+ APIModel: {
341
+ model: string;
342
+ /** @description Stable product-family identifier; endpoint variants are listed in `tasks` and expressed by `inputSchema`. */
343
+ family: string;
344
+ displayName: string;
345
+ provider: string;
346
+ /** @enum {string} */
347
+ modality: "image" | "video" | "audio" | "text";
348
+ tasks: string[];
349
+ async: boolean;
350
+ /** @description Informational model-creator capability metadata only. It does not participate in routing, authorization, or request rejection. */
351
+ mature: boolean;
352
+ /**
353
+ * @description Informational model-creator policy metadata only. It does not participate in routing, authorization, or request rejection.
354
+ * @enum {string}
355
+ */
356
+ policyTier: "unrestricted" | "borderline" | "unspecified";
357
+ /** @description Absolute platform execution deadline before timeout/refund; not media output duration. */
358
+ taskTimeoutSeconds: number;
359
+ /** @description Maximum `input.duration` accepted by the model schema; omitted when the model has no declared duration maximum. */
360
+ maxOutputDurationSeconds?: number;
361
+ enabled: boolean;
362
+ available: boolean;
363
+ quantityField: string;
364
+ pricing: components["schemas"]["APIModelPrice"][];
365
+ startingPrice?: components["schemas"]["APIModelPrice"];
366
+ /** @description JSON Schema draft 2020-12 used by `createTask.input` validation. */
367
+ inputSchema?: {
368
+ [key: string]: unknown;
369
+ };
370
+ /** @description Provider/model version label used to detect catalog changes. */
371
+ version: string;
372
+ /** @enum {string} */
373
+ availability: "planned" | "available" | "preview" | "maintenance";
374
+ /** @description Closed capability and licensing vocabulary; clients should ignore unknown future IDs. */
375
+ badges: ("commercial_use" | "no_watermark" | "commercial_restricted" | "reference_input" | "audio_output" | "streaming" | "fast_tier" | "high_resolution" | "long_context" | "mature_capable" | "policy_unrestricted" | "policy_borderline")[];
376
+ /** @description Curated model identifiers suitable for alternatives or workflow steps. */
377
+ relatedModels: string[];
378
+ /** @description Inputs validated against this model's current input schema. */
379
+ examples?: components["schemas"]["APIModelExample"][];
380
+ /** Format: date-time */
381
+ updatedAt: string;
382
+ };
383
+ APIModelExample: {
384
+ id: string;
385
+ input: {
386
+ [key: string]: unknown;
387
+ };
388
+ sortWeight: number;
389
+ };
390
+ APIModelList: {
391
+ total: number;
392
+ items: components["schemas"]["APIModel"][];
393
+ };
394
+ ModelEnvelope: components["schemas"]["EnvelopeBase"] & {
395
+ /** @constant */
396
+ code?: 200;
397
+ /** @constant */
398
+ msg?: "success";
399
+ data: components["schemas"]["APIModel"];
400
+ };
401
+ ModelListEnvelope: components["schemas"]["EnvelopeBase"] & {
402
+ /** @constant */
403
+ code?: 200;
404
+ /** @constant */
405
+ msg?: "success";
406
+ data: components["schemas"]["APIModelList"];
407
+ };
408
+ UploadURLRequest: {
409
+ /** @enum {string} */
410
+ contentType: "image/jpeg" | "image/png" | "image/webp" | "image/gif";
411
+ bytes: number;
412
+ };
413
+ UploadURLResponse: {
414
+ fileId: string;
415
+ /** @description Compatibility alias for the final URI; unusable until commit succeeds. */
416
+ key: string;
417
+ /** Format: uri */
418
+ uploadUrl: string;
419
+ /** @constant */
420
+ method: "PUT";
421
+ headers: {
422
+ [key: string]: string;
423
+ };
424
+ /** Format: date-time */
425
+ expiresAt: string;
426
+ maxBytes: number;
427
+ };
428
+ UploadURLEnvelope: components["schemas"]["EnvelopeBase"] & {
429
+ /** @constant */
430
+ code?: 200;
431
+ /** @constant */
432
+ msg?: "success";
433
+ data: components["schemas"]["UploadURLResponse"];
434
+ };
435
+ FileCommitResponse: {
436
+ fileId: string;
437
+ /** @constant */
438
+ status: "ready";
439
+ bytes: number;
440
+ /** @enum {string} */
441
+ contentType: "image/jpeg" | "image/png" | "image/webp" | "image/gif";
442
+ sha256: string;
443
+ uri: string;
444
+ /** Format: date-time */
445
+ expiresAt: string;
446
+ };
447
+ FileCommitEnvelope: components["schemas"]["EnvelopeBase"] & {
448
+ /** @constant */
449
+ code?: 200;
450
+ /** @constant */
451
+ msg?: "success";
452
+ data: components["schemas"]["FileCommitResponse"];
453
+ };
454
+ DownloadURLRequest: {
455
+ taskId: string;
456
+ /** @description Optional output key; empty selects the first output. */
457
+ key?: string;
458
+ };
459
+ DownloadURLResponse: {
460
+ key: string;
461
+ /** Format: uri */
462
+ url: string;
463
+ /** Format: date-time */
464
+ expiresAt: string;
465
+ };
466
+ DownloadURLEnvelope: components["schemas"]["EnvelopeBase"] & {
467
+ /** @constant */
468
+ code?: 200;
469
+ /** @constant */
470
+ msg?: "success";
471
+ data: components["schemas"]["DownloadURLResponse"];
472
+ };
473
+ /** @description Decimal USD amount encoded as a string to avoid binary floating-point loss. */
474
+ USDString: string;
475
+ };
476
+ responses: {
477
+ /** @description Invalid JSON, query, callback URL, model input, or media declaration. */
478
+ BadRequest: {
479
+ headers: {
480
+ [name: string]: unknown;
481
+ };
482
+ content: {
483
+ "application/json": components["schemas"]["ErrorEnvelope"];
484
+ };
485
+ };
486
+ /** @description Missing, malformed, expired, revoked, or otherwise invalid API key. */
487
+ Unauthorized: {
488
+ headers: {
489
+ [name: string]: unknown;
490
+ };
491
+ content: {
492
+ "application/json": components["schemas"]["ErrorEnvelope"];
493
+ };
494
+ };
495
+ /** @description Insufficient balance (`40201`) or a spend cap was reached (`40202`). */
496
+ PaymentRequired: {
497
+ headers: {
498
+ [name: string]: unknown;
499
+ };
500
+ content: {
501
+ "application/json": components["schemas"]["ErrorEnvelope"];
502
+ };
503
+ };
504
+ /** @description Account, model, API-key, IP, or region authorization failed. */
505
+ Forbidden: {
506
+ headers: {
507
+ [name: string]: unknown;
508
+ };
509
+ content: {
510
+ "application/json": components["schemas"]["ErrorEnvelope"];
511
+ };
512
+ };
513
+ /** @description Resource does not exist or is not visible to this account and API key. These cases are intentionally indistinguishable. */
514
+ NotFound: {
515
+ headers: {
516
+ [name: string]: unknown;
517
+ };
518
+ content: {
519
+ "application/json": components["schemas"]["ErrorEnvelope"];
520
+ };
521
+ };
522
+ /** @description Idempotency or media-transfer state conflicts with this request. */
523
+ Conflict: {
524
+ headers: {
525
+ [name: string]: unknown;
526
+ };
527
+ content: {
528
+ "application/json": components["schemas"]["ErrorEnvelope"];
529
+ };
530
+ };
531
+ /** @description Request body exceeds the server's accepted size limit. */
532
+ PayloadTooLarge: {
533
+ headers: {
534
+ [name: string]: unknown;
535
+ };
536
+ content: {
537
+ "application/json": components["schemas"]["ErrorEnvelope"];
538
+ };
539
+ };
540
+ /** @description Account-level request limit exceeded. */
541
+ RateLimited: {
542
+ headers: {
543
+ "X-RateLimit-Limit": components["headers"]["RateLimitLimit"];
544
+ "X-RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
545
+ "Retry-After": components["headers"]["RetryAfter"];
546
+ [name: string]: unknown;
547
+ };
548
+ content: {
549
+ "application/json": components["schemas"]["ErrorEnvelope"];
550
+ };
551
+ };
552
+ /** @description Internal failure. Details are not exposed; report `request_id` to support. */
553
+ ServerError: {
554
+ headers: {
555
+ [name: string]: unknown;
556
+ };
557
+ content: {
558
+ "application/json": components["schemas"]["ErrorEnvelope"];
559
+ };
560
+ };
561
+ /** @description No usable deployment or effective customer price exists for the selected model (`50301`). */
562
+ Unavailable: {
563
+ headers: {
564
+ [name: string]: unknown;
565
+ };
566
+ content: {
567
+ "application/json": components["schemas"]["ErrorEnvelope"];
568
+ };
569
+ };
570
+ };
571
+ parameters: {
572
+ /** @description Stable key for one logical task submission; retained for 24 hours per account and bound to both the submitting API key and normalized request fingerprint. A sibling key receives 409 without the original task ID. */
573
+ IdempotencyKey: string;
574
+ };
575
+ requestBodies: never;
576
+ headers: {
577
+ /** @description Capacity of the active account-level rate-limit window. */
578
+ RateLimitLimit: number;
579
+ /** @description Remaining requests in the active window. */
580
+ RateLimitRemaining: number;
581
+ /** @description Seconds to wait before retrying. */
582
+ RetryAfter: number;
583
+ };
584
+ pathItems: never;
585
+ }
586
+ export type $defs = Record<string, never>;
587
+ export interface operations {
588
+ createTask: {
589
+ parameters: {
590
+ query?: never;
591
+ header?: {
592
+ /** @description Stable key for one logical task submission; retained for 24 hours per account and bound to both the submitting API key and normalized request fingerprint. A sibling key receives 409 without the original task ID. */
593
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
594
+ };
595
+ path?: never;
596
+ cookie?: never;
597
+ };
598
+ requestBody: {
599
+ content: {
600
+ "application/json": components["schemas"]["CreateTaskRequest"];
601
+ };
602
+ };
603
+ responses: {
604
+ /** @description A newly accepted task is returned in `queued` state. A same-key idempotent replay returns the original task in its current state and does not create another hold. The hold is not a charge. */
605
+ 202: {
606
+ headers: {
607
+ /** @description Relative URL of the task status resource. */
608
+ Location?: string;
609
+ "Retry-After": components["headers"]["RetryAfter"];
610
+ /** @description Task submissions contain caller-specific state and must not be cached. */
611
+ "Cache-Control"?: "no-store";
612
+ "X-RateLimit-Limit": components["headers"]["RateLimitLimit"];
613
+ "X-RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
614
+ [name: string]: unknown;
615
+ };
616
+ content: {
617
+ "application/json": components["schemas"]["CreateTaskEnvelope"];
618
+ };
619
+ };
620
+ 400: components["responses"]["BadRequest"];
621
+ 401: components["responses"]["Unauthorized"];
622
+ 402: components["responses"]["PaymentRequired"];
623
+ 403: components["responses"]["Forbidden"];
624
+ 409: components["responses"]["Conflict"];
625
+ 413: components["responses"]["PayloadTooLarge"];
626
+ 429: components["responses"]["RateLimited"];
627
+ 500: components["responses"]["ServerError"];
628
+ 503: components["responses"]["Unavailable"];
629
+ };
630
+ };
631
+ recordInfo: {
632
+ parameters: {
633
+ query: {
634
+ taskId: string;
635
+ };
636
+ header?: never;
637
+ path?: never;
638
+ cookie?: never;
639
+ };
640
+ requestBody?: never;
641
+ responses: {
642
+ /** @description Current task record. Terminal and non-terminal states share this shape. */
643
+ 200: {
644
+ headers: {
645
+ /** @description Task state is caller-specific and changes asynchronously. */
646
+ "Cache-Control"?: "no-store";
647
+ [name: string]: unknown;
648
+ };
649
+ content: {
650
+ "application/json": components["schemas"]["TaskRecordEnvelope"];
651
+ };
652
+ };
653
+ 400: components["responses"]["BadRequest"];
654
+ 401: components["responses"]["Unauthorized"];
655
+ 403: components["responses"]["Forbidden"];
656
+ /** @description Task does not exist or belongs to another account or API key; these cases are indistinguishable. */
657
+ 404: {
658
+ headers: {
659
+ "Cache-Control"?: "no-store";
660
+ [name: string]: unknown;
661
+ };
662
+ content: {
663
+ "application/json": components["schemas"]["ErrorEnvelope"];
664
+ };
665
+ };
666
+ 429: components["responses"]["RateLimited"];
667
+ 500: components["responses"]["ServerError"];
668
+ };
669
+ };
670
+ retryTask: {
671
+ parameters: {
672
+ query?: never;
673
+ header?: {
674
+ /** @description Stable key for one logical task submission; retained for 24 hours per account and bound to both the submitting API key and normalized request fingerprint. A sibling key receives 409 without the original task ID. */
675
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
676
+ };
677
+ path?: never;
678
+ cookie?: never;
679
+ };
680
+ requestBody: {
681
+ content: {
682
+ "application/json": components["schemas"]["TaskActionRequest"];
683
+ };
684
+ };
685
+ responses: {
686
+ /** @description A newly created retry task is returned in `queued` state. An idempotent replay returns that retry task in its current state. */
687
+ 200: {
688
+ headers: {
689
+ [name: string]: unknown;
690
+ };
691
+ content: {
692
+ "application/json": components["schemas"]["RetryTaskEnvelope"];
693
+ };
694
+ };
695
+ 400: components["responses"]["BadRequest"];
696
+ 401: components["responses"]["Unauthorized"];
697
+ 402: components["responses"]["PaymentRequired"];
698
+ 403: components["responses"]["Forbidden"];
699
+ 404: components["responses"]["NotFound"];
700
+ 409: components["responses"]["Conflict"];
701
+ 413: components["responses"]["PayloadTooLarge"];
702
+ 429: components["responses"]["RateLimited"];
703
+ 500: components["responses"]["ServerError"];
704
+ 503: components["responses"]["Unavailable"];
705
+ };
706
+ };
707
+ listModels: {
708
+ parameters: {
709
+ query?: {
710
+ modality?: "image" | "video" | "audio" | "text";
711
+ provider?: string;
712
+ /** @description Exact supported task, for example `text-to-image`. */
713
+ task?: string;
714
+ search?: string;
715
+ /** @description Include each model's input JSON Schema when `true` or `1`. */
716
+ includeSchema?: boolean | (0 | 1);
717
+ /** @description Include validated example inputs when `true` or `1`. */
718
+ includeExamples?: boolean | (0 | 1);
719
+ };
720
+ header?: never;
721
+ path?: never;
722
+ cookie?: never;
723
+ };
724
+ requestBody?: never;
725
+ responses: {
726
+ /** @description Model list. */
727
+ 200: {
728
+ headers: {
729
+ "Cache-Control"?: "private, max-age=60";
730
+ [name: string]: unknown;
731
+ };
732
+ content: {
733
+ "application/json": components["schemas"]["ModelListEnvelope"];
734
+ };
735
+ };
736
+ 400: components["responses"]["BadRequest"];
737
+ 401: components["responses"]["Unauthorized"];
738
+ 403: components["responses"]["Forbidden"];
739
+ 429: components["responses"]["RateLimited"];
740
+ 500: components["responses"]["ServerError"];
741
+ };
742
+ };
743
+ getModel: {
744
+ parameters: {
745
+ query?: never;
746
+ header?: never;
747
+ path: {
748
+ model: string;
749
+ };
750
+ cookie?: never;
751
+ };
752
+ requestBody?: never;
753
+ responses: {
754
+ /** @description Complete model record. */
755
+ 200: {
756
+ headers: {
757
+ "Cache-Control"?: "private, max-age=60";
758
+ [name: string]: unknown;
759
+ };
760
+ content: {
761
+ "application/json": components["schemas"]["ModelEnvelope"];
762
+ };
763
+ };
764
+ 400: components["responses"]["BadRequest"];
765
+ 401: components["responses"]["Unauthorized"];
766
+ 403: components["responses"]["Forbidden"];
767
+ 404: components["responses"]["NotFound"];
768
+ 429: components["responses"]["RateLimited"];
769
+ 500: components["responses"]["ServerError"];
770
+ };
771
+ };
772
+ getCreditBalance: {
773
+ parameters: {
774
+ query?: never;
775
+ header?: never;
776
+ path?: never;
777
+ cookie?: never;
778
+ };
779
+ requestBody?: never;
780
+ responses: {
781
+ /** @description Available, held, and total balance in USD decimal strings. */
782
+ 200: {
783
+ headers: {
784
+ [name: string]: unknown;
785
+ };
786
+ content: {
787
+ "application/json": components["schemas"]["BalanceEnvelope"];
788
+ };
789
+ };
790
+ 401: components["responses"]["Unauthorized"];
791
+ 403: components["responses"]["Forbidden"];
792
+ 429: components["responses"]["RateLimited"];
793
+ 500: components["responses"]["ServerError"];
794
+ };
795
+ };
796
+ createUploadUrl: {
797
+ parameters: {
798
+ query?: never;
799
+ header?: never;
800
+ path?: never;
801
+ cookie?: never;
802
+ };
803
+ requestBody: {
804
+ content: {
805
+ "application/json": components["schemas"]["UploadURLRequest"];
806
+ };
807
+ };
808
+ responses: {
809
+ /** @description Presigned upload ticket. */
810
+ 200: {
811
+ headers: {
812
+ [name: string]: unknown;
813
+ };
814
+ content: {
815
+ "application/json": components["schemas"]["UploadURLEnvelope"];
816
+ };
817
+ };
818
+ 400: components["responses"]["BadRequest"];
819
+ 401: components["responses"]["Unauthorized"];
820
+ 403: components["responses"]["Forbidden"];
821
+ 413: components["responses"]["PayloadTooLarge"];
822
+ 429: components["responses"]["RateLimited"];
823
+ 500: components["responses"]["ServerError"];
824
+ };
825
+ };
826
+ commitUploadedFile: {
827
+ parameters: {
828
+ query?: never;
829
+ header?: never;
830
+ path: {
831
+ fileId: string;
832
+ };
833
+ cookie?: never;
834
+ };
835
+ requestBody?: never;
836
+ responses: {
837
+ /** @description Ready tenant-scoped file reference. */
838
+ 200: {
839
+ headers: {
840
+ [name: string]: unknown;
841
+ };
842
+ content: {
843
+ "application/json": components["schemas"]["FileCommitEnvelope"];
844
+ };
845
+ };
846
+ 400: components["responses"]["BadRequest"];
847
+ 401: components["responses"]["Unauthorized"];
848
+ 403: components["responses"]["Forbidden"];
849
+ 404: components["responses"]["NotFound"];
850
+ 409: components["responses"]["Conflict"];
851
+ 429: components["responses"]["RateLimited"];
852
+ 500: components["responses"]["ServerError"];
853
+ };
854
+ };
855
+ createDownloadUrl: {
856
+ parameters: {
857
+ query?: never;
858
+ header?: never;
859
+ path?: never;
860
+ cookie?: never;
861
+ };
862
+ requestBody: {
863
+ content: {
864
+ "application/json": components["schemas"]["DownloadURLRequest"];
865
+ };
866
+ };
867
+ responses: {
868
+ /** @description Short-lived download ticket. */
869
+ 200: {
870
+ headers: {
871
+ [name: string]: unknown;
872
+ };
873
+ content: {
874
+ "application/json": components["schemas"]["DownloadURLEnvelope"];
875
+ };
876
+ };
877
+ 400: components["responses"]["BadRequest"];
878
+ 401: components["responses"]["Unauthorized"];
879
+ 403: components["responses"]["Forbidden"];
880
+ 404: components["responses"]["NotFound"];
881
+ 409: components["responses"]["Conflict"];
882
+ 413: components["responses"]["PayloadTooLarge"];
883
+ 429: components["responses"]["RateLimited"];
884
+ 500: components["responses"]["ServerError"];
885
+ };
886
+ };
887
+ }
888
+ //# sourceMappingURL=openapi.d.ts.map