pricetoken 0.11.1 → 0.13.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/dist/index.d.mts CHANGED
@@ -264,6 +264,47 @@ interface SttProviderSummary {
264
264
  modelCount: number;
265
265
  cheapestCostPerMinute: number;
266
266
  }
267
+ interface MusicModelPricing {
268
+ modelId: string;
269
+ provider: string;
270
+ displayName: string;
271
+ costPerMinute: number;
272
+ maxDuration: number | null;
273
+ outputFormat: string | null;
274
+ vocals: boolean | null;
275
+ official: boolean;
276
+ pricingNote: string | null;
277
+ source: 'fetched' | 'seed' | 'admin' | 'verified' | 'carried';
278
+ status: ModelStatus | null;
279
+ confidence: DataConfidence;
280
+ confidenceScore: number;
281
+ confidenceLevel: ConfidenceLevel;
282
+ freshness: FreshnessInfo;
283
+ lastUpdated: string | null;
284
+ launchDate: string | null;
285
+ }
286
+ interface MusicCostEstimate {
287
+ modelId: string;
288
+ durationSeconds: number;
289
+ costPerMinute: number;
290
+ totalCost: number;
291
+ }
292
+ interface MusicPriceHistoryPoint {
293
+ date: string;
294
+ costPerMinute: number;
295
+ }
296
+ interface MusicModelHistory {
297
+ modelId: string;
298
+ provider: string;
299
+ displayName: string;
300
+ history: MusicPriceHistoryPoint[];
301
+ }
302
+ interface MusicProviderSummary {
303
+ id: string;
304
+ displayName: string;
305
+ modelCount: number;
306
+ cheapestCostPerMinute: number;
307
+ }
267
308
 
268
309
  interface ClientOptions {
269
310
  baseUrl?: string;
@@ -422,6 +463,30 @@ declare class PriceTokenClient {
422
463
  after?: string;
423
464
  before?: string;
424
465
  }): Promise<SttModelPricing>;
466
+ getMusicPricing(opts?: {
467
+ provider?: string;
468
+ currency?: string;
469
+ after?: string;
470
+ before?: string;
471
+ }): Promise<MusicModelPricing[]>;
472
+ getMusicModel(modelId: string, opts?: {
473
+ currency?: string;
474
+ }): Promise<MusicModelPricing>;
475
+ getMusicHistory(opts?: {
476
+ days?: number;
477
+ modelId?: string;
478
+ provider?: string;
479
+ }): Promise<MusicModelHistory[]>;
480
+ getMusicProviders(): Promise<MusicProviderSummary[]>;
481
+ compareMusicModels(modelIds: string[], opts?: {
482
+ currency?: string;
483
+ }): Promise<MusicModelPricing[]>;
484
+ getCheapestMusicModel(opts?: {
485
+ provider?: string;
486
+ currency?: string;
487
+ after?: string;
488
+ before?: string;
489
+ }): Promise<MusicModelPricing>;
425
490
  }
426
491
 
427
492
  declare function calculateCost(modelId: string, inputPerMTok: number, outputPerMTok: number, inputTokens: number, outputTokens: number): CostEstimate;
