@pydantic/genai-prices 0.0.63 → 0.0.64
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/cli.js +326 -79
- package/dist/index.cjs +2 -2
- package/dist/index.js +255 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2761,6 +2761,253 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2761
2761
|
}
|
|
2762
2762
|
]
|
|
2763
2763
|
},
|
|
2764
|
+
{
|
|
2765
|
+
id: "doubleword",
|
|
2766
|
+
name: "Doubleword",
|
|
2767
|
+
pricing_urls: ["https://docs.doubleword.ai/inference-api/models"],
|
|
2768
|
+
api_pattern: "https://api\\.doubleword\\.ai",
|
|
2769
|
+
price_comments: "Doubleword publishes Realtime, Async, and Batch prices. This provider currently encodes only Realtime pricing.",
|
|
2770
|
+
extractors: [
|
|
2771
|
+
{
|
|
2772
|
+
api_flavor: "chat",
|
|
2773
|
+
root: "usage",
|
|
2774
|
+
model_path: "model",
|
|
2775
|
+
mappings: [
|
|
2776
|
+
{
|
|
2777
|
+
path: "prompt_tokens",
|
|
2778
|
+
dest: "input_tokens",
|
|
2779
|
+
required: !0
|
|
2780
|
+
},
|
|
2781
|
+
{
|
|
2782
|
+
path: ["prompt_tokens_details", "cached_tokens"],
|
|
2783
|
+
dest: "cache_read_tokens",
|
|
2784
|
+
required: !1
|
|
2785
|
+
},
|
|
2786
|
+
{
|
|
2787
|
+
path: ["prompt_tokens_details", "cache_write_tokens"],
|
|
2788
|
+
dest: "cache_write_tokens",
|
|
2789
|
+
required: !1
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
path: "completion_tokens",
|
|
2793
|
+
dest: "output_tokens",
|
|
2794
|
+
required: !0
|
|
2795
|
+
}
|
|
2796
|
+
]
|
|
2797
|
+
},
|
|
2798
|
+
{
|
|
2799
|
+
api_flavor: "responses",
|
|
2800
|
+
root: "usage",
|
|
2801
|
+
model_path: "model",
|
|
2802
|
+
mappings: [
|
|
2803
|
+
{
|
|
2804
|
+
path: "input_tokens",
|
|
2805
|
+
dest: "input_tokens",
|
|
2806
|
+
required: !0
|
|
2807
|
+
},
|
|
2808
|
+
{
|
|
2809
|
+
path: ["input_tokens_details", "cached_tokens"],
|
|
2810
|
+
dest: "cache_read_tokens",
|
|
2811
|
+
required: !1
|
|
2812
|
+
},
|
|
2813
|
+
{
|
|
2814
|
+
path: "output_tokens",
|
|
2815
|
+
dest: "output_tokens",
|
|
2816
|
+
required: !0
|
|
2817
|
+
}
|
|
2818
|
+
]
|
|
2819
|
+
},
|
|
2820
|
+
{
|
|
2821
|
+
api_flavor: "embeddings",
|
|
2822
|
+
root: "usage",
|
|
2823
|
+
model_path: "model",
|
|
2824
|
+
mappings: [
|
|
2825
|
+
{
|
|
2826
|
+
path: "prompt_tokens",
|
|
2827
|
+
dest: "input_tokens",
|
|
2828
|
+
required: !0
|
|
2829
|
+
}
|
|
2830
|
+
]
|
|
2831
|
+
}
|
|
2832
|
+
],
|
|
2833
|
+
models: [
|
|
2834
|
+
{
|
|
2835
|
+
id: "Qwen/Qwen3-14B-FP8",
|
|
2836
|
+
name: "Qwen3 14B",
|
|
2837
|
+
match: {
|
|
2838
|
+
equals: "Qwen/Qwen3-14B-FP8"
|
|
2839
|
+
},
|
|
2840
|
+
prices: {
|
|
2841
|
+
input_mtok: 0.05,
|
|
2842
|
+
output_mtok: 0.6
|
|
2843
|
+
}
|
|
2844
|
+
},
|
|
2845
|
+
{
|
|
2846
|
+
id: "Qwen/Qwen3-Embedding-8B",
|
|
2847
|
+
name: "Qwen3 Embedding 8B",
|
|
2848
|
+
match: {
|
|
2849
|
+
equals: "Qwen/Qwen3-Embedding-8B"
|
|
2850
|
+
},
|
|
2851
|
+
prices: {
|
|
2852
|
+
input_mtok: 0.04
|
|
2853
|
+
}
|
|
2854
|
+
},
|
|
2855
|
+
{
|
|
2856
|
+
id: "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8",
|
|
2857
|
+
name: "Qwen3 VL 235B A22B Instruct",
|
|
2858
|
+
match: {
|
|
2859
|
+
equals: "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8"
|
|
2860
|
+
},
|
|
2861
|
+
prices: {
|
|
2862
|
+
input_mtok: 0.6,
|
|
2863
|
+
output_mtok: 1.2
|
|
2864
|
+
}
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
id: "Qwen/Qwen3-VL-30B-A3B-Instruct-FP8",
|
|
2868
|
+
name: "Qwen3 VL 30B A3B Instruct",
|
|
2869
|
+
match: {
|
|
2870
|
+
equals: "Qwen/Qwen3-VL-30B-A3B-Instruct-FP8"
|
|
2871
|
+
},
|
|
2872
|
+
prices: {
|
|
2873
|
+
input_mtok: 0.16,
|
|
2874
|
+
output_mtok: 0.8
|
|
2875
|
+
}
|
|
2876
|
+
},
|
|
2877
|
+
{
|
|
2878
|
+
id: "Qwen/Qwen3.5-35B-A3B-FP8",
|
|
2879
|
+
name: "Qwen3.5 35B A3B",
|
|
2880
|
+
match: {
|
|
2881
|
+
equals: "Qwen/Qwen3.5-35B-A3B-FP8"
|
|
2882
|
+
},
|
|
2883
|
+
prices: {
|
|
2884
|
+
input_mtok: 0.25,
|
|
2885
|
+
output_mtok: 2
|
|
2886
|
+
}
|
|
2887
|
+
},
|
|
2888
|
+
{
|
|
2889
|
+
id: "Qwen/Qwen3.5-397B-A17B",
|
|
2890
|
+
name: "Qwen3.5 397B A17B",
|
|
2891
|
+
match: {
|
|
2892
|
+
equals: "Qwen/Qwen3.5-397B-A17B"
|
|
2893
|
+
},
|
|
2894
|
+
prices: {
|
|
2895
|
+
input_mtok: 0.6,
|
|
2896
|
+
output_mtok: 3.6
|
|
2897
|
+
}
|
|
2898
|
+
},
|
|
2899
|
+
{
|
|
2900
|
+
id: "Qwen/Qwen3.5-9B",
|
|
2901
|
+
name: "Qwen3.5 9B",
|
|
2902
|
+
match: {
|
|
2903
|
+
equals: "Qwen/Qwen3.5-9B"
|
|
2904
|
+
},
|
|
2905
|
+
prices: {
|
|
2906
|
+
input_mtok: 0.08,
|
|
2907
|
+
output_mtok: 0.7
|
|
2908
|
+
}
|
|
2909
|
+
},
|
|
2910
|
+
{
|
|
2911
|
+
id: "Qwen/Qwen3.6-35B-A3B-FP8",
|
|
2912
|
+
name: "Qwen3.6 35B A3B",
|
|
2913
|
+
match: {
|
|
2914
|
+
equals: "Qwen/Qwen3.6-35B-A3B-FP8"
|
|
2915
|
+
},
|
|
2916
|
+
prices: {
|
|
2917
|
+
input_mtok: 0.25,
|
|
2918
|
+
output_mtok: 2
|
|
2919
|
+
}
|
|
2920
|
+
},
|
|
2921
|
+
{
|
|
2922
|
+
id: "deepseek-ai/DeepSeek-V4-Flash",
|
|
2923
|
+
name: "DeepSeek V4 Flash",
|
|
2924
|
+
match: {
|
|
2925
|
+
equals: "deepseek-ai/DeepSeek-V4-Flash"
|
|
2926
|
+
},
|
|
2927
|
+
prices: {
|
|
2928
|
+
input_mtok: 0.14,
|
|
2929
|
+
output_mtok: 0.28
|
|
2930
|
+
}
|
|
2931
|
+
},
|
|
2932
|
+
{
|
|
2933
|
+
id: "deepseek-ai/DeepSeek-V4-Pro",
|
|
2934
|
+
name: "DeepSeek V4 Pro",
|
|
2935
|
+
match: {
|
|
2936
|
+
equals: "deepseek-ai/DeepSeek-V4-Pro"
|
|
2937
|
+
},
|
|
2938
|
+
prices: {
|
|
2939
|
+
input_mtok: 1.74,
|
|
2940
|
+
output_mtok: 3.48
|
|
2941
|
+
}
|
|
2942
|
+
},
|
|
2943
|
+
{
|
|
2944
|
+
id: "google/gemma-4-31B-it",
|
|
2945
|
+
name: "Gemma 4 31B IT",
|
|
2946
|
+
match: {
|
|
2947
|
+
equals: "google/gemma-4-31B-it"
|
|
2948
|
+
},
|
|
2949
|
+
prices: {
|
|
2950
|
+
input_mtok: 0.14,
|
|
2951
|
+
output_mtok: 0.4
|
|
2952
|
+
}
|
|
2953
|
+
},
|
|
2954
|
+
{
|
|
2955
|
+
id: "mistralai/Devstral-2-123B-Instruct-2512",
|
|
2956
|
+
name: "Devstral 2 123B Instruct 2512",
|
|
2957
|
+
match: {
|
|
2958
|
+
equals: "mistralai/Devstral-2-123B-Instruct-2512"
|
|
2959
|
+
},
|
|
2960
|
+
prices: {
|
|
2961
|
+
input_mtok: 0.4,
|
|
2962
|
+
output_mtok: 2
|
|
2963
|
+
}
|
|
2964
|
+
},
|
|
2965
|
+
{
|
|
2966
|
+
id: "moonshotai/Kimi-K2.6",
|
|
2967
|
+
name: "Kimi K2.6",
|
|
2968
|
+
match: {
|
|
2969
|
+
equals: "moonshotai/Kimi-K2.6"
|
|
2970
|
+
},
|
|
2971
|
+
prices: {
|
|
2972
|
+
input_mtok: 0.95,
|
|
2973
|
+
output_mtok: 4
|
|
2974
|
+
}
|
|
2975
|
+
},
|
|
2976
|
+
{
|
|
2977
|
+
id: "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4",
|
|
2978
|
+
name: "Nemotron 3 Super 120B A12B",
|
|
2979
|
+
match: {
|
|
2980
|
+
equals: "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4"
|
|
2981
|
+
},
|
|
2982
|
+
prices: {
|
|
2983
|
+
input_mtok: 0.3,
|
|
2984
|
+
output_mtok: 0.75
|
|
2985
|
+
}
|
|
2986
|
+
},
|
|
2987
|
+
{
|
|
2988
|
+
id: "openai/gpt-oss-20b",
|
|
2989
|
+
name: "GPT OSS 20B",
|
|
2990
|
+
match: {
|
|
2991
|
+
equals: "openai/gpt-oss-20b"
|
|
2992
|
+
},
|
|
2993
|
+
prices: {
|
|
2994
|
+
input_mtok: 0.04,
|
|
2995
|
+
output_mtok: 0.3
|
|
2996
|
+
}
|
|
2997
|
+
},
|
|
2998
|
+
{
|
|
2999
|
+
id: "zai-org/GLM-5.1-FP8",
|
|
3000
|
+
name: "GLM 5.1",
|
|
3001
|
+
match: {
|
|
3002
|
+
equals: "zai-org/GLM-5.1-FP8"
|
|
3003
|
+
},
|
|
3004
|
+
prices: {
|
|
3005
|
+
input_mtok: 1.4,
|
|
3006
|
+
output_mtok: 4.4
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
]
|
|
3010
|
+
},
|
|
2764
3011
|
{
|
|
2765
3012
|
id: "fireworks",
|
|
2766
3013
|
name: "Fireworks",
|
|
@@ -19000,7 +19247,7 @@ function D(t) {
|
|
|
19000
19247
|
function N(t) {
|
|
19001
19248
|
I = t;
|
|
19002
19249
|
}
|
|
19003
|
-
function
|
|
19250
|
+
function O(t) {
|
|
19004
19251
|
t({
|
|
19005
19252
|
onCalc: N,
|
|
19006
19253
|
remoteDataUrl: C,
|
|
@@ -19043,9 +19290,9 @@ function $(t, e, i) {
|
|
|
19043
19290
|
}
|
|
19044
19291
|
if (!q.guard(e))
|
|
19045
19292
|
throw new Error(`Expected response data to be a mapping object, got ${_(e)}`);
|
|
19046
|
-
const o = v(a.model_path, e,
|
|
19293
|
+
const o = v(a.model_path, e, E, !1, []), r = T(a.root), m = v(r, e, q, !0, []), n = {};
|
|
19047
19294
|
for (const s of a.mappings) {
|
|
19048
|
-
const p = v(s.path, m,
|
|
19295
|
+
const p = v(s.path, m, F, s.required, r);
|
|
19049
19296
|
if (p !== null) {
|
|
19050
19297
|
const u = n[s.dest] ?? 0;
|
|
19051
19298
|
n[s.dest] = u + p;
|
|
@@ -19065,7 +19312,7 @@ function v(t, e, i, a, o) {
|
|
|
19065
19312
|
for (const u of m) {
|
|
19066
19313
|
if (s.push(u), typeof u == "object")
|
|
19067
19314
|
if (Array.isArray(n))
|
|
19068
|
-
n =
|
|
19315
|
+
n = V(u, n);
|
|
19069
19316
|
else {
|
|
19070
19317
|
if (a)
|
|
19071
19318
|
throw new Error(`Expected \`${k(o, s)}\` value to be a mapping, got ${_(n)}`);
|
|
@@ -19102,7 +19349,7 @@ function v(t, e, i, a, o) {
|
|
|
19102
19349
|
throw s.push(r), new Error(`Expected \`${k(o, s)}\` value to be a ${i.name}, got ${_(p)}`);
|
|
19103
19350
|
return null;
|
|
19104
19351
|
}
|
|
19105
|
-
function
|
|
19352
|
+
function V(t, e) {
|
|
19106
19353
|
for (const i of e)
|
|
19107
19354
|
if (q.guard(i)) {
|
|
19108
19355
|
const a = i[t.field];
|
|
@@ -19119,10 +19366,10 @@ function _(t) {
|
|
|
19119
19366
|
const q = {
|
|
19120
19367
|
guard: (t) => _(t) === "mapping",
|
|
19121
19368
|
name: "mapping"
|
|
19122
|
-
},
|
|
19369
|
+
}, E = {
|
|
19123
19370
|
guard: (t) => typeof t == "string",
|
|
19124
19371
|
name: "string"
|
|
19125
|
-
},
|
|
19372
|
+
}, F = {
|
|
19126
19373
|
guard: (t) => typeof t == "number",
|
|
19127
19374
|
name: "number"
|
|
19128
19375
|
}, k = (t, e) => [...t.map(L), ...e.map(L)].join("."), L = (t) => typeof t == "string" ? t : JSON.stringify(t);
|
|
@@ -19139,6 +19386,6 @@ export {
|
|
|
19139
19386
|
j as calcPrice,
|
|
19140
19387
|
$ as extractUsage,
|
|
19141
19388
|
H as findProvider,
|
|
19142
|
-
|
|
19389
|
+
O as updatePrices,
|
|
19143
19390
|
K as waitForUpdate
|
|
19144
19391
|
};
|