pricetoken 0.6.0 → 0.8.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
@@ -1,5 +1,11 @@
1
1
  type ModelStatus = 'active' | 'deprecated' | 'preview';
2
- type DataConfidence = 'high' | 'low';
2
+ type DataConfidence = 'high' | 'medium' | 'low';
3
+ type ConfidenceLevel = 'high' | 'medium' | 'low';
4
+ interface FreshnessInfo {
5
+ lastVerified: string;
6
+ ageHours: number;
7
+ stale: boolean;
8
+ }
3
9
  interface ModelPricing {
4
10
  modelId: string;
5
11
  provider: string;
@@ -8,9 +14,12 @@ interface ModelPricing {
8
14
  outputPerMTok: number;
9
15
  contextWindow: number | null;
10
16
  maxOutputTokens: number | null;
11
- source: 'fetched' | 'seed' | 'admin' | 'verified';
17
+ source: 'fetched' | 'seed' | 'admin' | 'verified' | 'carried';
12
18
  status: ModelStatus | null;
13
19
  confidence: DataConfidence;
20
+ confidenceScore: number;
21
+ confidenceLevel: ConfidenceLevel;
22
+ freshness: FreshnessInfo;
14
23
  lastUpdated: string | null;
15
24
  launchDate: string | null;
16
25
  }
@@ -53,6 +62,87 @@ interface PriceTokenError {
53
62
  error: string;
54
63
  status: number;
55
64
  }
65
+ type ImageQualityTier = 'standard' | 'hd' | 'ultra';
66
+ interface ImageModelPricing {
67
+ modelId: string;
68
+ provider: string;
69
+ displayName: string;
70
+ pricePerImage: number;
71
+ pricePerMegapixel: number | null;
72
+ defaultResolution: string;
73
+ qualityTier: ImageQualityTier;
74
+ maxResolution: string | null;
75
+ supportedFormats: string[];
76
+ source: 'fetched' | 'seed' | 'admin' | 'verified' | 'carried';
77
+ status: ModelStatus | null;
78
+ confidence: DataConfidence;
79
+ confidenceScore: number;
80
+ confidenceLevel: ConfidenceLevel;
81
+ freshness: FreshnessInfo;
82
+ lastUpdated: string | null;
83
+ launchDate: string | null;
84
+ }
85
+ interface ImageCostEstimate {
86
+ modelId: string;
87
+ imageCount: number;
88
+ pricePerImage: number;
89
+ totalCost: number;
90
+ }
91
+ interface ImagePriceHistoryPoint {
92
+ date: string;
93
+ pricePerImage: number;
94
+ }
95
+ interface ImageModelHistory {
96
+ modelId: string;
97
+ provider: string;
98
+ displayName: string;
99
+ history: ImagePriceHistoryPoint[];
100
+ }
101
+ interface ImageProviderSummary {
102
+ id: string;
103
+ displayName: string;
104
+ modelCount: number;
105
+ cheapestPerImage: number;
106
+ }
107
+ interface VideoModelPricing {
108
+ modelId: string;
109
+ provider: string;
110
+ displayName: string;
111
+ costPerMinute: number;
112
+ resolution: string | null;
113
+ maxDuration: number | null;
114
+ qualityMode: string | null;
115
+ source: 'fetched' | 'seed' | 'admin' | 'verified' | 'carried';
116
+ status: ModelStatus | null;
117
+ confidence: DataConfidence;
118
+ confidenceScore: number;
119
+ confidenceLevel: ConfidenceLevel;
120
+ freshness: FreshnessInfo;
121
+ lastUpdated: string | null;
122
+ launchDate: string | null;
123
+ }
124
+ interface VideoCostEstimate {
125
+ modelId: string;
126
+ durationSeconds: number;
127
+ costPerMinute: number;
128
+ totalCost: number;
129
+ }
130
+ interface VideoPriceHistoryPoint {
131
+ date: string;
132
+ costPerMinute: number;
133
+ }
134
+ interface VideoModelHistory {
135
+ modelId: string;
136
+ provider: string;
137
+ displayName: string;
138
+ history: VideoPriceHistoryPoint[];
139
+ }
140
+ interface VideoProviderSummary {
141
+ id: string;
142
+ displayName: string;
143
+ modelCount: number;
144
+ cheapestCostPerMinute: number;
145
+ }
56
146
 
57
147
  interface ClientOptions {
58
148
  baseUrl?: string;
@@ -91,11 +181,69 @@ declare class PriceTokenClient {
91
181
  after?: string;
92
182
  before?: string;
93
183
  }): Promise<ModelPricing>;
184
+ getImagePricing(opts?: {
185
+ provider?: string;
186
+ currency?: string;
187
+ after?: string;
188
+ before?: string;
189
+ }): Promise<ImageModelPricing[]>;
190
+ getImageModel(modelId: string, opts?: {
191
+ currency?: string;
192
+ }): Promise<ImageModelPricing>;
193
+ getImageHistory(opts?: {
194
+ days?: number;
195
+ modelId?: string;
196
+ provider?: string;
197
+ }): Promise<ImageModelHistory[]>;
198
+ getImageProviders(): Promise<ImageProviderSummary[]>;
199
+ compareImages(modelIds: string[], opts?: {
200
+ currency?: string;
201
+ }): Promise<ImageModelPricing[]>;
202
+ getCheapestImage(opts?: {
203
+ provider?: string;
204
+ currency?: string;
205
+ after?: string;
206
+ before?: string;
207
+ }): Promise<ImageModelPricing>;
208
+ getVideoPricing(opts?: {
209
+ provider?: string;
210
+ currency?: string;
211
+ after?: string;
212
+ before?: string;
213
+ }): Promise<VideoModelPricing[]>;
214
+ getVideoModel(modelId: string, opts?: {
215
+ currency?: string;
216
+ }): Promise<VideoModelPricing>;
217
+ getVideoHistory(opts?: {
218
+ days?: number;
219
+ modelId?: string;
220
+ provider?: string;
221
+ }): Promise<VideoModelHistory[]>;
222
+ getVideoProviders(): Promise<VideoProviderSummary[]>;
223
+ compareVideoModels(modelIds: string[], opts?: {
224
+ currency?: string;
225
+ }): Promise<VideoModelPricing[]>;
226
+ getCheapestVideoModel(opts?: {
227
+ provider?: string;
228
+ currency?: string;
229
+ after?: string;
230
+ before?: string;
231
+ }): Promise<VideoModelPricing>;
94
232
  }
