pricetoken 0.6.0 → 0.7.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
@@ -53,6 +53,81 @@ interface PriceTokenError {
53
53
  error: string;
54
54
  status: number;
55
55
  }
56
+ type ImageQualityTier = 'standard' | 'hd' | 'ultra';
57
+ interface ImageModelPricing {
58
+ modelId: string;
59
+ provider: string;
60
+ displayName: string;
61
+ pricePerImage: number;
62
+ pricePerMegapixel: number | null;
63
+ defaultResolution: string;
64
+ qualityTier: ImageQualityTier;
65
+ maxResolution: string | null;
66
+ supportedFormats: string[];
67
+ source: 'fetched' | 'seed' | 'admin';
68
+ status: ModelStatus | null;
69
+ confidence: DataConfidence;
70
+ lastUpdated: string | null;
71
+ launchDate: string | null;
72
+ }
73
+ interface ImageCostEstimate {
74
+ modelId: string;
75
+ imageCount: number;
76
+ pricePerImage: number;
77
+ totalCost: number;
78
+ }
79
+ interface ImagePriceHistoryPoint {
80
+ date: string;
81
+ pricePerImage: number;
82
+ }
83
+ interface ImageModelHistory {
84
+ modelId: string;
85
+ provider: string;
86
+ displayName: string;
87
+ history: ImagePriceHistoryPoint[];
88
+ }
89
+ interface ImageProviderSummary {
90
+ id: string;
91
+ displayName: string;
92
+ modelCount: number;
93
+ cheapestPerImage: number;
94
+ }
95
+ interface VideoModelPricing {
96
+ modelId: string;
97
+ provider: string;
98
+ displayName: string;
99
+ costPerMinute: number;
100
+ resolution: string | null;
101
+ maxDuration: number | null;
102
+ qualityMode: string | null;
103
+ source: 'fetched' | 'seed' | 'admin' | 'verified';
104
+ status: ModelStatus | null;
105
+ confidence: DataConfidence;
106
+ lastUpdated: string | null;
107
+ launchDate: string | null;
108
+ }
109
+ interface VideoCostEstimate {
110
+ modelId: string;
111
+ durationSeconds: number;
112
+ costPerMinute: number;
113
+ totalCost: number;
114
+ }
115
+ interface VideoPriceHistoryPoint {
116
+ date: string;
117
+ costPerMinute: number;
118
+ }
119
+ interface VideoModelHistory {
120
+ modelId: string;
121
+ provider: string;
122
+ displayName: string;
123
+ history: VideoPriceHistoryPoint[];
124
+ }
125
+ interface VideoProviderSummary {
126
+ id: string;
127
+ displayName: string;
128
+ modelCount: number;
129
+ cheapestCostPerMinute: number;
130
+ }
56
131
 
57
132
  interface ClientOptions {
58
133
  baseUrl?: string;
@@ -91,11 +166,69 @@ declare class PriceTokenClient {
91
166
  after?: string;
92
167
  before?: string;
93
168
  }): Promise<ModelPricing>;
169
+ getImagePricing(opts?: {
170
+ provider?: string;
171
+ currency?: string;
172
+ after?: string;
173
+ before?: string;
174
+ }): Promise<ImageModelPricing[]>;
175
+ getImageModel(modelId: string, opts?: {
176
+ currency?: string;
177
+ }): Promise<ImageModelPricing>;
178
+ getImageHistory(opts?: {
179
+ days?: number;
180
+ modelId?: string;
181
+ provider?: string;
182
+ }): Promise<ImageModelHistory[]>;
183
+ getImageProviders(): Promise<ImageProviderSummary[]>;
184
+ compareImages(modelIds: string[], opts?: {
185
+ currency?: string;
186
+ }): Promise<ImageModelPricing[]>;
187
+ getCheapestImage(opts?: {
188
+ provider?: string;
189
+ currency?: string;
190
+ after?: string;
191
+ before?: string;
192
+ }): Promise<ImageModelPricing>;
193
+ getVideoPricing(opts?: {
194
+ provider?: string;
195
+ currency?: string;
196
+ after?: string;
197
+ before?: string;
198
+ }): Promise<VideoModelPricing[]>;
199
+ getVideoModel(modelId: string, opts?: {
200
+ currency?: string;
201
+ }): Promise<VideoModelPricing>;
202
+ getVideoHistory(opts?: {
203
+ days?: number;
204
+ modelId?: string;
205
+ provider?: string;
206
+ }): Promise<VideoModelHistory[]>;
207
+ getVideoProviders(): Promise<VideoProviderSummary[]>;
208
+ compareVideoModels(modelIds: string[], opts?: {
209
+ currency?: string;
210
+ }): Promise<VideoModelPricing[]>;
211
+ getCheapestVideoModel(opts?: {
212
+ provider?: string;
213
+ currency?: string;
214
+ after?: string;
215
+ before?: string;
216
+ }): Promise<VideoModelPricing>;
94
217
  }
