openrouter 0.0.21__py3-none-any.whl → 0.0.22__py3-none-any.whl
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.
- openrouter/_version.py +2 -2
- openrouter/chat.py +138 -14
- openrouter/components/__init__.py +130 -54
- openrouter/components/_schema0.py +93 -0
- openrouter/components/chatgenerationparams.py +376 -4
- openrouter/components/openairesponsesreasoningeffort.py +1 -0
- openrouter/components/openresponsesrequest.py +111 -61
- openrouter/components/providername.py +2 -0
- openrouter/components/publicendpoint.py +49 -49
- openrouter/components/publicpricing.py +49 -49
- openrouter/operations/createembeddings.py +35 -21
- openrouter/operations/getparameters.py +2 -0
- openrouter/responses.py +66 -16
- {openrouter-0.0.21.dist-info → openrouter-0.0.22.dist-info}/METADATA +1 -1
- {openrouter-0.0.21.dist-info → openrouter-0.0.22.dist-info}/RECORD +18 -17
- {openrouter-0.0.21.dist-info → openrouter-0.0.22.dist-info}/WHEEL +0 -0
- {openrouter-0.0.21.dist-info → openrouter-0.0.22.dist-info}/licenses/LICENSE +0 -0
- {openrouter-0.0.21.dist-info → openrouter-0.0.22.dist-info}/top_level.txt +0 -0
|
@@ -175,41 +175,41 @@ Ignore = TypeAliasType(
|
|
|
175
175
|
)
|
|
176
176
|
|
|
177
177
|
|
|
178
|
-
class
|
|
178
|
+
class OpenResponsesRequestMaxPriceTypedDict(TypedDict):
|
|
179
179
|
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
|
180
180
|
|
|
181
|
-
prompt: NotRequired[
|
|
182
|
-
r"""A value in string
|
|
183
|
-
completion: NotRequired[
|
|
184
|
-
r"""A value in string
|
|
185
|
-
image: NotRequired[
|
|
186
|
-
r"""A value in string
|
|
187
|
-
audio: NotRequired[
|
|
188
|
-
r"""A value in string
|
|
189
|
-
request: NotRequired[
|
|
190
|
-
r"""A value in string
|
|
181
|
+
prompt: NotRequired[str]
|
|
182
|
+
r"""A value in string format that is a large number"""
|
|
183
|
+
completion: NotRequired[str]
|
|
184
|
+
r"""A value in string format that is a large number"""
|
|
185
|
+
image: NotRequired[str]
|
|
186
|
+
r"""A value in string format that is a large number"""
|
|
187
|
+
audio: NotRequired[str]
|
|
188
|
+
r"""A value in string format that is a large number"""
|
|
189
|
+
request: NotRequired[str]
|
|
190
|
+
r"""A value in string format that is a large number"""
|
|
191
191
|
|
|
192
192
|
|
|
193
|
-
class
|
|
193
|
+
class OpenResponsesRequestMaxPrice(BaseModel):
|
|
194
194
|
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
|
195
195
|
|
|
196
|
-
prompt: Optional[
|
|
197
|
-
r"""A value in string
|
|
196
|
+
prompt: Optional[str] = None
|
|
197
|
+
r"""A value in string format that is a large number"""
|
|
198
198
|
|
|
199
|
-
completion: Optional[
|
|
200
|
-
r"""A value in string
|
|
199
|
+
completion: Optional[str] = None
|
|
200
|
+
r"""A value in string format that is a large number"""
|
|
201
201
|
|
|
202
|
-
image: Optional[
|
|
203
|
-
r"""A value in string
|
|
202
|
+
image: Optional[str] = None
|
|
203
|
+
r"""A value in string format that is a large number"""
|
|
204
204
|
|
|
205
|
-
audio: Optional[
|
|
206
|
-
r"""A value in string
|
|
205
|
+
audio: Optional[str] = None
|
|
206
|
+
r"""A value in string format that is a large number"""
|
|
207
207
|
|
|
208
|
-
request: Optional[
|
|
209
|
-
r"""A value in string
|
|
208
|
+
request: Optional[str] = None
|
|
209
|
+
r"""A value in string format that is a large number"""
|
|
210
210
|
|
|
211
211
|
|
|
212
|
-
class
|
|
212
|
+
class OpenResponsesRequestProviderTypedDict(TypedDict):
|
|
213
213
|
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
|
214
214
|
|
|
215
215
|
allow_fallbacks: NotRequired[Nullable[bool]]
|
|
@@ -240,11 +240,15 @@ class ProviderTypedDict(TypedDict):
|
|
|
240
240
|
r"""A list of quantization levels to filter the provider by."""
|
|
241
241
|
sort: NotRequired[Nullable[ProviderSort]]
|
|
242
242
|
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
|
|
243
|
-
max_price: NotRequired[
|
|
243
|
+
max_price: NotRequired[OpenResponsesRequestMaxPriceTypedDict]
|
|
244
244
|
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
|
245
|
+
min_throughput: NotRequired[Nullable[float]]
|
|
246
|
+
r"""The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used."""
|
|
247
|
+
max_latency: NotRequired[Nullable[float]]
|
|
248
|
+
r"""The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used."""
|
|
245
249
|
|
|
246
250
|
|
|
247
|
-
class
|
|
251
|
+
class OpenResponsesRequestProvider(BaseModel):
|
|
248
252
|
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
|
249
253
|
|
|
250
254
|
allow_fallbacks: OptionalNullable[bool] = UNSET
|
|
@@ -291,9 +295,15 @@ class Provider(BaseModel):
|
|
|
291
295
|
] = UNSET
|
|
292
296
|
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
|
|
293
297
|
|
|
294
|
-
max_price: Optional[
|
|
298
|
+
max_price: Optional[OpenResponsesRequestMaxPrice] = None
|
|
295
299
|
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
|
296
300
|
|
|
301
|
+
min_throughput: OptionalNullable[float] = UNSET
|
|
302
|
+
r"""The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used."""
|
|
303
|
+
|
|
304
|
+
max_latency: OptionalNullable[float] = UNSET
|
|
305
|
+
r"""The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used."""
|
|
306
|
+
|
|
297
307
|
@model_serializer(mode="wrap")
|
|
298
308
|
def serialize_model(self, handler):
|
|
299
309
|
optional_fields = [
|
|
@@ -308,6 +318,8 @@ class Provider(BaseModel):
|
|
|
308
318
|
"quantizations",
|
|
309
319
|
"sort",
|
|
310
320
|
"max_price",
|
|
321
|
+
"min_throughput",
|
|
322
|
+
"max_latency",
|
|
311
323
|
]
|
|
312
324
|
nullable_fields = [
|
|
313
325
|
"allow_fallbacks",
|
|
@@ -320,6 +332,8 @@ class Provider(BaseModel):
|
|
|
320
332
|
"ignore",
|
|
321
333
|
"quantizations",
|
|
322
334
|
"sort",
|
|
335
|
+
"min_throughput",
|
|
336
|
+
"max_latency",
|
|
323
337
|
]
|
|
324
338
|
null_default_fields = []
|
|
325
339
|
|
|
@@ -351,18 +365,23 @@ class Provider(BaseModel):
|
|
|
351
365
|
IDResponseHealing = Literal["response-healing",]
|
|
352
366
|
|
|
353
367
|
|
|
354
|
-
class
|
|
368
|
+
class OpenResponsesRequestPluginResponseHealingTypedDict(TypedDict):
|
|
355
369
|
id: IDResponseHealing
|
|
370
|
+
enabled: NotRequired[bool]
|
|
371
|
+
r"""Set to false to disable the response-healing plugin for this request. Defaults to true."""
|
|
356
372
|
|
|
357
373
|
|
|
358
|
-
class
|
|
374
|
+
class OpenResponsesRequestPluginResponseHealing(BaseModel):
|
|
359
375
|
id: IDResponseHealing
|
|
360
376
|
|
|
377
|
+
enabled: Optional[bool] = None
|
|
378
|
+
r"""Set to false to disable the response-healing plugin for this request. Defaults to true."""
|
|
379
|
+
|
|
361
380
|
|
|
362
381
|
IDFileParser = Literal["file-parser",]
|
|
363
382
|
|
|
364
383
|
|
|
365
|
-
|
|
384
|
+
OpenResponsesRequestPdfEngine = Union[
|
|
366
385
|
Literal[
|
|
367
386
|
"mistral-ocr",
|
|
368
387
|
"pdf-text",
|
|
@@ -372,34 +391,40 @@ PdfEngine = Union[
|
|
|
372
391
|
]
|
|
373
392
|
|
|
374
393
|
|
|
375
|
-
class
|
|
376
|
-
engine: NotRequired[
|
|
394
|
+
class OpenResponsesRequestPdfTypedDict(TypedDict):
|
|
395
|
+
engine: NotRequired[OpenResponsesRequestPdfEngine]
|
|
377
396
|
|
|
378
397
|
|
|
379
|
-
class
|
|
398
|
+
class OpenResponsesRequestPdf(BaseModel):
|
|
380
399
|
engine: Annotated[
|
|
381
|
-
Optional[
|
|
400
|
+
Optional[OpenResponsesRequestPdfEngine],
|
|
401
|
+
PlainValidator(validate_open_enum(False)),
|
|
382
402
|
] = None
|
|
383
403
|
|
|
384
404
|
|
|
385
|
-
class
|
|
405
|
+
class OpenResponsesRequestPluginFileParserTypedDict(TypedDict):
|
|
386
406
|
id: IDFileParser
|
|
407
|
+
enabled: NotRequired[bool]
|
|
408
|
+
r"""Set to false to disable the file-parser plugin for this request. Defaults to true."""
|
|
387
409
|
max_files: NotRequired[float]
|
|
388
|
-
pdf: NotRequired[
|
|
410
|
+
pdf: NotRequired[OpenResponsesRequestPdfTypedDict]
|
|
389
411
|
|
|
390
412
|
|
|
391
|
-
class
|
|
413
|
+
class OpenResponsesRequestPluginFileParser(BaseModel):
|
|
392
414
|
id: IDFileParser
|
|
393
415
|
|
|
416
|
+
enabled: Optional[bool] = None
|
|
417
|
+
r"""Set to false to disable the file-parser plugin for this request. Defaults to true."""
|
|
418
|
+
|
|
394
419
|
max_files: Optional[float] = None
|
|
395
420
|
|
|
396
|
-
pdf: Optional[
|
|
421
|
+
pdf: Optional[OpenResponsesRequestPdf] = None
|
|
397
422
|
|
|
398
423
|
|
|
399
424
|
IDWeb = Literal["web",]
|
|
400
425
|
|
|
401
426
|
|
|
402
|
-
|
|
427
|
+
OpenResponsesRequestEngine = Union[
|
|
403
428
|
Literal[
|
|
404
429
|
"native",
|
|
405
430
|
"exa",
|
|
@@ -408,58 +433,73 @@ Engine = Union[
|
|
|
408
433
|
]
|
|
409
434
|
|
|
410
435
|
|
|
411
|
-
class
|
|
436
|
+
class OpenResponsesRequestPluginWebTypedDict(TypedDict):
|
|
412
437
|
id: IDWeb
|
|
438
|
+
enabled: NotRequired[bool]
|
|
439
|
+
r"""Set to false to disable the web-search plugin for this request. Defaults to true."""
|
|
413
440
|
max_results: NotRequired[float]
|
|
414
441
|
search_prompt: NotRequired[str]
|
|
415
|
-
engine: NotRequired[
|
|
442
|
+
engine: NotRequired[OpenResponsesRequestEngine]
|
|
416
443
|
|
|
417
444
|
|
|
418
|
-
class
|
|
445
|
+
class OpenResponsesRequestPluginWeb(BaseModel):
|
|
419
446
|
id: IDWeb
|
|
420
447
|
|
|
448
|
+
enabled: Optional[bool] = None
|
|
449
|
+
r"""Set to false to disable the web-search plugin for this request. Defaults to true."""
|
|
450
|
+
|
|
421
451
|
max_results: Optional[float] = None
|
|
422
452
|
|
|
423
453
|
search_prompt: Optional[str] = None
|
|
424
454
|
|
|
425
|
-
engine: Annotated[
|
|
426
|
-
|
|
427
|
-
|
|
455
|
+
engine: Annotated[
|
|
456
|
+
Optional[OpenResponsesRequestEngine], PlainValidator(validate_open_enum(False))
|
|
457
|
+
] = None
|
|
428
458
|
|
|
429
459
|
|
|
430
460
|
IDModeration = Literal["moderation",]
|
|
431
461
|
|
|
432
462
|
|
|
433
|
-
class
|
|
463
|
+
class OpenResponsesRequestPluginModerationTypedDict(TypedDict):
|
|
434
464
|
id: IDModeration
|
|
435
465
|
|
|
436
466
|
|
|
437
|
-
class
|
|
467
|
+
class OpenResponsesRequestPluginModeration(BaseModel):
|
|
438
468
|
id: IDModeration
|
|
439
469
|
|
|
440
470
|
|
|
441
|
-
|
|
442
|
-
"
|
|
471
|
+
OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
|
|
472
|
+
"OpenResponsesRequestPluginUnionTypedDict",
|
|
443
473
|
Union[
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
474
|
+
OpenResponsesRequestPluginModerationTypedDict,
|
|
475
|
+
OpenResponsesRequestPluginResponseHealingTypedDict,
|
|
476
|
+
OpenResponsesRequestPluginFileParserTypedDict,
|
|
477
|
+
OpenResponsesRequestPluginWebTypedDict,
|
|
448
478
|
],
|
|
449
479
|
)
|
|
450
480
|
|
|
451
481
|
|
|
452
|
-
|
|
482
|
+
OpenResponsesRequestPluginUnion = Annotated[
|
|
453
483
|
Union[
|
|
454
|
-
Annotated[
|
|
455
|
-
Annotated[
|
|
456
|
-
Annotated[
|
|
457
|
-
Annotated[
|
|
484
|
+
Annotated[OpenResponsesRequestPluginModeration, Tag("moderation")],
|
|
485
|
+
Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
|
|
486
|
+
Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
|
|
487
|
+
Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")],
|
|
458
488
|
],
|
|
459
489
|
Discriminator(lambda m: get_discriminator(m, "id", "id")),
|
|
460
490
|
]
|
|
461
491
|
|
|
462
492
|
|
|
493
|
+
OpenResponsesRequestRoute = Union[
|
|
494
|
+
Literal[
|
|
495
|
+
"fallback",
|
|
496
|
+
"sort",
|
|
497
|
+
],
|
|
498
|
+
UnrecognizedStr,
|
|
499
|
+
]
|
|
500
|
+
r"""Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria."""
|
|
501
|
+
|
|
502
|
+
|
|
463
503
|
class OpenResponsesRequestTypedDict(TypedDict):
|
|
464
504
|
r"""Request schema for Responses endpoint"""
|
|
465
505
|
|
|
@@ -491,10 +531,12 @@ class OpenResponsesRequestTypedDict(TypedDict):
|
|
|
491
531
|
service_tier: NotRequired[ServiceTier]
|
|
492
532
|
truncation: NotRequired[Nullable[Truncation]]
|
|
493
533
|
stream: NotRequired[bool]
|
|
494
|
-
provider: NotRequired[Nullable[
|
|
534
|
+
provider: NotRequired[Nullable[OpenResponsesRequestProviderTypedDict]]
|
|
495
535
|
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
|
496
|
-
plugins: NotRequired[List[
|
|
536
|
+
plugins: NotRequired[List[OpenResponsesRequestPluginUnionTypedDict]]
|
|
497
537
|
r"""Plugins you want to enable for this request, including their settings."""
|
|
538
|
+
route: NotRequired[Nullable[OpenResponsesRequestRoute]]
|
|
539
|
+
r"""Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria."""
|
|
498
540
|
user: NotRequired[str]
|
|
499
541
|
r"""A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters."""
|
|
500
542
|
session_id: NotRequired[str]
|
|
@@ -567,12 +609,18 @@ class OpenResponsesRequest(BaseModel):
|
|
|
567
609
|
|
|
568
610
|
stream: Optional[bool] = False
|
|
569
611
|
|
|
570
|
-
provider: OptionalNullable[
|
|
612
|
+
provider: OptionalNullable[OpenResponsesRequestProvider] = UNSET
|
|
571
613
|
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
|
572
614
|
|
|
573
|
-
plugins: Optional[List[
|
|
615
|
+
plugins: Optional[List[OpenResponsesRequestPluginUnion]] = None
|
|
574
616
|
r"""Plugins you want to enable for this request, including their settings."""
|
|
575
617
|
|
|
618
|
+
route: Annotated[
|
|
619
|
+
OptionalNullable[OpenResponsesRequestRoute],
|
|
620
|
+
PlainValidator(validate_open_enum(False)),
|
|
621
|
+
] = UNSET
|
|
622
|
+
r"""Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria."""
|
|
623
|
+
|
|
576
624
|
user: Optional[str] = None
|
|
577
625
|
r"""A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters."""
|
|
578
626
|
|
|
@@ -608,6 +656,7 @@ class OpenResponsesRequest(BaseModel):
|
|
|
608
656
|
"stream",
|
|
609
657
|
"provider",
|
|
610
658
|
"plugins",
|
|
659
|
+
"route",
|
|
611
660
|
"user",
|
|
612
661
|
"session_id",
|
|
613
662
|
]
|
|
@@ -627,6 +676,7 @@ class OpenResponsesRequest(BaseModel):
|
|
|
627
676
|
"safety_identifier",
|
|
628
677
|
"truncation",
|
|
629
678
|
"provider",
|
|
679
|
+
"route",
|
|
630
680
|
]
|
|
631
681
|
null_default_fields = []
|
|
632
682
|
|
|
@@ -43,6 +43,7 @@ ProviderName = Union[
|
|
|
43
43
|
"Infermatic",
|
|
44
44
|
"Inflection",
|
|
45
45
|
"Liquid",
|
|
46
|
+
"Mara",
|
|
46
47
|
"Mancer 2",
|
|
47
48
|
"Minimax",
|
|
48
49
|
"ModelRun",
|
|
@@ -71,6 +72,7 @@ ProviderName = Union[
|
|
|
71
72
|
"Together",
|
|
72
73
|
"Venice",
|
|
73
74
|
"WandB",
|
|
75
|
+
"Xiaomi",
|
|
74
76
|
"xAI",
|
|
75
77
|
"Z.AI",
|
|
76
78
|
"FakeProvider",
|
|
@@ -8,74 +8,74 @@ from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedSt
|
|
|
8
8
|
from openrouter.utils import validate_open_enum
|
|
9
9
|
from pydantic import model_serializer
|
|
10
10
|
from pydantic.functional_validators import PlainValidator
|
|
11
|
-
from typing import
|
|
11
|
+
from typing import List, Literal, Optional, Union
|
|
12
12
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class PricingTypedDict(TypedDict):
|
|
16
|
-
prompt:
|
|
17
|
-
r"""A value in string
|
|
18
|
-
completion:
|
|
19
|
-
r"""A value in string
|
|
20
|
-
request: NotRequired[
|
|
21
|
-
r"""A value in string
|
|
22
|
-
image: NotRequired[
|
|
23
|
-
r"""A value in string
|
|
24
|
-
image_token: NotRequired[
|
|
25
|
-
r"""A value in string
|
|
26
|
-
image_output: NotRequired[
|
|
27
|
-
r"""A value in string
|
|
28
|
-
audio: NotRequired[
|
|
29
|
-
r"""A value in string
|
|
30
|
-
input_audio_cache: NotRequired[
|
|
31
|
-
r"""A value in string
|
|
32
|
-
web_search: NotRequired[
|
|
33
|
-
r"""A value in string
|
|
34
|
-
internal_reasoning: NotRequired[
|
|
35
|
-
r"""A value in string
|
|
36
|
-
input_cache_read: NotRequired[
|
|
37
|
-
r"""A value in string
|
|
38
|
-
input_cache_write: NotRequired[
|
|
39
|
-
r"""A value in string
|
|
16
|
+
prompt: str
|
|
17
|
+
r"""A value in string format that is a large number"""
|
|
18
|
+
completion: str
|
|
19
|
+
r"""A value in string format that is a large number"""
|
|
20
|
+
request: NotRequired[str]
|
|
21
|
+
r"""A value in string format that is a large number"""
|
|
22
|
+
image: NotRequired[str]
|
|
23
|
+
r"""A value in string format that is a large number"""
|
|
24
|
+
image_token: NotRequired[str]
|
|
25
|
+
r"""A value in string format that is a large number"""
|
|
26
|
+
image_output: NotRequired[str]
|
|
27
|
+
r"""A value in string format that is a large number"""
|
|
28
|
+
audio: NotRequired[str]
|
|
29
|
+
r"""A value in string format that is a large number"""
|
|
30
|
+
input_audio_cache: NotRequired[str]
|
|
31
|
+
r"""A value in string format that is a large number"""
|
|
32
|
+
web_search: NotRequired[str]
|
|
33
|
+
r"""A value in string format that is a large number"""
|
|
34
|
+
internal_reasoning: NotRequired[str]
|
|
35
|
+
r"""A value in string format that is a large number"""
|
|
36
|
+
input_cache_read: NotRequired[str]
|
|
37
|
+
r"""A value in string format that is a large number"""
|
|
38
|
+
input_cache_write: NotRequired[str]
|
|
39
|
+
r"""A value in string format that is a large number"""
|
|
40
40
|
discount: NotRequired[float]
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
class Pricing(BaseModel):
|
|
44
|
-
prompt:
|
|
45
|
-
r"""A value in string
|
|
44
|
+
prompt: str
|
|
45
|
+
r"""A value in string format that is a large number"""
|
|
46
46
|
|
|
47
|
-
completion:
|
|
48
|
-
r"""A value in string
|
|
47
|
+
completion: str
|
|
48
|
+
r"""A value in string format that is a large number"""
|
|
49
49
|
|
|
50
|
-
request: Optional[
|
|
51
|
-
r"""A value in string
|
|
50
|
+
request: Optional[str] = None
|
|
51
|
+
r"""A value in string format that is a large number"""
|
|
52
52
|
|
|
53
|
-
image: Optional[
|
|
54
|
-
r"""A value in string
|
|
53
|
+
image: Optional[str] = None
|
|
54
|
+
r"""A value in string format that is a large number"""
|
|
55
55
|
|
|
56
|
-
image_token: Optional[
|
|
57
|
-
r"""A value in string
|
|
56
|
+
image_token: Optional[str] = None
|
|
57
|
+
r"""A value in string format that is a large number"""
|
|
58
58
|
|
|
59
|
-
image_output: Optional[
|
|
60
|
-
r"""A value in string
|
|
59
|
+
image_output: Optional[str] = None
|
|
60
|
+
r"""A value in string format that is a large number"""
|
|
61
61
|
|
|
62
|
-
audio: Optional[
|
|
63
|
-
r"""A value in string
|
|
62
|
+
audio: Optional[str] = None
|
|
63
|
+
r"""A value in string format that is a large number"""
|
|
64
64
|
|
|
65
|
-
input_audio_cache: Optional[
|
|
66
|
-
r"""A value in string
|
|
65
|
+
input_audio_cache: Optional[str] = None
|
|
66
|
+
r"""A value in string format that is a large number"""
|
|
67
67
|
|
|
68
|
-
web_search: Optional[
|
|
69
|
-
r"""A value in string
|
|
68
|
+
web_search: Optional[str] = None
|
|
69
|
+
r"""A value in string format that is a large number"""
|
|
70
70
|
|
|
71
|
-
internal_reasoning: Optional[
|
|
72
|
-
r"""A value in string
|
|
71
|
+
internal_reasoning: Optional[str] = None
|
|
72
|
+
r"""A value in string format that is a large number"""
|
|
73
73
|
|
|
74
|
-
input_cache_read: Optional[
|
|
75
|
-
r"""A value in string
|
|
74
|
+
input_cache_read: Optional[str] = None
|
|
75
|
+
r"""A value in string format that is a large number"""
|
|
76
76
|
|
|
77
|
-
input_cache_write: Optional[
|
|
78
|
-
r"""A value in string
|
|
77
|
+
input_cache_write: Optional[str] = None
|
|
78
|
+
r"""A value in string format that is a large number"""
|
|
79
79
|
|
|
80
80
|
discount: Optional[float] = None
|
|
81
81
|
|
|
@@ -2,77 +2,77 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from openrouter.types import BaseModel
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import Optional
|
|
6
6
|
from typing_extensions import NotRequired, TypedDict
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class PublicPricingTypedDict(TypedDict):
|
|
10
10
|
r"""Pricing information for the model"""
|
|
11
11
|
|
|
12
|
-
prompt:
|
|
13
|
-
r"""A value in string
|
|
14
|
-
completion:
|
|
15
|
-
r"""A value in string
|
|
16
|
-
request: NotRequired[
|
|
17
|
-
r"""A value in string
|
|
18
|
-
image: NotRequired[
|
|
19
|
-
r"""A value in string
|
|
20
|
-
image_token: NotRequired[
|
|
21
|
-
r"""A value in string
|
|
22
|
-
image_output: NotRequired[
|
|
23
|
-
r"""A value in string
|
|
24
|
-
audio: NotRequired[
|
|
25
|
-
r"""A value in string
|
|
26
|
-
input_audio_cache: NotRequired[
|
|
27
|
-
r"""A value in string
|
|
28
|
-
web_search: NotRequired[
|
|
29
|
-
r"""A value in string
|
|
30
|
-
internal_reasoning: NotRequired[
|
|
31
|
-
r"""A value in string
|
|
32
|
-
input_cache_read: NotRequired[
|
|
33
|
-
r"""A value in string
|
|
34
|
-
input_cache_write: NotRequired[
|
|
35
|
-
r"""A value in string
|
|
12
|
+
prompt: str
|
|
13
|
+
r"""A value in string format that is a large number"""
|
|
14
|
+
completion: str
|
|
15
|
+
r"""A value in string format that is a large number"""
|
|
16
|
+
request: NotRequired[str]
|
|
17
|
+
r"""A value in string format that is a large number"""
|
|
18
|
+
image: NotRequired[str]
|
|
19
|
+
r"""A value in string format that is a large number"""
|
|
20
|
+
image_token: NotRequired[str]
|
|
21
|
+
r"""A value in string format that is a large number"""
|
|
22
|
+
image_output: NotRequired[str]
|
|
23
|
+
r"""A value in string format that is a large number"""
|
|
24
|
+
audio: NotRequired[str]
|
|
25
|
+
r"""A value in string format that is a large number"""
|
|
26
|
+
input_audio_cache: NotRequired[str]
|
|
27
|
+
r"""A value in string format that is a large number"""
|
|
28
|
+
web_search: NotRequired[str]
|
|
29
|
+
r"""A value in string format that is a large number"""
|
|
30
|
+
internal_reasoning: NotRequired[str]
|
|
31
|
+
r"""A value in string format that is a large number"""
|
|
32
|
+
input_cache_read: NotRequired[str]
|
|
33
|
+
r"""A value in string format that is a large number"""
|
|
34
|
+
input_cache_write: NotRequired[str]
|
|
35
|
+
r"""A value in string format that is a large number"""
|
|
36
36
|
discount: NotRequired[float]
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class PublicPricing(BaseModel):
|
|
40
40
|
r"""Pricing information for the model"""
|
|
41
41
|
|
|
42
|
-
prompt:
|
|
43
|
-
r"""A value in string
|
|
42
|
+
prompt: str
|
|
43
|
+
r"""A value in string format that is a large number"""
|
|
44
44
|
|
|
45
|
-
completion:
|
|
46
|
-
r"""A value in string
|
|
45
|
+
completion: str
|
|
46
|
+
r"""A value in string format that is a large number"""
|
|
47
47
|
|
|
48
|
-
request: Optional[
|
|
49
|
-
r"""A value in string
|
|
48
|
+
request: Optional[str] = None
|
|
49
|
+
r"""A value in string format that is a large number"""
|
|
50
50
|
|
|
51
|
-
image: Optional[
|
|
52
|
-
r"""A value in string
|
|
51
|
+
image: Optional[str] = None
|
|
52
|
+
r"""A value in string format that is a large number"""
|
|
53
53
|
|
|
54
|
-
image_token: Optional[
|
|
55
|
-
r"""A value in string
|
|
54
|
+
image_token: Optional[str] = None
|
|
55
|
+
r"""A value in string format that is a large number"""
|
|
56
56
|
|
|
57
|
-
image_output: Optional[
|
|
58
|
-
r"""A value in string
|
|
57
|
+
image_output: Optional[str] = None
|
|
58
|
+
r"""A value in string format that is a large number"""
|
|
59
59
|
|
|
60
|
-
audio: Optional[
|
|
61
|
-
r"""A value in string
|
|
60
|
+
audio: Optional[str] = None
|
|
61
|
+
r"""A value in string format that is a large number"""
|
|
62
62
|
|
|
63
|
-
input_audio_cache: Optional[
|
|
64
|
-
r"""A value in string
|
|
63
|
+
input_audio_cache: Optional[str] = None
|
|
64
|
+
r"""A value in string format that is a large number"""
|
|
65
65
|
|
|
66
|
-
web_search: Optional[
|
|
67
|
-
r"""A value in string
|
|
66
|
+
web_search: Optional[str] = None
|
|
67
|
+
r"""A value in string format that is a large number"""
|
|
68
68
|
|
|
69
|
-
internal_reasoning: Optional[
|
|
70
|
-
r"""A value in string
|
|
69
|
+
internal_reasoning: Optional[str] = None
|
|
70
|
+
r"""A value in string format that is a large number"""
|
|
71
71
|
|
|
72
|
-
input_cache_read: Optional[
|
|
73
|
-
r"""A value in string
|
|
72
|
+
input_cache_read: Optional[str] = None
|
|
73
|
+
r"""A value in string format that is a large number"""
|
|
74
74
|
|
|
75
|
-
input_cache_write: Optional[
|
|
76
|
-
r"""A value in string
|
|
75
|
+
input_cache_write: Optional[str] = None
|
|
76
|
+
r"""A value in string format that is a large number"""
|
|
77
77
|
|
|
78
78
|
discount: Optional[float] = None
|