@@ -442,6 +507,9 @@ declare function calculateTtsModelCost(modelId: string, characters: number, pric
442
507
  declare function calculateSttCost(modelId: string, costPerMinute: number, durationSeconds: number): SttCostEstimate;
443
508
  declare function calculateSttModelCost(modelId: string, durationSeconds: number, pricing?: SttModelPricing[]): SttCostEstimate;
444
509
 
510
+ declare function calculateMusicCost(modelId: string, costPerMinute: number, durationSeconds: number): MusicCostEstimate;
511
+ declare function calculateMusicModelCost(modelId: string, durationSeconds: number, pricing?: MusicModelPricing[]): MusicCostEstimate;
512
+
445
513
  declare const STATIC_PRICING: ModelPricing[];
446
514
 
447
515
  declare const STATIC_IMAGE_PRICING: ImageModelPricing[];
@@ -454,4 +522,6 @@ declare const STATIC_TTS_PRICING: TtsModelPricing[];
454
522
 
455
523
  declare const STATIC_STT_PRICING: SttModelPricing[];
456
524
 
457
- export { type AvatarCostEstimate, type AvatarModelHistory, type AvatarModelPricing, type AvatarPriceHistoryPoint, type AvatarProviderSummary, type ClientOptions, type ConfidenceLevel, type CostEstimate, type DataConfidence, type FreshnessInfo, type ImageCostEstimate, type ImageModelHistory, type ImageModelPricing, type ImagePriceHistoryPoint, type ImageProviderSummary, type ImageQualityTier, type ModelHistory, type ModelPricing, type ModelStatus, type PriceHistoryPoint, PriceTokenClient, type PriceTokenError, type PriceTokenResponse, type ProviderSummary, STATIC_AVATAR_PRICING, STATIC_IMAGE_PRICING, STATIC_PRICING, STATIC_STT_PRICING, STATIC_TTS_PRICING, STATIC_VIDEO_PRICING, type SttCostEstimate, type SttModelHistory, type SttModelPricing, type SttPriceHistoryPoint, type SttProviderSummary, type TtsCostEstimate, type TtsModelHistory, type TtsModelPricing, type TtsPriceHistoryPoint, type TtsProviderSummary, type VideoCostEstimate, type VideoInputType, type VideoModelHistory, type VideoModelPricing, type VideoPriceHistoryPoint, type VideoProviderSummary, calculateAvatarCost, calculateAvatarModelCost, calculateCost, calculateImageCost, calculateImageModelCost, calculateModelCost, calculateSttCost, calculateSttModelCost, calculateTtsCost, calculateTtsModelCost, calculateVideoCost, calculateVideoModelCost };
525
+ declare const STATIC_MUSIC_PRICING: MusicModelPricing[];
526
+
527
+ export { type AvatarCostEstimate, type AvatarModelHistory, type AvatarModelPricing, type AvatarPriceHistoryPoint, type AvatarProviderSummary, type ClientOptions, type ConfidenceLevel, type CostEstimate, type DataConfidence, type FreshnessInfo, type ImageCostEstimate, type ImageModelHistory, type ImageModelPricing, type ImagePriceHistoryPoint, type ImageProviderSummary, type ImageQualityTier, type ModelHistory, type ModelPricing, type ModelStatus, type MusicCostEstimate, type MusicModelHistory, type MusicModelPricing, type MusicPriceHistoryPoint, type MusicProviderSummary, type PriceHistoryPoint, PriceTokenClient, type PriceTokenError, type PriceTokenResponse, type ProviderSummary, STATIC_AVATAR_PRICING, STATIC_IMAGE_PRICING, STATIC_MUSIC_PRICING, STATIC_PRICING, STATIC_STT_PRICING, STATIC_TTS_PRICING, STATIC_VIDEO_PRICING, type SttCostEstimate, type SttModelHistory, type SttModelPricing, type SttPriceHistoryPoint, type SttProviderSummary, type TtsCostEstimate, type TtsModelHistory, type TtsModelPricing, type TtsPriceHistoryPoint, type TtsProviderSummary, type VideoCostEstimate, type VideoInputType, type VideoModelHistory, type VideoModelPricing, type VideoPriceHistoryPoint, type VideoProviderSummary, calculateAvatarCost, calculateAvatarModelCost, calculateCost, calculateImageCost, calculateImageModelCost, calculateModelCost, calculateMusicCost, calculateMusicModelCost, calculateSttCost, calculateSttModelCost, calculateTtsCost, calculateTtsModelCost, calculateVideoCost, calculateVideoModelCost };
package/dist/index.d.ts CHANGED
@@ -264,6 +264,47 @@ interface SttProviderSummary {
264
264
  modelCount: number;
265
265
  cheapestCostPerMinute: number;
266
266
  }
267
+ interface MusicModelPricing {
268
+ modelId: string;
269
+ provider: string;
270
+ displayName: string;
271
+ costPerMinute: number;
272
+ maxDuration: number | null;
273
+ outputFormat: string | null;
274
+ vocals: boolean | null;
275
+ official: boolean;
276
+ pricingNote: string | null;
277
+ source: 'fetched' | 'seed' | 'admin' | 'verified' | 'carried';
278
+ status: ModelStatus | null;
279
+ confidence: DataConfidence;
280
+ confidenceScore: number;
281
+ confidenceLevel: ConfidenceLevel;
282
+ freshness: FreshnessInfo;
283
+ lastUpdated: string | null;
284
+ launchDate: string | null;
285
+ }
286
+ interface MusicCostEstimate {
287
+ modelId: string;
288
+ durationSeconds: number;
289
+ costPerMinute: number;
290
+ totalCost: number;
291
+ }
292
+ interface MusicPriceHistoryPoint {
293
+ date: string;
294
+ costPerMinute: number;
295
+ }
296
+ interface MusicModelHistory {
297
+ modelId: string;
298
+ provider: string;
299
+ displayName: string;
300
+ history: MusicPriceHistoryPoint[];
301
+ }
302
+ interface MusicProviderSummary {
303
+ id: string;
304
+ displayName: string;
305
+ modelCount: number;
306
+ cheapestCostPerMinute: number;
307
+ }
267
308
 
268
309
  interface ClientOptions {
269
310
  baseUrl?: string;
@@ -422,6 +463,30 @@ declare class PriceTokenClient {
422
463
  after?: string;
423
464
  before?: string;
424
465
  }): Promise<SttModelPricing>;
466
+ getMusicPricing(opts?: {
467
+ provider?: string;
468
+ currency?: string;
469
+ after?: string;
470
+ before?: string;
471
+ }): Promise<MusicModelPricing[]>;
472
+ getMusicModel(modelId: string, opts?: {
473
+ currency?: string;
474
+ }): Promise<MusicModelPricing>;
475
+ getMusicHistory(opts?: {
476
+ days?: number;
477
+ modelId?: string;
478
+ provider?: string;
479
+ }): Promise<MusicModelHistory[]>;
480
+ getMusicProviders(): Promise<MusicProviderSummary[]>;
481
+ compareMusicModels(modelIds: string[], opts?: {
482
+ currency?: string;
483
+ }): Promise<MusicModelPricing[]>;
484
+ getCheapestMusicModel(opts?: {
485
+ provider?: string;
486
+ currency?: string;
487
+ after?: string;
488
+ before?: string;
489
+ }): Promise<MusicModelPricing>;
425
490
  }
