@reverbia/sdk 1.0.0 → 1.1.0-next.20251230221037

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 (110) hide show
  1. package/README.md +290 -45
  2. package/dist/expo/index.cjs +3428 -0
  3. package/dist/expo/index.d.mts +1217 -0
  4. package/dist/expo/index.d.ts +1217 -0
  5. package/dist/expo/index.mjs +3395 -0
  6. package/dist/index.cjs +972 -0
  7. package/dist/index.d.mts +1514 -0
  8. package/dist/index.d.ts +1514 -0
  9. package/dist/index.mjs +934 -0
  10. package/dist/next/index.cjs +64 -0
  11. package/dist/next/index.d.mts +23 -0
  12. package/dist/next/index.d.ts +23 -0
  13. package/dist/next/index.mjs +39 -0
  14. package/dist/polyfills/index.cjs +61 -0
  15. package/dist/polyfills/index.d.mts +9 -0
  16. package/dist/polyfills/index.d.ts +9 -0
  17. package/dist/polyfills/index.mjs +34 -0
  18. package/dist/react/chunk-KUFGQF6E.mjs +290 -0
  19. package/dist/react/chunk-T56Y62G7.mjs +410 -0
  20. package/dist/react/index.cjs +7982 -0
  21. package/dist/react/index.d.mts +3139 -0
  22. package/dist/react/index.d.ts +3139 -0
  23. package/dist/react/index.mjs +7209 -0
  24. package/dist/react/storage-Z2NBANCK.mjs +29 -0
  25. package/dist/react/useEncryption-5RTXKDNZ.mjs +31 -0
  26. package/dist/vercel/index.cjs +86 -0
  27. package/dist/vercel/index.d.mts +119 -0
  28. package/dist/vercel/index.d.ts +119 -0
  29. package/dist/vercel/index.mjs +57 -0
  30. package/package.json +91 -16
  31. package/dist/cjs/client/client/client.gen.d.ts +0 -2
  32. package/dist/cjs/client/client/client.gen.js +0 -203
  33. package/dist/cjs/client/client/index.d.ts +0 -8
  34. package/dist/cjs/client/client/index.js +0 -16
  35. package/dist/cjs/client/client/types.gen.d.ts +0 -99
  36. package/dist/cjs/client/client/types.gen.js +0 -3
  37. package/dist/cjs/client/client/utils.gen.d.ts +0 -40
  38. package/dist/cjs/client/client/utils.gen.js +0 -314
  39. package/dist/cjs/client/client.gen.d.ts +0 -12
  40. package/dist/cjs/client/client.gen.js +0 -6
  41. package/dist/cjs/client/core/auth.gen.d.ts +0 -18
  42. package/dist/cjs/client/core/auth.gen.js +0 -18
  43. package/dist/cjs/client/core/bodySerializer.gen.d.ts +0 -25
  44. package/dist/cjs/client/core/bodySerializer.gen.js +0 -60
  45. package/dist/cjs/client/core/params.gen.d.ts +0 -43
  46. package/dist/cjs/client/core/params.gen.js +0 -104
  47. package/dist/cjs/client/core/pathSerializer.gen.d.ts +0 -33
  48. package/dist/cjs/client/core/pathSerializer.gen.js +0 -123
  49. package/dist/cjs/client/core/queryKeySerializer.gen.d.ts +0 -18
  50. package/dist/cjs/client/core/queryKeySerializer.gen.js +0 -105
  51. package/dist/cjs/client/core/serverSentEvents.gen.d.ts +0 -71
  52. package/dist/cjs/client/core/serverSentEvents.gen.js +0 -139
  53. package/dist/cjs/client/core/types.gen.d.ts +0 -78
  54. package/dist/cjs/client/core/types.gen.js +0 -3
  55. package/dist/cjs/client/core/utils.gen.d.ts +0 -19
  56. package/dist/cjs/client/core/utils.gen.js +0 -93
  57. package/dist/cjs/client/index.d.ts +0 -2
  58. package/dist/cjs/client/index.js +0 -18
  59. package/dist/cjs/client/sdk.gen.d.ts +0 -27
  60. package/dist/cjs/client/sdk.gen.js +0 -33
  61. package/dist/cjs/client/types.gen.d.ts +0 -120
  62. package/dist/cjs/client/types.gen.js +0 -3
  63. package/dist/esm/client/client/client.gen.d.ts +0 -2
  64. package/dist/esm/client/client/client.gen.js +0 -199
  65. package/dist/esm/client/client/index.d.ts +0 -8
  66. package/dist/esm/client/client/index.js +0 -6
  67. package/dist/esm/client/client/types.gen.d.ts +0 -99
  68. package/dist/esm/client/client/types.gen.js +0 -2
  69. package/dist/esm/client/client/utils.gen.d.ts +0 -40
  70. package/dist/esm/client/client/utils.gen.js +0 -302
  71. package/dist/esm/client/client.gen.d.ts +0 -12
  72. package/dist/esm/client/client.gen.js +0 -3
  73. package/dist/esm/client/core/auth.gen.d.ts +0 -18
  74. package/dist/esm/client/core/auth.gen.js +0 -14
  75. package/dist/esm/client/core/bodySerializer.gen.d.ts +0 -25
  76. package/dist/esm/client/core/bodySerializer.gen.js +0 -57
  77. package/dist/esm/client/core/params.gen.d.ts +0 -43
  78. package/dist/esm/client/core/params.gen.js +0 -100
  79. package/dist/esm/client/core/pathSerializer.gen.d.ts +0 -33
  80. package/dist/esm/client/core/pathSerializer.gen.js +0 -114
  81. package/dist/esm/client/core/queryKeySerializer.gen.d.ts +0 -18
  82. package/dist/esm/client/core/queryKeySerializer.gen.js +0 -99
  83. package/dist/esm/client/core/serverSentEvents.gen.d.ts +0 -71
  84. package/dist/esm/client/core/serverSentEvents.gen.js +0 -135
  85. package/dist/esm/client/core/types.gen.d.ts +0 -78
  86. package/dist/esm/client/core/types.gen.js +0 -2
  87. package/dist/esm/client/core/utils.gen.d.ts +0 -19
  88. package/dist/esm/client/core/utils.gen.js +0 -87
  89. package/dist/esm/client/index.d.ts +0 -2
  90. package/dist/esm/client/index.js +0 -2
  91. package/dist/esm/client/sdk.gen.d.ts +0 -27
  92. package/dist/esm/client/sdk.gen.js +0 -28
  93. package/dist/esm/client/types.gen.d.ts +0 -120
  94. package/dist/esm/client/types.gen.js +0 -2
  95. package/dist/types/client/client/client.gen.d.ts +0 -2
  96. package/dist/types/client/client/index.d.ts +0 -8
  97. package/dist/types/client/client/types.gen.d.ts +0 -99
  98. package/dist/types/client/client/utils.gen.d.ts +0 -40
  99. package/dist/types/client/client.gen.d.ts +0 -12
  100. package/dist/types/client/core/auth.gen.d.ts +0 -18
  101. package/dist/types/client/core/bodySerializer.gen.d.ts +0 -25
  102. package/dist/types/client/core/params.gen.d.ts +0 -43
  103. package/dist/types/client/core/pathSerializer.gen.d.ts +0 -33
  104. package/dist/types/client/core/queryKeySerializer.gen.d.ts +0 -18
  105. package/dist/types/client/core/serverSentEvents.gen.d.ts +0 -71
  106. package/dist/types/client/core/types.gen.d.ts +0 -78
  107. package/dist/types/client/core/utils.gen.d.ts +0 -19
  108. package/dist/types/client/index.d.ts +0 -2
  109. package/dist/types/client/sdk.gen.d.ts +0 -27
  110. package/dist/types/client/types.gen.d.ts +0 -120
