nixflex 0.4.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.5.0
2
+
3
+ - New: `client.llm` - bring your own OpenAI-compatible model (set() verifies with a real completion + tool-calling probe, key write-only). Calls it serves bill at -0.015/min.
4
+ - New: `client.tts` - bring your own voice (elevenlabs/cartesia, set() verifies with a real synthesis, key write-only). Phone calls only; -0.02/min.
5
+ - Docs: https://docs.nixflex.com/advanced/your-own-llm and /advanced/your-own-tts
6
+
1
7
  ## 0.4.0
2
8
 
3
9
  - New: `client.storage` - connect your own S3-compatible bucket for call recordings (data residency). `storage.set()` verifies with a probe write before saving, `storage.get()` never returns the secret, `storage.delete()` disconnects. Recordings then upload to your bucket and `recording_url` becomes a `byo:` path. See https://docs.nixflex.com/advanced/your-own-storage
package/dist/index.cjs CHANGED
@@ -487,6 +487,49 @@ var Storage = class {
487
487
  return this.http.request("DELETE", "/account/storage", void 0, void 0, opts);
488
488
  }
489
489
  };
490
+ var Llm = class {
491
+ constructor(http) {
492
+ this.http = http;
493
+ }
494
+ http;
495
+ /** Connect an OpenAI-compatible model. Verified BEFORE saving with a real
496
+ * completion + a tool-calling round trip (models without tool calling are
497
+ * refused). Calls your model serves bill at a $0.015/min discount; if it
498
+ * fails on a call the standard stack takes over and that call bills standard. */
499
+ set(params, opts) {
500
+ return this.http.request("PUT", "/account/llm", params, void 0, opts);
501
+ }
502
+ /** Current LLM configuration. The provider key is never included. */
503
+ get(opts) {
504
+ return this.http.request("GET", "/account/llm", void 0, void 0, opts);
505
+ }
506
+ /** Disconnect. Calls return to the standard stack and rate from the next call. */
507
+ delete(opts) {
508
+ return this.http.request("DELETE", "/account/llm", void 0, void 0, opts);
509
+ }
510
+ };
511
+ var Tts = class {
512
+ constructor(http) {
513
+ this.http = http;
514
+ }
515
+ http;
516
+ /** Connect your voice provider (elevenlabs or cartesia). Verified BEFORE
517
+ * saving with one real synthesis using the exact voice ID. Phone calls only -
518
+ * web calls keep the standard voice. Calls your voice serves bill at a
519
+ * $0.02/min discount; on failure the standard voice takes over and that call
520
+ * bills the standard TTS rate. */
521
+ set(params, opts) {
522
+ return this.http.request("PUT", "/account/tts", params, void 0, opts);
523
+ }
524
+ /** Current TTS configuration. The provider key is never included. */
525
+ get(opts) {
526
+ return this.http.request("GET", "/account/tts", void 0, void 0, opts);
527
+ }
528
+ /** Disconnect. Calls return to the standard voice and rate from the next call. */
529
+ delete(opts) {
530
+ return this.http.request("DELETE", "/account/tts", void 0, void 0, opts);
531
+ }
532
+ };
490
533
  var Webhooks = class {
491
534
  constructor(http) {
492
535
  this.http = http;
@@ -536,6 +579,10 @@ var Nixflex = class {
536
579
  webhooks;
537
580
  /** Your own S3-compatible recording storage (data residency). */
538
581
  storage;
582
+ /** Your own LLM (OpenAI-compatible endpoint, verified with tool-calling probe). */
583
+ llm;
584
+ /** Your own TTS (elevenlabs/cartesia, verified with a real synthesis). */
585
+ tts;
539
586
  constructor(options) {
540
587
  const http = new HttpClient(options);
541
588
  this.agents = new Agents(http);
@@ -547,6 +594,8 @@ var Nixflex = class {
547
594
  this.usage = new UsageResource(http);
548
595
  this.webhooks = new Webhooks(http);
549
596
  this.storage = new Storage(http);
597
+ this.llm = new Llm(http);
598
+ this.tts = new Tts(http);
550
599
  }
551
600
  /** Create a brand-new API key (unauthenticated signup endpoint - most
552
601
  * developers use the dashboard instead). The key_secret is shown ONCE.
package/dist/index.d.cts CHANGED
@@ -608,6 +608,57 @@ interface StorageDeleteResponse {
608
608
  ok: boolean;
609
609
  storage_enabled: boolean;
610
610
  }
611
+ /** Your own LLM (BYO LLM) - an OpenAI-compatible endpoint answers every call. */
612
+ interface LlmConfig {
613
+ byo_llm_enabled: boolean;
614
+ endpoint: string | null;
615
+ model: string | null;
616
+ }
617
+ interface LlmSetParams {
618
+ /** OpenAI-compatible https:// base URL, e.g. https://api.openai.com/v1 */
619
+ endpoint: string;
620
+ /** Model name as your provider knows it. Must support OpenAI-style tool calling. */
621
+ model: string;
622
+ /** Your provider API key. Write-only - stored encrypted, never returned. */
623
+ api_key: string;
624
+ }
625
+ interface LlmSetResponse {
626
+ ok: boolean;
627
+ byo_llm_enabled: boolean;
628
+ endpoint: string;
629
+ model: string;
630
+ verified: boolean;
631
+ }
632
+ interface LlmDeleteResponse {
633
+ ok: boolean;
634
+ byo_llm_enabled: boolean;
635
+ }
636
+ /** Your own TTS (BYO TTS) - your voice provider speaks on every phone call. */
637
+ type TtsProvider = 'elevenlabs' | 'cartesia';
638
+ interface TtsConfig {
639
+ byo_tts_enabled: boolean;
640
+ provider: TtsProvider | null;
641
+ voice_id: string | null;
642
+ }
643
+ interface TtsSetParams {
644
+ /** 'elevenlabs' or 'cartesia'. */
645
+ provider: TtsProvider;
646
+ /** Voice ID exactly as shown in your provider console. */
647
+ voice_id: string;
648
+ /** Your provider API key. Write-only - stored encrypted, never returned. */
649
+ api_key: string;
650
+ }
651
+ interface TtsSetResponse {
652
+ ok: boolean;
653
+ byo_tts_enabled: boolean;
654
+ provider: TtsProvider;
655
+ voice_id: string;
656
+ verified: boolean;
657
+ }
658
+ interface TtsDeleteResponse {
659
+ ok: boolean;
660
+ byo_tts_enabled: boolean;
661
+ }
611
662
 
612
663
  declare class PhoneNumbers {
613
664
  private readonly http;
@@ -710,6 +761,34 @@ declare class Storage {
710
761
  delete(opts?: RequestOptions): Promise<StorageDeleteResponse>;
711
762
  }
712
763
 
764
+ declare class Llm {
765
+ private readonly http;
766
+ constructor(http: HttpClient);
767
+ /** Connect an OpenAI-compatible model. Verified BEFORE saving with a real
768
+ * completion + a tool-calling round trip (models without tool calling are
769
+ * refused). Calls your model serves bill at a $0.015/min discount; if it
770
+ * fails on a call the standard stack takes over and that call bills standard. */
771
+ set(params: LlmSetParams, opts?: RequestOptions): Promise<LlmSetResponse>;
772
+ /** Current LLM configuration. The provider key is never included. */
773
+ get(opts?: RequestOptions): Promise<LlmConfig>;
774
+ /** Disconnect. Calls return to the standard stack and rate from the next call. */
775
+ delete(opts?: RequestOptions): Promise<LlmDeleteResponse>;
776
+ }
777
+ declare class Tts {
778
+ private readonly http;
779
+ constructor(http: HttpClient);
780
+ /** Connect your voice provider (elevenlabs or cartesia). Verified BEFORE
781
+ * saving with one real synthesis using the exact voice ID. Phone calls only -
782
+ * web calls keep the standard voice. Calls your voice serves bill at a
783
+ * $0.02/min discount; on failure the standard voice takes over and that call
784
+ * bills the standard TTS rate. */
785
+ set(params: TtsSetParams, opts?: RequestOptions): Promise<TtsSetResponse>;
786
+ /** Current TTS configuration. The provider key is never included. */
787
+ get(opts?: RequestOptions): Promise<TtsConfig>;
788
+ /** Disconnect. Calls return to the standard voice and rate from the next call. */
789
+ delete(opts?: RequestOptions): Promise<TtsDeleteResponse>;
790
+ }
791
+
713
792
  declare class Webhooks {
714
793
  private readonly http;
715
794
  constructor(http: HttpClient);
@@ -801,6 +880,10 @@ declare class Nixflex {
801
880
  readonly webhooks: Webhooks;
802
881
  /** Your own S3-compatible recording storage (data residency). */
803
882
  readonly storage: Storage;
883
+ /** Your own LLM (OpenAI-compatible endpoint, verified with tool-calling probe). */
884
+ readonly llm: Llm;
885
+ /** Your own TTS (elevenlabs/cartesia, verified with a real synthesis). */
886
+ readonly tts: Tts;
804
887
  constructor(options: NixflexClientOptions);
805
888
  /** Create a brand-new API key (unauthenticated signup endpoint - most
806
889
  * developers use the dashboard instead). The key_secret is shown ONCE.
@@ -811,4 +894,4 @@ declare class Nixflex {
811
894
  }, baseUrl?: string): Promise<KeyCreateResponse>;
812
895
  }
813
896
 
814
- export { type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentUpdateParams, type BatchCampaignParams, type BatchCreateResponse, type BatchInvalidEntry, type BatchLaunchResponse, type BatchRecipient, type Call, type CallDeleteAllResponse, type CallDeleteResponse, type CallDirection, type CallerSentiment, type KeyCreateResponse, type KeyRotateResponse, type ListParams, type MonitorToggleResponse, Nixflex, type NixflexAPIErrorBody, NixflexAuthenticationError, type NixflexClientOptions, NixflexConnectionError, NixflexError, NixflexInvalidRequestError, NixflexNotFoundError, NixflexPaymentRequiredError, NixflexRateLimitError, NixflexServerError, type OutboundCallParams, type OutboundCallResponse, type PhoneNumber, type PhoneNumberDeleteResponse, type PhoneNumberImportParams, type PhoneNumberListResponse, type PhoneNumberUpdateParams, type RequestOptions, type ResponseLength, type SmsCampaign, type SmsCampaignCreateParams, type SmsCampaignDeleteResponse, type SmsCampaignLaunchResponse, type SmsCampaignListResponse, type SmsCampaignRecipient, type SmsCampaignStatus, type SmsSendParams, type SmsSendResponse, type StorageConfig, type StorageDeleteResponse, type StorageSetParams, type StorageSetResponse, type TransferType, type Usage, type VerifyOptions, type WebCallsToggleResponse, type WebhookConfigResponse, type Weekday, Nixflex as default, errorFromResponse, verifyWebhookSignature };
897
+ export { type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentUpdateParams, type BatchCampaignParams, type BatchCreateResponse, type BatchInvalidEntry, type BatchLaunchResponse, type BatchRecipient, type Call, type CallDeleteAllResponse, type CallDeleteResponse, type CallDirection, type CallerSentiment, type KeyCreateResponse, type KeyRotateResponse, type ListParams, type LlmConfig, type LlmDeleteResponse, type LlmSetParams, type LlmSetResponse, type MonitorToggleResponse, Nixflex, type NixflexAPIErrorBody, NixflexAuthenticationError, type NixflexClientOptions, NixflexConnectionError, NixflexError, NixflexInvalidRequestError, NixflexNotFoundError, NixflexPaymentRequiredError, NixflexRateLimitError, NixflexServerError, type OutboundCallParams, type OutboundCallResponse, type PhoneNumber, type PhoneNumberDeleteResponse, type PhoneNumberImportParams, type PhoneNumberListResponse, type PhoneNumberUpdateParams, type RequestOptions, type ResponseLength, type SmsCampaign, type SmsCampaignCreateParams, type SmsCampaignDeleteResponse, type SmsCampaignLaunchResponse, type SmsCampaignListResponse, type SmsCampaignRecipient, type SmsCampaignStatus, type SmsSendParams, type SmsSendResponse, type StorageConfig, type StorageDeleteResponse, type StorageSetParams, type StorageSetResponse, type TransferType, type TtsConfig, type TtsDeleteResponse, type TtsProvider, type TtsSetParams, type TtsSetResponse, type Usage, type VerifyOptions, type WebCallsToggleResponse, type WebhookConfigResponse, type Weekday, Nixflex as default, errorFromResponse, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -608,6 +608,57 @@ interface StorageDeleteResponse {
608
608
  ok: boolean;
609
609
  storage_enabled: boolean;
610
610
  }
611
+ /** Your own LLM (BYO LLM) - an OpenAI-compatible endpoint answers every call. */
612
+ interface LlmConfig {
613
+ byo_llm_enabled: boolean;
614
+ endpoint: string | null;
615
+ model: string | null;
616
+ }
617
+ interface LlmSetParams {
618
+ /** OpenAI-compatible https:// base URL, e.g. https://api.openai.com/v1 */
619
+ endpoint: string;
620
+ /** Model name as your provider knows it. Must support OpenAI-style tool calling. */
621
+ model: string;
622
+ /** Your provider API key. Write-only - stored encrypted, never returned. */
623
+ api_key: string;
624
+ }
625
+ interface LlmSetResponse {
626
+ ok: boolean;
627
+ byo_llm_enabled: boolean;
628
+ endpoint: string;
629
+ model: string;
630
+ verified: boolean;
631
+ }
632
+ interface LlmDeleteResponse {
633
+ ok: boolean;
634
+ byo_llm_enabled: boolean;
635
+ }
636
+ /** Your own TTS (BYO TTS) - your voice provider speaks on every phone call. */
637
+ type TtsProvider = 'elevenlabs' | 'cartesia';
638
+ interface TtsConfig {
639
+ byo_tts_enabled: boolean;
640
+ provider: TtsProvider | null;
641
+ voice_id: string | null;
642
+ }
643
+ interface TtsSetParams {
644
+ /** 'elevenlabs' or 'cartesia'. */
645
+ provider: TtsProvider;
646
+ /** Voice ID exactly as shown in your provider console. */
647
+ voice_id: string;
648
+ /** Your provider API key. Write-only - stored encrypted, never returned. */
649
+ api_key: string;
650
+ }
651
+ interface TtsSetResponse {
652
+ ok: boolean;
653
+ byo_tts_enabled: boolean;
654
+ provider: TtsProvider;
655
+ voice_id: string;
656
+ verified: boolean;
657
+ }
658
+ interface TtsDeleteResponse {
659
+ ok: boolean;
660
+ byo_tts_enabled: boolean;
661
+ }
611
662
 
612
663
  declare class PhoneNumbers {
613
664
  private readonly http;
@@ -710,6 +761,34 @@ declare class Storage {
710
761
  delete(opts?: RequestOptions): Promise<StorageDeleteResponse>;
711
762
  }
712
763
 
764
+ declare class Llm {
765
+ private readonly http;
766
+ constructor(http: HttpClient);
767
+ /** Connect an OpenAI-compatible model. Verified BEFORE saving with a real
768
+ * completion + a tool-calling round trip (models without tool calling are
769
+ * refused). Calls your model serves bill at a $0.015/min discount; if it
770
+ * fails on a call the standard stack takes over and that call bills standard. */
771
+ set(params: LlmSetParams, opts?: RequestOptions): Promise<LlmSetResponse>;
772
+ /** Current LLM configuration. The provider key is never included. */
773
+ get(opts?: RequestOptions): Promise<LlmConfig>;
774
+ /** Disconnect. Calls return to the standard stack and rate from the next call. */
775
+ delete(opts?: RequestOptions): Promise<LlmDeleteResponse>;
776
+ }
777
+ declare class Tts {
778
+ private readonly http;
779
+ constructor(http: HttpClient);
780
+ /** Connect your voice provider (elevenlabs or cartesia). Verified BEFORE
781
+ * saving with one real synthesis using the exact voice ID. Phone calls only -
782
+ * web calls keep the standard voice. Calls your voice serves bill at a
783
+ * $0.02/min discount; on failure the standard voice takes over and that call
784
+ * bills the standard TTS rate. */
785
+ set(params: TtsSetParams, opts?: RequestOptions): Promise<TtsSetResponse>;
786
+ /** Current TTS configuration. The provider key is never included. */
787
+ get(opts?: RequestOptions): Promise<TtsConfig>;
788
+ /** Disconnect. Calls return to the standard voice and rate from the next call. */
789
+ delete(opts?: RequestOptions): Promise<TtsDeleteResponse>;
790
+ }
791
+
713
792
  declare class Webhooks {
714
793
  private readonly http;
715
794
  constructor(http: HttpClient);
@@ -801,6 +880,10 @@ declare class Nixflex {
801
880
  readonly webhooks: Webhooks;
802
881
  /** Your own S3-compatible recording storage (data residency). */
803
882
  readonly storage: Storage;
883
+ /** Your own LLM (OpenAI-compatible endpoint, verified with tool-calling probe). */
884
+ readonly llm: Llm;
885
+ /** Your own TTS (elevenlabs/cartesia, verified with a real synthesis). */
886
+ readonly tts: Tts;
804
887
  constructor(options: NixflexClientOptions);
805
888
  /** Create a brand-new API key (unauthenticated signup endpoint - most
806
889
  * developers use the dashboard instead). The key_secret is shown ONCE.
@@ -811,4 +894,4 @@ declare class Nixflex {
811
894
  }, baseUrl?: string): Promise<KeyCreateResponse>;
812
895
  }
813
896
 
814
- export { type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentUpdateParams, type BatchCampaignParams, type BatchCreateResponse, type BatchInvalidEntry, type BatchLaunchResponse, type BatchRecipient, type Call, type CallDeleteAllResponse, type CallDeleteResponse, type CallDirection, type CallerSentiment, type KeyCreateResponse, type KeyRotateResponse, type ListParams, type MonitorToggleResponse, Nixflex, type NixflexAPIErrorBody, NixflexAuthenticationError, type NixflexClientOptions, NixflexConnectionError, NixflexError, NixflexInvalidRequestError, NixflexNotFoundError, NixflexPaymentRequiredError, NixflexRateLimitError, NixflexServerError, type OutboundCallParams, type OutboundCallResponse, type PhoneNumber, type PhoneNumberDeleteResponse, type PhoneNumberImportParams, type PhoneNumberListResponse, type PhoneNumberUpdateParams, type RequestOptions, type ResponseLength, type SmsCampaign, type SmsCampaignCreateParams, type SmsCampaignDeleteResponse, type SmsCampaignLaunchResponse, type SmsCampaignListResponse, type SmsCampaignRecipient, type SmsCampaignStatus, type SmsSendParams, type SmsSendResponse, type StorageConfig, type StorageDeleteResponse, type StorageSetParams, type StorageSetResponse, type TransferType, type Usage, type VerifyOptions, type WebCallsToggleResponse, type WebhookConfigResponse, type Weekday, Nixflex as default, errorFromResponse, verifyWebhookSignature };
897
+ export { type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentUpdateParams, type BatchCampaignParams, type BatchCreateResponse, type BatchInvalidEntry, type BatchLaunchResponse, type BatchRecipient, type Call, type CallDeleteAllResponse, type CallDeleteResponse, type CallDirection, type CallerSentiment, type KeyCreateResponse, type KeyRotateResponse, type ListParams, type LlmConfig, type LlmDeleteResponse, type LlmSetParams, type LlmSetResponse, type MonitorToggleResponse, Nixflex, type NixflexAPIErrorBody, NixflexAuthenticationError, type NixflexClientOptions, NixflexConnectionError, NixflexError, NixflexInvalidRequestError, NixflexNotFoundError, NixflexPaymentRequiredError, NixflexRateLimitError, NixflexServerError, type OutboundCallParams, type OutboundCallResponse, type PhoneNumber, type PhoneNumberDeleteResponse, type PhoneNumberImportParams, type PhoneNumberListResponse, type PhoneNumberUpdateParams, type RequestOptions, type ResponseLength, type SmsCampaign, type SmsCampaignCreateParams, type SmsCampaignDeleteResponse, type SmsCampaignLaunchResponse, type SmsCampaignListResponse, type SmsCampaignRecipient, type SmsCampaignStatus, type SmsSendParams, type SmsSendResponse, type StorageConfig, type StorageDeleteResponse, type StorageSetParams, type StorageSetResponse, type TransferType, type TtsConfig, type TtsDeleteResponse, type TtsProvider, type TtsSetParams, type TtsSetResponse, type Usage, type VerifyOptions, type WebCallsToggleResponse, type WebhookConfigResponse, type Weekday, Nixflex as default, errorFromResponse, verifyWebhookSignature };
package/dist/index.js CHANGED
@@ -451,6 +451,49 @@ var Storage = class {
451
451
  return this.http.request("DELETE", "/account/storage", void 0, void 0, opts);
452
452
  }
453
453
  };
454
+ var Llm = class {
455
+ constructor(http) {
456
+ this.http = http;
457
+ }
458
+ http;
459
+ /** Connect an OpenAI-compatible model. Verified BEFORE saving with a real
460
+ * completion + a tool-calling round trip (models without tool calling are
461
+ * refused). Calls your model serves bill at a $0.015/min discount; if it
462
+ * fails on a call the standard stack takes over and that call bills standard. */
463
+ set(params, opts) {
464
+ return this.http.request("PUT", "/account/llm", params, void 0, opts);
465
+ }
466
+ /** Current LLM configuration. The provider key is never included. */
467
+ get(opts) {
468
+ return this.http.request("GET", "/account/llm", void 0, void 0, opts);
469
+ }
470
+ /** Disconnect. Calls return to the standard stack and rate from the next call. */
471
+ delete(opts) {
472
+ return this.http.request("DELETE", "/account/llm", void 0, void 0, opts);
473
+ }
474
+ };
475
+ var Tts = class {
476
+ constructor(http) {
477
+ this.http = http;
478
+ }
479
+ http;
480
+ /** Connect your voice provider (elevenlabs or cartesia). Verified BEFORE
481
+ * saving with one real synthesis using the exact voice ID. Phone calls only -
482
+ * web calls keep the standard voice. Calls your voice serves bill at a
483
+ * $0.02/min discount; on failure the standard voice takes over and that call
484
+ * bills the standard TTS rate. */
485
+ set(params, opts) {
486
+ return this.http.request("PUT", "/account/tts", params, void 0, opts);
487
+ }
488
+ /** Current TTS configuration. The provider key is never included. */
489
+ get(opts) {
490
+ return this.http.request("GET", "/account/tts", void 0, void 0, opts);
491
+ }
492
+ /** Disconnect. Calls return to the standard voice and rate from the next call. */
493
+ delete(opts) {
494
+ return this.http.request("DELETE", "/account/tts", void 0, void 0, opts);
495
+ }
496
+ };
454
497
  var Webhooks = class {
455
498
  constructor(http) {
456
499
  this.http = http;
@@ -500,6 +543,10 @@ var Nixflex = class {
500
543
  webhooks;
501
544
  /** Your own S3-compatible recording storage (data residency). */
502
545
  storage;
546
+ /** Your own LLM (OpenAI-compatible endpoint, verified with tool-calling probe). */
547
+ llm;
548
+ /** Your own TTS (elevenlabs/cartesia, verified with a real synthesis). */
549
+ tts;
503
550
  constructor(options) {
504
551
  const http = new HttpClient(options);
505
552
  this.agents = new Agents(http);
@@ -511,6 +558,8 @@ var Nixflex = class {
511
558
  this.usage = new UsageResource(http);
512
559
  this.webhooks = new Webhooks(http);
513
560
  this.storage = new Storage(http);
561
+ this.llm = new Llm(http);
562
+ this.tts = new Tts(http);
514
563
  }
515
564
  /** Create a brand-new API key (unauthenticated signup endpoint - most
516
565
  * developers use the dashboard instead). The key_secret is shown ONCE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nixflex",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Official Node.js SDK for the Nixflex voice AI platform - AI phone agents, outbound campaigns, and SMS.",
5
5
  "keywords": [
6
6
  "nixflex",