95
233
 
96
234
  declare function calculateCost(modelId: string, inputPerMTok: number, outputPerMTok: number, inputTokens: number, outputTokens: number): CostEstimate;
97
235
  declare function calculateModelCost(modelId: string, inputTokens: number, outputTokens: number, pricing?: ModelPricing[]): CostEstimate;
98
236
 
237
+ declare function calculateImageCost(modelId: string, pricePerImage: number, imageCount: number): ImageCostEstimate;
238
+ declare function calculateImageModelCost(modelId: string, imageCount: number, pricing?: ImageModelPricing[]): ImageCostEstimate;
239
+
240
+ declare function calculateVideoCost(modelId: string, costPerMinute: number, durationSeconds: number): VideoCostEstimate;
241
+ declare function calculateVideoModelCost(modelId: string, durationSeconds: number, pricing?: VideoModelPricing[]): VideoCostEstimate;
242
+
99
243
  declare const STATIC_PRICING: ModelPricing[];
100
244
 
101
- export { type ClientOptions, type CostEstimate, type DataConfidence, type ModelHistory, type ModelPricing, type ModelStatus, type PriceHistoryPoint, PriceTokenClient, type PriceTokenError, type PriceTokenResponse, type ProviderSummary, STATIC_PRICING, calculateCost, calculateModelCost };
245
+ declare const STATIC_IMAGE_PRICING: ImageModelPricing[];
246
+
247
+ declare const STATIC_VIDEO_PRICING: VideoModelPricing[];
248
+
249
+ export { 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_IMAGE_PRICING, STATIC_PRICING, STATIC_VIDEO_PRICING, type VideoCostEstimate, type VideoModelHistory, type VideoModelPricing, type VideoPriceHistoryPoint, type VideoProviderSummary, calculateCost, calculateImageCost, calculateImageModelCost, calculateModelCost, calculateVideoCost, calculateVideoModelCost };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  type ModelStatus = 'active' | 'deprecated' | 'preview';
2
- type DataConfidence = 'high' | 'low';
2
+ type DataConfidence = 'high' | 'medium' | 'low';
3
+ type ConfidenceLevel = 'high' | 'medium' | 'low';
4
+ interface FreshnessInfo {
5
+ lastVerified: string;
6
+ ageHours: number;
7
+ stale: boolean;
8
+ }
3
9
  interface ModelPricing {
4
10
  modelId: string;
5
11
  provider: string;
@@ -8,9 +14,12 @@ interface ModelPricing {
8
14
  outputPerMTok: number;
9
15
  contextWindow: number | null;
10
16
  maxOutputTokens: number | null;
11
- source: 'fetched' | 'seed' | 'admin' | 'verified';
17
+ source: 'fetched' | 'seed' | 'admin' | 'verified' | 'carried';
12
18
  status: ModelStatus | null;
13
19
  confidence: DataConfidence;
20
+ confidenceScore: number;
21
+ confidenceLevel: ConfidenceLevel;
22
+ freshness: FreshnessInfo;
14
23
  lastUpdated: string | null;
15
24
  launchDate: string | null;
16
25
  }
@@ -53,6 +62,87 @@ interface PriceTokenError {
53
62
  error: string;
54
63
  status: number;
55
64
  }
65
+ type ImageQualityTier = 'standard' | 'hd' | 'ultra';
66
+ interface ImageModelPricing {
67
+ modelId: string;
68
+ provider: string;
69
+ displayName: string;
70
+ pricePerImage: number;
71
+ pricePerMegapixel: number | null;
72
+ defaultResolution: string;
73
+ qualityTier: ImageQualityTier;
74
+ maxResolution: string | null;
75
+ supportedFormats: string[];
76
+ source: 'fetched' | 'seed' | 'admin' | 'verified' | 'carried';
77
+ status: ModelStatus | null;
78
+ confidence: DataConfidence;
79
+ confidenceScore: number;
80
+ confidenceLevel: ConfidenceLevel;
81
+ freshness: FreshnessInfo;
82
+ lastUpdated: string | null;
83
+ launchDate: string | null;
84
+ }
85
+ interface ImageCostEstimate {
86
+ modelId: string;
87
+ imageCount: number;
88
+ pricePerImage: number;
89
+ totalCost: number;
90
+ }
91
+ interface ImagePriceHistoryPoint {
92
+ date: string;
93
+ pricePerImage: number;
94
+ }
95
+ interface ImageModelHistory {
96
+ modelId: string;
97
+ provider: string;
98
+ displayName: string;
99
+ history: ImagePriceHistoryPoint[];
100
+ }
101
+ interface ImageProviderSummary {
102
+ id: string;
103
+ displayName: string;
104
+ modelCount: number;
105
+ cheapestPerImage: number;
106
+ }
107
+ interface VideoModelPricing {
108
+ modelId: string;
109
+ provider: string;
110
+ displayName: string;
111
+ costPerMinute: number;
112
+ resolution: string | null;
113
+ maxDuration: number | null;
114
+ qualityMode: string | null;
115
+ source: 'fetched' | 'seed' | 'admin' | 'verified' | 'carried';
116
+ status: ModelStatus | null;
117
+ confidence: DataConfidence;
118
+ confidenceScore: number;
119
+ confidenceLevel: ConfidenceLevel;
120
+ freshness: FreshnessInfo;
121
+ lastUpdated: string | null;
122
+ launchDate: string | null;
123
+ }
124
+ interface VideoCostEstimate {
125
+ modelId: string;
126
+ durationSeconds: number;
127
+ costPerMinute: number;
128
+ totalCost: number;
129
+ }
130
+ interface VideoPriceHistoryPoint {
131
+ date: string;
132
+ costPerMinute: number;
133
+ }
134
+ interface VideoModelHistory {
135
+ modelId: string;
136
+ provider: string;
137
+ displayName: string;
138
+ history: VideoPriceHistoryPoint[];
139
+ }
140
+ interface VideoProviderSummary {
141
+ id: string;
142
+ displayName: string;
143
+ modelCount: number;
144
+ cheapestCostPerMinute: number;
145
+ }
56
146
 
57
147
  interface ClientOptions {
58
148
  baseUrl?: string;
@@ -91,11 +181,69 @@ declare class PriceTokenClient {
91
181
  after?: string;
92
182
  before?: string;
93
183
  }): Promise<ModelPricing>;
184
+ getImagePricing(opts?: {
185
+ provider?: string;
186
+ currency?: string;
187
+ after?: string;
188
+ before?: string;
189
+ }): Promise<ImageModelPricing[]>;
190
+ getImageModel(modelId: string, opts?: {
191
+ currency?: string;
192
+ }): Promise<ImageModelPricing>;
193
+ getImageHistory(opts?: {
194
+ days?: number;
195
+ modelId?: string;
196
+ provider?: string;
197
+ }): Promise<ImageModelHistory[]>;
198
+ getImageProviders(): Promise<ImageProviderSummary[]>;
199
+ compareImages(modelIds: string[], opts?: {
200
+ currency?: string;
201
+ }): Promise<ImageModelPricing[]>;
202
+ getCheapestImage(opts?: {
203
+ provider?: string;
204
+ currency?: string;
205
+ after?: string;
206
+ before?: string;
207
+ }): Promise<ImageModelPricing>;
208
+ getVideoPricing(opts?: {
209
+ provider?: string;
210
+ currency?: string;
211
+ after?: string;
212
+ before?: string;
213
+ }): Promise<VideoModelPricing[]>;
214
+ getVideoModel(modelId: string, opts?: {
215
+ currency?: string;
216
+ }): Promise<VideoModelPricing>;
217
+ getVideoHistory(opts?: {
218
+ days?: number;
219
+ modelId?: string;
220
+ provider?: string;
221
+ }): Promise<VideoModelHistory[]>;
222
+ getVideoProviders(): Promise<VideoProviderSummary[]>;
223
+ compareVideoModels(modelIds: string[], opts?: {
224
+ currency?: string;
225
+ }): Promise<VideoModelPricing[]>;
226
+ getCheapestVideoModel(opts?: {
227
+ provider?: string;
228
+ currency?: string;
229
+ after?: string;
230
+ before?: string;
231
+ }): Promise<VideoModelPricing>;
94
232
  }
