quantum-ai-sdk 0.2.0 → 0.2.1

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 (49) hide show
  1. package/dist/account.d.ts +22 -0
  2. package/dist/account.js +47 -0
  3. package/dist/agent.d.ts +12 -0
  4. package/dist/agent.js +114 -0
  5. package/dist/audio.d.ts +82 -0
  6. package/dist/audio.js +140 -0
  7. package/dist/auth.d.ts +7 -0
  8. package/dist/auth.js +8 -0
  9. package/dist/batch.d.ts +22 -0
  10. package/dist/batch.js +32 -0
  11. package/dist/chat.d.ts +27 -0
  12. package/dist/chat.js +122 -0
  13. package/dist/client.d.ts +251 -0
  14. package/dist/client.js +479 -0
  15. package/dist/compute.d.ts +37 -0
  16. package/dist/compute.js +56 -0
  17. package/dist/contact.d.ts +12 -0
  18. package/dist/contact.js +26 -0
  19. package/dist/credits.d.ts +27 -0
  20. package/dist/credits.js +40 -0
  21. package/dist/documents.d.ts +17 -0
  22. package/dist/documents.js +42 -0
  23. package/dist/embeddings.d.ts +7 -0
  24. package/dist/embeddings.js +14 -0
  25. package/dist/errors.d.ts +29 -0
  26. package/dist/errors.js +70 -0
  27. package/dist/image.d.ts +12 -0
  28. package/dist/image.js +28 -0
  29. package/dist/index.d.ts +17 -0
  30. package/dist/index.js +33 -0
  31. package/dist/jobs.d.ts +28 -0
  32. package/dist/jobs.js +56 -0
  33. package/dist/keys.d.ts +17 -0
  34. package/dist/keys.js +24 -0
  35. package/dist/models.d.ts +12 -0
  36. package/dist/models.js +16 -0
  37. package/dist/rag.d.ts +22 -0
  38. package/dist/rag.js +44 -0
  39. package/dist/realtime.d.ts +121 -0
  40. package/dist/realtime.js +259 -0
  41. package/dist/session.d.ts +7 -0
  42. package/dist/session.js +17 -0
  43. package/dist/types.d.ts +1008 -0
  44. package/dist/types.js +5 -0
  45. package/dist/video.d.ts +46 -0
  46. package/dist/video.js +74 -0
  47. package/dist/voices.d.ts +27 -0
  48. package/dist/voices.js +55 -0
  49. package/package.json +3 -3