@@ -0,0 +1,1514 @@
1
+ type ClientOptions$1 = {
2
+ baseUrl: `${string}://${string}` | (string & {});
3
+ };
4
+ type HandlersConfigResponse = {
5
+ /**
6
+ * ChainID is the blockchain chain ID
7
+ */
8
+ chain_id?: string;
9
+ /**
10
+ * CostLimitEscrowAddress is the cost-limit escrow contract address (if configured)
11
+ */
12
+ cost_limit_escrow_address?: string;
13
+ /**
14
+ * OperatorAddress is the operator wallet address
15
+ */
16
+ operator_address?: string;
17
+ /**
18
+ * PayAsYouGoEscrowAddress is the pay-as-you-go escrow contract address (if configured)
19
+ */
20
+ pay_as_you_go_escrow_address?: string;
21
+ /**
22
+ * PaymentModel is the payment model used (pay_as_you_go or cost_limit)
23
+ */
24
+ payment_model?: string;
25
+ /**
26
+ * SettlementRecipient is the address that receives settlement payments
27
+ */
28
+ settlement_recipient?: string;
29
+ };
30
+ type HandlersExchangeRequest = {
31
+ code: string;
32
+ /**
33
+ * Optional - uses config default if not provided
34
+ */
35
+ redirect_uri?: string;
36
+ };
37
+ type HandlersHealthResponse = {
38
+ /**
39
+ * Status indicates the service health status
40
+ */
41
+ status?: string;
42
+ /**
43
+ * Timestamp is the Unix timestamp of the response
44
+ */
45
+ timestamp?: number;
46
+ /**
47
+ * Version is the current API version
48
+ */
49
+ version?: string;
50
+ };
51
+ type HandlersRefreshRequest = {
52
+ refresh_token: string;
53
+ };
54
+ type HandlersRevokeRequest = {
55
+ token: string;
56
+ };
57
+ type HandlersTokenResponse = {
58
+ access_token?: string;
59
+ /**
60
+ * Seconds until expiration
61
+ */
62
+ expires_in?: number;
63
+ /**
64
+ * May not be present on refresh
65
+ */
66
+ refresh_token?: string;
67
+ /**
68
+ * Granted scopes
69
+ */
70
+ scope?: string;
71
+ /**
72
+ * Usually "Bearer"
73
+ */
74
+ token_type?: string;
75
+ };
76
+ /**
77
+ * ExtraFields contains additional metadata
78
+ */
79
+ type LlmapiChatCompletionExtraFields = {
80
+ /**
81
+ * Latency is the request latency in milliseconds
82
+ */
83
+ latency?: number;
84
+ /**
85
+ * ModelRequested is the model that was requested
86
+ */
87
+ model_requested?: string;
88
+ /**
89
+ * Provider is the LLM provider used (e.g., "openai", "anthropic")
90
+ */
91
+ provider?: string;
92
+ /**
93
+ * RequestType is always "chat_completion"
94
+ */
95
+ request_type?: string;
96
+ };
97
+ type LlmapiChatCompletionRequest = {
98
+ /**
99
+ * Messages is the conversation history
100
+ */
101
+ messages: Array<LlmapiMessage>;
102
+ /**
103
+ * Model is the model identifier
104
+ */
105
+ model: string;
106
+ /**
107
+ * Stream indicates if response should be streamed
108
+ */
109
+ stream?: boolean;
110
+ };
111
+ type LlmapiChatCompletionResponse = {
112
+ /**
113
+ * Choices contains the completion choices
114
+ */
115
+ choices?: Array<LlmapiChoice>;
116
+ extra_fields?: LlmapiChatCompletionExtraFields;
117
+ /**
118
+ * ID is the completion ID
119
+ */
120
+ id?: string;
121
+ /**
122
+ * Model is the model used
123
+ */
124
+ model?: string;
125
+ usage?: LlmapiChatCompletionUsage;
126
+ };
127
+ /**
128
+ * Usage contains token usage information
129
+ */
130
+ type LlmapiChatCompletionUsage = {
131
+ /**
132
+ * CompletionTokens is the number of tokens in the completion
133
+ */
134
+ completion_tokens?: number;
135
+ /**
136
+ * CostMicroUSD is the cost of this completion in micro-dollars (USD × 1,000,000)
137
+ */
138
+ cost_micro_usd?: number;
139
+ /**
140
+ * PromptTokens is the number of tokens in the prompt
141
+ */
142
+ prompt_tokens?: number;
143
+ /**
144
+ * TotalTokens is the total number of tokens used
145
+ */
146
+ total_tokens?: number;
147
+ };
148
+ type LlmapiChoice = {
149
+ /**
150
+ * FinishReason indicates why the completion stopped
151
+ */
152
+ finish_reason?: string;
153
+ /**
154
+ * Index is the choice index
155
+ */
156
+ index?: number;
157
+ message?: LlmapiMessage;
158
+ };
159
+ type LlmapiEmbeddingData = {
160
+ /**
161
+ * Embedding vector
162
+ */
163
+ embedding?: Array<number>;
164
+ /**
165
+ * Index of the embedding
166
+ */
167
+ index?: number;
168
+ /**
169
+ * Object type identifier
170
+ */
171
+ object?: string;
172
+ };
173
+ /**
174
+ * ExtraFields contains additional metadata
175
+ */
176
+ type LlmapiEmbeddingExtraFields = {
177
+ /**
178
+ * ChunkIndex is the chunk index (0 for single requests)
179
+ */
180
+ chunk_index?: number;
181
+ /**
182
+ * Latency is the request latency in milliseconds
183
+ */
184
+ latency?: number;
185
+ /**
186
+ * ModelRequested is the model that was requested
187
+ */
188
+ model_requested?: string;
189
+ /**
190
+ * Provider is the LLM provider used (e.g., "openai", "anthropic")
191
+ */
192
+ provider?: string;
193
+ /**
194
+ * RequestType is always "embedding"
195
+ */
196
+ request_type?: string;
197
+ };
198
+ type LlmapiEmbeddingRequest = {
199
+ /**
200
+ * Dimensions is the number of dimensions the resulting output embeddings should have (optional)
201
+ */
202
+ dimensions?: number;
203
+ /**
204
+ * EncodingFormat is the format to return the embeddings in (optional: "float" or "base64")
205
+ */
206
+ encoding_format?: string;
207
+ /**
208
+ * Input text or tokens to embed (can be string, []string, []int, or [][]int)
209
+ */
210
+ input: unknown;
211
+ /**
212
+ * Model identifier in 'provider/model' format
213
+ */
214
+ model: string;
215
+ };
216
+ type LlmapiEmbeddingResponse = {
217
+ /**
218
+ * Data contains the embeddings
219
+ */
220
+ data?: Array<LlmapiEmbeddingData>;
221
+ extra_fields?: LlmapiEmbeddingExtraFields;
222
+ /**
223
+ * Model is the model used
224
+ */
225
+ model?: string;
226
+ /**
227
+ * Object is always "list"
228
+ */
229
+ object?: string;
230
+ usage?: LlmapiEmbeddingUsage;
231
+ };
232
+ /**
233
+ * Usage contains token usage information
234
+ */
235
+ type LlmapiEmbeddingUsage = {
236
+ /**
237
+ * CostMicroUSD is the inference cost for this embedding request
238
+ */
239
+ cost_micro_usd?: number;
240
+ /**
241
+ * PromptTokens is the number of tokens in the prompt
242
+ */
243
+ prompt_tokens?: number;
244
+ /**
245
+ * TotalTokens is the total number of tokens used
246
+ */
247
+ total_tokens?: number;
248
+ };
249
+ /**
250
+ * ExtraFields contains additional metadata such as provider/model information.
251
+ */
252
+ type LlmapiImageGenerationExtraFields = {
253
+ /**
254
+ * ModelRequested is the model identifier that the client asked for.
255
+ */
256
+ model_requested?: string;
257
+ /**
258
+ * Provider is the gateway that serviced this request.
259
+ */
260
+ provider?: string;
261
+ /**
262
+ * RequestType is always "image_generation".
263
+ */
264
+ request_type?: string;
265
+ };
266
+ type LlmapiImageGenerationImage = {
267
+ /**
268
+ * B64JSON is the base64 payload for models that can only return binary.
269
+ */
270
+ b64_json?: string;
271
+ /**
272
+ * URL is the signed URL to download the image.
273
+ */
274
+ url?: string;
275
+ };
276
+ type LlmapiImageGenerationRequest = {
277
+ /**
278
+ * Model is the model identifier to use for generation (e.g., "gpt-image-1").
279
+ */
280
+ model: string;
281
+ /**
282
+ * Prompt is the text description of the desired image.
283
+ */
284
+ prompt: string;
285
+ /**
286
+ * Quality targets a quality preset (e.g., "auto", "high").
287
+ */
288
+ quality?: string;
289
+ /**
290
+ * ResponseFormat controls how the generated image is returned (e.g., "url" or "b64_json").
291
+ */
292
+ response_format?: string;
293
+ /**
294
+ * Size controls the dimensions of the generated image (e.g., "1024x1024").
295
+ */
296
+ size?: string;
297
+ };
298
+ type LlmapiImageGenerationResponse = {
299
+ /**
300
+ * Created is the Unix timestamp when the image was generated.
301
+ */
302
+ created?: number;
303
+ extra_fields?: LlmapiImageGenerationExtraFields;
304
+ /**
305
+ * Images contains the generated images.
306
+ */
307
+ images?: Array<LlmapiImageGenerationImage>;
308
+ /**
309
+ * Model is the model identifier that generated the image.
310
+ */
311
+ model?: string;
312
+ /**
313
+ * Provider is the gateway that produced the image.
314
+ */
315
+ provider?: string;
316
+ usage?: LlmapiImageGenerationUsage;
317
+ };
318
+ /**
319
+ * Usage documents token usage (when available).
320
+ */
321
+ type LlmapiImageGenerationUsage = {
322
+ /**
323
+ * CostMicroUSD is the inference cost for this image generation request
324
+ */
325
+ cost_micro_usd?: number;
326
+ /**
327
+ * InputTokens is the number of tokens sent in the prompt.
328
+ */
329
+ input_tokens?: number;
330
+ /**
331
+ * OutputTokens is the number of tokens returned by the model.
332
+ */
333
+ output_tokens?: number;
334
+ /**
335
+ * TotalTokens is the total number of tokens consumed.
336
+ */
337
+ total_tokens?: number;
338
+ };
339
+ /**
340
+ * Message is the generated message
341
+ */
342
+ type LlmapiMessage = {
343
+ /**
344
+ * Content is the message content
345
+ */
346
+ content?: Array<LlmapiMessageContentPart>;
347
+ role?: LlmapiRole;
348
+ /**
349
+ * ToolCalls contains tool/function calls made by the assistant (only for assistant role)
350
+ */
351
+ tool_calls?: Array<LlmapiToolCall>;
352
+ };
353
+ /**
354
+ * ImageURL is used when Type=image_url
355
+ */
356
+ type LlmapiMessageContentImage = {
357
+ /**
358
+ * Detail is the OpenAI detail hint (auto|low|high)
359
+ */
360
+ detail?: string;
361
+ /**
362
+ * URL is the image URL or data URI
363
+ */
364
+ url?: string;
365
+ };
366
+ type LlmapiMessageContentPart = {
367
+ image_url?: LlmapiMessageContentImage;
368
+ /**
369
+ * Text holds the text content when Type=text
370
+ */
371
+ text?: string;
372
+ /**
373
+ * Type is the block type (`text` or `image_url`)
374
+ */
375
+ type?: string;
376
+ };
377
+ type LlmapiModel = {
378
+ architecture?: LlmapiModelArchitecture;
379
+ /**
380
+ * CanonicalSlug is the canonical slug for the model
381
+ */
382
+ canonical_slug?: string;
383
+ /**
384
+ * ContextLength is the maximum context length in tokens
385
+ */
386
+ context_length?: number;
387
+ /**
388
+ * Created is the Unix timestamp of when the model was created
389
+ */
390
+ created?: number;
391
+ /**
392
+ * DefaultParameters contains default parameter values
393
+ */
394
+ default_parameters?: {
395
+ [key: string]: unknown;
396
+ };
397
+ /**
398
+ * Description describes the model and its capabilities
399
+ */
400
+ description?: string;
401
+ /**
402
+ * HuggingFaceID is the Hugging Face model identifier
403
+ */
404
+ hugging_face_id?: string;
405
+ /**
406
+ * ID is the model identifier (e.g., "openai/gpt-4")
407
+ */
408
+ id?: string;
409
+ /**
410
+ * MaxInputTokens is the maximum input tokens
411
+ */
412
+ max_input_tokens?: number;
413
+ /**
414
+ * MaxOutputTokens is the maximum output tokens
415
+ */
416
+ max_output_tokens?: number;
417
+ /**
418
+ * Modalities is a list of supported modalities (e.g., ["llm", "vision"])
419
+ */
420
+ modalities?: Array<string>;
421
+ /**
422
+ * Name is the human-readable model name (optional)
423
+ */
424
+ name?: string;
425
+ /**
426
+ * OwnedBy is the organization that owns the model
427
+ */
428
+ owned_by?: string;
429
+ per_request_limits?: LlmapiModelPerRequestLimits;
430
+ pricing?: LlmapiModelPricing;
431
+ /**
432
+ * SupportedMethods is a list of supported API methods
433
+ */
434
+ supported_methods?: Array<string>;
435
+ /**
436
+ * SupportedParameters is a list of supported parameter names
437
+ */
438
+ supported_parameters?: Array<string>;
439
+ top_provider?: LlmapiModelTopProvider;
440
+ };
441
+ /**
442
+ * Architecture describes the model's technical capabilities
443
+ */
444
+ type LlmapiModelArchitecture = {
445
+ instruct_type?: string;
446
+ modality?: string;
447
+ prompt_formatting?: string;
448
+ tokenizer?: string;
449
+ };
450
+ /**
451
+ * PerRequestLimits contains rate limiting information
452
+ */
453
+ type LlmapiModelPerRequestLimits = {
454
+ completion_tokens?: number;
455
+ prompt_tokens?: number;
456
+ };
457
+ /**
458
+ * Pricing contains the pricing structure for using this model
459
+ */
460
+ type LlmapiModelPricing = {
461
+ completion?: string;
462
+ image?: string;
463
+ prompt?: string;
464
+ request?: string;
465
+ };
466
+ /**
467
+ * TopProvider contains configuration details for the primary provider
468
+ */
469
+ type LlmapiModelTopProvider = {
470
+ context_length?: number;
471
+ is_moderated?: boolean;
472
+ max_completion_tokens?: number;
473
+ };
474
+ /**
475
+ * ExtraFields contains additional metadata
476
+ */
477
+ type LlmapiModelsListExtraFields = {
478
+ /**
479
+ * ChunkIndex is the chunk index (0 for single requests)
480
+ */
481
+ chunk_index?: number;
482
+ /**
483
+ * Latency is the request latency in milliseconds
484
+ */
485
+ latency?: number;
486
+ /**
487
+ * RequestType is always "list_models"
488
+ */
489
+ request_type?: string;
490
+ };
491
+ type LlmapiModelsListResponse = {
492
+ /**
493
+ * Data contains the list of available models
494
+ */
495
+ data?: Array<LlmapiModel>;
496
+ extra_fields?: LlmapiModelsListExtraFields;
497
+ /**
498
+ * NextPageToken is the token to retrieve the next page of results (omitted if no more pages)
499
+ */
500
+ next_page_token?: string;
501
+ };
502
+ /**
503
+ * ExtraFields contains additional metadata
504
+ */
505
+ type LlmapiResponseExtraFields = {
506
+ /**
507
+ * Latency is the request latency in milliseconds
508
+ */
509
+ latency?: number;
510
+ /**
511
+ * ModelRequested is the model that was requested
512
+ */
513
+ model_requested?: string;
514
+ /**
515
+ * Provider is the LLM provider used (e.g., "openai", "anthropic")
516
+ */
517
+ provider?: string;
518
+ /**
519
+ * RequestType is always "responses"
520
+ */
521
+ request_type?: string;
522
+ };
523
+ type LlmapiResponseOutputContent = {
524
+ /**
525
+ * Text is the text content
526
+ */
527
+ text?: string;
528
+ /**
529
+ * Type is the content type (e.g., "output_text")
530
+ */
531
+ type?: string;
532
+ };
533
+ type LlmapiResponseOutputItem = {
534
+ /**
535
+ * Arguments is the function arguments for function_call types
536
+ */
537
+ arguments?: string;
538
+ /**
539
+ * CallID is the call ID for function_call types
540
+ */
541
+ call_id?: string;
542
+ /**
543
+ * Content is the content array for message and reasoning types
544
+ */
545
+ content?: Array<LlmapiResponseOutputContent>;
546
+ /**
547
+ * ID is the unique identifier for this output item
548
+ */
549
+ id?: string;
550
+ /**
551
+ * Name is the function name for function_call types
552
+ */
553
+ name?: string;
554
+ /**
555
+ * Role is the role for message types (e.g., "assistant")
556
+ */
557
+ role?: string;
558
+ /**
559
+ * Status is the status of this output item (e.g., "completed")
560
+ */
561
+ status?: string;
562
+ /**
563
+ * Summary is the reasoning summary for reasoning types
564
+ */
565
+ summary?: Array<LlmapiResponseOutputContent>;
566
+ /**
567
+ * Type is the output item type (e.g., "message", "function_call", "reasoning")
568
+ */
569
+ type?: string;
570
+ };
571
+ /**
572
+ * Reasoning configures reasoning for o-series and other reasoning models
573
+ */
574
+ type LlmapiResponseReasoning = {
575
+ /**
576
+ * Effort controls reasoning effort: "low", "medium", or "high"
577
+ */
578
+ effort?: string;
579
+ /**
580
+ * Summary controls reasoning summary: "auto", "concise", or "detailed"
581
+ */
582
+ summary?: string;
583
+ };
584
+ type LlmapiResponseRequest = {
585
+ /**
586
+ * Background indicates if request should be processed in background
587
+ */
588
+ background?: boolean;
589
+ /**
590
+ * Conversation is the conversation ID (optional)
591
+ */
592
+ conversation?: string;
593
+ /**
594
+ * Input is the simple text input for the response
595
+ */
596
+ input: string;
597
+ /**
598
+ * MaxOutputTokens is the maximum number of tokens to generate
599
+ */
600
+ max_output_tokens?: number;
601
+ /**
602
+ * Model is the model identifier in 'provider/model' format
603
+ */
604
+ model: string;
605
+ reasoning?: LlmapiResponseReasoning;
606
+ /**
607
+ * Stream indicates if response should be streamed
608
+ */
609
+ stream?: boolean;
610
+ /**
611
+ * Temperature controls randomness (0.0 to 2.0)
612
+ */
613
+ temperature?: number;
614
+ thinking?: LlmapiThinkingOptions;
615
+ /**
616
+ * ToolChoice controls which tool to use (auto, any, none, required, or tool name)
617
+ */
618
+ tool_choice?: string;
619
+ /**
620
+ * Tools is an array of tool definitions (passed through, no MCP loop)
621
+ */
622
+ tools?: Array<LlmapiTool>;
623
+ };
624
+ type LlmapiResponseResponse = {
625
+ /**
626
+ * Created is the Unix timestamp of creation (created_at in OpenAI format)
627
+ */
628
+ created_at?: number;
629
+ extra_fields?: LlmapiResponseExtraFields;
630
+ /**
631
+ * ID is the unique response identifier
632
+ */
633
+ id?: string;
634
+ /**
635
+ * Model is the model used for generation
636
+ */
637
+ model?: string;
638
+ /**
639
+ * Object is the response type (e.g., "response")
640
+ */
641
+ object?: string;
642
+ /**
643
+ * Output is the array of output items (OpenAI Responses API format)
644
+ */
645
+ output?: Array<LlmapiResponseOutputItem>;
646
+ usage?: LlmapiResponseUsage;
647
+ };
648
+ /**
649
+ * Usage contains token usage information
650
+ */
651
+ type LlmapiResponseUsage = {
652
+ /**
653
+ * CompletionTokens is the number of tokens in the completion
654
+ */
655
+ completion_tokens?: number;
656
+ /**
657
+ * CostMicroUSD is the cost of this response in micro-dollars (USD × 1,000,000)
658
+ */
659
+ cost_micro_usd?: number;
660
+ /**
661
+ * PromptTokens is the number of tokens in the prompt
662
+ */
663
+ prompt_tokens?: number;
664
+ /**
665
+ * TotalTokens is the total number of tokens used
666
+ */
667
+ total_tokens?: number;
668
+ };
669
+ /**
670
+ * Role is the message role (system, user, assistant)
671
+ */
672
+ type LlmapiRole = string;
673
+ /**
674
+ * ExtraFields contains additional metadata.
675
+ */
676
+ type LlmapiSearchExtraFields = {
677
+ /**
678
+ * RequestType is always "search".
679
+ */
680
+ request_type?: string;
681
+ /**
682
+ * SearchProvider is the search provider used (e.g., "perplexity", "google-pse").
683
+ */
684
+ search_provider?: string;
685
+ };
686
+ type LlmapiSearchRequest = {
687
+ /**
688
+ * Country code filter (e.g., "US", "GB", "DE").
689
+ */
690
+ country?: string;
691
+ /**
692
+ * Maximum number of results to return (1-20). Default: 10.
693
+ */
694
+ max_results?: number;
695
+ /**
696
+ * Maximum tokens per page to process. Default: 1024.
697
+ */
698
+ max_tokens_per_page?: number;
699
+ /**
700
+ * Search query. Can be a single string or array of strings.
701
+ */
702
+ query: Array<string>;
703
+ /**
704
+ * List of domains to filter results (max 20 domains).
705
+ */
706
+ search_domain_filter?: Array<string>;
707
+ /**
708
+ * The search provider to use.
709
+ */
710
+ search_tool_name: string;
711
+ };
712
+ type LlmapiSearchResponse = {
713
+ extra_fields?: LlmapiSearchExtraFields;
714
+ /**
715
+ * List of search results.
716
+ */
717
+ results?: Array<LlmapiSearchResult>;
718
+ usage?: LlmapiSearchUsage;
719
+ };
720
+ type LlmapiSearchResult = {
721
+ /**
722
+ * Optional publication or last updated date.
723
+ */
724
+ date?: string;
725
+ /**
726
+ * Text snippet from the result.
727
+ */
728
+ snippet?: string;
729
+ /**
730
+ * Title of the search result.
731
+ */
732
+ title?: string;
733
+ /**
734
+ * URL of the search result.
735
+ */
736
+ url?: string;
737
+ };
738
+ /**
739
+ * Usage contains usage information.
740
+ */
741
+ type LlmapiSearchUsage = {
742
+ /**
743
+ * CostMicroUSD is the cost of this search in micro-dollars (USD × 1,000,000).
744
+ */
745
+ cost_micro_usd?: number;
746
+ };
747
+ /**
748
+ * Thinking configures extended thinking for Anthropic models
749
+ */
750
+ type LlmapiThinkingOptions = {
751
+ /**
752
+ * BudgetTokens is the token budget for thinking
753
+ */
754
+ budget_tokens?: number;
755
+ /**
756
+ * Type indicates if thinking is enabled: "enabled" or "disabled"
757
+ */
758
+ type?: string;
759
+ };
760
+ type LlmapiTool = {
761
+ function?: LlmapiToolFunction;
762
+ /**
763
+ * Type is the tool type (function, code_interpreter, file_search, web_search)
764
+ */
765
+ type?: string;
766
+ };
767
+ type LlmapiToolCall = {
768
+ function?: LlmapiToolCallFunction;
769
+ /**
770
+ * ID is the unique identifier for this tool call
771
+ */
772
+ id?: string;
773
+ /**
774
+ * Type is the type of tool call (always "function" for now)
775
+ */
776
+ type?: string;
777
+ };
778
+ /**
779
+ * Function contains the function call details
780
+ */
781
+ type LlmapiToolCallFunction = {
782
+ /**
783
+ * Arguments is the JSON string of arguments to pass to the function
784
+ */
785
+ arguments?: string;
786
+ /**
787
+ * Name is the name of the function to call
788
+ */
789
+ name?: string;
790
+ };
791
+ /**
792
+ * Function is the function definition (when Type is "function")
793
+ */
794
+ type LlmapiToolFunction = {
795
+ /**
796
+ * Arguments is the function arguments schema (JSON object)
797
+ */
798
+ arguments?: {
799
+ [key: string]: unknown;
800
+ };
801
+ /**
802
+ * Name is the function name
803
+ */
804
+ name?: string;
805
+ };
806
+ type ResponseErrorResponse = {
807
+ error?: string;
808
+ };
809
+ type PostApiV1ChatCompletionsData = {
810
+ /**
811
+ * Chat completion request
812
+ */
813
+ body: LlmapiChatCompletionRequest;
814
+ path?: never;
815
+ query?: never;
816
+ url: '/api/v1/chat/completions';
817
+ };
818
+ type PostApiV1ChatCompletionsErrors = {
819
+ /**
820
+ * Bad Request
821
+ */
822
+ 400: ResponseErrorResponse;
823
+ /**
824
+ * Internal Server Error
825
+ */
826
+ 500: ResponseErrorResponse;
827
+ };
828
+ type PostApiV1ChatCompletionsError = PostApiV1ChatCompletionsErrors[keyof PostApiV1ChatCompletionsErrors];
829
+ type PostApiV1ChatCompletionsResponses = {
830
+ /**
831
+ * OK
832
+ */
833
+ 200: LlmapiChatCompletionResponse | string;
834
+ };
835
+ type PostApiV1ChatCompletionsResponse = PostApiV1ChatCompletionsResponses[keyof PostApiV1ChatCompletionsResponses];
836
+ type GetApiV1ConfigData = {
837
+ body?: never;
838
+ path?: never;
839
+ query?: never;
840
+ url: '/api/v1/config';
841
+ };
842
+ type GetApiV1ConfigErrors = {
843
+ /**
844
+ * Internal Server Error
845
+ */
846
+ 500: ResponseErrorResponse;
847
+ };
848
+ type GetApiV1ConfigError = GetApiV1ConfigErrors[keyof GetApiV1ConfigErrors];
849
+ type GetApiV1ConfigResponses = {
850
+ /**
851
+ * OK
852
+ */
853
+ 200: HandlersConfigResponse;
854
+ };
855
+ type GetApiV1ConfigResponse = GetApiV1ConfigResponses[keyof GetApiV1ConfigResponses];
856
+ type GetApiV1DocsSwaggerJsonData = {
857
+ body?: never;
858
+ path?: never;
859
+ query?: never;
860
+ url: '/api/v1/docs/swagger.json';
861
+ };
862
+ type GetApiV1DocsSwaggerJsonResponses = {
863
+ /**
864
+ * OK
865
+ */
866
+ 200: {
867
+ [key: string]: unknown;
868
+ };
869
+ };
870
+ type GetApiV1DocsSwaggerJsonResponse = GetApiV1DocsSwaggerJsonResponses[keyof GetApiV1DocsSwaggerJsonResponses];
871
+ type PostApiV1EmbeddingsData = {
872
+ /**
873
+ * Embedding request
874
+ */
875
+ body: LlmapiEmbeddingRequest;
876
+ path?: never;
877
+ query?: never;
878
+ url: '/api/v1/embeddings';
879
+ };
880
+ type PostApiV1EmbeddingsErrors = {
881
+ /**
882
+ * Bad Request
883
+ */
884
+ 400: ResponseErrorResponse;
885
+ /**
886
+ * Internal Server Error
887
+ */
888
+ 500: ResponseErrorResponse;
889
+ };
890
+ type PostApiV1EmbeddingsError = PostApiV1EmbeddingsErrors[keyof PostApiV1EmbeddingsErrors];
891
+ type PostApiV1EmbeddingsResponses = {
892
+ /**
893
+ * OK
894
+ */
895
+ 200: LlmapiEmbeddingResponse;
896
+ };
897
+ type PostApiV1EmbeddingsResponse = PostApiV1EmbeddingsResponses[keyof PostApiV1EmbeddingsResponses];
898
+ type PostApiV1ImagesGenerationsData = {
899
+ /**
900
+ * Image generation request
901
+ */
902
+ body: LlmapiImageGenerationRequest;
903
+ path?: never;
904
+ query?: never;
905
+ url: '/api/v1/images/generations';
906
+ };
907
+ type PostApiV1ImagesGenerationsErrors = {
908
+ /**
909
+ * Bad Request
910
+ */
911
+ 400: ResponseErrorResponse;
912
+ /**
913
+ * Internal Server Error
914
+ */
915
+ 500: ResponseErrorResponse;
916
+ /**
917
+ * Not Implemented
918
+ */
919
+ 501: ResponseErrorResponse;
920
+ };
921
+ type PostApiV1ImagesGenerationsError = PostApiV1ImagesGenerationsErrors[keyof PostApiV1ImagesGenerationsErrors];
922
+ type PostApiV1ImagesGenerationsResponses = {
923
+ /**
924
+ * OK
925
+ */
926
+ 200: LlmapiImageGenerationResponse;
927
+ };
928
+ type PostApiV1ImagesGenerationsResponse = PostApiV1ImagesGenerationsResponses[keyof PostApiV1ImagesGenerationsResponses];
929
+ type GetApiV1ModelsData = {
930
+ body?: never;
931
+ path?: never;
932
+ query?: {
933
+ /**
934
+ * Filter by provider (e.g., openai, anthropic)
935
+ */
936
+ provider?: string;
937
+ /**
938
+ * Number of models to return per page
939
+ */
940
+ page_size?: number;
941
+ /**
942
+ * Token to get next page of results
943
+ */
944
+ page_token?: string;
945
+ };
946
+ url: '/api/v1/models';
947
+ };
948
+ type GetApiV1ModelsErrors = {
949
+ /**
950
+ * Bad Request
951
+ */
952
+ 400: ResponseErrorResponse;
953
+ /**
954
+ * Internal Server Error
955
+ */
956
+ 500: ResponseErrorResponse;
957
+ };
958
+ type GetApiV1ModelsError = GetApiV1ModelsErrors[keyof GetApiV1ModelsErrors];
959
+ type GetApiV1ModelsResponses = {
960
+ /**
961
+ * OK
962
+ */
963
+ 200: LlmapiModelsListResponse;
964
+ };
965
+ type GetApiV1ModelsResponse = GetApiV1ModelsResponses[keyof GetApiV1ModelsResponses];
966
+ type PostApiV1ResponsesData = {
967
+ /**
968
+ * Response request
969
+ */
970
+ body: LlmapiResponseRequest;
971
+ path?: never;
972
+ query?: never;
973
+ url: '/api/v1/responses';
974
+ };
975
+ type PostApiV1ResponsesErrors = {
976
+ /**
977
+ * Bad Request
978
+ */
979
+ 400: ResponseErrorResponse;
980
+ /**
981
+ * Internal Server Error
982
+ */
983
+ 500: ResponseErrorResponse;
984
+ };
985
+ type PostApiV1ResponsesError = PostApiV1ResponsesErrors[keyof PostApiV1ResponsesErrors];
986
+ type PostApiV1ResponsesResponses = {
987
+ /**
988
+ * OK
989
+ */
990
+ 200: LlmapiResponseResponse | string;
991
+ };
992
+ type PostApiV1ResponsesResponse = PostApiV1ResponsesResponses[keyof PostApiV1ResponsesResponses];
993
+ type PostApiV1SearchData = {
994
+ /**
995
+ * Search request
996
+ */
997
+ body: LlmapiSearchRequest;
998
+ path?: never;
999
+ query?: never;
1000
+ url: '/api/v1/search';
1001
+ };
1002
+ type PostApiV1SearchErrors = {
1003
+ /**
1004
+ * Bad Request
1005
+ */
1006
+ 400: ResponseErrorResponse;
1007
+ /**
1008
+ * Internal Server Error
1009
+ */
1010
+ 500: ResponseErrorResponse;
1011
+ };
1012
+ type PostApiV1SearchError = PostApiV1SearchErrors[keyof PostApiV1SearchErrors];
1013
+ type PostApiV1SearchResponses = {
1014
+ /**
1015
+ * OK
1016
+ */
1017
+ 200: LlmapiSearchResponse;
1018
+ };
1019
+ type PostApiV1SearchResponse = PostApiV1SearchResponses[keyof PostApiV1SearchResponses];
1020
+ type PostAuthOauthByProviderExchangeData = {
1021
+ /**
1022
+ * Exchange request
1023
+ */
1024
+ body: HandlersExchangeRequest;
1025
+ path: {
1026
+ /**
1027
+ * OAuth provider (google-drive, dropbox)
1028
+ */
1029
+ provider: string;
1030
+ };
1031
+ query?: never;
1032
+ url: '/auth/oauth/{provider}/exchange';
1033
+ };
1034
+ type PostAuthOauthByProviderExchangeErrors = {
1035
+ /**
1036
+ * Bad Request
1037
+ */
1038
+ 400: ResponseErrorResponse;
1039
+ /**
1040
+ * Internal Server Error
1041
+ */
1042
+ 500: ResponseErrorResponse;
1043
+ };
1044
+ type PostAuthOauthByProviderExchangeError = PostAuthOauthByProviderExchangeErrors[keyof PostAuthOauthByProviderExchangeErrors];
1045
+ type PostAuthOauthByProviderExchangeResponses = {
1046
+ /**
1047
+ * OK
1048
+ */
1049
+ 200: HandlersTokenResponse;
1050
+ };
1051
+ type PostAuthOauthByProviderExchangeResponse = PostAuthOauthByProviderExchangeResponses[keyof PostAuthOauthByProviderExchangeResponses];
1052
+ type PostAuthOauthByProviderRefreshData = {
1053
+ /**
1054
+ * Refresh request
1055
+ */
1056
+ body: HandlersRefreshRequest;
1057
+ path: {
1058
+ /**
1059
+ * OAuth provider (google-drive, dropbox)
1060
+ */
1061
+ provider: string;
1062
+ };
1063
+ query?: never;
1064
+ url: '/auth/oauth/{provider}/refresh';
1065
+ };
1066
+ type PostAuthOauthByProviderRefreshErrors = {
1067
+ /**
1068
+ * Bad Request
1069
+ */
1070
+ 400: ResponseErrorResponse;
1071
+ /**
1072
+ * Internal Server Error
1073
+ */
1074
+ 500: ResponseErrorResponse;
1075
+ };
1076
+ type PostAuthOauthByProviderRefreshError = PostAuthOauthByProviderRefreshErrors[keyof PostAuthOauthByProviderRefreshErrors];
1077
+ type PostAuthOauthByProviderRefreshResponses = {
1078
+ /**
1079
+ * OK
1080
+ */
1081
+ 200: HandlersTokenResponse;
1082
+ };
1083
+ type PostAuthOauthByProviderRefreshResponse = PostAuthOauthByProviderRefreshResponses[keyof PostAuthOauthByProviderRefreshResponses];
1084
+ type PostAuthOauthByProviderRevokeData = {
1085
+ /**
1086
+ * Revoke request
1087
+ */
1088
+ body: HandlersRevokeRequest;
1089
+ path: {
1090
+ /**
1091
+ * OAuth provider (google-drive, dropbox)
1092
+ */
1093
+ provider: string;
1094
+ };
1095
+ query?: never;
1096
+ url: '/auth/oauth/{provider}/revoke';
1097
+ };
1098
+ type PostAuthOauthByProviderRevokeErrors = {
1099
+ /**
1100
+ * Bad Request
1101
+ */
1102
+ 400: ResponseErrorResponse;
1103
+ /**
1104
+ * Internal Server Error
1105
+ */
1106
+ 500: ResponseErrorResponse;
1107
+ };
1108
+ type PostAuthOauthByProviderRevokeError = PostAuthOauthByProviderRevokeErrors[keyof PostAuthOauthByProviderRevokeErrors];
1109
+ type PostAuthOauthByProviderRevokeResponses = {
1110
+ /**
1111
+ * Empty object on success
1112
+ */
1113
+ 200: {
1114
+ [key: string]: unknown;
1115
+ };
1116
+ };
1117
+ type PostAuthOauthByProviderRevokeResponse = PostAuthOauthByProviderRevokeResponses[keyof PostAuthOauthByProviderRevokeResponses];
1118
+ type GetHealthData = {
1119
+ body?: never;
1120
+ path?: never;
1121
+ query?: never;
1122
+ url: '/health';
1123
+ };
1124
+ type GetHealthErrors = {
1125
+ /**
1126
+ * Internal Server Error
1127
+ */
1128
+ 500: ResponseErrorResponse;
1129
+ };
1130
+ type GetHealthError = GetHealthErrors[keyof GetHealthErrors];
1131
+ type GetHealthResponses = {
1132
+ /**
1133
+ * OK
1134
+ */
1135
+ 200: HandlersHealthResponse;
1136
+ };
1137
+ type GetHealthResponse = GetHealthResponses[keyof GetHealthResponses];
1138
+
1139
+ type AuthToken = string | undefined;
1140
+ interface Auth {
1141
+ /**
1142
+ * Which part of the request do we use to send the auth?
1143
+ *
1144
+ * @default 'header'
1145
+ */
1146
+ in?: 'header' | 'query' | 'cookie';
1147
+ /**
1148
+ * Header or query parameter name.
1149
+ *
1150
+ * @default 'Authorization'
1151
+ */
1152
+ name?: string;
1153
+ scheme?: 'basic' | 'bearer';
1154
+ type: 'apiKey' | 'http';
1155
+ }
1156
+
1157
+ interface SerializerOptions<T> {
1158
+ /**
1159
+ * @default true
1160
+ */
1161
+ explode: boolean;
1162
+ style: T;
1163
+ }
1164
+ type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
1165
+ type ObjectStyle = 'form' | 'deepObject';
1166
+
1167
+ type QuerySerializer = (query: Record<string, unknown>) => string;
1168
+ type BodySerializer = (body: any) => any;
1169
+ type QuerySerializerOptionsObject = {
1170
+ allowReserved?: boolean;
1171
+ array?: Partial<SerializerOptions<ArrayStyle>>;
1172
+ object?: Partial<SerializerOptions<ObjectStyle>>;
1173
+ };
1174
+ type QuerySerializerOptions = QuerySerializerOptionsObject & {
1175
+ /**
1176
+ * Per-parameter serialization overrides. When provided, these settings
1177
+ * override the global array/object settings for specific parameter names.
1178
+ */
1179
+ parameters?: Record<string, QuerySerializerOptionsObject>;
1180
+ };
1181
+
1182
+ type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
1183
+ type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
1184
+ /**
1185
+ * Returns the final request URL.
1186
+ */
1187
+ buildUrl: BuildUrlFn;
1188
+ getConfig: () => Config;
1189
+ request: RequestFn;
1190
+ setConfig: (config: Config) => Config;
1191
+ } & {
1192
+ [K in HttpMethod]: MethodFn;
1193
+ } & ([SseFn] extends [never] ? {
1194
+ sse?: never;
1195
+ } : {
1196
+ sse: {
1197
+ [K in HttpMethod]: SseFn;
1198
+ };
1199
+ });
1200
+ interface Config$1 {
1201
+ /**
1202
+ * Auth token or a function returning auth token. The resolved value will be
1203
+ * added to the request payload as defined by its `security` array.
1204
+ */
1205
+ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
1206
+ /**
1207
+ * A function for serializing request body parameter. By default,
1208
+ * {@link JSON.stringify()} will be used.
1209
+ */
1210
+ bodySerializer?: BodySerializer | null;
1211
+ /**
1212
+ * An object containing any HTTP headers that you want to pre-populate your
1213
+ * `Headers` object with.
1214
+ *
1215
+ * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
1216
+ */
1217
+ headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
1218
+ /**
1219
+ * The request method.
1220
+ *
1221
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
1222
+ */
1223
+ method?: Uppercase<HttpMethod>;
1224
+ /**
1225
+ * A function for serializing request query parameters. By default, arrays
1226
+ * will be exploded in form style, objects will be exploded in deepObject
1227
+ * style, and reserved characters are percent-encoded.
1228
+ *
1229
+ * This method will have no effect if the native `paramsSerializer()` Axios
1230
+ * API function is used.
1231
+ *
1232
+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
1233
+ */
1234
+ querySerializer?: QuerySerializer | QuerySerializerOptions;
1235
+ /**
1236
+ * A function validating request data. This is useful if you want to ensure
1237
+ * the request conforms to the desired shape, so it can be safely sent to
1238
+ * the server.
1239
+ */
1240
+ requestValidator?: (data: unknown) => Promise<unknown>;
1241
+ /**
1242
+ * A function transforming response data before it's returned. This is useful
1243
+ * for post-processing data, e.g. converting ISO strings into Date objects.
1244
+ */
1245
+ responseTransformer?: (data: unknown) => Promise<unknown>;
1246
+ /**
1247
+ * A function validating response data. This is useful if you want to ensure
1248
+ * the response conforms to the desired shape, so it can be safely passed to
1249
+ * the transformers and returned to the user.
1250
+ */
1251
+ responseValidator?: (data: unknown) => Promise<unknown>;
1252
+ }
1253
+
1254
+ type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
1255
+ /**
1256
+ * Fetch API implementation. You can use this option to provide a custom
1257
+ * fetch instance.
1258
+ *
1259
+ * @default globalThis.fetch
1260
+ */
1261
+ fetch?: typeof fetch;
1262
+ /**
1263
+ * Implementing clients can call request interceptors inside this hook.
1264
+ */
1265
+ onRequest?: (url: string, init: RequestInit) => Promise<Request>;
1266
+ /**
1267
+ * Callback invoked when a network or parsing error occurs during streaming.
1268
+ *
1269
+ * This option applies only if the endpoint returns a stream of events.
1270
+ *
1271
+ * @param error The error that occurred.
1272
+ */
1273
+ onSseError?: (error: unknown) => void;
1274
+ /**
1275
+ * Callback invoked when an event is streamed from the server.
1276
+ *
1277
+ * This option applies only if the endpoint returns a stream of events.
1278
+ *
1279
+ * @param event Event streamed from the server.
1280
+ * @returns Nothing (void).
1281
+ */
1282
+ onSseEvent?: (event: StreamEvent<TData>) => void;
1283
+ serializedBody?: RequestInit['body'];
1284
+ /**
1285
+ * Default retry delay in milliseconds.
1286
+ *
1287
+ * This option applies only if the endpoint returns a stream of events.
1288
+ *
1289
+ * @default 3000
1290
+ */
1291
+ sseDefaultRetryDelay?: number;
1292
+ /**
1293
+ * Maximum number of retry attempts before giving up.
1294
+ */
1295
+ sseMaxRetryAttempts?: number;
1296
+ /**
1297
+ * Maximum retry delay in milliseconds.
1298
+ *
1299
+ * Applies only when exponential backoff is used.
1300
+ *
1301
+ * This option applies only if the endpoint returns a stream of events.
1302
+ *
1303
+ * @default 30000
1304
+ */
1305
+ sseMaxRetryDelay?: number;
1306
+ /**
1307
+ * Optional sleep function for retry backoff.
1308
+ *
1309
+ * Defaults to using `setTimeout`.
1310
+ */
1311
+ sseSleepFn?: (ms: number) => Promise<void>;
1312
+ url: string;
1313
+ };
1314
+ interface StreamEvent<TData = unknown> {
1315
+ data: TData;
1316
+ event?: string;
1317
+ id?: string;
1318
+ retry?: number;
1319
+ }
1320
+ type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
1321
+ stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
1322
+ };
1323
+
1324
+ type ErrInterceptor<Err, Res, Options> = (error: Err, response: Res, options: Options) => Err | Promise<Err>;
1325
+ type ReqInterceptor<Options> = (options: Options) => void | Promise<void>;
1326
+ type ResInterceptor<Res, Options> = (response: Res, options: Options) => Res | Promise<Res>;
1327
+ declare class Interceptors<Interceptor> {
1328
+ fns: Array<Interceptor | null>;
1329
+ clear(): void;
1330
+ eject(id: number | Interceptor): void;
1331
+ exists(id: number | Interceptor): boolean;
1332
+ getInterceptorIndex(id: number | Interceptor): number;
1333
+ update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
1334
+ use(fn: Interceptor): number;
1335
+ }
1336
+ interface Middleware<Res, Err, Options> {
1337
+ error: Interceptors<ErrInterceptor<Err, Res, Options>>;
1338
+ request: Interceptors<ReqInterceptor<Options>>;
1339
+ response: Interceptors<ResInterceptor<Res, Options>>;
1340
+ }
1341
+
1342
+ interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
1343
+ /**
1344
+ * Base URL for all requests made by this client.
1345
+ */
1346
+ baseUrl?: T['baseUrl'];
1347
+ /**
1348
+ * Fetch API implementation. You can use this option to provide a custom
1349
+ * fetch instance.
1350
+ *
1351
+ * @default globalThis.fetch
1352
+ */
1353
+ fetch?: typeof fetch;
1354
+ /**
1355
+ * Return the response data parsed in a specified format. By default, `auto`
1356
+ * will infer the appropriate method from the `Content-Type` response header.
1357
+ * You can override this behavior with any of the {@link Body} methods.
1358
+ * Select `stream` if you don't want to parse response data at all.
1359
+ *
1360
+ * @default 'auto'
1361
+ */
1362
+ parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
1363
+ /**
1364
+ * Throw an error instead of returning it in the response?
1365
+ *
1366
+ * @default false
1367
+ */
1368
+ throwOnError?: T['throwOnError'];
1369
+ }
1370
+ interface RequestOptions<TData = unknown, ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
1371
+ throwOnError: ThrowOnError;
1372
+ }>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
1373
+ /**
1374
+ * Any body that you want to add to your request.
1375
+ *
1376
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
1377
+ */
1378
+ body?: unknown;
1379
+ path?: Record<string, unknown>;
1380
+ query?: Record<string, unknown>;
1381
+ /**
1382
+ * Security mechanism(s) to use for the request.
1383
+ */
1384
+ security?: ReadonlyArray<Auth>;
1385
+ url: Url;
1386
+ }
1387
+ interface ResolvedRequestOptions<ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, ThrowOnError, Url> {
1388
+ serializedBody?: string;
1389
+ }
1390
+ type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean> = ThrowOnError extends true ? Promise<{
1391
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
1392
+ response: Response;
1393
+ }> : Promise<({
1394
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
1395
+ error: undefined;
1396
+ } | {
1397
+ data: undefined;
1398
+ error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
1399
+ }) & {
1400
+ response: Response;
1401
+ }>;
1402
+ interface ClientOptions {
1403
+ baseUrl?: string;
1404
+ throwOnError?: boolean;
1405
+ }
1406
+ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions<TData, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError>;
1407
+ type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions<TData, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
1408
+ type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions<TData, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError>;
1409
+ type BuildUrlFn = <TData extends {
1410
+ body?: unknown;
1411
+ path?: Record<string, unknown>;
1412
+ query?: Record<string, unknown>;
1413
+ url: string;
1414
+ }>(options: TData & Options$1<TData>) => string;
1415
+ type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
1416
+ interceptors: Middleware<Response, unknown, ResolvedRequestOptions>;
1417
+ };
1418
+ interface TDataShape {
1419
+ body?: unknown;
1420
+ headers?: unknown;
1421
+ path?: unknown;
1422
+ query?: unknown;
1423
+ url: string;
1424
+ }
1425
+ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
1426
+ type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = OmitKeys<RequestOptions<TResponse, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
1427
+
1428
+ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options$1<TData, ThrowOnError> & {
1429
+ /**
1430
+ * You can provide a client instance returned by `createClient()` instead of
1431
+ * individual options. This might be also useful if you want to implement a
1432
+ * custom client.
1433
+ */
1434
+ client?: Client;
1435
+ /**
1436
+ * You can pass arbitrary values through the `meta` object. This can be
1437
+ * used to access values that aren't defined as part of the SDK function.
1438
+ */
1439
+ meta?: Record<string, unknown>;
1440
+ };
1441
+ /**
1442
+ * Create chat completion
1443
+ *
1444
+ * Generates a chat completion using the configured gateway. Supports streaming when stream=true.
1445
+ */
1446
+ declare const postApiV1ChatCompletions: <ThrowOnError extends boolean = false>(options: Options<PostApiV1ChatCompletionsData, ThrowOnError>) => RequestResult<PostApiV1ChatCompletionsResponses, PostApiV1ChatCompletionsErrors, ThrowOnError>;
1447
+ /**
1448
+ * Get configuration
1449
+ *
1450
+ * Returns public configuration including contract addresses and payment model
1451
+ */
1452
+ declare const getApiV1Config: <ThrowOnError extends boolean = false>(options?: Options<GetApiV1ConfigData, ThrowOnError>) => RequestResult<GetApiV1ConfigResponses, GetApiV1ConfigErrors, ThrowOnError>;
1453
+ /**
1454
+ * Get OpenAPI specification
1455
+ *
1456
+ * Returns the OpenAPI 3.1 specification for this API
1457
+ */
1458
+ declare const getApiV1DocsSwaggerJson: <ThrowOnError extends boolean = false>(options?: Options<GetApiV1DocsSwaggerJsonData, ThrowOnError>) => RequestResult<GetApiV1DocsSwaggerJsonResponses, unknown, ThrowOnError>;
1459
+ /**
1460
+ * Create embeddings
1461
+ *
1462
+ * Generates embeddings using the configured gateway.
1463
+ */
1464
+ declare const postApiV1Embeddings: <ThrowOnError extends boolean = false>(options: Options<PostApiV1EmbeddingsData, ThrowOnError>) => RequestResult<PostApiV1EmbeddingsResponses, PostApiV1EmbeddingsErrors, ThrowOnError>;
1465
+ /**
1466
+ * Generate images
1467
+ *
1468
+ * Generates images using the configured LLM gateway.
1469
+ */
1470
+ declare const postApiV1ImagesGenerations: <ThrowOnError extends boolean = false>(options: Options<PostApiV1ImagesGenerationsData, ThrowOnError>) => RequestResult<PostApiV1ImagesGenerationsResponses, PostApiV1ImagesGenerationsErrors, ThrowOnError>;
1471
+ /**
1472
+ * List available models
1473
+ *
1474
+ * Returns a list of all available models from the configured gateway with optional filters. Models include modality information indicating their capabilities (e.g., llm, embedding, vision, image, audio, reasoning, code, reranker, multimodal, video).
1475
+ */
1476
+ declare const getApiV1Models: <ThrowOnError extends boolean = false>(options?: Options<GetApiV1ModelsData, ThrowOnError>) => RequestResult<GetApiV1ModelsResponses, GetApiV1ModelsErrors, ThrowOnError>;
1477
+ /**
1478
+ * Create response
1479
+ *
1480
+ * Generates a response using the Responses API format. Supports streaming when stream=true.
1481
+ */
1482
+ declare const postApiV1Responses: <ThrowOnError extends boolean = false>(options: Options<PostApiV1ResponsesData, ThrowOnError>) => RequestResult<PostApiV1ResponsesResponses, PostApiV1ResponsesErrors, ThrowOnError>;
1483
+ /**
1484
+ * Create search
1485
+ *
1486
+ * Returns a list of ranked search results
1487
+ */
1488
+ declare const postApiV1Search: <ThrowOnError extends boolean = false>(options: Options<PostApiV1SearchData, ThrowOnError>) => RequestResult<PostApiV1SearchResponses, PostApiV1SearchErrors, ThrowOnError>;
1489
+ /**
1490
+ * Exchange authorization code for tokens
1491
+ *
1492
+ * Exchanges an OAuth authorization code for access and refresh tokens
1493
+ */
1494
+ declare const postAuthOauthByProviderExchange: <ThrowOnError extends boolean = false>(options: Options<PostAuthOauthByProviderExchangeData, ThrowOnError>) => RequestResult<PostAuthOauthByProviderExchangeResponses, PostAuthOauthByProviderExchangeErrors, ThrowOnError>;
1495
+ /**
1496
+ * Refresh access token
1497
+ *
1498
+ * Refreshes an expired access token using a refresh token
1499
+ */
1500
+ declare const postAuthOauthByProviderRefresh: <ThrowOnError extends boolean = false>(options: Options<PostAuthOauthByProviderRefreshData, ThrowOnError>) => RequestResult<PostAuthOauthByProviderRefreshResponses, PostAuthOauthByProviderRefreshErrors, ThrowOnError>;
1501
+ /**
1502
+ * Revoke OAuth token
1503
+ *
1504
+ * Revokes an OAuth access or refresh token
1505
+ */
1506
+ declare const postAuthOauthByProviderRevoke: <ThrowOnError extends boolean = false>(options: Options<PostAuthOauthByProviderRevokeData, ThrowOnError>) => RequestResult<PostAuthOauthByProviderRevokeResponses, PostAuthOauthByProviderRevokeErrors, ThrowOnError>;
1507
+ /**
1508
+ * Health check
1509
+ *
1510
+ * Returns the current health status of the service.
1511
+ */
1512
+ declare const getHealth: <ThrowOnError extends boolean = false>(options?: Options<GetHealthData, ThrowOnError>) => RequestResult<GetHealthResponses, GetHealthErrors, ThrowOnError>;
1513
+
1514
+ export { type ClientOptions$1 as ClientOptions, type GetApiV1ConfigData, type GetApiV1ConfigError, type GetApiV1ConfigErrors, type GetApiV1ConfigResponse, type GetApiV1ConfigResponses, type GetApiV1DocsSwaggerJsonData, type GetApiV1DocsSwaggerJsonResponse, type GetApiV1DocsSwaggerJsonResponses, type GetApiV1ModelsData, type GetApiV1ModelsError, type GetApiV1ModelsErrors, type GetApiV1ModelsResponse, type GetApiV1ModelsResponses, type GetHealthData, type GetHealthError, type GetHealthErrors, type GetHealthResponse, type GetHealthResponses, type HandlersConfigResponse, type HandlersExchangeRequest, type HandlersHealthResponse, type HandlersRefreshRequest, type HandlersRevokeRequest, type HandlersTokenResponse, type LlmapiChatCompletionExtraFields, type LlmapiChatCompletionRequest, type LlmapiChatCompletionResponse, type LlmapiChatCompletionUsage, type LlmapiChoice, type LlmapiEmbeddingData, type LlmapiEmbeddingExtraFields, type LlmapiEmbeddingRequest, type LlmapiEmbeddingResponse, type LlmapiEmbeddingUsage, type LlmapiImageGenerationExtraFields, type LlmapiImageGenerationImage, type LlmapiImageGenerationRequest, type LlmapiImageGenerationResponse, type LlmapiImageGenerationUsage, type LlmapiMessage, type LlmapiMessageContentImage, type LlmapiMessageContentPart, type LlmapiModel, type LlmapiModelArchitecture, type LlmapiModelPerRequestLimits, type LlmapiModelPricing, type LlmapiModelTopProvider, type LlmapiModelsListExtraFields, type LlmapiModelsListResponse, type LlmapiResponseExtraFields, type LlmapiResponseOutputContent, type LlmapiResponseOutputItem, type LlmapiResponseReasoning, type LlmapiResponseRequest, type LlmapiResponseResponse, type LlmapiResponseUsage, type LlmapiRole, type LlmapiSearchExtraFields, type LlmapiSearchRequest, type LlmapiSearchResponse, type LlmapiSearchResult, type LlmapiSearchUsage, type LlmapiThinkingOptions, type LlmapiTool, type LlmapiToolCall, type LlmapiToolCallFunction, type LlmapiToolFunction, type Options, type PostApiV1ChatCompletionsData, type PostApiV1ChatCompletionsError, type PostApiV1ChatCompletionsErrors, type PostApiV1ChatCompletionsResponse, type PostApiV1ChatCompletionsResponses, type PostApiV1EmbeddingsData, type PostApiV1EmbeddingsError, type PostApiV1EmbeddingsErrors, type PostApiV1EmbeddingsResponse, type PostApiV1EmbeddingsResponses, type PostApiV1ImagesGenerationsData, type PostApiV1ImagesGenerationsError, type PostApiV1ImagesGenerationsErrors, type PostApiV1ImagesGenerationsResponse, type PostApiV1ImagesGenerationsResponses, type PostApiV1ResponsesData, type PostApiV1ResponsesError, type PostApiV1ResponsesErrors, type PostApiV1ResponsesResponse, type PostApiV1ResponsesResponses, type PostApiV1SearchData, type PostApiV1SearchError, type PostApiV1SearchErrors, type PostApiV1SearchResponse, type PostApiV1SearchResponses, type PostAuthOauthByProviderExchangeData, type PostAuthOauthByProviderExchangeError, type PostAuthOauthByProviderExchangeErrors, type PostAuthOauthByProviderExchangeResponse, type PostAuthOauthByProviderExchangeResponses, type PostAuthOauthByProviderRefreshData, type PostAuthOauthByProviderRefreshError, type PostAuthOauthByProviderRefreshErrors, type PostAuthOauthByProviderRefreshResponse, type PostAuthOauthByProviderRefreshResponses, type PostAuthOauthByProviderRevokeData, type PostAuthOauthByProviderRevokeError, type PostAuthOauthByProviderRevokeErrors, type PostAuthOauthByProviderRevokeResponse, type PostAuthOauthByProviderRevokeResponses, type ResponseErrorResponse, getApiV1Config, getApiV1DocsSwaggerJson, getApiV1Models, getHealth, postApiV1ChatCompletions, postApiV1Embeddings, postApiV1ImagesGenerations, postApiV1Responses, postApiV1Search, postAuthOauthByProviderExchange, postAuthOauthByProviderRefresh, postAuthOauthByProviderRevoke };