95
233
 
96
234
  declare function calculateCost(modelId: string, inputPerMTok: number, outputPerMTok: number, inputTokens: number, outputTokens: number): CostEstimate;
97
235
  declare function calculateModelCost(modelId: string, inputTokens: number, outputTokens: number, pricing?: ModelPricing[]): CostEstimate;
98
236
 
237
+ declare function calculateImageCost(modelId: string, pricePerImage: number, imageCount: number): ImageCostEstimate;
238
+ declare function calculateImageModelCost(modelId: string, imageCount: number, pricing?: ImageModelPricing[]): ImageCostEstimate;
239
+
240
+ declare function calculateVideoCost(modelId: string, costPerMinute: number, durationSeconds: number): VideoCostEstimate;
241
+ declare function calculateVideoModelCost(modelId: string, durationSeconds: number, pricing?: VideoModelPricing[]): VideoCostEstimate;
242
+
99
243
  declare const STATIC_PRICING: ModelPricing[];
100
244
 
101
- export { type ClientOptions, type CostEstimate, type DataConfidence, type ModelHistory, type ModelPricing, type ModelStatus, type PriceHistoryPoint, PriceTokenClient, type PriceTokenError, type PriceTokenResponse, type ProviderSummary, STATIC_PRICING, calculateCost, calculateModelCost };
245
+ declare const STATIC_IMAGE_PRICING: ImageModelPricing[];
246
+
247
+ declare const STATIC_VIDEO_PRICING: VideoModelPricing[];
248
+
249
+ export { 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_IMAGE_PRICING, STATIC_PRICING, STATIC_VIDEO_PRICING, type VideoCostEstimate, type VideoModelHistory, type VideoModelPricing, type VideoPriceHistoryPoint, type VideoProviderSummary, calculateCost, calculateImageCost, calculateImageModelCost, calculateModelCost, calculateVideoCost, calculateVideoModelCost };