@breeze.blue/sdk 0.13.0 → 0.14.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,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.0
4
+
5
+ - Added `account.currentApiKey()` for checking the authenticating key's status
6
+ and current Key Budget counters before starting work.
7
+
3
8
  ## 0.13.0
4
9
 
5
10
  - `voices.random(...)` accepts optional `languageCode` and `voiceType`
package/README.md CHANGED
@@ -530,6 +530,8 @@ language-to-accent cascade at runtime.
530
530
  ```ts
531
531
  const models = await client.models.list();
532
532
  const balance = await client.account.balance();
533
+ const currentKey = (await client.account.currentApiKey()).apiKey;
534
+ console.log(currentKey.status, currentKey.creditRemaining);
533
535
  const usage = await client.account.usage({ days: 7 });
534
536
  const keyUsage = await client.account.usage({
535
537
  apiKeyId: "key_01hprod",
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AudioResponse } from "./audio.js";
2
- import type { AudioRequestOptions, BreezeBlueWebSocket, AsyncTextToSpeechJob, Balance, BreezeBlueClientOptions, GenericStatus, GenerationJob, HistoryItem, HistoryList, HistoryListParams, Model, RequestOptions, RealtimeTextToSpeechConnectOptions, RealtimeTextToSpeechEvent, RealtimeTextToSpeechManagedConnectOptions, RealtimeTextToSpeechMessage, RealtimeTextToSpeechSession, RealtimeTextToSpeechSessionRequest, SavedVoice, SaveVoiceRequest, StreamTextToSpeechOptions, TextToSpeechRequest, TtsEnhanceRequest, TtsEnhanceResponse, Usage, UsageParams, Voice, VoiceClonePreview, VoiceClonePreviewRequest, VoiceDesignRequest, VoiceDesignResponse, VoiceDesignStreamRequest, VoiceEditRequest, VoiceList, VoiceMetadataOptions, VoiceRandomParams, VoiceSearchParams, VoiceSettings } from "./types.js";
2
+ import type { AudioRequestOptions, BreezeBlueWebSocket, AsyncTextToSpeechJob, Balance, BreezeBlueClientOptions, CurrentApiKeyResponse, GenericStatus, GenerationJob, HistoryItem, HistoryList, HistoryListParams, Model, RequestOptions, RealtimeTextToSpeechConnectOptions, RealtimeTextToSpeechEvent, RealtimeTextToSpeechManagedConnectOptions, RealtimeTextToSpeechMessage, RealtimeTextToSpeechSession, RealtimeTextToSpeechSessionRequest, SavedVoice, SaveVoiceRequest, StreamTextToSpeechOptions, TextToSpeechRequest, TtsEnhanceRequest, TtsEnhanceResponse, Usage, UsageParams, Voice, VoiceClonePreview, VoiceClonePreviewRequest, VoiceDesignRequest, VoiceDesignResponse, VoiceDesignStreamRequest, VoiceEditRequest, VoiceList, VoiceMetadataOptions, VoiceRandomParams, VoiceSearchParams, VoiceSettings } from "./types.js";
3
3
  export declare class BreezeBlueClient {
4
4
  readonly apiKey: string | undefined;
5
5
  readonly baseUrl: string;
@@ -267,6 +267,8 @@ declare class AccountResource {
267
267
  private readonly client;
268
268
  constructor(client: BreezeBlueClient);
269
269
  balance(options?: RequestOptions): Promise<Balance>;
270
+ /** Return the authenticating API key and its current Key Budget counters. */
271
+ currentApiKey(options?: RequestOptions): Promise<CurrentApiKeyResponse>;
270
272
  usage(params?: UsageParams, options?: RequestOptions): Promise<Usage>;
271
273
  }
272
274
  export {};
package/dist/client.js CHANGED
@@ -1625,6 +1625,10 @@ class AccountResource {
1625
1625
  balance(options) {
1626
1626
  return this.client.requestJson("GET", "/v1/balance", undefined, undefined, options);
1627
1627
  }
1628
+ /** Return the authenticating API key and its current Key Budget counters. */
1629
+ currentApiKey(options) {
1630
+ return this.client.requestJson("GET", "/v1/api-keys/current", undefined, undefined, options);
1631
+ }
1628
1632
  usage(params = {}, options) {
1629
1633
  return this.client.requestJson("GET", "/v1/usage", params, undefined, options);
1630
1634
  }
package/dist/types.d.ts CHANGED
@@ -508,6 +508,19 @@ export interface Balance {
508
508
  topups: BalanceTopup[];
509
509
  [key: string]: unknown;
510
510
  }
511
+ export interface CurrentApiKey {
512
+ id: string;
513
+ name: string;
514
+ prefix: string;
515
+ status: string;
516
+ creditLimit?: number | null;
517
+ creditUsed?: number;
518
+ creditReserved?: number;
519
+ creditRemaining?: number | null;
520
+ }
521
+ export interface CurrentApiKeyResponse {
522
+ apiKey: CurrentApiKey;
523
+ }
511
524
  export interface UsageSummary {
512
525
  requestCount: number;
513
526
  totalTextCharacters: number;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.13.0";
1
+ export declare const SDK_VERSION = "0.14.0";
2
2
  export declare const SDK_NAME = "@breeze.blue/sdk";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const SDK_VERSION = "0.13.0";
1
+ export const SDK_VERSION = "0.14.0";
2
2
  export const SDK_NAME = "@breeze.blue/sdk";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breeze.blue/sdk",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "ESM-first TypeScript SDK for the Breeze Blue Developer API.",
5
5
  "license": "MIT",
6
6
  "author": "Breeze Blue <support@breezeblue.ai>",