openrouter 0.1.2__py3-none-any.whl → 0.6.0__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.
Files changed (84) hide show
  1. openrouter/_version.py +2 -2
  2. openrouter/analytics.py +28 -2
  3. openrouter/api_keys.py +210 -14
  4. openrouter/chat.py +192 -200
  5. openrouter/components/__init__.py +229 -285
  6. openrouter/components/_schema10.py +39 -0
  7. openrouter/components/_schema14.py +11 -0
  8. openrouter/components/_schema17.py +154 -0
  9. openrouter/components/{_schema3.py → _schema19.py} +28 -22
  10. openrouter/components/{_schema0.py → _schema5.py} +7 -5
  11. openrouter/components/assistantmessage.py +32 -1
  12. openrouter/components/chatgenerationparams.py +57 -343
  13. openrouter/components/chatmessagecontentitemimage.py +4 -4
  14. openrouter/components/chatresponsechoice.py +1 -6
  15. openrouter/components/chatstreamingmessagechunk.py +3 -3
  16. openrouter/components/developermessage.py +41 -0
  17. openrouter/components/message.py +6 -39
  18. openrouter/components/model.py +7 -1
  19. openrouter/components/openresponsesrequest.py +31 -39
  20. openrouter/components/outputmodality.py +1 -0
  21. openrouter/components/providername.py +2 -0
  22. openrouter/components/providerpreferences.py +2 -10
  23. openrouter/components/publicendpoint.py +8 -24
  24. openrouter/components/publicpricing.py +3 -24
  25. openrouter/credits.py +86 -14
  26. openrouter/embeddings.py +92 -20
  27. openrouter/endpoints.py +62 -2
  28. openrouter/generations.py +26 -0
  29. openrouter/guardrails.py +3367 -0
  30. openrouter/models_.py +120 -12
  31. openrouter/oauth.py +90 -22
  32. openrouter/operations/__init__.py +601 -30
  33. openrouter/operations/bulkassignkeystoguardrail.py +116 -0
  34. openrouter/operations/bulkassignmemberstoguardrail.py +116 -0
  35. openrouter/operations/bulkunassignkeysfromguardrail.py +116 -0
  36. openrouter/operations/bulkunassignmembersfromguardrail.py +116 -0
  37. openrouter/operations/createauthkeyscode.py +81 -3
  38. openrouter/operations/createcoinbasecharge.py +82 -2
  39. openrouter/operations/createembeddings.py +82 -3
  40. openrouter/operations/createguardrail.py +325 -0
  41. openrouter/operations/createkeys.py +81 -3
  42. openrouter/operations/createresponses.py +84 -3
  43. openrouter/operations/deleteguardrail.py +104 -0
  44. openrouter/operations/deletekeys.py +69 -3
  45. openrouter/operations/exchangeauthcodeforapikey.py +81 -3
  46. openrouter/operations/getcredits.py +70 -1
  47. openrouter/operations/getcurrentkey.py +81 -3
  48. openrouter/operations/getgeneration.py +248 -3
  49. openrouter/operations/getguardrail.py +228 -0
  50. openrouter/operations/getkey.py +64 -1
  51. openrouter/operations/getmodels.py +95 -5
  52. openrouter/operations/getuseractivity.py +62 -1
  53. openrouter/operations/list.py +63 -1
  54. openrouter/operations/listembeddingsmodels.py +74 -0
  55. openrouter/operations/listendpoints.py +65 -2
  56. openrouter/operations/listendpointszdr.py +70 -2
  57. openrouter/operations/listguardrailkeyassignments.py +192 -0
  58. openrouter/operations/listguardrailmemberassignments.py +187 -0
  59. openrouter/operations/listguardrails.py +238 -0
  60. openrouter/operations/listkeyassignments.py +180 -0
  61. openrouter/operations/listmemberassignments.py +175 -0
  62. openrouter/operations/listmodelscount.py +74 -0
  63. openrouter/operations/listmodelsuser.py +70 -2
  64. openrouter/operations/listproviders.py +70 -2
  65. openrouter/operations/sendchatcompletionrequest.py +87 -3
  66. openrouter/operations/updateguardrail.py +334 -0
  67. openrouter/operations/updatekeys.py +63 -0
  68. openrouter/providers.py +36 -2
  69. openrouter/responses.py +178 -148
  70. openrouter/sdk.py +5 -8
  71. openrouter/types/models.py +378 -0
  72. {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/METADATA +5 -1
  73. {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/RECORD +76 -63
  74. {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/WHEEL +1 -1
  75. openrouter/completions.py +0 -361
  76. openrouter/components/completionchoice.py +0 -82
  77. openrouter/components/completioncreateparams.py +0 -277
  78. openrouter/components/completionlogprobs.py +0 -54
  79. openrouter/components/completionresponse.py +0 -46
  80. openrouter/components/completionusage.py +0 -19
  81. openrouter/operations/getparameters.py +0 -123
  82. openrouter/parameters.py +0 -237
  83. {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/licenses/LICENSE +0 -0
  84. {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,41 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .chatmessagecontentitemtext import (
5
+ ChatMessageContentItemText,
6
+ ChatMessageContentItemTextTypedDict,
7
+ )
8
+ from openrouter.types import BaseModel
9
+ from openrouter.utils import validate_const
10
+ import pydantic
11
+ from pydantic.functional_validators import AfterValidator
12
+ from typing import List, Literal, Optional, Union
13
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
14
+
15
+
16
+ DeveloperMessageContentTypedDict = TypeAliasType(
17
+ "DeveloperMessageContentTypedDict",
18
+ Union[str, List[ChatMessageContentItemTextTypedDict]],
19
+ )
20
+
21
+
22
+ DeveloperMessageContent = TypeAliasType(
23
+ "DeveloperMessageContent", Union[str, List[ChatMessageContentItemText]]
24
+ )
25
+
26
+
27
+ class DeveloperMessageTypedDict(TypedDict):
28
+ content: DeveloperMessageContentTypedDict
29
+ role: Literal["developer"]
30
+ name: NotRequired[str]
31
+
32
+
33
+ class DeveloperMessage(BaseModel):
34
+ content: DeveloperMessageContent
35
+
36
+ ROLE: Annotated[
37
+ Annotated[Literal["developer"], AfterValidator(validate_const("developer"))],
38
+ pydantic.Field(alias="role"),
39
+ ] = "developer"
40
+
41
+ name: Optional[str] = None
@@ -2,47 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
5
- from .chatmessagecontentitemtext import (
6
- ChatMessageContentItemText,
7
- ChatMessageContentItemTextTypedDict,
8
- )
5
+ from .developermessage import DeveloperMessage, DeveloperMessageTypedDict
9
6
  from .systemmessage import SystemMessage, SystemMessageTypedDict
10
7
  from .toolresponsemessage import ToolResponseMessage, ToolResponseMessageTypedDict
11
8
  from .usermessage import UserMessage, UserMessageTypedDict
12
- from openrouter.types import BaseModel
13
- from openrouter.utils import get_discriminator, validate_const
14
- import pydantic
9
+ from openrouter.utils import get_discriminator
15
10
  from pydantic import Discriminator, Tag
16
- from pydantic.functional_validators import AfterValidator
17
- from typing import List, Literal, Optional, Union
18
- from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
19
-
20
-
21
- MessageContentTypedDict = TypeAliasType(
22
- "MessageContentTypedDict", Union[str, List[ChatMessageContentItemTextTypedDict]]
23
- )
24
-
25
-
26
- MessageContent = TypeAliasType(
27
- "MessageContent", Union[str, List[ChatMessageContentItemText]]
28
- )
29
-
30
-
31
- class MessageDeveloperTypedDict(TypedDict):
32
- content: MessageContentTypedDict
33
- role: Literal["developer"]
34
- name: NotRequired[str]
35
-
36
-
37
- class MessageDeveloper(BaseModel):
38
- content: MessageContent
39
-
40
- ROLE: Annotated[
41
- Annotated[Literal["developer"], AfterValidator(validate_const("developer"))],
42
- pydantic.Field(alias="role"),
43
- ] = "developer"
44
-
45
- name: Optional[str] = None
11
+ from typing import Union
12
+ from typing_extensions import Annotated, TypeAliasType
46
13
 
47
14
 
48
15
  MessageTypedDict = TypeAliasType(
@@ -50,7 +17,7 @@ MessageTypedDict = TypeAliasType(
50
17
  Union[
51
18
  SystemMessageTypedDict,
52
19
  UserMessageTypedDict,
53
- MessageDeveloperTypedDict,
20
+ DeveloperMessageTypedDict,
54
21
  ToolResponseMessageTypedDict,
55
22
  AssistantMessageTypedDict,
56
23
  ],
@@ -61,7 +28,7 @@ Message = Annotated[
61
28
  Union[
62
29
  Annotated[SystemMessage, Tag("system")],
63
30
  Annotated[UserMessage, Tag("user")],
64
- Annotated[MessageDeveloper, Tag("developer")],
31
+ Annotated[DeveloperMessage, Tag("developer")],
65
32
  Annotated[AssistantMessage, Tag("assistant")],
66
33
  Annotated[ToolResponseMessage, Tag("tool")],
67
34
  ],
@@ -50,6 +50,8 @@ class ModelTypedDict(TypedDict):
50
50
  r"""Hugging Face model identifier, if applicable"""
51
51
  description: NotRequired[str]
52
52
  r"""Description of the model"""
53
+ expiration_date: NotRequired[Nullable[str]]
54
+ r"""The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration."""
53
55
 
54
56
 
55
57
  class Model(BaseModel):
@@ -96,14 +98,18 @@ class Model(BaseModel):
96
98
  description: Optional[str] = None
97
99
  r"""Description of the model"""
98
100
 
101
+ expiration_date: OptionalNullable[str] = UNSET
102
+ r"""The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration."""
103
+
99
104
  @model_serializer(mode="wrap")
100
105
  def serialize_model(self, handler):
101
- optional_fields = ["hugging_face_id", "description"]
106
+ optional_fields = ["hugging_face_id", "description", "expiration_date"]
102
107
  nullable_fields = [
103
108
  "hugging_face_id",
104
109
  "context_length",
105
110
  "per_request_limits",
106
111
  "default_parameters",
112
+ "expiration_date",
107
113
  ]
108
114
  null_default_fields = []
109
115
 
@@ -222,37 +222,29 @@ class OpenResponsesRequestMaxPriceTypedDict(TypedDict):
222
222
  r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
223
223
 
224
224
  prompt: NotRequired[str]
225
- r"""A value in string format that is a large number"""
225
+ r"""Price per million prompt tokens"""
226
226
  completion: NotRequired[str]
227
- r"""A value in string format that is a large number"""
228
227
  image: NotRequired[str]
229
- r"""A value in string format that is a large number"""
230
228
  audio: NotRequired[str]
231
- r"""A value in string format that is a large number"""
232
229
  request: NotRequired[str]
233
- r"""A value in string format that is a large number"""
234
230
 
235
231
 
236
232
  class OpenResponsesRequestMaxPrice(BaseModel):
237
233
  r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
238
234
 
239
235
  prompt: Optional[str] = None
240
- r"""A value in string format that is a large number"""
236
+ r"""Price per million prompt tokens"""
241
237
 
242
238
  completion: Optional[str] = None
243
- r"""A value in string format that is a large number"""
244
239
 
245
240
  image: Optional[str] = None
246
- r"""A value in string format that is a large number"""
247
241
 
248
242
  audio: Optional[str] = None
249
- r"""A value in string format that is a large number"""
250
243
 
251
244
  request: Optional[str] = None
252
- r"""A value in string format that is a large number"""
253
245
 
254
246
 
255
- class OpenResponsesRequestProviderTypedDict(TypedDict):
247
+ class ProviderTypedDict(TypedDict):
256
248
  r"""When multiple model providers are available, optionally indicate your routing preference."""
257
249
 
258
250
  allow_fallbacks: NotRequired[Nullable[bool]]
@@ -291,7 +283,7 @@ class OpenResponsesRequestProviderTypedDict(TypedDict):
291
283
  r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
292
284
 
293
285
 
294
- class OpenResponsesRequestProvider(BaseModel):
286
+ class Provider(BaseModel):
295
287
  r"""When multiple model providers are available, optionally indicate your routing preference."""
296
288
 
297
289
  allow_fallbacks: OptionalNullable[bool] = UNSET
@@ -406,13 +398,13 @@ class OpenResponsesRequestProvider(BaseModel):
406
398
  IDResponseHealing = Literal["response-healing",]
407
399
 
408
400
 
409
- class OpenResponsesRequestPluginResponseHealingTypedDict(TypedDict):
401
+ class PluginResponseHealingTypedDict(TypedDict):
410
402
  id: IDResponseHealing
411
403
  enabled: NotRequired[bool]
412
404
  r"""Set to false to disable the response-healing plugin for this request. Defaults to true."""
413
405
 
414
406
 
415
- class OpenResponsesRequestPluginResponseHealing(BaseModel):
407
+ class PluginResponseHealing(BaseModel):
416
408
  id: IDResponseHealing
417
409
 
418
410
  enabled: Optional[bool] = None
@@ -422,7 +414,7 @@ class OpenResponsesRequestPluginResponseHealing(BaseModel):
422
414
  IDFileParser = Literal["file-parser",]
423
415
 
424
416
 
425
- class OpenResponsesRequestPluginFileParserTypedDict(TypedDict):
417
+ class PluginFileParserTypedDict(TypedDict):
426
418
  id: IDFileParser
427
419
  enabled: NotRequired[bool]
428
420
  r"""Set to false to disable the file-parser plugin for this request. Defaults to true."""
@@ -430,7 +422,7 @@ class OpenResponsesRequestPluginFileParserTypedDict(TypedDict):
430
422
  r"""Options for PDF parsing."""
431
423
 
432
424
 
433
- class OpenResponsesRequestPluginFileParser(BaseModel):
425
+ class PluginFileParser(BaseModel):
434
426
  id: IDFileParser
435
427
 
436
428
  enabled: Optional[bool] = None
@@ -443,7 +435,7 @@ class OpenResponsesRequestPluginFileParser(BaseModel):
443
435
  IDWeb = Literal["web",]
444
436
 
445
437
 
446
- class OpenResponsesRequestPluginWebTypedDict(TypedDict):
438
+ class PluginWebTypedDict(TypedDict):
447
439
  id: IDWeb
448
440
  enabled: NotRequired[bool]
449
441
  r"""Set to false to disable the web-search plugin for this request. Defaults to true."""
@@ -453,7 +445,7 @@ class OpenResponsesRequestPluginWebTypedDict(TypedDict):
453
445
  r"""The search engine to use for web search."""
454
446
 
455
447
 
456
- class OpenResponsesRequestPluginWeb(BaseModel):
448
+ class PluginWeb(BaseModel):
457
449
  id: IDWeb
458
450
 
459
451
  enabled: Optional[bool] = None
@@ -472,18 +464,18 @@ class OpenResponsesRequestPluginWeb(BaseModel):
472
464
  IDModeration = Literal["moderation",]
473
465
 
474
466
 
475
- class OpenResponsesRequestPluginModerationTypedDict(TypedDict):
467
+ class PluginModerationTypedDict(TypedDict):
476
468
  id: IDModeration
477
469
 
478
470
 
479
- class OpenResponsesRequestPluginModeration(BaseModel):
471
+ class PluginModeration(BaseModel):
480
472
  id: IDModeration
481
473
 
482
474
 
483
475
  IDAutoRouter = Literal["auto-router",]
484
476
 
485
477
 
486
- class OpenResponsesRequestPluginAutoRouterTypedDict(TypedDict):
478
+ class PluginAutoRouterTypedDict(TypedDict):
487
479
  id: IDAutoRouter
488
480
  enabled: NotRequired[bool]
489
481
  r"""Set to false to disable the auto-router plugin for this request. Defaults to true."""
@@ -491,7 +483,7 @@ class OpenResponsesRequestPluginAutoRouterTypedDict(TypedDict):
491
483
  r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."""
492
484
 
493
485
 
494
- class OpenResponsesRequestPluginAutoRouter(BaseModel):
486
+ class PluginAutoRouter(BaseModel):
495
487
  id: IDAutoRouter
496
488
 
497
489
  enabled: Optional[bool] = None
@@ -501,25 +493,25 @@ class OpenResponsesRequestPluginAutoRouter(BaseModel):
501
493
  r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."""
502
494
 
503
495
 
504
- OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
505
- "OpenResponsesRequestPluginUnionTypedDict",
496
+ PluginTypedDict = TypeAliasType(
497
+ "PluginTypedDict",
506
498
  Union[
507
- OpenResponsesRequestPluginModerationTypedDict,
508
- OpenResponsesRequestPluginResponseHealingTypedDict,
509
- OpenResponsesRequestPluginAutoRouterTypedDict,
510
- OpenResponsesRequestPluginFileParserTypedDict,
511
- OpenResponsesRequestPluginWebTypedDict,
499
+ PluginModerationTypedDict,
500
+ PluginResponseHealingTypedDict,
501
+ PluginAutoRouterTypedDict,
502
+ PluginFileParserTypedDict,
503
+ PluginWebTypedDict,
512
504
  ],
513
505
  )
514
506
 
515
507
 
516
- OpenResponsesRequestPluginUnion = Annotated[
508
+ Plugin = Annotated[
517
509
  Union[
518
- Annotated[OpenResponsesRequestPluginAutoRouter, Tag("auto-router")],
519
- Annotated[OpenResponsesRequestPluginModeration, Tag("moderation")],
520
- Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
521
- Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
522
- Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")],
510
+ Annotated[PluginAutoRouter, Tag("auto-router")],
511
+ Annotated[PluginModeration, Tag("moderation")],
512
+ Annotated[PluginWeb, Tag("web")],
513
+ Annotated[PluginFileParser, Tag("file-parser")],
514
+ Annotated[PluginResponseHealing, Tag("response-healing")],
523
515
  ],
524
516
  Discriminator(lambda m: get_discriminator(m, "id", "id")),
525
517
  ]
@@ -564,9 +556,9 @@ class OpenResponsesRequestTypedDict(TypedDict):
564
556
  service_tier: NotRequired[ServiceTier]
565
557
  truncation: NotRequired[Nullable[Truncation]]
566
558
  stream: NotRequired[bool]
567
- provider: NotRequired[Nullable[OpenResponsesRequestProviderTypedDict]]
559
+ provider: NotRequired[Nullable[ProviderTypedDict]]
568
560
  r"""When multiple model providers are available, optionally indicate your routing preference."""
569
- plugins: NotRequired[List[OpenResponsesRequestPluginUnionTypedDict]]
561
+ plugins: NotRequired[List[PluginTypedDict]]
570
562
  r"""Plugins you want to enable for this request, including their settings."""
571
563
  user: NotRequired[str]
572
564
  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."""
@@ -660,10 +652,10 @@ class OpenResponsesRequest(BaseModel):
660
652
 
661
653
  stream: Optional[bool] = False
662
654
 
663
- provider: OptionalNullable[OpenResponsesRequestProvider] = UNSET
655
+ provider: OptionalNullable[Provider] = UNSET
664
656
  r"""When multiple model providers are available, optionally indicate your routing preference."""
665
657
 
666
- plugins: Optional[List[OpenResponsesRequestPluginUnion]] = None
658
+ plugins: Optional[List[Plugin]] = None
667
659
  r"""Plugins you want to enable for this request, including their settings."""
668
660
 
669
661
  user: Optional[str] = None
@@ -10,6 +10,7 @@ OutputModality = Union[
10
10
  "text",
11
11
  "image",
12
12
  "embeddings",
13
+ "audio",
13
14
  ],
14
15
  UnrecognizedStr,
15
16
  ]
@@ -10,6 +10,7 @@ ProviderName = Union[
10
10
  "AI21",
11
11
  "AionLabs",
12
12
  "Alibaba",
13
+ "Ambient",
13
14
  "Amazon Bedrock",
14
15
  "Amazon Nova",
15
16
  "Anthropic",
@@ -66,6 +67,7 @@ ProviderName = Union[
66
67
  "Seed",
67
68
  "SiliconFlow",
68
69
  "Sourceful",
70
+ "StepFun",
69
71
  "Stealth",
70
72
  "StreamLake",
71
73
  "Switchpoint",
@@ -176,34 +176,26 @@ class ProviderPreferencesMaxPriceTypedDict(TypedDict):
176
176
  r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
177
177
 
178
178
  prompt: NotRequired[str]
179
- r"""A value in string format that is a large number"""
179
+ r"""Price per million prompt tokens"""
180
180
  completion: NotRequired[str]
181
- r"""A value in string format that is a large number"""
182
181
  image: NotRequired[str]
183
- r"""A value in string format that is a large number"""
184
182
  audio: NotRequired[str]
185
- r"""A value in string format that is a large number"""
186
183
  request: NotRequired[str]
187
- r"""A value in string format that is a large number"""
188
184
 
189
185
 
190
186
  class ProviderPreferencesMaxPrice(BaseModel):
191
187
  r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
192
188
 
193
189
  prompt: Optional[str] = None
194
- r"""A value in string format that is a large number"""
190
+ r"""Price per million prompt tokens"""
195
191
 
196
192
  completion: Optional[str] = None
197
- r"""A value in string format that is a large number"""
198
193
 
199
194
  image: Optional[str] = None
200
- r"""A value in string format that is a large number"""
201
195
 
202
196
  audio: Optional[str] = None
203
- r"""A value in string format that is a large number"""
204
197
 
205
198
  request: Optional[str] = None
206
- r"""A value in string format that is a large number"""
207
199
 
208
200
 
209
201
  class ProviderPreferencesTypedDict(TypedDict):
@@ -15,68 +15,47 @@ from typing_extensions import Annotated, NotRequired, TypedDict
15
15
 
16
16
  class PricingTypedDict(TypedDict):
17
17
  prompt: str
18
- r"""A value in string format that is a large number"""
19
18
  completion: str
20
- r"""A value in string format that is a large number"""
21
19
  request: NotRequired[str]
22
- r"""A value in string format that is a large number"""
23
20
  image: NotRequired[str]
24
- r"""A value in string format that is a large number"""
25
21
  image_token: NotRequired[str]
26
- r"""A value in string format that is a large number"""
27
22
  image_output: NotRequired[str]
28
- r"""A value in string format that is a large number"""
29
23
  audio: NotRequired[str]
30
- r"""A value in string format that is a large number"""
24
+ audio_output: NotRequired[str]
31
25
  input_audio_cache: NotRequired[str]
32
- r"""A value in string format that is a large number"""
33
26
  web_search: NotRequired[str]
34
- r"""A value in string format that is a large number"""
35
27
  internal_reasoning: NotRequired[str]
36
- r"""A value in string format that is a large number"""
37
28
  input_cache_read: NotRequired[str]
38
- r"""A value in string format that is a large number"""
39
29
  input_cache_write: NotRequired[str]
40
- r"""A value in string format that is a large number"""
41
30
  discount: NotRequired[float]
42
31
 
43
32
 
44
33
  class Pricing(BaseModel):
45
34
  prompt: str
46
- r"""A value in string format that is a large number"""
47
35
 
48
36
  completion: str
49
- r"""A value in string format that is a large number"""
50
37
 
51
38
  request: Optional[str] = None
52
- r"""A value in string format that is a large number"""
53
39
 
54
40
  image: Optional[str] = None
55
- r"""A value in string format that is a large number"""
56
41
 
57
42
  image_token: Optional[str] = None
58
- r"""A value in string format that is a large number"""
59
43
 
60
44
  image_output: Optional[str] = None
61
- r"""A value in string format that is a large number"""
62
45
 
63
46
  audio: Optional[str] = None
64
- r"""A value in string format that is a large number"""
47
+
48
+ audio_output: Optional[str] = None
65
49
 
66
50
  input_audio_cache: Optional[str] = None
67
- r"""A value in string format that is a large number"""
68
51
 
69
52
  web_search: Optional[str] = None
70
- r"""A value in string format that is a large number"""
71
53
 
72
54
  internal_reasoning: Optional[str] = None
73
- r"""A value in string format that is a large number"""
74
55
 
75
56
  input_cache_read: Optional[str] = None
76
- r"""A value in string format that is a large number"""
77
57
 
78
58
  input_cache_write: Optional[str] = None
79
- r"""A value in string format that is a large number"""
80
59
 
81
60
  discount: Optional[float] = None
82
61
 
@@ -101,6 +80,8 @@ class PublicEndpointTypedDict(TypedDict):
101
80
  r"""Information about a specific model endpoint"""
102
81
 
103
82
  name: str
83
+ model_id: str
84
+ r"""The unique identifier for the model (permaslug)"""
104
85
  model_name: str
105
86
  context_length: float
106
87
  pricing: PricingTypedDict
@@ -123,6 +104,9 @@ class PublicEndpoint(BaseModel):
123
104
 
124
105
  name: str
125
106
 
107
+ model_id: str
108
+ r"""The unique identifier for the model (permaslug)"""
109
+
126
110
  model_name: str
127
111
 
128
112
  context_length: float
@@ -10,29 +10,18 @@ class PublicPricingTypedDict(TypedDict):
10
10
  r"""Pricing information for the model"""
11
11
 
12
12
  prompt: str
13
- r"""A value in string format that is a large number"""
14
13
  completion: str
15
- r"""A value in string format that is a large number"""
16
14
  request: NotRequired[str]
17
- r"""A value in string format that is a large number"""
18
15
  image: NotRequired[str]
19
- r"""A value in string format that is a large number"""
20
16
  image_token: NotRequired[str]
21
- r"""A value in string format that is a large number"""
22
17
  image_output: NotRequired[str]
23
- r"""A value in string format that is a large number"""
24
18
  audio: NotRequired[str]
25
- r"""A value in string format that is a large number"""
19
+ audio_output: NotRequired[str]
26
20
  input_audio_cache: NotRequired[str]
27
- r"""A value in string format that is a large number"""
28
21
  web_search: NotRequired[str]
29
- r"""A value in string format that is a large number"""
30
22
  internal_reasoning: NotRequired[str]
31
- r"""A value in string format that is a large number"""
32
23
  input_cache_read: NotRequired[str]
33
- r"""A value in string format that is a large number"""
34
24
  input_cache_write: NotRequired[str]
35
- r"""A value in string format that is a large number"""
36
25
  discount: NotRequired[float]
37
26
 
38
27
 
@@ -40,39 +29,29 @@ class PublicPricing(BaseModel):
40
29
  r"""Pricing information for the model"""
41
30
 
42
31
  prompt: str
43
- r"""A value in string format that is a large number"""
44
32
 
45
33
  completion: str
46
- r"""A value in string format that is a large number"""
47
34
 
48
35
  request: Optional[str] = None
49
- r"""A value in string format that is a large number"""
50
36
 
51
37
  image: Optional[str] = None
52
- r"""A value in string format that is a large number"""
53
38
 
54
39
  image_token: Optional[str] = None
55
- r"""A value in string format that is a large number"""
56
40
 
57
41
  image_output: Optional[str] = None
58
- r"""A value in string format that is a large number"""
59
42
 
60
43
  audio: Optional[str] = None
61
- r"""A value in string format that is a large number"""
44
+
45
+ audio_output: Optional[str] = None
62
46
 
63
47
  input_audio_cache: Optional[str] = None
64
- r"""A value in string format that is a large number"""
65
48
 
66
49
  web_search: Optional[str] = None
67
- r"""A value in string format that is a large number"""
68
50
 
69
51
  internal_reasoning: Optional[str] = None
70
- r"""A value in string format that is a large number"""
71
52
 
72
53
  input_cache_read: Optional[str] = None
73
- r"""A value in string format that is a large number"""
74
54
 
75
55
  input_cache_write: Optional[str] = None
76
- r"""A value in string format that is a large number"""
77
56
 
78
57
  discount: Optional[float] = None