95
218
 
96
219
  declare function calculateCost(modelId: string, inputPerMTok: number, outputPerMTok: number, inputTokens: number, outputTokens: number): CostEstimate;
97
220
  declare function calculateModelCost(modelId: string, inputTokens: number, outputTokens: number, pricing?: ModelPricing[]): CostEstimate;
98
221
 
222
+ declare function calculateImageCost(modelId: string, pricePerImage: number, imageCount: number): ImageCostEstimate;
223
+ declare function calculateImageModelCost(modelId: string, imageCount: number, pricing?: ImageModelPricing[]): ImageCostEstimate;
224
+
225
+ declare function calculateVideoCost(modelId: string, costPerMinute: number, durationSeconds: number): VideoCostEstimate;
226
+ declare function calculateVideoModelCost(modelId: string, durationSeconds: number, pricing?: VideoModelPricing[]): VideoCostEstimate;
227
+
99
228
  declare const STATIC_PRICING: ModelPricing[];
100
229
 
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 };
230
+ declare const STATIC_IMAGE_PRICING: ImageModelPricing[];
231
+
232
+ declare const STATIC_VIDEO_PRICING: VideoModelPricing[];
233
+
234
+ export { type ClientOptions, type CostEstimate, type DataConfidence, 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
@@ -53,6 +53,81 @@ interface PriceTokenError {
53
53
  error: string;
54
54
  status: number;
55
55
  }
56
+ type ImageQualityTier = 'standard' | 'hd' | 'ultra';
57
+ interface ImageModelPricing {
58
+ modelId: string;
59
+ provider: string;
60
+ displayName: string;
61
+ pricePerImage: number;
62
+ pricePerMegapixel: number | null;
63
+ defaultResolution: string;
64
+ qualityTier: ImageQualityTier;
65
+ maxResolution: string | null;
66
+ supportedFormats: string[];
67
+ source: 'fetched' | 'seed' | 'admin';
68
+ status: ModelStatus | null;
69
+ confidence: DataConfidence;
70
+ lastUpdated: string | null;
71
+ launchDate: string | null;
72
+ }
73
+ interface ImageCostEstimate {
74
+ modelId: string;
75
+ imageCount: number;
76
+ pricePerImage: number;
77
+ totalCost: number;
78
+ }
79
+ interface ImagePriceHistoryPoint {
80
+ date: string;
81
+ pricePerImage: number;
82
+ }
83
+ interface ImageModelHistory {
84
+ modelId: string;
85
+ provider: string;
86
+ displayName: string;
87
+ history: ImagePriceHistoryPoint[];
88
+ }
89
+ interface ImageProviderSummary {
90
+ id: string;
91
+ displayName: string;
92
+ modelCount: number;
93
+ cheapestPerImage: number;
94
+ }
95
+ interface VideoModelPricing {
96
+ modelId: string;
97
+ provider: string;
98
+ displayName: string;
99
+ costPerMinute: number;
100
+ resolution: string | null;
101
+ maxDuration: number | null;
102
+ qualityMode: string | null;
103
+ source: 'fetched' | 'seed' | 'admin' | 'verified';
104
+ status: ModelStatus | null;
105
+ confidence: DataConfidence;
106
+ lastUpdated: string | null;
107
+ launchDate: string | null;
108
+ }
109
+ interface VideoCostEstimate {
110
+ modelId: string;
111
+ durationSeconds: number;
112
+ costPerMinute: number;
113
+ totalCost: number;
114
+ }
115
+ interface VideoPriceHistoryPoint {
116
+ date: string;
117
+ costPerMinute: number;
118
+ }
119
+ interface VideoModelHistory {
120
+ modelId: string;
121
+ provider: string;
122
+ displayName: string;
123
+ history: VideoPriceHistoryPoint[];
124
+ }
125
+ interface VideoProviderSummary {
126
+ id: string;
127
+ displayName: string;
128
+ modelCount: number;
129
+ cheapestCostPerMinute: number;
130
+ }
56
131
 
57
132
  interface ClientOptions {
58
133
  baseUrl?: string;
@@ -91,11 +166,69 @@ declare class PriceTokenClient {
91
166
  after?: string;
92
167
  before?: string;
93
168
  }): Promise<ModelPricing>;
169
+ getImagePricing(opts?: {
170
+ provider?: string;
171
+ currency?: string;
172
+ after?: string;
173
+ before?: string;
174
+ }): Promise<ImageModelPricing[]>;
175
+ getImageModel(modelId: string, opts?: {
176
+ currency?: string;
177
+ }): Promise<ImageModelPricing>;
178
+ getImageHistory(opts?: {
179
+ days?: number;
180
+ modelId?: string;
181
+ provider?: string;
182
+ }): Promise<ImageModelHistory[]>;
183
+ getImageProviders(): Promise<ImageProviderSummary[]>;
184
+ compareImages(modelIds: string[], opts?: {
185
+ currency?: string;
186
+ }): Promise<ImageModelPricing[]>;
187
+ getCheapestImage(opts?: {
188
+ provider?: string;
189
+ currency?: string;
190
+ after?: string;
191
+ before?: string;
192
+ }): Promise<ImageModelPricing>;
193
+ getVideoPricing(opts?: {
194
+ provider?: string;
195
+ currency?: string;
196
+ after?: string;
197
+ before?: string;
198
+ }): Promise<VideoModelPricing[]>;
199
+ getVideoModel(modelId: string, opts?: {
200
+ currency?: string;
201
+ }): Promise<VideoModelPricing>;
202
+ getVideoHistory(opts?: {
203
+ days?: number;
204
+ modelId?: string;
205
+ provider?: string;
206
+ }): Promise<VideoModelHistory[]>;
207
+ getVideoProviders(): Promise<VideoProviderSummary[]>;
208
+ compareVideoModels(modelIds: string[], opts?: {
209
+ currency?: string;
210
+ }): Promise<VideoModelPricing[]>;
211
+ getCheapestVideoModel(opts?: {
212
+ provider?: string;
213
+ currency?: string;
214
+ after?: string;
215
+ before?: string;
216
+ }): Promise<VideoModelPricing>;
94
217
  }
95
218
 
96
219
  declare function calculateCost(modelId: string, inputPerMTok: number, outputPerMTok: number, inputTokens: number, outputTokens: number): CostEstimate;
97
220
  declare function calculateModelCost(modelId: string, inputTokens: number, outputTokens: number, pricing?: ModelPricing[]): CostEstimate;
98
221
 
222
+ declare function calculateImageCost(modelId: string, pricePerImage: number, imageCount: number): ImageCostEstimate;
223
+ declare function calculateImageModelCost(modelId: string, imageCount: number, pricing?: ImageModelPricing[]): ImageCostEstimate;
224
+
225
+ declare function calculateVideoCost(modelId: string, costPerMinute: number, durationSeconds: number): VideoCostEstimate;
226
+ declare function calculateVideoModelCost(modelId: string, durationSeconds: number, pricing?: VideoModelPricing[]): VideoCostEstimate;
227
+
99
228
  declare const STATIC_PRICING: ModelPricing[];
100
229
 
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 };
230
+ declare const STATIC_IMAGE_PRICING: ImageModelPricing[];
231
+
232
+ declare const STATIC_VIDEO_PRICING: VideoModelPricing[];
233
+
234
+ export { type ClientOptions, type CostEstimate, type DataConfidence, 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 };