@@ -0,0 +1,1008 @@
1
+ /** Default production Quantum AI API endpoint. */
2
+ export declare const DEFAULT_BASE_URL = "https://api.quantumencoding.ai";
3
+ /** Number of ticks in one US dollar (10 billion). */
4
+ export declare const TICKS_PER_USD = 10000000000n;
5
+ export interface ClientOptions {
6
+ /** Override the default API base URL. */
7
+ baseUrl?: string;
8
+ /** Custom fetch implementation (defaults to global fetch). */
9
+ fetch?: typeof globalThis.fetch;
10
+ }
11
+ /** Common metadata parsed from API response headers. */
12
+ export interface ResponseMeta {
13
+ costTicks: number;
14
+ requestId: string;
15
+ model: string;
16
+ }
17
+ export interface ChatRequest {
18
+ /** Model ID that determines provider routing (e.g. "claude-sonnet-4-6"). */
19
+ model: string;
20
+ /** Conversation history. */
21
+ messages: ChatMessage[];
22
+ /** Functions the model can call. */
23
+ tools?: ChatTool[];
24
+ /** Enable server-sent event streaming. Use chatStream() instead of chat(). */
25
+ stream?: boolean;
26
+ /** Controls randomness (0.0-2.0). */
27
+ temperature?: number;
28
+ /** Limits the response length. */
29
+ max_tokens?: number;
30
+ /**
31
+ * Provider-specific settings (e.g. Anthropic thinking, xAI search).
32
+ * Example: { anthropic: { thinking: { budget_tokens: 10000 } } }
33
+ */
34
+ provider_options?: Record<string, Record<string, unknown>>;
35
+ }
36
+ export interface ChatMessage {
37
+ role: "system" | "user" | "assistant" | "tool";
38
+ content?: string;
39
+ content_blocks?: ContentBlock[];
40
+ tool_call_id?: string;
41
+ is_error?: boolean;
42
+ }
43
+ export interface ChatTool {
44
+ type: "function";
45
+ function: {
46
+ name: string;
47
+ description?: string;
48
+ parameters?: Record<string, unknown>;
49
+ };
50
+ }
51
+ export interface ContentBlock {
52
+ type: string;
53
+ text?: string;
54
+ id?: string;
55
+ name?: string;
56
+ input?: Record<string, unknown>;
57
+ [key: string]: unknown;
58
+ }
59
+ export interface ChatUsage {
60
+ input_tokens: number;
61
+ output_tokens: number;
62
+ cost_ticks: number;
63
+ }
64
+ export interface ChatResponse {
65
+ id: string;
66
+ model: string;
67
+ content: ContentBlock[];
68
+ usage: ChatUsage;
69
+ stop_reason: string;
70
+ request_id: string;
71
+ cost_ticks: number;
72
+ }
73
+ export interface StreamDelta {
74
+ text?: string;
75
+ }
76
+ export interface StreamToolUse {
77
+ id: string;
78
+ name: string;
79
+ input: Record<string, unknown>;
80
+ }
81
+ export interface StreamEvent {
82
+ type: string;
83
+ delta?: StreamDelta;
84
+ tool_use?: StreamToolUse;
85
+ usage?: ChatUsage;
86
+ error?: string;
87
+ done?: boolean;
88
+ }
89
+ /** Raw SSE event before parsing into StreamEvent. */
90
+ export interface RawStreamEvent {
91
+ type?: string;
92
+ delta?: StreamDelta;
93
+ tool_use?: StreamToolUse;
94
+ usage?: ChatUsage;
95
+ message?: string;
96
+ input_tokens?: number;
97
+ output_tokens?: number;
98
+ cost_ticks?: number;
99
+ [key: string]: unknown;
100
+ }
101
+ export interface SessionChatRequest {
102
+ /** Session ID. Omit to create a new session. */
103
+ session_id?: string;
104
+ /** Model to use for generation. */
105
+ model?: string;
106
+ /** The user message. */
107
+ message: string;
108
+ /** Tools the model can call. */
109
+ tools?: ChatTool[];
110
+ /** Tool results from previous calls. */
111
+ tool_results?: SessionToolResult[];
112
+ /** Enable streaming. */
113
+ stream?: boolean;
114
+ /** System prompt. */
115
+ system_prompt?: string;
116
+ /** Context management configuration. */
117
+ context_config?: ContextConfig;
118
+ /** Provider-specific settings. */
119
+ provider_options?: Record<string, Record<string, unknown>>;
120
+ }
121
+ export interface SessionToolResult {
122
+ tool_call_id: string;
123
+ content: string;
124
+ is_error?: boolean;
125
+ }
126
+ export interface ContextConfig {
127
+ max_tokens?: number;
128
+ auto_compact?: boolean;
129
+ }
130
+ export interface ContextMetadata {
131
+ turn_count: number;
132
+ estimated_tokens: number;
133
+ compacted: boolean;
134
+ compaction_note?: string;
135
+ }
136
+ export interface SessionChatResponse {
137
+ session_id: string;
138
+ response: ChatResponse;
139
+ context: ContextMetadata;
140
+ }
141
+ export interface AgentRequest {
142
+ /** The task or goal for the agent to accomplish. */
143
+ task: string;
144
+ /** Model for the conductor (default: server picks). */
145
+ conductor_model?: string;
146
+ /** Worker configurations. */
147
+ workers?: AgentWorkerConfig[];
148
+ /** Maximum number of orchestration steps. */
149
+ max_steps?: number;
150
+ /** System prompt for the conductor. */
151
+ system_prompt?: string;
152
+ }
153
+ export interface AgentWorkerConfig {
154
+ name: string;
155
+ model?: string;
156
+ tools?: ChatTool[];
157
+ system_prompt?: string;
158
+ }
159
+ export interface AgentEvent {
160
+ type: string;
161
+ done: boolean;
162
+ worker?: string;
163
+ content?: string;
164
+ tool_use?: StreamToolUse;
165
+ error?: string;
166
+ [key: string]: unknown;
167
+ }
168
+ export interface MissionRequest {
169
+ /** The goal for the mission. */
170
+ goal: string;
171
+ /** Model for the conductor. */
172
+ conductor_model?: string;
173
+ /** Worker configurations. */
174
+ workers?: MissionWorkerConfig[];
175
+ /** Maximum orchestration steps. */
176
+ max_steps?: number;
177
+ }
178
+ export interface MissionWorkerConfig {
179
+ name: string;
180
+ model?: string;
181
+ tools?: ChatTool[];
182
+ system_prompt?: string;
183
+ }
184
+ export interface MissionEvent {
185
+ type: string;
186
+ done: boolean;
187
+ worker?: string;
188
+ content?: string;
189
+ tool_use?: StreamToolUse;
190
+ error?: string;
191
+ [key: string]: unknown;
192
+ }
193
+ export interface ImageRequest {
194
+ /** Model for image generation. */
195
+ model: string;
196
+ /** Text prompt describing the image. */
197
+ prompt: string;
198
+ /** Number of images to generate. */
199
+ n?: number;
200
+ /** Image size (e.g. "1024x1024"). */
201
+ size?: string;
202
+ /** Quality level (e.g. "standard", "hd"). */
203
+ quality?: string;
204
+ }
205
+ export interface GeneratedImage {
206
+ url?: string;
207
+ b64_json?: string;
208
+ }
209
+ export interface ImageResponse {
210
+ images: GeneratedImage[];
211
+ model: string;
212
+ request_id: string;
213
+ cost_ticks: number;
214
+ }
215
+ export interface ImageEditRequest {
216
+ /** Model for image editing. */
217
+ model: string;
218
+ /** Text prompt describing the edit. */
219
+ prompt: string;
220
+ /** Base64-encoded source image. */
221
+ image: string;
222
+ /** Optional mask image for inpainting. */
223
+ mask?: string;
224
+ /** Image size. */
225
+ size?: string;
226
+ /** Number of images. */
227
+ n?: number;
228
+ }
229
+ export interface ImageEditResponse {
230
+ images: GeneratedImage[];
231
+ model: string;
232
+ request_id: string;
233
+ cost_ticks: number;
234
+ }
235
+ export interface TTSRequest {
236
+ /** Model for text-to-speech. */
237
+ model?: string;
238
+ /** Text to speak. */
239
+ text: string;
240
+ /** Voice ID. */
241
+ voice?: string;
242
+ /** Output format (e.g. "mp3", "wav"). */
243
+ format?: string;
244
+ /** Speaking speed. */
245
+ speed?: number;
246
+ }
247
+ export interface TTSResponse {
248
+ audio_url: string;
249
+ format: string;
250
+ duration_seconds: number;
251
+ request_id: string;
252
+ cost_ticks: number;
253
+ }
254
+ export interface STTRequest {
255
+ /** Model for speech-to-text. */
256
+ model?: string;
257
+ /** Base64-encoded audio data. */
258
+ audio: string;
259
+ /** Audio format (e.g. "wav", "mp3"). */
260
+ format?: string;
261
+ /** BCP-47 language code. */
262
+ language?: string;
263
+ }
264
+ export interface STTResponse {
265
+ text: string;
266
+ language: string;
267
+ duration_seconds: number;
268
+ request_id: string;
269
+ cost_ticks: number;
270
+ }
271
+ export interface MusicRequest {
272
+ /** Text prompt describing the music. */
273
+ prompt: string;
274
+ /** Duration in seconds. */
275
+ duration?: number;
276
+ /** Model to use for music generation. */
277
+ model?: string;
278
+ }
279
+ export interface MusicClip {
280
+ audio_url: string;
281
+ title?: string;
282
+ tags?: string;
283
+ duration_seconds: number;
284
+ }
285
+ export interface MusicResponse {
286
+ clips: MusicClip[];
287
+ request_id: string;
288
+ cost_ticks: number;
289
+ }
290
+ export interface SoundEffectRequest {
291
+ /** Text prompt describing the sound effect. */
292
+ text: string;
293
+ /** Duration in seconds. */
294
+ duration_seconds?: number;
295
+ /** Whether to generate multiple variations. */
296
+ prompt_influence?: number;
297
+ }
298
+ export interface SoundEffectResponse {
299
+ audio_url: string;
300
+ request_id: string;
301
+ cost_ticks: number;
302
+ }
303
+ export interface DialogueVoice {
304
+ voice_id: string;
305
+ name?: string;
306
+ }
307
+ export interface DialogueRequest {
308
+ /** Script with speaker names and lines. */
309
+ script: string;
310
+ /** Voice mapping (speaker name -> voice ID). */
311
+ voices: Record<string, string>;
312
+ /** Model for dialogue generation. */
313
+ model?: string;
314
+ }
315
+ export interface DialogueResponse {
316
+ audio_url: string;
317
+ duration_seconds: number;
318
+ request_id: string;
319
+ cost_ticks: number;
320
+ }
321
+ export interface SpeechToSpeechRequest {
322
+ /** Base64-encoded source audio. */
323
+ audio: string;
324
+ /** Target voice ID. */
325
+ voice_id: string;
326
+ /** Model for voice conversion. */
327
+ model?: string;
328
+ }
329
+ export interface SpeechToSpeechResponse {
330
+ audio_url: string;
331
+ duration_seconds: number;
332
+ request_id: string;
333
+ cost_ticks: number;
334
+ }
335
+ export interface IsolateVoiceRequest {
336
+ /** Base64-encoded audio. */
337
+ audio: string;
338
+ }
339
+ export interface IsolateVoiceResponse {
340
+ audio_url: string;
341
+ request_id: string;
342
+ cost_ticks: number;
343
+ }
344
+ export interface RemixVoiceRequest {
345
+ /** Base64-encoded audio. */
346
+ audio: string;
347
+ /** Target voice ID. */
348
+ voice_id: string;
349
+ }
350
+ export interface RemixVoiceResponse {
351
+ audio_url: string;
352
+ request_id: string;
353
+ cost_ticks: number;
354
+ }
355
+ export interface DubRequest {
356
+ /** Base64-encoded audio/video to dub. */
357
+ audio: string;
358
+ /** Target language code. */
359
+ target_lang: string;
360
+ /** Source language code. */
361
+ source_lang?: string;
362
+ }
363
+ export interface DubResponse {
364
+ audio_url: string;
365
+ request_id: string;
366
+ cost_ticks: number;
367
+ }
368
+ export interface AlignRequest {
369
+ /** Base64-encoded audio. */
370
+ audio: string;
371
+ /** Text to align against the audio. */
372
+ text: string;
373
+ }
374
+ export interface AlignedWord {
375
+ word: string;
376
+ start: number;
377
+ end: number;
378
+ }
379
+ export interface AlignResponse {
380
+ words: AlignedWord[];
381
+ request_id: string;
382
+ cost_ticks: number;
383
+ }
384
+ export interface VoiceDesignRequest {
385
+ /** Text description of the desired voice. */
386
+ description: string;
387
+ /** Text to preview the voice with. */
388
+ preview_text?: string;
389
+ }
390
+ export interface VoicePreview {
391
+ audio_url: string;
392
+ voice_id: string;
393
+ }
394
+ export interface VoiceDesignResponse {
395
+ previews: VoicePreview[];
396
+ request_id: string;
397
+ cost_ticks: number;
398
+ }
399
+ export interface StarfishTTSRequest {
400
+ /** Text to speak. */
401
+ text: string;
402
+ /** Base64-encoded reference audio for voice cloning. */
403
+ reference_audio?: string;
404
+ }
405
+ export interface StarfishTTSResponse {
406
+ audio_url: string;
407
+ duration_seconds: number;
408
+ request_id: string;
409
+ cost_ticks: number;
410
+ }
411
+ export interface MusicAdvancedRequest {
412
+ /** Prompt describing the music to generate. */
413
+ prompt: string;
414
+ /** Target duration in seconds. */
415
+ duration_seconds?: number;
416
+ /** Music generation model. */
417
+ model?: string;
418
+ /** Finetune ID to apply. */
419
+ finetune_id?: string;
420
+ }
421
+ export interface MusicAdvancedClip {
422
+ base64: string;
423
+ format: string;
424
+ size: number;
425
+ }
426
+ export interface MusicAdvancedResponse {
427
+ clips: MusicAdvancedClip[];
428
+ model: string;
429
+ cost_ticks: number;
430
+ request_id: string;
431
+ }
432
+ export interface MusicFinetuneInfo {
433
+ finetune_id: string;
434
+ name: string;
435
+ description?: string;
436
+ status: string;
437
+ model_id?: string;
438
+ created_at?: string;
439
+ }
440
+ export interface MusicFinetuneListResponse {
441
+ finetunes: MusicFinetuneInfo[];
442
+ }
443
+ export interface MusicFinetuneCreateRequest {
444
+ name: string;
445
+ description?: string;
446
+ /** Base64-encoded audio samples. */
447
+ samples: string[];
448
+ }
449
+ export interface VideoRequest {
450
+ /** Model for video generation. */
451
+ model: string;
452
+ /** Text prompt. */
453
+ prompt: string;
454
+ /** Duration in seconds. */
455
+ duration?: number;
456
+ /** Resolution (e.g. "720p", "1080p"). */
457
+ resolution?: string;
458
+ }
459
+ export interface GeneratedVideo {
460
+ url: string;
461
+ duration_seconds: number;
462
+ }
463
+ export interface VideoResponse {
464
+ videos: GeneratedVideo[];
465
+ model: string;
466
+ request_id: string;
467
+ cost_ticks: number;
468
+ }
469
+ export interface VideoStudioRequest {
470
+ /** Avatar ID. */
471
+ avatar_id: string;
472
+ /** Script text. */
473
+ script: string;
474
+ /** Voice ID (optional). */
475
+ voice_id?: string;
476
+ /** Clips for multi-scene videos. */
477
+ clips?: StudioClip[];
478
+ }
479
+ export interface StudioClip {
480
+ avatar_id: string;
481
+ script: string;
482
+ voice_id?: string;
483
+ background?: string;
484
+ }
485
+ export interface VideoTranslateRequest {
486
+ /** URL of the video to translate. */
487
+ video_url: string;
488
+ /** Target language code. */
489
+ target_lang: string;
490
+ /** Source language code (auto-detect if omitted). */
491
+ source_lang?: string;
492
+ }
493
+ export interface PhotoAvatarRequest {
494
+ /** Base64-encoded photo image. */
495
+ image: string;
496
+ }
497
+ export interface DigitalTwinRequest {
498
+ /** Base64-encoded training video. */
499
+ video: string;
500
+ }
501
+ export interface AsyncJobResponse {
502
+ job_id: string;
503
+ status: string;
504
+ }
505
+ export interface HeyGenAvatar {
506
+ avatar_id: string;
507
+ avatar_name: string;
508
+ preview_url?: string;
509
+ [key: string]: unknown;
510
+ }
511
+ export interface AvatarsResponse {
512
+ avatars: HeyGenAvatar[];
513
+ }
514
+ export interface HeyGenTemplate {
515
+ template_id: string;
516
+ name: string;
517
+ [key: string]: unknown;
518
+ }
519
+ export interface HeyGenTemplatesResponse {
520
+ templates: HeyGenTemplate[];
521
+ }
522
+ export interface HeyGenVoice {
523
+ voice_id: string;
524
+ name: string;
525
+ language?: string;
526
+ [key: string]: unknown;
527
+ }
528
+ export interface HeyGenVoicesResponse {
529
+ voices: HeyGenVoice[];
530
+ }
531
+ export interface EmbedRequest {
532
+ /** Model for embedding generation. */
533
+ model?: string;
534
+ /** Input text(s) to embed. */
535
+ input: string | string[];
536
+ }
537
+ export interface EmbedResponse {
538
+ embeddings: number[][];
539
+ model: string;
540
+ request_id: string;
541
+ cost_ticks: number;
542
+ }
543
+ export interface DocumentRequest {
544
+ /** Document content (base64 or URL). */
545
+ content: string;
546
+ /** Content type (e.g. "pdf", "image", "url"). */
547
+ type?: string;
548
+ /** Model for extraction. */
549
+ model?: string;
550
+ }
551
+ export interface DocumentResponse {
552
+ text: string;
553
+ pages?: number;
554
+ request_id: string;
555
+ cost_ticks: number;
556
+ }
557
+ export interface ChunkDocumentRequest {
558
+ /** Text to chunk. */
559
+ text: string;
560
+ /** Target chunk size in tokens. */
561
+ chunk_size?: number;
562
+ }
563
+ export interface DocumentChunk {
564
+ text: string;
565
+ index: number;
566
+ tokens: number;
567
+ }
568
+ export interface ChunkDocumentResponse {
569
+ chunks: DocumentChunk[];
570
+ request_id: string;
571
+ cost_ticks: number;
572
+ }
573
+ export interface ProcessDocumentRequest {
574
+ /** Text to process. */
575
+ text: string;
576
+ /** Processing instructions. */
577
+ instructions?: string;
578
+ /** Model for processing. */
579
+ model?: string;
580
+ }
581
+ export interface ProcessDocumentResponse {
582
+ result: string;
583
+ request_id: string;
584
+ cost_ticks: number;
585
+ }
586
+ export interface RAGSearchRequest {
587
+ /** Search query. */
588
+ query: string;
589
+ /** Corpus name or ID (optional). */
590
+ corpus?: string;
591
+ /** Maximum number of results. */
592
+ top_k?: number;
593
+ }
594
+ export interface RAGResult {
595
+ text: string;
596
+ score: number;
597
+ source?: string;
598
+ }
599
+ export interface RAGSearchResponse {
600
+ results: RAGResult[];
601
+ request_id: string;
602
+ cost_ticks: number;
603
+ }
604
+ export interface RAGCorpus {
605
+ name: string;
606
+ displayName: string;
607
+ description: string;
608
+ state: string;
609
+ }
610
+ export interface SurrealRAGSearchRequest {
611
+ /** Search query. */
612
+ query: string;
613
+ /** Provider to search (optional). */
614
+ provider?: string;
615
+ /** Maximum number of results. */
616
+ limit?: number;
617
+ }
618
+ export interface SurrealRAGResult {
619
+ id: string;
620
+ text: string;
621
+ score: number;
622
+ provider: string;
623
+ source?: string;
624
+ }
625
+ export interface SurrealRAGSearchResponse {
626
+ results: SurrealRAGResult[];
627
+ request_id: string;
628
+ cost_ticks: number;
629
+ }
630
+ export interface SurrealRAGProviderInfo {
631
+ provider: string;
632
+ chunk_count: number;
633
+ }
634
+ export interface SurrealRAGProvidersResponse {
635
+ providers: SurrealRAGProviderInfo[];
636
+ }
637
+ export interface ModelInfo {
638
+ id: string;
639
+ provider: string;
640
+ display_name: string;
641
+ input_per_million: number;
642
+ output_per_million: number;
643
+ [key: string]: unknown;
644
+ }
645
+ export interface PricingInfo {
646
+ id: string;
647
+ provider: string;
648
+ display_name: string;
649
+ input_per_million: number;
650
+ output_per_million: number;
651
+ }
652
+ export interface BalanceResponse {
653
+ user_id: string;
654
+ credit_ticks: number;
655
+ credit_usd: number;
656
+ ticks_per_usd: number;
657
+ }
658
+ export interface UsageEntry {
659
+ id: string;
660
+ request_id?: string;
661
+ model?: string;
662
+ provider?: string;
663
+ endpoint?: string;
664
+ delta_ticks?: number;
665
+ balance_after?: number;
666
+ input_tokens?: number;
667
+ output_tokens?: number;
668
+ created_at?: string;
669
+ }
670
+ export interface UsageResponse {
671
+ entries: UsageEntry[];
672
+ has_more: boolean;
673
+ next_cursor?: string;
674
+ }
675
+ export interface UsageQuery {
676
+ limit?: number;
677
+ start_after?: string;
678
+ }
679
+ export interface UsageSummaryMonth {
680
+ month: string;
681
+ total_requests: number;
682
+ total_input_tokens: number;
683
+ total_output_tokens: number;
684
+ total_cost_usd: number;
685
+ total_margin_usd: number;
686
+ by_provider?: unknown[];
687
+ }
688
+ export interface UsageSummaryResponse {
689
+ months: UsageSummaryMonth[];
690
+ }
691
+ export interface PricingEntry {
692
+ Provider: string;
693
+ Model: string;
694
+ DisplayName: string;
695
+ InputPerMillion: number;
696
+ OutputPerMillion: number;
697
+ CachedPerMillion?: number;
698
+ }
699
+ export interface AccountPricingResponse {
700
+ pricing: Record<string, PricingEntry>;
701
+ }
702
+ export interface JobCreateRequest {
703
+ type: string;
704
+ params: Record<string, unknown>;
705
+ }
706
+ export interface JobCreateResponse {
707
+ job_id: string;
708
+ status: string;
709
+ }
710
+ export interface JobStatusResponse {
711
+ job_id: string;
712
+ status: string;
713
+ result?: unknown;
714
+ error?: string;
715
+ cost_ticks: number;
716
+ }
717
+ export interface JobListItem {
718
+ job_id: string;
719
+ status: string;
720
+ type?: string;
721
+ created_at?: string;
722
+ completed_at?: string;
723
+ cost_ticks: number;
724
+ }
725
+ export interface JobListResponse {
726
+ jobs: JobListItem[];
727
+ }
728
+ export interface CreateKeyRequest {
729
+ name: string;
730
+ scopes?: string[];
731
+ expires_at?: string;
732
+ }
733
+ export interface CreateKeyResponse {
734
+ key: string;
735
+ id: string;
736
+ }
737
+ export interface KeyDetails {
738
+ id: string;
739
+ name: string;
740
+ prefix: string;
741
+ scopes?: string[];
742
+ created_at: string;
743
+ expires_at?: string;
744
+ last_used_at?: string;
745
+ }
746
+ export interface ListKeysResponse {
747
+ keys: KeyDetails[];
748
+ }
749
+ export interface ComputeTemplate {
750
+ id: string;
751
+ name: string;
752
+ gpu_type: string;
753
+ gpu_count: number;
754
+ vcpus: number;
755
+ ram_gb: number;
756
+ disk_gb: number;
757
+ price_per_hour: number;
758
+ [key: string]: unknown;
759
+ }
760
+ export interface TemplatesResponse {
761
+ templates: ComputeTemplate[];
762
+ }
763
+ export interface ProvisionRequest {
764
+ template_id: string;
765
+ region?: string;
766
+ ssh_public_key?: string;
767
+ }
768
+ export interface ProvisionResponse {
769
+ instance_id: string;
770
+ status: string;
771
+ }
772
+ export interface ComputeInstanceInfo {
773
+ id: string;
774
+ status: string;
775
+ template_id: string;
776
+ created_at: string;
777
+ [key: string]: unknown;
778
+ }
779
+ export interface InstancesResponse {
780
+ instances: ComputeInstanceInfo[];
781
+ }
782
+ export interface InstanceDetailInfo extends ComputeInstanceInfo {
783
+ ip_address?: string;
784
+ ssh_host?: string;
785
+ ssh_port?: number;
786
+ }
787
+ export interface InstanceResponse {
788
+ instance: InstanceDetailInfo;
789
+ }
790
+ export interface SSHKeyRequest {
791
+ ssh_public_key: string;
792
+ }
793
+ export interface DeleteResponse {
794
+ status: string;
795
+ cost_ticks?: number;
796
+ }
797
+ export interface VoiceInfo {
798
+ voice_id: string;
799
+ name: string;
800
+ provider: string;
801
+ preview_url?: string;
802
+ [key: string]: unknown;
803
+ }
804
+ export interface VoicesResponse {
805
+ voices: VoiceInfo[];
806
+ }
807
+ export interface CloneVoiceRequest {
808
+ name: string;
809
+ /** Base64-encoded audio samples. */
810
+ audio_samples: string[];
811
+ description?: string;
812
+ }
813
+ export interface CloneVoiceResponse {
814
+ voice_id: string;
815
+ name: string;
816
+ }
817
+ export interface SharedVoice {
818
+ public_owner_id: string;
819
+ voice_id: string;
820
+ name: string;
821
+ category?: string;
822
+ description?: string;
823
+ preview_url?: string;
824
+ gender?: string;
825
+ age?: string;
826
+ accent?: string;
827
+ language?: string;
828
+ use_case?: string;
829
+ rate?: number;
830
+ cloned_by_count?: number;
831
+ free_users_allowed?: boolean;
832
+ }
833
+ export interface SharedVoicesResponse {
834
+ voices: SharedVoice[];
835
+ next_cursor?: string;
836
+ has_more: boolean;
837
+ }
838
+ export interface VoiceLibraryQuery {
839
+ query?: string;
840
+ page_size?: number;
841
+ cursor?: string;
842
+ gender?: string;
843
+ language?: string;
844
+ use_case?: string;
845
+ }
846
+ export interface AddVoiceFromLibraryRequest {
847
+ public_owner_id: string;
848
+ voice_id: string;
849
+ name?: string;
850
+ }
851
+ export interface AddVoiceFromLibraryResponse {
852
+ voice_id: string;
853
+ }
854
+ export interface Generate3DRequest {
855
+ model: string;
856
+ prompt?: string;
857
+ image_url?: string;
858
+ }
859
+ export interface ContactRequest {
860
+ /** Sender name. */
861
+ name: string;
862
+ /** Sender email address. */
863
+ email: string;
864
+ /** Message body. */
865
+ message: string;
866
+ }
867
+ /** A single job in a batch submission. */
868
+ export interface BatchJobInput {
869
+ /** Model to use for this job. */
870
+ model: string;
871
+ /** The prompt text. */
872
+ prompt: string;
873
+ /** Optional title for this job. */
874
+ title?: string;
875
+ /** Optional system prompt. */
876
+ system_prompt?: string;
877
+ /** Optional maximum tokens to generate. */
878
+ max_tokens?: number;
879
+ }
880
+ /** Request to submit a batch of jobs. */
881
+ export interface BatchSubmitRequest {
882
+ /** Array of jobs to submit. */
883
+ jobs: BatchJobInput[];
884
+ }
885
+ /** Response from batch submission. */
886
+ export interface BatchSubmitResponse {
887
+ /** The IDs of the created jobs. */
888
+ job_ids: string[];
889
+ /** Status of the batch submission. */
890
+ status: string;
891
+ }
892
+ /** Response from JSONL batch submission. */
893
+ export interface BatchJsonlResponse {
894
+ /** The IDs of the created jobs. */
895
+ job_ids: string[];
896
+ }
897
+ /** A single job in the batch jobs list. */
898
+ export interface BatchJobInfo {
899
+ job_id: string;
900
+ status: string;
901
+ model?: string;
902
+ title?: string;
903
+ created_at?: string;
904
+ completed_at?: string;
905
+ result?: unknown;
906
+ error?: string;
907
+ cost_ticks: number;
908
+ }
909
+ /** Response from listing batch jobs. */
910
+ export interface BatchJobsResponse {
911
+ jobs: BatchJobInfo[];
912
+ }
913
+ /** A credit pack available for purchase. */
914
+ export interface CreditPack {
915
+ id: string;
916
+ name?: string;
917
+ price_usd: number;
918
+ credit_ticks: number;
919
+ description?: string;
920
+ }
921
+ /** Response from listing credit packs. */
922
+ export interface CreditPacksResponse {
923
+ packs: CreditPack[];
924
+ }
925
+ /** Request to purchase a credit pack. */
926
+ export interface CreditPurchaseRequest {
927
+ pack_id: string;
928
+ success_url?: string;
929
+ cancel_url?: string;
930
+ }
931
+ /** Response from purchasing a credit pack. */
932
+ export interface CreditPurchaseResponse {
933
+ checkout_url: string;
934
+ }
935
+ /** Response from checking credit balance. */
936
+ export interface CreditBalanceResponse {
937
+ balance_ticks: number;
938
+ balance_usd: number;
939
+ }
940
+ /** A pricing tier. */
941
+ export interface CreditTier {
942
+ name?: string;
943
+ min_balance?: number;
944
+ discount_percent?: number;
945
+ [key: string]: unknown;
946
+ }
947
+ /** Response from listing credit tiers. */
948
+ export interface CreditTiersResponse {
949
+ tiers: CreditTier[];
950
+ }
951
+ /** Request to apply for the developer program. */
952
+ export interface DevProgramApplyRequest {
953
+ use_case: string;
954
+ company?: string;
955
+ expected_usd?: number;
956
+ website?: string;
957
+ }
958
+ /** Response from dev program application. */
959
+ export interface DevProgramApplyResponse {
960
+ status: string;
961
+ }
962
+ /** User information returned after authentication. */
963
+ export interface AuthUser {
964
+ id: string;
965
+ name?: string;
966
+ email?: string;
967
+ avatar_url?: string;
968
+ }
969
+ /** Response from authentication endpoints. */
970
+ export interface AuthResponse {
971
+ token: string;
972
+ user: AuthUser;
973
+ }
974
+ /** Request body for Apple Sign-In. */
975
+ export interface AuthAppleRequest {
976
+ /** The Apple identity token (JWT from Sign in with Apple). */
977
+ id_token: string;
978
+ /** Optional display name (only provided on first sign-in). */
979
+ name?: string;
980
+ }
981
+ /** Generic status response used by many endpoints. */
982
+ export interface StatusResponse {
983
+ /** Status string (e.g. "revoked", "deleted", "alive", "sent"). */
984
+ status: string;
985
+ /** Additional fields. */
986
+ [key: string]: unknown;
987
+ }
988
+ /** @internal */
989
+ export interface ModelsResponseBody {
990
+ models: ModelInfo[];
991
+ }
992
+ /** @internal */
993
+ export interface PricingResponseBody {
994
+ pricing: PricingInfo[];
995
+ }
996
+ /** @internal */
997
+ export interface RAGCorporaResponseBody {
998
+ corpora: RAGCorpus[];
999
+ request_id: string;
1000
+ }
1001
+ /** @internal */
1002
+ export interface APIErrorBody {
1003
+ error: {
1004
+ message: string;
1005
+ type?: string;
1006
+ code?: string;
1007
+ };
1008
+ }