@anyway-sh/node-server-sdk 0.22.10 → 0.22.11

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.js CHANGED
@@ -90,7 +90,7 @@ class PromptNotFoundError extends TraceloopError {
90
90
  }
91
91
  }
92
92
 
93
- var version = "0.22.10";
93
+ var version = "0.22.11";
94
94
 
95
95
  /**
96
96
  * Base class for handling annotation operations with the Traceloop API.
@@ -3934,13 +3934,607 @@ class PricingCalculator {
3934
3934
  }
3935
3935
  }
3936
3936
 
3937
+ var embeddings = {
3938
+ "text-embedding-ada-002": 0.0001,
3939
+ "text-embedding-3-small": 0.00002,
3940
+ "text-embedding-3-large": 0.00013,
3941
+ ada: 0.0001,
3942
+ "ada-v2": 0.0001,
3943
+ "text-ada-001": 0.0001,
3944
+ "azure_text-embedding-ada-002": 0.0001,
3945
+ "azure_text-embedding-3-small": 0.00002,
3946
+ "azure_text-embedding-3-large": 0.00013,
3947
+ azure_ada: 0.0001,
3948
+ "azure_ada-v2": 0.0001,
3949
+ "azure_text-ada-001": 0.0001,
3950
+ "embed-english-v3.0": 0.0001,
3951
+ "embed-multilingual-v3.0": 0.0001,
3952
+ "embed-english-light-v3.0": 0.0001,
3953
+ "embed-multilingual-light-v3.0": 0.0001,
3954
+ "embed-english-v2.0": 0.0001,
3955
+ "embed-english-light-v2.0": 0.0001,
3956
+ "embed-multilingual-v2.0": 0.0001,
3957
+ "mistral-embed": 0.0001,
3958
+ "amazon.titan-embed-text-v1": 0.0001,
3959
+ "amazon.titan-embed-text-v2": 0.00002,
3960
+ "textembedding-gecko": 0.0001,
3961
+ "textembedding-gecko@001": 0.0001,
3962
+ "textembedding-gecko@002": 0.0001,
3963
+ "textembedding-gecko@003": 0.0001
3964
+ };
3965
+ var images = {
3966
+ "dall-e-3": {
3967
+ standard: {
3968
+ "1024x1024": 0.04,
3969
+ "1024x1792": 0.02,
3970
+ "1792x1024": 0.08
3971
+ },
3972
+ hd: {
3973
+ "1024x1024": 0.08,
3974
+ "1024x1792": 0.12,
3975
+ "1792x1024": 0.12
3976
+ }
3977
+ },
3978
+ "azure_dall-e-3": {
3979
+ standard: {
3980
+ "1024x1024": 0.04,
3981
+ "1024x1792": 0.02,
3982
+ "1792x1024": 0.08
3983
+ },
3984
+ hd: {
3985
+ "1024x1024": 0.08,
3986
+ "1024x1792": 0.12,
3987
+ "1792x1024": 0.12
3988
+ }
3989
+ },
3990
+ "dall-e-2": {
3991
+ standard: {
3992
+ "1024x1024": 0.02,
3993
+ "512x512": 0.018,
3994
+ "256x256": 0.016
3995
+ }
3996
+ },
3997
+ "black-forest-labs/FLUX.1-dev": {
3998
+ standard: {
3999
+ "1000000": 0.025
4000
+ }
4001
+ },
4002
+ "black-forest-labs/FLUX.1-canny": {
4003
+ standard: {
4004
+ "1000000": 0.025
4005
+ }
4006
+ },
4007
+ "black-forest-labs/FLUX.1-depth": {
4008
+ standard: {
4009
+ "1000000": 0.025
4010
+ }
4011
+ },
4012
+ "black-forest-labs/FLUX.1-redux": {
4013
+ standard: {
4014
+ "1000000": 0.025
4015
+ }
4016
+ },
4017
+ "black-forest-labs/FLUX.1-schnell": {
4018
+ standard: {
4019
+ "1000000": 0.0027
4020
+ }
4021
+ },
4022
+ "black-forest-labs/FLUX.1-pro": {
4023
+ standard: {
4024
+ "1000000": 0.04
4025
+ }
4026
+ },
4027
+ "black-forest-labs/FLUX.1.1-pro": {
4028
+ standard: {
4029
+ "1000000": 0.05
4030
+ }
4031
+ },
4032
+ "stabilityai/stable-diffusion-xl-base-1.0": {
4033
+ standard: {
4034
+ "512X512": 0.001,
4035
+ "1024x1024": 0.01
4036
+ }
4037
+ },
4038
+ "amazon.titan-image-generator-v1": {
4039
+ standard: {
4040
+ "512x512": 0.008,
4041
+ "1024x1024": 0.01
4042
+ },
4043
+ premium: {
4044
+ "512x512": 0.01,
4045
+ "1024x1024": 0.012
4046
+ }
4047
+ }
4048
+ };
4049
+ var audio = {
4050
+ "tts-1": 0.015,
4051
+ "tts-1-hd": 0.03,
4052
+ eleven_multilingual_v2: 0.24,
4053
+ eleven_multilingual_v1: 0.24,
4054
+ eleven_monolingual_v1: 0.24,
4055
+ eleven_english_v1: 0.24,
4056
+ eleven_turbo_v2: 0.24,
4057
+ eleven_english_sts_v2: 0.24,
4058
+ eleven_multilingual_sts_v2: 0.24,
4059
+ best: 0.00010277777,
4060
+ nano: 0.00003333333
4061
+ };
4062
+ var chat = {
4063
+ "gpt-4.1-nano-2025-04-14": {
4064
+ promptPrice: 0.0001,
4065
+ completionPrice: 0.0004
4066
+ },
4067
+ "gpt-4.1-nano": {
4068
+ promptPrice: 0.0001,
4069
+ completionPrice: 0.0004
4070
+ },
4071
+ "gpt-4.1-mini-2025-04-14": {
4072
+ promptPrice: 0.0004,
4073
+ completionPrice: 0.0016
4074
+ },
4075
+ "gpt-4.1-mini": {
4076
+ promptPrice: 0.0004,
4077
+ completionPrice: 0.0016
4078
+ },
4079
+ "gpt-4.1-2025-04-14": {
4080
+ promptPrice: 0.002,
4081
+ completionPrice: 0.008
4082
+ },
4083
+ "gpt-4.1": {
4084
+ promptPrice: 0.002,
4085
+ completionPrice: 0.008
4086
+ },
4087
+ "gpt-4o": {
4088
+ promptPrice: 0.0005,
4089
+ completionPrice: 0.0015
4090
+ },
4091
+ "gpt-4o-2024-08-06": {
4092
+ promptPrice: 0.0025,
4093
+ completionPrice: 0.01
4094
+ },
4095
+ "gpt-4o-2024-05-13": {
4096
+ promptPrice: 0.005,
4097
+ completionPrice: 0.015
4098
+ },
4099
+ "gpt-4o-mini": {
4100
+ promptPrice: 0.00015,
4101
+ completionPrice: 0.0006
4102
+ },
4103
+ "gpt-4o-mini-2024-07-18": {
4104
+ promptPrice: 0.00015,
4105
+ completionPrice: 0.0006
4106
+ },
4107
+ "o1-mini": {
4108
+ promptPrice: 0.003,
4109
+ completionPrice: 0.012
4110
+ },
4111
+ "o1-mini-2024-09-12": {
4112
+ promptPrice: 0.003,
4113
+ completionPrice: 0.012
4114
+ },
4115
+ "o1-preview": {
4116
+ promptPrice: 0.015,
4117
+ completionPrice: 0.06
4118
+ },
4119
+ "o1-preview-2024-09-12": {
4120
+ promptPrice: 0.015,
4121
+ completionPrice: 0.06
4122
+ },
4123
+ "gpt-3.5-turbo": {
4124
+ promptPrice: 0.0005,
4125
+ completionPrice: 0.0015
4126
+ },
4127
+ "gpt-3.5-turbo-0125": {
4128
+ promptPrice: 0.0005,
4129
+ completionPrice: 0.0015
4130
+ },
4131
+ "azure_gpt-35-turbo": {
4132
+ promptPrice: 0.0005,
4133
+ completionPrice: 0.0015
4134
+ },
4135
+ "azure_gpt-35-turbo-16k": {
4136
+ promptPrice: 0.0005,
4137
+ completionPrice: 0.0015
4138
+ },
4139
+ "azure_gpt-35-turbo-instruct": {
4140
+ promptPrice: 0.0015,
4141
+ completionPrice: 0.002
4142
+ },
4143
+ "gpt-4": {
4144
+ promptPrice: 0.03,
4145
+ completionPrice: 0.06
4146
+ },
4147
+ "gpt-4-turbo": {
4148
+ promptPrice: 0.01,
4149
+ completionPrice: 0.03
4150
+ },
4151
+ "gpt-4-32k": {
4152
+ promptPrice: 0.06,
4153
+ completionPrice: 0.12
4154
+ },
4155
+ "gpt-4-1106-preview": {
4156
+ promptPrice: 0.01,
4157
+ completionPrice: 0.03
4158
+ },
4159
+ "gpt-4-0125-preview": {
4160
+ promptPrice: 0.01,
4161
+ completionPrice: 0.03
4162
+ },
4163
+ "gpt-4-preview": {
4164
+ promptPrice: 0.01,
4165
+ completionPrice: 0.03
4166
+ },
4167
+ "gpt-4-1106-vision-preview": {
4168
+ promptPrice: 0.01,
4169
+ completionPrice: 0.03
4170
+ },
4171
+ "gpt-4-vision-preview": {
4172
+ promptPrice: 0.01,
4173
+ completionPrice: 0.03
4174
+ },
4175
+ "azure_gpt-4": {
4176
+ promptPrice: 0.03,
4177
+ completionPrice: 0.06
4178
+ },
4179
+ "azure_gpt-4-32k": {
4180
+ promptPrice: 0.06,
4181
+ completionPrice: 0.12
4182
+ },
4183
+ "claude-3-opus-20240229": {
4184
+ promptPrice: 0.015,
4185
+ completionPrice: 0.075
4186
+ },
4187
+ "claude-3-sonnet-20240229": {
4188
+ promptPrice: 0.003,
4189
+ completionPrice: 0.015
4190
+ },
4191
+ "claude-3-haiku-20240307": {
4192
+ promptPrice: 0.00025,
4193
+ completionPrice: 0.00125
4194
+ },
4195
+ command: {
4196
+ promptPrice: 0.001,
4197
+ completionPrice: 0.002
4198
+ },
4199
+ "command-nightly": {
4200
+ promptPrice: 0.001,
4201
+ completionPrice: 0.002
4202
+ },
4203
+ "command-light": {
4204
+ promptPrice: 0.0003,
4205
+ completionPrice: 0.0006
4206
+ },
4207
+ "command-light-nightly": {
4208
+ promptPrice: 0.0003,
4209
+ completionPrice: 0.0006
4210
+ },
4211
+ "open-mistral-7b": {
4212
+ promptPrice: 0.00025,
4213
+ completionPrice: 0.00025
4214
+ },
4215
+ "open-mixtral-8x7b": {
4216
+ promptPrice: 0.0007,
4217
+ completionPrice: 0.0007
4218
+ },
4219
+ "mistral-small-latest": {
4220
+ promptPrice: 0.002,
4221
+ completionPrice: 0.006
4222
+ },
4223
+ "mistral-medium-latest": {
4224
+ promptPrice: 0.0027,
4225
+ completionPrice: 0.0081
4226
+ },
4227
+ "mistral-large-latest": {
4228
+ promptPrice: 0.008,
4229
+ completionPrice: 0.024
4230
+ },
4231
+ "amazon.titan-text-express-v1": {
4232
+ promptPrice: 0.0008,
4233
+ completionPrice: 0.0016
4234
+ },
4235
+ "amazon.titan-text-lite-v1": {
4236
+ promptPrice: 0.0003,
4237
+ completionPrice: 0.0004
4238
+ },
4239
+ "mistral.mistral-7b-instruct-v0:2": {
4240
+ promptPrice: 0.00015,
4241
+ completionPrice: 0.0002
4242
+ },
4243
+ "mistral.mixtral-8x7b-instruct-v0:1": {
4244
+ promptPrice: 0.00045,
4245
+ completionPrice: 0.0007
4246
+ },
4247
+ "mistral.mistral-large-2402-v1:0": {
4248
+ promptPrice: 0.008,
4249
+ completionPrice: 0.024
4250
+ },
4251
+ "anthropic.claude-3-haiku-20240307-v1:0": {
4252
+ promptPrice: 0.00025,
4253
+ completionPrice: 0.00125
4254
+ },
4255
+ "anthropic.claude-v2": {
4256
+ promptPrice: 0.008,
4257
+ completionPrice: 0.024
4258
+ },
4259
+ "anthropic.claude-3-sonnet-20240229-v1:0": {
4260
+ promptPrice: 0.003,
4261
+ completionPrice: 0.015
4262
+ },
4263
+ "anthropic.claude-3-opus-20240229-v1:0": {
4264
+ promptPrice: 0.015,
4265
+ completionPrice: 0.075
4266
+ },
4267
+ "meta.llama3-8b-instruct-v1:0": {
4268
+ promptPrice: 0.0004,
4269
+ completionPrice: 0.0006
4270
+ },
4271
+ "meta.llama3-70b-instruct-v1:0": {
4272
+ promptPrice: 0.00265,
4273
+ completionPrice: 0.0035
4274
+ },
4275
+ "meta.llama2-13b-chat-v1": {
4276
+ promptPrice: 0.00075,
4277
+ completionPrice: 0.001
4278
+ },
4279
+ "meta.llama2-70b-chat-v1": {
4280
+ promptPrice: 0.00195,
4281
+ completionPrice: 0.00256
4282
+ },
4283
+ "cohere.command-text-v14": {
4284
+ promptPrice: 0.0015,
4285
+ completionPrice: 0.002
4286
+ },
4287
+ "cohere.command-light-text-v14": {
4288
+ promptPrice: 0.0003,
4289
+ completionPrice: 0.0006
4290
+ },
4291
+ "ai21.j2-mid-v1": {
4292
+ promptPrice: 0.0125,
4293
+ completionPrice: 0.0125
4294
+ },
4295
+ "ai21.j2-ultra-v1": {
4296
+ promptPrice: 0.0188,
4297
+ completionPrice: 0.0188
4298
+ },
4299
+ "gemini-1.0-pro": {
4300
+ promptPrice: 0.0005,
4301
+ completionPrice: 0.0015
4302
+ },
4303
+ "gemini-1.5-flash": {
4304
+ promptPrice: 0.000075,
4305
+ completionPrice: 0.0003
4306
+ },
4307
+ "gemini-1.5-pro": {
4308
+ promptPrice: 0.00125,
4309
+ completionPrice: 0.005
4310
+ },
4311
+ "gemini-1.0-pro-002": {
4312
+ promptPrice: 0.0005,
4313
+ completionPrice: 0.0015
4314
+ },
4315
+ "gemini-1.0-pro-001": {
4316
+ promptPrice: 0.0005,
4317
+ completionPrice: 0.0015
4318
+ },
4319
+ "gemini-1.5-pro-preview-0409": {
4320
+ promptPrice: 0.005,
4321
+ completionPrice: 0.015
4322
+ },
4323
+ "gemini-1.5-pro-preview-0514": {
4324
+ promptPrice: 0.005,
4325
+ completionPrice: 0.015
4326
+ },
4327
+ "gemini-1.5-flash-preview-0514": {
4328
+ promptPrice: 0.0005,
4329
+ completionPrice: 0.0015
4330
+ },
4331
+ "gemini-2.0-flash": {
4332
+ promptPrice: 0.0001,
4333
+ completionPrice: 0.0004
4334
+ },
4335
+ "gemini-2.0-flash-lite": {
4336
+ promptPrice: 0.000075,
4337
+ completionPrice: 0.0003
4338
+ },
4339
+ "gemini-2.5-flash": {
4340
+ promptPrice: 0.0003,
4341
+ completionPrice: 0.0025
4342
+ },
4343
+ "gemini-2.5-flash-preview": {
4344
+ promptPrice: 0.0003,
4345
+ completionPrice: 0.0025
4346
+ },
4347
+ "gemini-2.5-flash-lite": {
4348
+ promptPrice: 0.0001,
4349
+ completionPrice: 0.0004
4350
+ },
4351
+ "gemini-2.5-flash-lite-preview": {
4352
+ promptPrice: 0.0001,
4353
+ completionPrice: 0.0004
4354
+ },
4355
+ "gemini-2.5-pro": {
4356
+ promptPrice: 0.00125,
4357
+ completionPrice: 0.01
4358
+ },
4359
+ "text-bison": {
4360
+ promptPrice: 0.001,
4361
+ completionPrice: 0.002
4362
+ },
4363
+ "text-bison@002": {
4364
+ promptPrice: 0.001,
4365
+ completionPrice: 0.002
4366
+ },
4367
+ "text-bison-32k": {
4368
+ promptPrice: 0.001,
4369
+ completionPrice: 0.002
4370
+ },
4371
+ "text-bison-32k@002": {
4372
+ promptPrice: 0.001,
4373
+ completionPrice: 0.002
4374
+ },
4375
+ "text-unicorn": {
4376
+ promptPrice: 0.01,
4377
+ completionPrice: 0.03
4378
+ },
4379
+ "text-unicorn@001": {
4380
+ promptPrice: 0.01,
4381
+ completionPrice: 0.03
4382
+ },
4383
+ "chat-bison": {
4384
+ promptPrice: 0.001,
4385
+ completionPrice: 0.002
4386
+ },
4387
+ "chat-bison@002": {
4388
+ promptPrice: 0.001,
4389
+ completionPrice: 0.002
4390
+ },
4391
+ "chat-bison-32k": {
4392
+ promptPrice: 0.001,
4393
+ completionPrice: 0.002
4394
+ },
4395
+ "chat-bison-32k@002": {
4396
+ promptPrice: 0.001,
4397
+ completionPrice: 0.002
4398
+ },
4399
+ "llama3-8b-8192": {
4400
+ promptPrice: 0.00005,
4401
+ completionPrice: 0.0001
4402
+ },
4403
+ "llama3-70b-8192": {
4404
+ promptPrice: 0.00059,
4405
+ completionPrice: 0.00079
4406
+ },
4407
+ "mixtral-8x7b-32768": {
4408
+ promptPrice: 0.00024,
4409
+ completionPrice: 0.00024
4410
+ },
4411
+ "gemma-7b-it": {
4412
+ promptPrice: 0.0001,
4413
+ completionPrice: 0.0001
4414
+ },
4415
+ "reka-core": {
4416
+ promptPrice: 0.002,
4417
+ completionPrice: 0.002
4418
+ },
4419
+ "reka-core-20240415": {
4420
+ promptPrice: 0.002,
4421
+ completionPrice: 0.002
4422
+ },
4423
+ "reka-core-20240501": {
4424
+ promptPrice: 0.002,
4425
+ completionPrice: 0.002
4426
+ },
4427
+ "reka-flash": {
4428
+ promptPrice: 0.0002,
4429
+ completionPrice: 0.0008
4430
+ },
4431
+ "reka-flash-20240226": {
4432
+ promptPrice: 0.0002,
4433
+ completionPrice: 0.0008
4434
+ },
4435
+ "reka-edge": {
4436
+ promptPrice: 0.0001,
4437
+ completionPrice: 0.0001
4438
+ },
4439
+ "reka-edge-20240208": {
4440
+ promptPrice: 0.0001,
4441
+ completionPrice: 0.0001
4442
+ },
4443
+ "reka-spark": {
4444
+ promptPrice: 0.00005,
4445
+ completionPrice: 0.00005
4446
+ },
4447
+ "grok-beta": {
4448
+ promptPrice: 0.0005,
4449
+ completionPrice: 0.0015
4450
+ },
4451
+ "grok-vision-beta": {
4452
+ promptPrice: 0.0005,
4453
+ completionPrice: 0.0015
4454
+ },
4455
+ "jamba-1.5-mini": {
4456
+ promptPrice: 0.0002,
4457
+ completionPrice: 0.0004
4458
+ },
4459
+ "jamba-1.5-large": {
4460
+ promptPrice: 0.002,
4461
+ completionPrice: 0.008
4462
+ },
4463
+ "meta-llama/Llama-3.3-70B-Instruct-Turbo": {
4464
+ promptPrice: 0.00088,
4465
+ completionPrice: 0.00088
4466
+ },
4467
+ "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo-vLLM-json": {
4468
+ promptPrice: 0.00088,
4469
+ completionPrice: 0.00088
4470
+ },
4471
+ "meta-llama/Meta-Llama-3.1-405B-Instruct-Lite-Pro-lora": {
4472
+ promptPrice: 0.00088,
4473
+ completionPrice: 0.00088
4474
+ },
4475
+ "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo": {
4476
+ promptPrice: 0.00088,
4477
+ completionPrice: 0.00088
4478
+ },
4479
+ "Qwen/QwQ-32B-Preview": {
4480
+ promptPrice: 0.0012,
4481
+ completionPrice: 0.0012
4482
+ },
4483
+ "codellama/CodeLlama-34b-Instruct-hf": {
4484
+ promptPrice: 0.0008,
4485
+ completionPrice: 0.0008
4486
+ },
4487
+ "databricks/dbrx-instruct": {
4488
+ promptPrice: 0.0012,
4489
+ completionPrice: 0.0012
4490
+ },
4491
+ "deepseek-ai/deepseek-llm-67b-chat": {
4492
+ promptPrice: 0.0009,
4493
+ completionPrice: 0.0009
4494
+ },
4495
+ "google/gemma-2b-it": {
4496
+ promptPrice: 0.0001,
4497
+ completionPrice: 0.0001
4498
+ },
4499
+ "google/gemma-2-27b-it": {
4500
+ promptPrice: 0.0008,
4501
+ completionPrice: 0.0008
4502
+ },
4503
+ "google/gemma-2-9b-it": {
4504
+ promptPrice: 0.0003,
4505
+ completionPrice: 0.0003
4506
+ },
4507
+ "Gryphe/MythoMax-L2-13b-Lite": {
4508
+ promptPrice: 0.0003,
4509
+ completionPrice: 0.0003
4510
+ },
4511
+ "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF": {
4512
+ promptPrice: 0.0088,
4513
+ completionPrice: 0.0088
4514
+ },
4515
+ "deepseek-chat": {
4516
+ promptPrice: 0.00014,
4517
+ completionPrice: 0.00028
4518
+ },
4519
+ "deepseek-reasoner": {
4520
+ promptPrice: 0.00055,
4521
+ completionPrice: 0.00219
4522
+ }
4523
+ };
4524
+ var defaultPricing = {
4525
+ embeddings: embeddings,
4526
+ images: images,
4527
+ audio: audio,
4528
+ chat: chat
4529
+ };
4530
+
3937
4531
  function loadPricing(pricingJsonPath) {
3938
4532
  if (pricingJsonPath) {
3939
4533
  // eslint-disable-next-line @typescript-eslint/no-var-requires
3940
4534
  const fs = require("fs");
3941
4535
  return JSON.parse(fs.readFileSync(pricingJsonPath, "utf-8"));
3942
4536
  }
3943
- return require("./data/default_pricing.json");
4537
+ return defaultPricing;
3944
4538
  }
3945
4539
 
3946
4540
  let _configuration;