@spicyapi/sdk 0.3.0 → 0.5.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.
@@ -94,7 +94,7 @@ export interface paths {
94
94
  * as a Server-Sent Events stream. Each event is a `data:` line carrying one
95
95
  * JSON chunk; the stream ends with `data: [DONE]`.
96
96
  *
97
- * The hold is settled when the stream completes. If the upstream call fails
97
+ * The hold is settled when the stream completes. If generation fails
98
98
  * before the first event, the response is a normal JSON error and the hold is
99
99
  * released. If it fails mid-stream the connection is terminated with an
100
100
  * `error` event and the hold is still released — a truncated answer is never
@@ -123,7 +123,7 @@ export interface paths {
123
123
  /**
124
124
  * Create a new task from a failed or expired task
125
125
  * @description The source terminal task is never modified. Current model schema,
126
- * pricing, permissions, balance, and routing are evaluated again. An
126
+ * pricing, permissions, balance, and availability are evaluated again. An
127
127
  * optional Idempotency-Key is scoped to the source task and retry action.
128
128
  * The source task must have been created by the same API key; unknown,
129
129
  * cross-account, and same-account cross-key task IDs all return 404.
@@ -135,6 +135,48 @@ export interface paths {
135
135
  patch?: never;
136
136
  trace?: never;
137
137
  };
138
+ "/api/v1/jobs/purge": {
139
+ parameters: {
140
+ query?: never;
141
+ header?: never;
142
+ path?: never;
143
+ cookie?: never;
144
+ };
145
+ get?: never;
146
+ put?: never;
147
+ /**
148
+ * Destroy the stored content of a finished task
149
+ * @description Removes the task's generated media objects, its result payload, and the
150
+ * stored request text including the prompt.
151
+ *
152
+ * **Billing evidence is never touched.** The ledger, the charged amount,
153
+ * the model identifier, the state, the timestamps and the request_id all
154
+ * remain, so the task stays fully auditable in billing. What is destroyed
155
+ * is the content, not the spend record; the response repeats this as
156
+ * `billingRetained`.
157
+ *
158
+ * Only a finished task can be destroyed; a task that is still queued or
159
+ * running returns 400. Its outputs have not landed yet, and removing half
160
+ * of them is worse than removing none. An accepted generation task cannot
161
+ * be stopped, so the only thing to do is wait for it to reach a terminal
162
+ * state and call this endpoint then.
163
+ *
164
+ * The call is idempotent by `taskId`: destroying an already destroyed task
165
+ * returns 200 with the original `purgedAt`, so a client may safely retry
166
+ * after a timeout. No `Idempotency-Key` is needed.
167
+ *
168
+ * Media objects are removed by a background sweep within about a minute,
169
+ * so `mediaDeletionPending` can be true while `contentState` is already
170
+ * `purged`. Deleting them inline would let one undeletable object block the
171
+ * whole request.
172
+ */
173
+ post: operations["purgeTask"];
174
+ delete?: never;
175
+ options?: never;
176
+ head?: never;
177
+ patch?: never;
178
+ trace?: never;
179
+ };
138
180
  "/api/v1/models": {
139
181
  parameters: {
140
182
  query?: never;
@@ -191,7 +233,7 @@ export interface paths {
191
233
  * @description Returns only visible tasks created by this API key and its account,
192
234
  * newest first by createdAt and taskId. The list contains metadata only;
193
235
  * use recordInfo for a selected task's result. No input, output, signed
194
- * media URL, or execution-channel information is included.
236
+ * media URL, or internal processing detail is included.
195
237
  * Dates form a UTC half-open interval [from,to), up to 92 days.
196
238
  * Default to is tomorrow in UTC; omitted from is seven days before to.
197
239
  * Keep all filters, including explicit from/to dates, unchanged while
@@ -248,7 +290,7 @@ export interface paths {
248
290
  path?: never;
249
291
  cookie?: never;
250
292
  };
251
- /** Get the account balance */
293
+ /** Get net balance, promotional grants, and approved credit */
252
294
  get: operations["getCreditBalance"];
253
295
  put?: never;
254
296
  post?: never;
@@ -272,7 +314,7 @@ export interface paths {
272
314
  * @description The server generates the object key. Upload the exact declared number of
273
315
  * bytes with PUT and copy every returned header. Supported media types are
274
316
  * JPEG, PNG, WebP and GIF images (10 MiB), or MP4/WebM video and
275
- * MP3/WAV audio (100 MiB, at most 600 seconds). Audio/video commit verifies
317
+ * MP3/WAV audio (90 MiB, at most 600 seconds). Audio/video commit verifies
276
318
  * format and measurable duration; it does not inspect adult content. After PUT,
277
319
  * call the file commit endpoint and use its spicy:// URI in task input.
278
320
  */
@@ -340,8 +382,8 @@ export interface paths {
340
382
  * List callable models in the OpenAI `model` list shape
341
383
  * @description Returns every model that can be called right now. `id` is the SpicyAPI
342
384
  * model identifier accepted by every `/v1` and `/api/v1` operation;
343
- * `owned_by` is the model publisher (for example a research lab), never
344
- * an execution supplier. Pricing is not included; use `/api/v1/models`.
385
+ * `owned_by` is the model publisher (for example a research lab).
386
+ * Pricing is not included; use `/api/v1/models`.
345
387
  */
346
388
  get: operations["listOpenAIModels"];
347
389
  put?: never;
@@ -443,6 +485,61 @@ export interface paths {
443
485
  patch?: never;
444
486
  trace?: never;
445
487
  };
488
+ "/v1beta/models/{model}:generateContent": {
489
+ parameters: {
490
+ query?: never;
491
+ header?: never;
492
+ path?: never;
493
+ cookie?: never;
494
+ };
495
+ get?: never;
496
+ put?: never;
497
+ /**
498
+ * Google Gemini generateContent on a SpicyAPI text model
499
+ * @description Accepts a Google Gemini `generateContent` request (`contents` with
500
+ * text / inlineData / functionCall / functionResponse parts,
501
+ * `systemInstruction`, `tools.functionDeclarations`, `toolConfig`,
502
+ * `generationConfig` such as `temperature`, `topP`, `maxOutputTokens`,
503
+ * `stopSequences`, `responseMimeType`, `responseSchema`,
504
+ * `thinkingConfig`). `{model}` is a SpicyAPI text model identifier from
505
+ * `/v1/models` and may contain a slash (for example
506
+ * `google/gemini-3-flash-preview`). Validation, pricing and availability are
507
+ * identical to `/v1/chat/completions`. The response is one
508
+ * `GenerateContentResponse`. Errors use the Google
509
+ * `{error:{code,message,status}}` shape.
510
+ */
511
+ post: operations["geminiGenerateContent"];
512
+ delete?: never;
513
+ options?: never;
514
+ head?: never;
515
+ patch?: never;
516
+ trace?: never;
517
+ };
518
+ "/v1beta/models/{model}:streamGenerateContent": {
519
+ parameters: {
520
+ query?: never;
521
+ header?: never;
522
+ path?: never;
523
+ cookie?: never;
524
+ };
525
+ get?: never;
526
+ put?: never;
527
+ /**
528
+ * Google Gemini streamGenerateContent on a SpicyAPI text model
529
+ * @description Same request as `generateContent`. With `?alt=sse` (what the Google
530
+ * GenAI SDKs send) the response is a server-sent event stream where each
531
+ * `data:` line is one `GenerateContentResponse`; the final one carries
532
+ * `finishReason` and `usageMetadata`. There is no `[DONE]` sentinel.
533
+ * Without `alt=sse` the response is a JSON array of
534
+ * `GenerateContentResponse` objects written progressively.
535
+ */
536
+ post: operations["geminiStreamGenerateContent"];
537
+ delete?: never;
538
+ options?: never;
539
+ head?: never;
540
+ patch?: never;
541
+ trace?: never;
542
+ };
446
543
  "/v1/videos": {
447
544
  parameters: {
448
545
  query?: never;
@@ -521,6 +618,53 @@ export interface paths {
521
618
  export type webhooks = Record<string, never>;
522
619
  export interface components {
523
620
  schemas: {
621
+ FundingGrantItem: {
622
+ id: string;
623
+ name: string;
624
+ amountUsd: string;
625
+ availableUsd: string;
626
+ heldUsd: string;
627
+ spentUsd: string;
628
+ status: string;
629
+ /** Format: date-time */
630
+ startsAt: string;
631
+ /** Format: date-time */
632
+ expiresAt?: string | null;
633
+ /** @description Empty means all models. */
634
+ modelSlugs: string[];
635
+ customerMemo: string;
636
+ /** Format: date-time */
637
+ createdAt: string;
638
+ };
639
+ CreditFacilityItem: {
640
+ enabled: boolean;
641
+ /** @description Approved ceiling */
642
+ limitUsd: string;
643
+ availableUsd: string;
644
+ /** @description Outstanding settled principal. */
645
+ usedUsd: string;
646
+ /** @description Credit reserved for accepted tasks. */
647
+ heldUsd: string;
648
+ /** Format: date-time */
649
+ expiresAt?: string | null;
650
+ status: string;
651
+ /** Format: int64 */
652
+ version: number;
653
+ };
654
+ FundingOverview: {
655
+ /** @description Net wallet available balance; may be negative for approved credit consumption or external payment recovery. */
656
+ balanceUsd: string;
657
+ heldUsd: string;
658
+ /** @description Unrestricted prepaid or legacy available funds. */
659
+ prepaidAvailableUsd: string;
660
+ /** @description Active available grants; model applicability is checked at task admission. */
661
+ grantAvailableUsd: string;
662
+ /** @description External payment recovery shortfall that cannot be covered by grants or credit. */
663
+ cashShortfallUsd: string;
664
+ credit: components["schemas"]["CreditFacilityItem"];
665
+ grants: components["schemas"]["FundingGrantItem"][];
666
+ grantsHasMore: boolean;
667
+ };
524
668
  EnvelopeBase: {
525
669
  code: number;
526
670
  msg: string;
@@ -530,6 +674,7 @@ export interface components {
530
674
  ErrorEnvelope: components["schemas"]["EnvelopeBase"] & {
531
675
  /** @enum {integer} */
532
676
  code?: 400 | 401 | 40201 | 40202 | 403 | 40301 | 40302 | 40303 | 404 | 409 | 40901 | 413 | 429 | 500 | 50301;
677
+ /** @description Human-readable explanation, English unless `Accept-Language` or the account's API error language selects another supported language. Never parse it; branch on `code`. */
533
678
  msg?: string;
534
679
  };
535
680
  CreateTaskRequest: {
@@ -594,6 +739,38 @@ export interface components {
594
739
  msg?: "success";
595
740
  data: components["schemas"]["RetryTaskResponse"];
596
741
  };
742
+ TaskPurgeResponse: {
743
+ taskId: string;
744
+ /**
745
+ * @description `purged` after a successful destroy, and on any idempotent repeat. Still `present` means this call removed nothing and may be retried later; the reason is deliberately not disclosed.
746
+ * @enum {string}
747
+ */
748
+ contentState: "present" | "expired" | "purged";
749
+ /**
750
+ * Format: date-time
751
+ * @description Time of the **first** destroy, not of this call.
752
+ */
753
+ purgedAt?: string;
754
+ /**
755
+ * @description Omitted while `contentState` is `present`.
756
+ * @enum {string}
757
+ */
758
+ contentRemovedBy?: "user" | "system";
759
+ /**
760
+ * @description Always true. Destroying content never changes the ledger, the charged amount, or any other billing fact. It is stated explicitly because it is the one thing a caller is likely to get wrong about an endpoint named "purge".
761
+ * @constant
762
+ */
763
+ billingRetained: true;
764
+ /** @description True while the background sweep has not finished removing the stored media objects. */
765
+ mediaDeletionPending: boolean;
766
+ };
767
+ TaskPurgeEnvelope: components["schemas"]["EnvelopeBase"] & {
768
+ /** @constant */
769
+ code?: 200;
770
+ /** @constant */
771
+ msg?: "success";
772
+ data: components["schemas"]["TaskPurgeResponse"];
773
+ };
597
774
  CreateTaskEnvelope: components["schemas"]["EnvelopeBase"] & {
598
775
  /** @constant */
599
776
  code?: 200;
@@ -646,9 +823,12 @@ export interface components {
646
823
  [key: string]: unknown;
647
824
  };
648
825
  output?: components["schemas"]["TaskOutput"];
649
- /** @description Stable SpicyAPI failure identifier; never a raw execution-channel code. */
650
- errorCode?: string;
651
- /** @description Safe normalized explanation without internal service names */
826
+ /**
827
+ * @description Stable SpicyAPI failure identifier from a closed set; never an internal diagnostic code. The set is closed: any other value a client sees should be handled as `upstream_failed`.
828
+ * @enum {string}
829
+ */
830
+ errorCode?: "invalid_request" | "unsupported_combination" | "content_rejected" | "rate_limited" | "upstream_unavailable" | "generation_failed" | "timeout" | "invalid_asset" | "upstream_failed";
831
+ /** @description Safe normalized explanation without internal service names, hosts, task IDs, or raw errors. Follows the same language selection as `msg`; `errorCode` never changes. */
652
832
  errorMessage?: string;
653
833
  cost: components["schemas"]["USDString"];
654
834
  /** @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. */
@@ -662,6 +842,40 @@ export interface components {
662
842
  deadlineAt?: string;
663
843
  /** Format: date-time */
664
844
  completedAt?: string;
845
+ /**
846
+ * @description Whether the task content is still stored, and why it is not. `expired` means the retention policy removed it; `purged` means the account owner destroyed it with `purgeTask`. The two are deliberately distinct: telling a customer their own deletion was an expiry reads as the platform losing their data.
847
+ * @enum {string}
848
+ */
849
+ contentState?: "present" | "expired" | "purged";
850
+ /**
851
+ * @description Present only once content has been removed. Omitted while `contentState` is `present`.
852
+ * @enum {string}
853
+ */
854
+ contentRemovedBy?: "user" | "system";
855
+ /**
856
+ * Format: date-time
857
+ * @description Present only for a task destroyed with `purgeTask`. Expiry does not set it.
858
+ */
859
+ purgedAt?: string;
860
+ retention?: components["schemas"]["TaskRetention"];
861
+ };
862
+ /** @description When this task's content is scheduled to be removed, and which layer decided it. Omitted for tasks created before per-task retention existed; those follow the platform maximum. */
863
+ TaskRetention: {
864
+ /**
865
+ * Format: date-time
866
+ * @description When the generated media objects and the result payload are removed. Before the task finishes this is measured from acceptance; when the task reaches a terminal state it is re-based on the completion time using the same window, so it only ever moves later, never earlier.
867
+ */
868
+ outputsExpireAt: string;
869
+ /**
870
+ * Format: date-time
871
+ * @description When the stored request text is erased. The task row, its state, amounts and request_id remain.
872
+ */
873
+ promptsExpireAt: string;
874
+ /**
875
+ * @description Which layer actually constrained the value: the per-request `X-Spicy-Retention` header, the account setting, or the platform maximum. A request that sends the header and still sees `account` has an account setting that is already shorter than it asked for.
876
+ * @enum {string}
877
+ */
878
+ source: "header" | "account" | "platform";
665
879
  };
666
880
  TaskRecordEnvelope: components["schemas"]["EnvelopeBase"] & {
667
881
  /** @constant */
@@ -756,6 +970,7 @@ export interface components {
756
970
  data: components["schemas"]["APIKeyUsageResponse"];
757
971
  };
758
972
  Balance: {
973
+ funding?: components["schemas"]["FundingOverview"];
759
974
  available: components["schemas"]["USDString"];
760
975
  held: components["schemas"]["USDString"];
761
976
  total: components["schemas"]["USDString"];
@@ -790,16 +1005,16 @@ export interface components {
790
1005
  /** @description Stable product-family identifier; endpoint variants are listed in `tasks` and expressed by `inputSchema`. */
791
1006
  family: string;
792
1007
  displayName: string;
793
- /** @description Model creator/author identifier. It never identifies an execution channel. */
1008
+ /** @description Model creator/author identifier, such as the research lab that built the model. */
794
1009
  provider: string;
795
1010
  /** @enum {string} */
796
1011
  modality: "image" | "video" | "audio" | "text";
797
1012
  tasks: string[];
798
1013
  async: boolean;
799
- /** @description Informational model-creator capability metadata only. It does not participate in routing, authorization, or request rejection. */
1014
+ /** @description Informational model-creator capability metadata only. It does not participate in authorization, availability decisions, or request rejection. */
800
1015
  mature: boolean;
801
1016
  /**
802
- * @description Informational model-creator policy metadata only. It does not participate in routing, authorization, or request rejection.
1017
+ * @description Informational model-creator policy metadata only. It does not participate in authorization, availability decisions, or request rejection.
803
1018
  * @enum {string}
804
1019
  */
805
1020
  policyTier: "unrestricted" | "borderline" | "unspecified";
@@ -857,7 +1072,7 @@ export interface components {
857
1072
  UploadURLRequest: {
858
1073
  /** @enum {string} */
859
1074
  contentType: "image/jpeg" | "image/png" | "image/webp" | "image/gif" | "video/mp4" | "video/webm" | "audio/mpeg" | "audio/wav";
860
- /** @description Images are limited to 10 MiB; supported audio/video to 100 MiB. */
1075
+ /** @description Images are limited to 10 MiB; supported audio/video to 90 MiB. */
861
1076
  bytes: number;
862
1077
  };
863
1078
  UploadURLResponse: {
@@ -1080,6 +1295,53 @@ export interface components {
1080
1295
  total_tokens?: number;
1081
1296
  };
1082
1297
  };
1298
+ /** @description Google Gemini `generateContent` request. Which generation parameters a model accepts comes from that model's `inputSchema` in `/v1/models` and the catalog; unsupported parameters return 400. */
1299
+ GeminiGenerateContentRequest: {
1300
+ contents: {
1301
+ /** @enum {string} */
1302
+ role?: "user" | "model";
1303
+ parts?: Record<string, never>[];
1304
+ }[];
1305
+ systemInstruction?: Record<string, never>;
1306
+ tools?: Record<string, never>[];
1307
+ toolConfig?: Record<string, never>;
1308
+ generationConfig?: {
1309
+ temperature?: number;
1310
+ topP?: number;
1311
+ maxOutputTokens?: number;
1312
+ stopSequences?: string[];
1313
+ responseMimeType?: string;
1314
+ responseSchema?: Record<string, never>;
1315
+ thinkingConfig?: Record<string, never>;
1316
+ };
1317
+ };
1318
+ GeminiGenerateContentResponse: {
1319
+ candidates?: {
1320
+ index?: number;
1321
+ content?: {
1322
+ role?: string;
1323
+ parts?: Record<string, never>[];
1324
+ };
1325
+ finishReason?: string;
1326
+ }[];
1327
+ usageMetadata?: {
1328
+ promptTokenCount?: number;
1329
+ candidatesTokenCount?: number;
1330
+ totalTokenCount?: number;
1331
+ cachedContentTokenCount?: number;
1332
+ thoughtsTokenCount?: number;
1333
+ };
1334
+ /** @description The SpicyAPI model identifier. */
1335
+ modelVersion?: string;
1336
+ responseId?: string;
1337
+ };
1338
+ GeminiErrorBody: {
1339
+ error: {
1340
+ code: number;
1341
+ message: string;
1342
+ status: string;
1343
+ };
1344
+ };
1083
1345
  AnthropicMessageRequest: {
1084
1346
  model: string;
1085
1347
  system?: string | Record<string, never>[];
@@ -1263,10 +1525,25 @@ export interface components {
1263
1525
  "application/json": components["schemas"]["AnthropicErrorBody"];
1264
1526
  };
1265
1527
  };
1528
+ /** @description Error in the Google `{error:{code,message,status}}` shape. `status` is the google.rpc code name (for example `INVALID_ARGUMENT`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`). */
1529
+ GeminiError: {
1530
+ headers: {
1531
+ [name: string]: unknown;
1532
+ };
1533
+ content: {
1534
+ "application/json": components["schemas"]["GeminiErrorBody"];
1535
+ };
1536
+ };
1266
1537
  };
1267
1538
  parameters: {
1268
1539
  /** @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. */
1269
1540
  IdempotencyKey: string;
1541
+ /**
1542
+ * @description Retention for this one task, in whole seconds. It applies to both the generated outputs and the stored request text. The effective value is always `min(header, account setting, platform maximum)`: a request can only shorten retention, never extend it.
1543
+ * `0` is valid and means the outputs are removed as soon as the task reaches a terminal state. Values that cannot be applied never fail the request: a negative number is clamped to `0`, a value above the ceiling is clamped to the ceiling, and a value that is not a decimal integer is ignored so the account setting applies. The effective result is always reported back in `retention` on the task record.
1544
+ * Accepted by `createTask` and `stream`. `retry` inherits the source task's effective value and ignores this header, so one task family never ends up with two different expiry times. `quote` does not accept it because it does not create a task.
1545
+ */
1546
+ SpicyRetention: string;
1270
1547
  };
1271
1548
  requestBodies: never;
1272
1549
  headers: {
@@ -1319,6 +1596,12 @@ export interface operations {
1319
1596
  header?: {
1320
1597
  /** @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. */
1321
1598
  "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
1599
+ /**
1600
+ * @description Retention for this one task, in whole seconds. It applies to both the generated outputs and the stored request text. The effective value is always `min(header, account setting, platform maximum)`: a request can only shorten retention, never extend it.
1601
+ * `0` is valid and means the outputs are removed as soon as the task reaches a terminal state. Values that cannot be applied never fail the request: a negative number is clamped to `0`, a value above the ceiling is clamped to the ceiling, and a value that is not a decimal integer is ignored so the account setting applies. The effective result is always reported back in `retention` on the task record.
1602
+ * Accepted by `createTask` and `stream`. `retry` inherits the source task's effective value and ignores this header, so one task family never ends up with two different expiry times. `quote` does not accept it because it does not create a task.
1603
+ */
1604
+ "X-Spicy-Retention"?: components["parameters"]["SpicyRetention"];
1322
1605
  };
1323
1606
  path?: never;
1324
1607
  cookie?: never;
@@ -1401,6 +1684,12 @@ export interface operations {
1401
1684
  header?: {
1402
1685
  /** @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. */
1403
1686
  "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
1687
+ /**
1688
+ * @description Retention for this one task, in whole seconds. It applies to both the generated outputs and the stored request text. The effective value is always `min(header, account setting, platform maximum)`: a request can only shorten retention, never extend it.
1689
+ * `0` is valid and means the outputs are removed as soon as the task reaches a terminal state. Values that cannot be applied never fail the request: a negative number is clamped to `0`, a value above the ceiling is clamped to the ceiling, and a value that is not a decimal integer is ignored so the account setting applies. The effective result is always reported back in `retention` on the task record.
1690
+ * Accepted by `createTask` and `stream`. `retry` inherits the source task's effective value and ignores this header, so one task family never ends up with two different expiry times. `quote` does not accept it because it does not create a task.
1691
+ */
1692
+ "X-Spicy-Retention"?: components["parameters"]["SpicyRetention"];
1404
1693
  };
1405
1694
  path?: never;
1406
1695
  cookie?: never;
@@ -1468,11 +1757,45 @@ export interface operations {
1468
1757
  503: components["responses"]["Unavailable"];
1469
1758
  };
1470
1759
  };
1760
+ purgeTask: {
1761
+ parameters: {
1762
+ query?: never;
1763
+ header?: {
1764
+ /** @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. */
1765
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
1766
+ };
1767
+ path?: never;
1768
+ cookie?: never;
1769
+ };
1770
+ requestBody: {
1771
+ content: {
1772
+ "application/json": components["schemas"]["TaskActionRequest"];
1773
+ };
1774
+ };
1775
+ responses: {
1776
+ /** @description Content destroyed, or already destroyed by an earlier call. */
1777
+ 200: {
1778
+ headers: {
1779
+ "Cache-Control"?: "no-store";
1780
+ [name: string]: unknown;
1781
+ };
1782
+ content: {
1783
+ "application/json": components["schemas"]["TaskPurgeEnvelope"];
1784
+ };
1785
+ };
1786
+ 400: components["responses"]["BadRequest"];
1787
+ 401: components["responses"]["Unauthorized"];
1788
+ 403: components["responses"]["Forbidden"];
1789
+ 404: components["responses"]["NotFound"];
1790
+ 429: components["responses"]["RateLimited"];
1791
+ 500: components["responses"]["ServerError"];
1792
+ };
1793
+ };
1471
1794
  listModels: {
1472
1795
  parameters: {
1473
1796
  query?: {
1474
1797
  modality?: "image" | "video" | "audio" | "text";
1475
- /** @description Exact model creator/author identifier. This never identifies an execution channel. */
1798
+ /** @description Exact model creator/author identifier, such as the research lab that built the model. */
1476
1799
  provider?: string;
1477
1800
  /** @description Exact supported task, for example `text-to-image`. */
1478
1801
  task?: string;
@@ -1615,7 +1938,7 @@ export interface operations {
1615
1938
  };
1616
1939
  requestBody?: never;
1617
1940
  responses: {
1618
- /** @description Available, held, and total balance in USD decimal strings. */
1941
+ /** @description Net available, held, and total balances plus funding sources in USD decimal strings. Unused credit is separate from wallet funds; model-scoped grants may not pay for every request. */
1619
1942
  200: {
1620
1943
  headers: {
1621
1944
  [name: string]: unknown;
@@ -1860,6 +2183,87 @@ export interface operations {
1860
2183
  503: components["responses"]["AnthropicError"];
1861
2184
  };
1862
2185
  };
2186
+ geminiGenerateContent: {
2187
+ parameters: {
2188
+ query?: never;
2189
+ header?: {
2190
+ /** @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. */
2191
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
2192
+ };
2193
+ path: {
2194
+ model: string;
2195
+ };
2196
+ cookie?: never;
2197
+ };
2198
+ requestBody: {
2199
+ content: {
2200
+ "application/json": components["schemas"]["GeminiGenerateContentRequest"];
2201
+ };
2202
+ };
2203
+ responses: {
2204
+ /** @description One `GenerateContentResponse`. */
2205
+ 200: {
2206
+ headers: {
2207
+ [name: string]: unknown;
2208
+ };
2209
+ content: {
2210
+ "application/json": components["schemas"]["GeminiGenerateContentResponse"];
2211
+ };
2212
+ };
2213
+ 400: components["responses"]["GeminiError"];
2214
+ 401: components["responses"]["GeminiError"];
2215
+ 402: components["responses"]["GeminiError"];
2216
+ 403: components["responses"]["GeminiError"];
2217
+ 404: components["responses"]["GeminiError"];
2218
+ 409: components["responses"]["GeminiError"];
2219
+ 413: components["responses"]["GeminiError"];
2220
+ 429: components["responses"]["GeminiError"];
2221
+ 500: components["responses"]["GeminiError"];
2222
+ 503: components["responses"]["GeminiError"];
2223
+ };
2224
+ };
2225
+ geminiStreamGenerateContent: {
2226
+ parameters: {
2227
+ query?: {
2228
+ alt?: "sse";
2229
+ };
2230
+ header?: {
2231
+ /** @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. */
2232
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
2233
+ };
2234
+ path: {
2235
+ model: string;
2236
+ };
2237
+ cookie?: never;
2238
+ };
2239
+ requestBody: {
2240
+ content: {
2241
+ "application/json": components["schemas"]["GeminiGenerateContentRequest"];
2242
+ };
2243
+ };
2244
+ responses: {
2245
+ /** @description An SSE stream (`alt=sse`) or a JSON array of `GenerateContentResponse`. */
2246
+ 200: {
2247
+ headers: {
2248
+ [name: string]: unknown;
2249
+ };
2250
+ content: {
2251
+ "text/event-stream": string;
2252
+ "application/json": components["schemas"]["GeminiGenerateContentResponse"][];
2253
+ };
2254
+ };
2255
+ 400: components["responses"]["GeminiError"];
2256
+ 401: components["responses"]["GeminiError"];
2257
+ 402: components["responses"]["GeminiError"];
2258
+ 403: components["responses"]["GeminiError"];
2259
+ 404: components["responses"]["GeminiError"];
2260
+ 409: components["responses"]["GeminiError"];
2261
+ 413: components["responses"]["GeminiError"];
2262
+ 429: components["responses"]["GeminiError"];
2263
+ 500: components["responses"]["GeminiError"];
2264
+ 503: components["responses"]["GeminiError"];
2265
+ };
2266
+ };
1863
2267
  createVideo: {
1864
2268
  parameters: {
1865
2269
  query?: never;