426
491
 
427
492
  declare function calculateCost(modelId: string, inputPerMTok: number, outputPerMTok: number, inputTokens: number, outputTokens: number): CostEstimate;
@@ -442,6 +507,9 @@ declare function calculateTtsModelCost(modelId: string, characters: number, pric
442
507
  declare function calculateSttCost(modelId: string, costPerMinute: number, durationSeconds: number): SttCostEstimate;
443
508
  declare function calculateSttModelCost(modelId: string, durationSeconds: number, pricing?: SttModelPricing[]): SttCostEstimate;
444
509
 
510
+ declare function calculateMusicCost(modelId: string, costPerMinute: number, durationSeconds: number): MusicCostEstimate;
511
+ declare function calculateMusicModelCost(modelId: string, durationSeconds: number, pricing?: MusicModelPricing[]): MusicCostEstimate;
512
+
445
513
  declare const STATIC_PRICING: ModelPricing[];
446
514
 
447
515
  declare const STATIC_IMAGE_PRICING: ImageModelPricing[];
@@ -454,4 +522,6 @@ declare const STATIC_TTS_PRICING: TtsModelPricing[];
454
522
 
455
523
  declare const STATIC_STT_PRICING: SttModelPricing[];
456
524
 
457
- export { type AvatarCostEstimate, type AvatarModelHistory, type AvatarModelPricing, type AvatarPriceHistoryPoint, type AvatarProviderSummary, type ClientOptions, type ConfidenceLevel, type CostEstimate, type DataConfidence, type FreshnessInfo, type ImageCostEstimate, type ImageModelHistory, type ImageModelPricing, type ImagePriceHistoryPoint, type ImageProviderSummary, type ImageQualityTier, type ModelHistory, type ModelPricing, type ModelStatus, type PriceHistoryPoint, PriceTokenClient, type PriceTokenError, type PriceTokenResponse, type ProviderSummary, STATIC_AVATAR_PRICING, STATIC_IMAGE_PRICING, STATIC_PRICING, STATIC_STT_PRICING, STATIC_TTS_PRICING, STATIC_VIDEO_PRICING, type SttCostEstimate, type SttModelHistory, type SttModelPricing, type SttPriceHistoryPoint, type SttProviderSummary, type TtsCostEstimate, type TtsModelHistory, type TtsModelPricing, type TtsPriceHistoryPoint, type TtsProviderSummary, type VideoCostEstimate, type VideoInputType, type VideoModelHistory, type VideoModelPricing, type VideoPriceHistoryPoint, type VideoProviderSummary, calculateAvatarCost, calculateAvatarModelCost, calculateCost, calculateImageCost, calculateImageModelCost, calculateModelCost, calculateSttCost, calculateSttModelCost, calculateTtsCost, calculateTtsModelCost, calculateVideoCost, calculateVideoModelCost };
525
+ declare const STATIC_MUSIC_PRICING: MusicModelPricing[];
526
+
527
+ export { type AvatarCostEstimate, type AvatarModelHistory, type AvatarModelPricing, type AvatarPriceHistoryPoint, type AvatarProviderSummary, type ClientOptions, type ConfidenceLevel, type CostEstimate, type DataConfidence, type FreshnessInfo, type ImageCostEstimate, type ImageModelHistory, type ImageModelPricing, type ImagePriceHistoryPoint, type ImageProviderSummary, type ImageQualityTier, type ModelHistory, type ModelPricing, type ModelStatus, type MusicCostEstimate, type MusicModelHistory, type MusicModelPricing, type MusicPriceHistoryPoint, type MusicProviderSummary, type PriceHistoryPoint, PriceTokenClient, type PriceTokenError, type PriceTokenResponse, type ProviderSummary, STATIC_AVATAR_PRICING, STATIC_IMAGE_PRICING, STATIC_MUSIC_PRICING, STATIC_PRICING, STATIC_STT_PRICING, STATIC_TTS_PRICING, STATIC_VIDEO_PRICING, type SttCostEstimate, type SttModelHistory, type SttModelPricing, type SttPriceHistoryPoint, type SttProviderSummary, type TtsCostEstimate, type TtsModelHistory, type TtsModelPricing, type TtsPriceHistoryPoint, type TtsProviderSummary, type VideoCostEstimate, type VideoInputType, type VideoModelHistory, type VideoModelPricing, type VideoPriceHistoryPoint, type VideoProviderSummary, calculateAvatarCost, calculateAvatarModelCost, calculateCost, calculateImageCost, calculateImageModelCost, calculateModelCost, calculateMusicCost, calculateMusicModelCost, calculateSttCost, calculateSttModelCost, calculateTtsCost, calculateTtsModelCost, calculateVideoCost, calculateVideoModelCost };
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ __export(index_exports, {
23
23
  PriceTokenClient: () => PriceTokenClient,
24
24
  STATIC_AVATAR_PRICING: () => STATIC_AVATAR_PRICING,
25
25
  STATIC_IMAGE_PRICING: () => STATIC_IMAGE_PRICING,
26
+ STATIC_MUSIC_PRICING: () => STATIC_MUSIC_PRICING,
26
27
  STATIC_PRICING: () => STATIC_PRICING,
27
28
  STATIC_STT_PRICING: () => STATIC_STT_PRICING,
28
29
  STATIC_TTS_PRICING: () => STATIC_TTS_PRICING,
@@ -33,6 +34,8 @@ __export(index_exports, {
33
34
  calculateImageCost: () => calculateImageCost,
34
35
  calculateImageModelCost: () => calculateImageModelCost,
35
36
  calculateModelCost: () => calculateModelCost,
37
+ calculateMusicCost: () => calculateMusicCost,
38
+ calculateMusicModelCost: () => calculateMusicModelCost,
36
39
  calculateSttCost: () => calculateSttCost,
37
40
  calculateSttModelCost: () => calculateSttModelCost,
38
41
  calculateTtsCost: () => calculateTtsCost,
@@ -328,6 +331,47 @@ var PriceTokenClient = class {
328
331
  const qs = params.toString();
329
332
  return this.request(`/api/v1/stt/cheapest${qs ? `?${qs}` : ""}`);
330
333
  }
334
+ // Music pricing methods
335
+ async getMusicPricing(opts) {
336
+ const params = new URLSearchParams();
337
+ if (opts?.provider) params.set("provider", opts.provider);
338
+ if (opts?.currency) params.set("currency", opts.currency);
339
+ if (opts?.after) params.set("after", opts.after);
340
+ if (opts?.before) params.set("before", opts.before);
341
+ const qs = params.toString();
342
+ return this.request(`/api/v1/music${qs ? `?${qs}` : ""}`);
343
+ }
344
+ async getMusicModel(modelId, opts) {
345
+ const params = new URLSearchParams();
346
+ if (opts?.currency) params.set("currency", opts.currency);
347
+ const qs = params.toString();
348
+ return this.request(`/api/v1/music/${encodeURIComponent(modelId)}${qs ? `?${qs}` : ""}`);
349
+ }
350
+ async getMusicHistory(opts) {
351
+ const params = new URLSearchParams();
352
+ if (opts?.days) params.set("days", String(opts.days));
353
+ if (opts?.modelId) params.set("modelId", opts.modelId);
354
+ if (opts?.provider) params.set("provider", opts.provider);
355
+ const qs = params.toString();
356
+ return this.request(`/api/v1/music/history${qs ? `?${qs}` : ""}`);
357
+ }
358
+ async getMusicProviders() {
359
+ return this.request("/api/v1/music/providers");
360
+ }
361
+ async compareMusicModels(modelIds, opts) {
362
+ const params = new URLSearchParams({ models: modelIds.join(",") });
363
+ if (opts?.currency) params.set("currency", opts.currency);
364
+ return this.request(`/api/v1/music/compare?${params}`);
365
+ }
366
+ async getCheapestMusicModel(opts) {
367
+ const params = new URLSearchParams();
368
+ if (opts?.provider) params.set("provider", opts.provider);
369
+ if (opts?.currency) params.set("currency", opts.currency);
370
+ if (opts?.after) params.set("after", opts.after);
371
+ if (opts?.before) params.set("before", opts.before);
372
+ const qs = params.toString();
373
+ return this.request(`/api/v1/music/cheapest${qs ? `?${qs}` : ""}`);
374
+ }
331
375
  };
332
376
 
333
377
  // src/static.ts
@@ -2887,7 +2931,7 @@ var STATIC_AVATAR_PRICING = [
2887
2931
  qualityMode: "premium",
2888
2932
  lipSync: true,
2889
2933
  source: "seed",
2890
- status: "active",
2934
+ status: "deprecated",
2891
2935
  confidence: "high",
2892
2936
  confidenceScore: 99,
2893
2937
  confidenceLevel: "high",
@@ -2906,7 +2950,7 @@ var STATIC_AVATAR_PRICING = [
2906
2950
  qualityMode: "standard",
2907
2951
  lipSync: true,
2908
2952
  source: "seed",
2909
- status: "active",
2953
+ status: "deprecated",
2910
2954
  confidence: "high",
2911
2955
  confidenceScore: 99,
2912
2956
  confidenceLevel: "high",
@@ -3028,63 +3072,6 @@ var STATIC_AVATAR_PRICING = [
3028
3072
  lastUpdated: null,
3029
3073
  launchDate: "2025-05-01"
3030
3074
  },
3031
- {
3032
- modelId: "heygen-translate-precision",
3033
- provider: "heygen",
3034
- displayName: "HeyGen Video Translation Precision Mode",
3035
- costPerMinute: 6,
3036
- avatarType: "translation",
3037
- resolution: null,
3038
- maxDuration: null,
3039
- qualityMode: null,
3040
- lipSync: true,
3041
- source: "seed",
3042
- status: "active",
3043
- confidence: "high",
3044
- confidenceScore: 99,
3045
- confidenceLevel: "high",
3046
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3047
- lastUpdated: null,
3048
- launchDate: null
3049
- },
3050
- {
3051
- modelId: "heygen-translate-proofread",
3052
- provider: "heygen",
3053
- displayName: "HeyGen Video Translation Proofread",
3054
- costPerMinute: 0.498,
3055
- avatarType: "translation",
3056
- resolution: null,
3057
- maxDuration: null,
3058
- qualityMode: null,
3059
- lipSync: false,
3060
- source: "seed",
3061
- status: "active",
3062
- confidence: "high",
3063
- confidenceScore: 99,
3064
- confidenceLevel: "high",
3065
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3066
- lastUpdated: null,
3067
- launchDate: null
3068
- },
3069
- {
3070
- modelId: "heygen-translate-speed",
3071
- provider: "heygen",
3072
- displayName: "HeyGen Video Translation Speed Mode",
3073
- costPerMinute: 3,
3074
- avatarType: "translation",
3075
- resolution: null,
3076
- maxDuration: null,
3077
- qualityMode: null,
3078
- lipSync: true,
3079
- source: "seed",
3080
- status: "active",
3081
- confidence: "high",
3082
- confidenceScore: 99,
3083
- confidenceLevel: "high",
3084
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3085
- lastUpdated: null,
3086
- launchDate: null
3087
- },
3088
3075
  {
3089
3076
  modelId: "heygen-translation-precision",
3090
3077
  provider: "heygen",
@@ -3142,44 +3129,6 @@ var STATIC_AVATAR_PRICING = [
3142
3129
  lastUpdated: null,
3143
3130
  launchDate: "2025-11-17"
3144
3131
  },
3145
- {
3146
- modelId: "heygen-video-agent-prompt",
3147
- provider: "heygen",
3148
- displayName: "HeyGen Video Agent (Prompt to Video)",
3149
- costPerMinute: 1.998,
3150
- avatarType: "standard",
3151
- resolution: null,
3152
- maxDuration: null,
3153
- qualityMode: null,
3154
- lipSync: true,
3155
- source: "seed",
3156
- status: "active",
3157
- confidence: "high",
3158
- confidenceScore: 99,
3159
- confidenceLevel: "high",
3160
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3161
- lastUpdated: null,
3162
- launchDate: null
3163
- },
3164
- {
3165
- modelId: "heygen-video-translation",
3166
- provider: "heygen",
3167
- displayName: "HeyGen Video Translation",
3168
- costPerMinute: 3,
3169
- avatarType: "translation",
3170
- resolution: "1080p",
3171
- maxDuration: 1800,
3172
- qualityMode: "standard",
3173
- lipSync: true,
3174
- source: "seed",
3175
- status: "active",
3176
- confidence: "high",
3177
- confidenceScore: 99,
3178
- confidenceLevel: "high",
3179
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3180
- lastUpdated: null,
3181
- launchDate: "2024-06-01"
3182
- },
3183
3132
  {
3184
3133
  modelId: "runway-characters",
3185
3134
  provider: "runway",
@@ -5492,11 +5441,92 @@ function calculateSttModelCost(modelId, durationSeconds, pricing) {
5492
5441
  }
5493
5442
  return calculateSttCost(modelId, model.costPerMinute, durationSeconds);
5494
5443
  }
5444
+
5445
+ // src/music-static.ts
5446
+ var STATIC_MUSIC_PRICING = [
5447
+ {
5448
+ modelId: "elevenlabs-eleven-music",
5449
+ provider: "elevenlabs",
5450
+ displayName: "ElevenLabs Eleven Music",
5451
+ costPerMinute: 0.5,
5452
+ maxDuration: null,
5453
+ outputFormat: "mp3",
5454
+ vocals: true,
5455
+ official: true,
5456
+ pricingNote: null,
5457
+ source: "seed",
5458
+ status: "active",
5459
+ confidence: "high",
5460
+ confidenceScore: 99,
5461
+ confidenceLevel: "high",
5462
+ freshness: { lastVerified: "", ageHours: 0, stale: false },
5463
+ lastUpdated: null,
5464
+ launchDate: "2025-06-01"
5465
+ },
5466
+ {
5467
+ modelId: "soundverse-music",
5468
+ provider: "soundverse",
5469
+ displayName: "Soundverse Music Generation",
5470
+ costPerMinute: 0.0125,
5471
+ maxDuration: 240,
5472
+ outputFormat: "mp3",
5473
+ vocals: true,
5474
+ official: true,
5475
+ pricingNote: "Approximated from ~$0.05/song at ~4 min avg",
5476
+ source: "seed",
5477
+ status: "active",
5478
+ confidence: "high",
5479
+ confidenceScore: 99,
5480
+ confidenceLevel: "high",
5481
+ freshness: { lastVerified: "", ageHours: 0, stale: false },
5482
+ lastUpdated: null,
5483
+ launchDate: "2025-01-01"
5484
+ },
5485
+ {
5486
+ modelId: "sunoapi-suno-v4.5",
5487
+ provider: "sunoapi",
5488
+ displayName: "Suno v4.5 via SunoAPI.org",
5489
+ costPerMinute: 625e-5,
5490
+ maxDuration: 480,
5491
+ outputFormat: "mp3",
5492
+ vocals: true,
5493
+ official: false,
5494
+ pricingNote: "Unofficial wrapper. ~$0.025/song ($0.005/credit x 5 credits) at ~4 min avg",
5495
+ source: "seed",
5496
+ status: "active",
5497
+ confidence: "high",
5498
+ confidenceScore: 99,
5499
+ confidenceLevel: "high",
5500
+ freshness: { lastVerified: "", ageHours: 0, stale: false },
5501
+ lastUpdated: null,
5502
+ launchDate: "2025-09-01"
5503
+ }
5504
+ ];
5505
+
5506
+ // src/music-cost.ts
5507
+ function calculateMusicCost(modelId, costPerMinute, durationSeconds) {
5508
+ const totalCost = durationSeconds / 60 * costPerMinute;
5509
+ return {
5510
+ modelId,
5511
+ durationSeconds,
5512
+ costPerMinute,
5513
+ totalCost
5514
+ };
5515
+ }
5516
+ function calculateMusicModelCost(modelId, durationSeconds, pricing) {
5517
+ const data = pricing ?? STATIC_MUSIC_PRICING;
5518
+ const model = data.find((m) => m.modelId === modelId);
5519
+ if (!model) {
5520
+ throw new Error(`Unknown music model: ${modelId}. Provide pricing data or use calculateMusicCost().`);
5521
+ }
5522
+ return calculateMusicCost(modelId, model.costPerMinute, durationSeconds);
5523
+ }
5495
5524
  // Annotate the CommonJS export names for ESM import in node:
5496
5525
  0 && (module.exports = {
5497
5526
  PriceTokenClient,
5498
5527
  STATIC_AVATAR_PRICING,
5499
5528
  STATIC_IMAGE_PRICING,
5529
+ STATIC_MUSIC_PRICING,
5500
5530
  STATIC_PRICING,
5501
5531
  STATIC_STT_PRICING,
5502
5532
  STATIC_TTS_PRICING,
@@ -5507,6 +5537,8 @@ function calculateSttModelCost(modelId, durationSeconds, pricing) {
5507
5537
  calculateImageCost,
5508
5538
  calculateImageModelCost,
5509
5539
  calculateModelCost,
5540
+ calculateMusicCost,
5541
+ calculateMusicModelCost,
5510
5542
  calculateSttCost,
5511
5543
  calculateSttModelCost,
5512
5544
  calculateTtsCost,
package/dist/index.mjs CHANGED
@@ -284,6 +284,47 @@ var PriceTokenClient = class {
284
284
  const qs = params.toString();
285
285
  return this.request(`/api/v1/stt/cheapest${qs ? `?${qs}` : ""}`);
286
286
  }
287
+ // Music pricing methods
288
+ async getMusicPricing(opts) {
289
+ const params = new URLSearchParams();
290
+ if (opts?.provider) params.set("provider", opts.provider);
291
+ if (opts?.currency) params.set("currency", opts.currency);
292
+ if (opts?.after) params.set("after", opts.after);
293
+ if (opts?.before) params.set("before", opts.before);
294
+ const qs = params.toString();
295
+ return this.request(`/api/v1/music${qs ? `?${qs}` : ""}`);
296
+ }
297
+ async getMusicModel(modelId, opts) {
298
+ const params = new URLSearchParams();
299
+ if (opts?.currency) params.set("currency", opts.currency);
300
+ const qs = params.toString();
301
+ return this.request(`/api/v1/music/${encodeURIComponent(modelId)}${qs ? `?${qs}` : ""}`);
302
+ }
303
+ async getMusicHistory(opts) {
304
+ const params = new URLSearchParams();
305
+ if (opts?.days) params.set("days", String(opts.days));
306
+ if (opts?.modelId) params.set("modelId", opts.modelId);
307
+ if (opts?.provider) params.set("provider", opts.provider);
308
+ const qs = params.toString();
309
+ return this.request(`/api/v1/music/history${qs ? `?${qs}` : ""}`);
310
+ }
311
+ async getMusicProviders() {
312
+ return this.request("/api/v1/music/providers");
313
+ }
314
+ async compareMusicModels(modelIds, opts) {
315
+ const params = new URLSearchParams({ models: modelIds.join(",") });
316
+ if (opts?.currency) params.set("currency", opts.currency);
317
+ return this.request(`/api/v1/music/compare?${params}`);
318
+ }
319
+ async getCheapestMusicModel(opts) {
320
+ const params = new URLSearchParams();
321
+ if (opts?.provider) params.set("provider", opts.provider);
322
+ if (opts?.currency) params.set("currency", opts.currency);
323
+ if (opts?.after) params.set("after", opts.after);
324
+ if (opts?.before) params.set("before", opts.before);
325
+ const qs = params.toString();
326
+ return this.request(`/api/v1/music/cheapest${qs ? `?${qs}` : ""}`);
327
+ }
287
328
  };
288
329
 
289
330
  // src/static.ts
@@ -2843,7 +2884,7 @@ var STATIC_AVATAR_PRICING = [
2843
2884
  qualityMode: "premium",
2844
2885
  lipSync: true,
2845
2886
  source: "seed",
2846
- status: "active",
2887
+ status: "deprecated",
2847
2888
  confidence: "high",
2848
2889
  confidenceScore: 99,
2849
2890
  confidenceLevel: "high",
@@ -2862,7 +2903,7 @@ var STATIC_AVATAR_PRICING = [
2862
2903
  qualityMode: "standard",
2863
2904
  lipSync: true,
2864
2905
  source: "seed",
2865
- status: "active",
2906
+ status: "deprecated",
2866
2907
  confidence: "high",
2867
2908
  confidenceScore: 99,
2868
2909
  confidenceLevel: "high",
@@ -2984,63 +3025,6 @@ var STATIC_AVATAR_PRICING = [
2984
3025
  lastUpdated: null,
2985
3026
  launchDate: "2025-05-01"
2986
3027
  },
2987
- {
2988
- modelId: "heygen-translate-precision",
2989
- provider: "heygen",
2990
- displayName: "HeyGen Video Translation Precision Mode",
2991
- costPerMinute: 6,
2992
- avatarType: "translation",
2993
- resolution: null,
2994
- maxDuration: null,
2995
- qualityMode: null,
2996
- lipSync: true,
2997
- source: "seed",
2998
- status: "active",
2999
- confidence: "high",
3000
- confidenceScore: 99,
3001
- confidenceLevel: "high",
3002
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3003
- lastUpdated: null,
3004
- launchDate: null
3005
- },
3006
- {
3007
- modelId: "heygen-translate-proofread",
3008
- provider: "heygen",
3009
- displayName: "HeyGen Video Translation Proofread",
3010
- costPerMinute: 0.498,
3011
- avatarType: "translation",
3012
- resolution: null,
3013
- maxDuration: null,
3014
- qualityMode: null,
3015
- lipSync: false,
3016
- source: "seed",
3017
- status: "active",
3018
- confidence: "high",
3019
- confidenceScore: 99,
3020
- confidenceLevel: "high",
3021
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3022
- lastUpdated: null,
3023
- launchDate: null
3024
- },
3025
- {
3026
- modelId: "heygen-translate-speed",
3027
- provider: "heygen",
3028
- displayName: "HeyGen Video Translation Speed Mode",
3029
- costPerMinute: 3,
3030
- avatarType: "translation",
3031
- resolution: null,
3032
- maxDuration: null,
3033
- qualityMode: null,
3034
- lipSync: true,
3035
- source: "seed",
3036
- status: "active",
3037
- confidence: "high",
3038
- confidenceScore: 99,
3039
- confidenceLevel: "high",
3040
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3041
- lastUpdated: null,
3042
- launchDate: null
3043
- },
3044
3028
  {
3045
3029
  modelId: "heygen-translation-precision",
3046
3030
  provider: "heygen",
@@ -3098,44 +3082,6 @@ var STATIC_AVATAR_PRICING = [
3098
3082
  lastUpdated: null,
3099
3083
  launchDate: "2025-11-17"
3100
3084
  },
3101
- {
3102
- modelId: "heygen-video-agent-prompt",
3103
- provider: "heygen",
3104
- displayName: "HeyGen Video Agent (Prompt to Video)",
3105
- costPerMinute: 1.998,
3106
- avatarType: "standard",
3107
- resolution: null,
3108
- maxDuration: null,
3109
- qualityMode: null,
3110
- lipSync: true,
3111
- source: "seed",
3112
- status: "active",
3113
- confidence: "high",
3114
- confidenceScore: 99,
3115
- confidenceLevel: "high",
3116
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3117
- lastUpdated: null,
3118
- launchDate: null
3119
- },
3120
- {
3121
- modelId: "heygen-video-translation",
3122
- provider: "heygen",
3123
- displayName: "HeyGen Video Translation",
3124
- costPerMinute: 3,
3125
- avatarType: "translation",
3126
- resolution: "1080p",
3127
- maxDuration: 1800,
3128
- qualityMode: "standard",
3129
- lipSync: true,
3130
- source: "seed",
3131
- status: "active",
3132
- confidence: "high",
3133
- confidenceScore: 99,
3134
- confidenceLevel: "high",
3135
- freshness: { lastVerified: "", ageHours: 0, stale: false },
3136
- lastUpdated: null,
3137
- launchDate: "2024-06-01"
3138
- },
3139
3085
  {
3140
3086
  modelId: "runway-characters",
3141
3087
  provider: "runway",
@@ -5448,10 +5394,91 @@ function calculateSttModelCost(modelId, durationSeconds, pricing) {
5448
5394
  }
5449
5395
  return calculateSttCost(modelId, model.costPerMinute, durationSeconds);
5450
5396
  }
5397
+
5398
+ // src/music-static.ts
5399
+ var STATIC_MUSIC_PRICING = [
5400
+ {
5401
+ modelId: "elevenlabs-eleven-music",
5402
+ provider: "elevenlabs",
5403
+ displayName: "ElevenLabs Eleven Music",
5404
+ costPerMinute: 0.5,
5405
+ maxDuration: null,
5406
+ outputFormat: "mp3",
5407
+ vocals: true,
5408
+ official: true,
5409
+ pricingNote: null,
5410
+ source: "seed",
5411
+ status: "active",
5412
+ confidence: "high",
5413
+ confidenceScore: 99,
5414
+ confidenceLevel: "high",
5415
+ freshness: { lastVerified: "", ageHours: 0, stale: false },
5416
+ lastUpdated: null,
5417
+ launchDate: "2025-06-01"
5418
+ },
5419
+ {
5420
+ modelId: "soundverse-music",
5421
+ provider: "soundverse",
5422
+ displayName: "Soundverse Music Generation",
5423
+ costPerMinute: 0.0125,
5424
+ maxDuration: 240,
5425
+ outputFormat: "mp3",
5426
+ vocals: true,
5427
+ official: true,
5428
+ pricingNote: "Approximated from ~$0.05/song at ~4 min avg",
5429
+ source: "seed",
5430
+ status: "active",
5431
+ confidence: "high",
5432
+ confidenceScore: 99,
5433
+ confidenceLevel: "high",
5434
+ freshness: { lastVerified: "", ageHours: 0, stale: false },
5435
+ lastUpdated: null,
5436
+ launchDate: "2025-01-01"
5437
+ },
5438
+ {
5439
+ modelId: "sunoapi-suno-v4.5",
5440
+ provider: "sunoapi",
5441
+ displayName: "Suno v4.5 via SunoAPI.org",
5442
+ costPerMinute: 625e-5,
5443
+ maxDuration: 480,
5444
+ outputFormat: "mp3",
5445
+ vocals: true,
5446
+ official: false,
5447
+ pricingNote: "Unofficial wrapper. ~$0.025/song ($0.005/credit x 5 credits) at ~4 min avg",
5448
+ source: "seed",
5449
+ status: "active",
5450
+ confidence: "high",
5451
+ confidenceScore: 99,
5452
+ confidenceLevel: "high",
5453
+ freshness: { lastVerified: "", ageHours: 0, stale: false },
5454
+ lastUpdated: null,
5455
+ launchDate: "2025-09-01"
5456
+ }
5457
+ ];
5458
+
5459
+ // src/music-cost.ts
5460
+ function calculateMusicCost(modelId, costPerMinute, durationSeconds) {
5461
+ const totalCost = durationSeconds / 60 * costPerMinute;
5462
+ return {
5463
+ modelId,
5464
+ durationSeconds,
5465
+ costPerMinute,
5466
+ totalCost
5467
+ };
5468
+ }
5469
+ function calculateMusicModelCost(modelId, durationSeconds, pricing) {
5470
+ const data = pricing ?? STATIC_MUSIC_PRICING;
5471
+ const model = data.find((m) => m.modelId === modelId);
5472
+ if (!model) {
5473
+ throw new Error(`Unknown music model: ${modelId}. Provide pricing data or use calculateMusicCost().`);
5474
+ }
5475
+ return calculateMusicCost(modelId, model.costPerMinute, durationSeconds);
5476
+ }
5451
5477
  export {
5452
5478
  PriceTokenClient,
5453
5479
  STATIC_AVATAR_PRICING,
5454
5480
  STATIC_IMAGE_PRICING,
5481
+ STATIC_MUSIC_PRICING,
5455
5482
  STATIC_PRICING,
5456
5483
  STATIC_STT_PRICING,
5457
5484
  STATIC_TTS_PRICING,
@@ -5462,6 +5489,8 @@ export {
5462
5489
  calculateImageCost,
5463
5490
  calculateImageModelCost,
5464
5491
  calculateModelCost,
5492
+ calculateMusicCost,
5493
+ calculateMusicModelCost,
5465
5494
  calculateSttCost,
5466
5495
  calculateSttModelCost,
5467
5496
  calculateTtsCost,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pricetoken",
3
- "version": "0.11.1",
3
+ "version": "0.13.0",
4
4
  "description": "Real-time LLM pricing data — typed client, cost calculator, and static pricing",
5
5
  "keywords": [
6
6
  "llm",