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,116 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from openrouter.types import BaseModel
5
+ from openrouter.utils import (
6
+ FieldMetadata,
7
+ HeaderMetadata,
8
+ PathParamMetadata,
9
+ RequestMetadata,
10
+ )
11
+ import pydantic
12
+ from typing import List, Optional
13
+ from typing_extensions import Annotated, NotRequired, TypedDict
14
+
15
+
16
+ class BulkAssignKeysToGuardrailGlobalsTypedDict(TypedDict):
17
+ http_referer: NotRequired[str]
18
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
19
+ This is used to track API usage per application.
20
+
21
+ """
22
+ x_title: NotRequired[str]
23
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
24
+
25
+ """
26
+
27
+
28
+ class BulkAssignKeysToGuardrailGlobals(BaseModel):
29
+ http_referer: Annotated[
30
+ Optional[str],
31
+ pydantic.Field(alias="HTTP-Referer"),
32
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
33
+ ] = None
34
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
35
+ This is used to track API usage per application.
36
+
37
+ """
38
+
39
+ x_title: Annotated[
40
+ Optional[str],
41
+ pydantic.Field(alias="X-Title"),
42
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
43
+ ] = None
44
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
45
+
46
+ """
47
+
48
+
49
+ class BulkAssignKeysToGuardrailRequestBodyTypedDict(TypedDict):
50
+ key_hashes: List[str]
51
+ r"""Array of API key hashes to assign to the guardrail"""
52
+
53
+
54
+ class BulkAssignKeysToGuardrailRequestBody(BaseModel):
55
+ key_hashes: List[str]
56
+ r"""Array of API key hashes to assign to the guardrail"""
57
+
58
+
59
+ class BulkAssignKeysToGuardrailRequestTypedDict(TypedDict):
60
+ id: str
61
+ r"""The unique identifier of the guardrail"""
62
+ request_body: BulkAssignKeysToGuardrailRequestBodyTypedDict
63
+ http_referer: NotRequired[str]
64
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
65
+ This is used to track API usage per application.
66
+
67
+ """
68
+ x_title: NotRequired[str]
69
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
70
+
71
+ """
72
+
73
+
74
+ class BulkAssignKeysToGuardrailRequest(BaseModel):
75
+ id: Annotated[
76
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
77
+ ]
78
+ r"""The unique identifier of the guardrail"""
79
+
80
+ request_body: Annotated[
81
+ BulkAssignKeysToGuardrailRequestBody,
82
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
83
+ ]
84
+
85
+ http_referer: Annotated[
86
+ Optional[str],
87
+ pydantic.Field(alias="HTTP-Referer"),
88
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
89
+ ] = None
90
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
91
+ This is used to track API usage per application.
92
+
93
+ """
94
+
95
+ x_title: Annotated[
96
+ Optional[str],
97
+ pydantic.Field(alias="X-Title"),
98
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
99
+ ] = None
100
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
101
+
102
+ """
103
+
104
+
105
+ class BulkAssignKeysToGuardrailResponseTypedDict(TypedDict):
106
+ r"""Assignment result"""
107
+
108
+ assigned_count: float
109
+ r"""Number of keys successfully assigned"""
110
+
111
+
112
+ class BulkAssignKeysToGuardrailResponse(BaseModel):
113
+ r"""Assignment result"""
114
+
115
+ assigned_count: float
116
+ r"""Number of keys successfully assigned"""
@@ -0,0 +1,116 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from openrouter.types import BaseModel
5
+ from openrouter.utils import (
6
+ FieldMetadata,
7
+ HeaderMetadata,
8
+ PathParamMetadata,
9
+ RequestMetadata,
10
+ )
11
+ import pydantic
12
+ from typing import List, Optional
13
+ from typing_extensions import Annotated, NotRequired, TypedDict
14
+
15
+
16
+ class BulkAssignMembersToGuardrailGlobalsTypedDict(TypedDict):
17
+ http_referer: NotRequired[str]
18
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
19
+ This is used to track API usage per application.
20
+
21
+ """
22
+ x_title: NotRequired[str]
23
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
24
+
25
+ """
26
+
27
+
28
+ class BulkAssignMembersToGuardrailGlobals(BaseModel):
29
+ http_referer: Annotated[
30
+ Optional[str],
31
+ pydantic.Field(alias="HTTP-Referer"),
32
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
33
+ ] = None
34
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
35
+ This is used to track API usage per application.
36
+
37
+ """
38
+
39
+ x_title: Annotated[
40
+ Optional[str],
41
+ pydantic.Field(alias="X-Title"),
42
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
43
+ ] = None
44
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
45
+
46
+ """
47
+
48
+
49
+ class BulkAssignMembersToGuardrailRequestBodyTypedDict(TypedDict):
50
+ member_user_ids: List[str]
51
+ r"""Array of member user IDs to assign to the guardrail"""
52
+
53
+
54
+ class BulkAssignMembersToGuardrailRequestBody(BaseModel):
55
+ member_user_ids: List[str]
56
+ r"""Array of member user IDs to assign to the guardrail"""
57
+
58
+
59
+ class BulkAssignMembersToGuardrailRequestTypedDict(TypedDict):
60
+ id: str
61
+ r"""The unique identifier of the guardrail"""
62
+ request_body: BulkAssignMembersToGuardrailRequestBodyTypedDict
63
+ http_referer: NotRequired[str]
64
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
65
+ This is used to track API usage per application.
66
+
67
+ """
68
+ x_title: NotRequired[str]
69
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
70
+
71
+ """
72
+
73
+
74
+ class BulkAssignMembersToGuardrailRequest(BaseModel):
75
+ id: Annotated[
76
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
77
+ ]
78
+ r"""The unique identifier of the guardrail"""
79
+
80
+ request_body: Annotated[
81
+ BulkAssignMembersToGuardrailRequestBody,
82
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
83
+ ]
84
+
85
+ http_referer: Annotated[
86
+ Optional[str],
87
+ pydantic.Field(alias="HTTP-Referer"),
88
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
89
+ ] = None
90
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
91
+ This is used to track API usage per application.
92
+
93
+ """
94
+
95
+ x_title: Annotated[
96
+ Optional[str],
97
+ pydantic.Field(alias="X-Title"),
98
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
99
+ ] = None
100
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
101
+
102
+ """
103
+
104
+
105
+ class BulkAssignMembersToGuardrailResponseTypedDict(TypedDict):
106
+ r"""Assignment result"""
107
+
108
+ assigned_count: float
109
+ r"""Number of members successfully assigned"""
110
+
111
+
112
+ class BulkAssignMembersToGuardrailResponse(BaseModel):
113
+ r"""Assignment result"""
114
+
115
+ assigned_count: float
116
+ r"""Number of members successfully assigned"""
@@ -0,0 +1,116 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from openrouter.types import BaseModel
5
+ from openrouter.utils import (
6
+ FieldMetadata,
7
+ HeaderMetadata,
8
+ PathParamMetadata,
9
+ RequestMetadata,
10
+ )
11
+ import pydantic
12
+ from typing import List, Optional
13
+ from typing_extensions import Annotated, NotRequired, TypedDict
14
+
15
+
16
+ class BulkUnassignKeysFromGuardrailGlobalsTypedDict(TypedDict):
17
+ http_referer: NotRequired[str]
18
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
19
+ This is used to track API usage per application.
20
+
21
+ """
22
+ x_title: NotRequired[str]
23
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
24
+
25
+ """
26
+
27
+
28
+ class BulkUnassignKeysFromGuardrailGlobals(BaseModel):
29
+ http_referer: Annotated[
30
+ Optional[str],
31
+ pydantic.Field(alias="HTTP-Referer"),
32
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
33
+ ] = None
34
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
35
+ This is used to track API usage per application.
36
+
37
+ """
38
+
39
+ x_title: Annotated[
40
+ Optional[str],
41
+ pydantic.Field(alias="X-Title"),
42
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
43
+ ] = None
44
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
45
+
46
+ """
47
+
48
+
49
+ class BulkUnassignKeysFromGuardrailRequestBodyTypedDict(TypedDict):
50
+ key_hashes: List[str]
51
+ r"""Array of API key hashes to unassign from the guardrail"""
52
+
53
+
54
+ class BulkUnassignKeysFromGuardrailRequestBody(BaseModel):
55
+ key_hashes: List[str]
56
+ r"""Array of API key hashes to unassign from the guardrail"""
57
+
58
+
59
+ class BulkUnassignKeysFromGuardrailRequestTypedDict(TypedDict):
60
+ id: str
61
+ r"""The unique identifier of the guardrail"""
62
+ request_body: BulkUnassignKeysFromGuardrailRequestBodyTypedDict
63
+ http_referer: NotRequired[str]
64
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
65
+ This is used to track API usage per application.
66
+
67
+ """
68
+ x_title: NotRequired[str]
69
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
70
+
71
+ """
72
+
73
+
74
+ class BulkUnassignKeysFromGuardrailRequest(BaseModel):
75
+ id: Annotated[
76
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
77
+ ]
78
+ r"""The unique identifier of the guardrail"""
79
+
80
+ request_body: Annotated[
81
+ BulkUnassignKeysFromGuardrailRequestBody,
82
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
83
+ ]
84
+
85
+ http_referer: Annotated[
86
+ Optional[str],
87
+ pydantic.Field(alias="HTTP-Referer"),
88
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
89
+ ] = None
90
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
91
+ This is used to track API usage per application.
92
+
93
+ """
94
+
95
+ x_title: Annotated[
96
+ Optional[str],
97
+ pydantic.Field(alias="X-Title"),
98
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
99
+ ] = None
100
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
101
+
102
+ """
103
+
104
+
105
+ class BulkUnassignKeysFromGuardrailResponseTypedDict(TypedDict):
106
+ r"""Unassignment result"""
107
+
108
+ unassigned_count: float
109
+ r"""Number of keys successfully unassigned"""
110
+
111
+
112
+ class BulkUnassignKeysFromGuardrailResponse(BaseModel):
113
+ r"""Unassignment result"""
114
+
115
+ unassigned_count: float
116
+ r"""Number of keys successfully unassigned"""
@@ -0,0 +1,116 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from openrouter.types import BaseModel
5
+ from openrouter.utils import (
6
+ FieldMetadata,
7
+ HeaderMetadata,
8
+ PathParamMetadata,
9
+ RequestMetadata,
10
+ )
11
+ import pydantic
12
+ from typing import List, Optional
13
+ from typing_extensions import Annotated, NotRequired, TypedDict
14
+
15
+
16
+ class BulkUnassignMembersFromGuardrailGlobalsTypedDict(TypedDict):
17
+ http_referer: NotRequired[str]
18
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
19
+ This is used to track API usage per application.
20
+
21
+ """
22
+ x_title: NotRequired[str]
23
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
24
+
25
+ """
26
+
27
+
28
+ class BulkUnassignMembersFromGuardrailGlobals(BaseModel):
29
+ http_referer: Annotated[
30
+ Optional[str],
31
+ pydantic.Field(alias="HTTP-Referer"),
32
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
33
+ ] = None
34
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
35
+ This is used to track API usage per application.
36
+
37
+ """
38
+
39
+ x_title: Annotated[
40
+ Optional[str],
41
+ pydantic.Field(alias="X-Title"),
42
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
43
+ ] = None
44
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
45
+
46
+ """
47
+
48
+
49
+ class BulkUnassignMembersFromGuardrailRequestBodyTypedDict(TypedDict):
50
+ member_user_ids: List[str]
51
+ r"""Array of member user IDs to unassign from the guardrail"""
52
+
53
+
54
+ class BulkUnassignMembersFromGuardrailRequestBody(BaseModel):
55
+ member_user_ids: List[str]
56
+ r"""Array of member user IDs to unassign from the guardrail"""
57
+
58
+
59
+ class BulkUnassignMembersFromGuardrailRequestTypedDict(TypedDict):
60
+ id: str
61
+ r"""The unique identifier of the guardrail"""
62
+ request_body: BulkUnassignMembersFromGuardrailRequestBodyTypedDict
63
+ http_referer: NotRequired[str]
64
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
65
+ This is used to track API usage per application.
66
+
67
+ """
68
+ x_title: NotRequired[str]
69
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
70
+
71
+ """
72
+
73
+
74
+ class BulkUnassignMembersFromGuardrailRequest(BaseModel):
75
+ id: Annotated[
76
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
77
+ ]
78
+ r"""The unique identifier of the guardrail"""
79
+
80
+ request_body: Annotated[
81
+ BulkUnassignMembersFromGuardrailRequestBody,
82
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
83
+ ]
84
+
85
+ http_referer: Annotated[
86
+ Optional[str],
87
+ pydantic.Field(alias="HTTP-Referer"),
88
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
89
+ ] = None
90
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
91
+ This is used to track API usage per application.
92
+
93
+ """
94
+
95
+ x_title: Annotated[
96
+ Optional[str],
97
+ pydantic.Field(alias="X-Title"),
98
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
99
+ ] = None
100
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
101
+
102
+ """
103
+
104
+
105
+ class BulkUnassignMembersFromGuardrailResponseTypedDict(TypedDict):
106
+ r"""Unassignment result"""
107
+
108
+ unassigned_count: float
109
+ r"""Number of members successfully unassigned"""
110
+
111
+
112
+ class BulkUnassignMembersFromGuardrailResponse(BaseModel):
113
+ r"""Unassignment result"""
114
+
115
+ unassigned_count: float
116
+ r"""Number of members successfully unassigned"""
@@ -10,13 +10,52 @@ from openrouter.types import (
10
10
  UNSET_SENTINEL,
11
11
  UnrecognizedStr,
12
12
  )
13
- from openrouter.utils import validate_open_enum
13
+ from openrouter.utils import (
14
+ FieldMetadata,
15
+ HeaderMetadata,
16
+ RequestMetadata,
17
+ validate_open_enum,
18
+ )
19
+ import pydantic
14
20
  from pydantic import model_serializer
15
21
  from pydantic.functional_validators import PlainValidator
16
22
  from typing import Literal, Optional, Union
17
23
  from typing_extensions import Annotated, NotRequired, TypedDict
18
24
 
19
25
 
26
+ class CreateAuthKeysCodeGlobalsTypedDict(TypedDict):
27
+ http_referer: NotRequired[str]
28
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
29
+ This is used to track API usage per application.
30
+
31
+ """
32
+ x_title: NotRequired[str]
33
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
34
+
35
+ """
36
+
37
+
38
+ class CreateAuthKeysCodeGlobals(BaseModel):
39
+ http_referer: Annotated[
40
+ Optional[str],
41
+ pydantic.Field(alias="HTTP-Referer"),
42
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
43
+ ] = None
44
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
45
+ This is used to track API usage per application.
46
+
47
+ """
48
+
49
+ x_title: Annotated[
50
+ Optional[str],
51
+ pydantic.Field(alias="X-Title"),
52
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
53
+ ] = None
54
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
55
+
56
+ """
57
+
58
+
20
59
  CreateAuthKeysCodeCodeChallengeMethod = Union[
21
60
  Literal[
22
61
  "S256",
@@ -27,7 +66,7 @@ CreateAuthKeysCodeCodeChallengeMethod = Union[
27
66
  r"""The method used to generate the code challenge"""
28
67
 
29
68
 
30
- class CreateAuthKeysCodeRequestTypedDict(TypedDict):
69
+ class CreateAuthKeysCodeRequestBodyTypedDict(TypedDict):
31
70
  callback_url: str
32
71
  r"""The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed."""
33
72
  code_challenge: NotRequired[str]
@@ -40,7 +79,7 @@ class CreateAuthKeysCodeRequestTypedDict(TypedDict):
40
79
  r"""Optional expiration time for the API key to be created"""
41
80
 
42
81
 
43
- class CreateAuthKeysCodeRequest(BaseModel):
82
+ class CreateAuthKeysCodeRequestBody(BaseModel):
44
83
  callback_url: str
45
84
  r"""The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed."""
46
85
 
@@ -95,6 +134,45 @@ class CreateAuthKeysCodeRequest(BaseModel):
95
134
  return m
96
135
 
97
136
 
137
+ class CreateAuthKeysCodeRequestTypedDict(TypedDict):
138
+ request_body: CreateAuthKeysCodeRequestBodyTypedDict
139
+ http_referer: NotRequired[str]
140
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
141
+ This is used to track API usage per application.
142
+
143
+ """
144
+ x_title: NotRequired[str]
145
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
146
+
147
+ """
148
+
149
+
150
+ class CreateAuthKeysCodeRequest(BaseModel):
151
+ request_body: Annotated[
152
+ CreateAuthKeysCodeRequestBody,
153
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
154
+ ]
155
+
156
+ http_referer: Annotated[
157
+ Optional[str],
158
+ pydantic.Field(alias="HTTP-Referer"),
159
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
160
+ ] = None
161
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
162
+ This is used to track API usage per application.
163
+
164
+ """
165
+
166
+ x_title: Annotated[
167
+ Optional[str],
168
+ pydantic.Field(alias="X-Title"),
169
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
170
+ ] = None
171
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
172
+
173
+ """
174
+
175
+
98
176
  class CreateAuthKeysCodeDataTypedDict(TypedDict):
99
177
  r"""Auth code data"""
100
178
 
@@ -1,9 +1,50 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from openrouter.components import createchargerequest as components_createchargerequest
4
5
  from openrouter.types import BaseModel
5
- from openrouter.utils import FieldMetadata, SecurityMetadata
6
- from typing_extensions import Annotated, TypedDict
6
+ from openrouter.utils import (
7
+ FieldMetadata,
8
+ HeaderMetadata,
9
+ RequestMetadata,
10
+ SecurityMetadata,
11
+ )
12
+ import pydantic
13
+ from typing import Optional
14
+ from typing_extensions import Annotated, NotRequired, TypedDict
15
+
16
+
17
+ class CreateCoinbaseChargeGlobalsTypedDict(TypedDict):
18
+ http_referer: NotRequired[str]
19
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
20
+ This is used to track API usage per application.
21
+
22
+ """
23
+ x_title: NotRequired[str]
24
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
25
+
26
+ """
27
+
28
+
29
+ class CreateCoinbaseChargeGlobals(BaseModel):
30
+ http_referer: Annotated[
31
+ Optional[str],
32
+ pydantic.Field(alias="HTTP-Referer"),
33
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
34
+ ] = None
35
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
36
+ This is used to track API usage per application.
37
+
38
+ """
39
+
40
+ x_title: Annotated[
41
+ Optional[str],
42
+ pydantic.Field(alias="X-Title"),
43
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
44
+ ] = None
45
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
46
+
47
+ """
7
48
 
8
49
 
9
50
  class CreateCoinbaseChargeSecurityTypedDict(TypedDict):
@@ -24,6 +65,45 @@ class CreateCoinbaseChargeSecurity(BaseModel):
24
65
  ]
25
66
 
26
67
 
68
+ class CreateCoinbaseChargeRequestTypedDict(TypedDict):
69
+ create_charge_request: components_createchargerequest.CreateChargeRequestTypedDict
70
+ http_referer: NotRequired[str]
71
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
72
+ This is used to track API usage per application.
73
+
74
+ """
75
+ x_title: NotRequired[str]
76
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
77
+
78
+ """
79
+
80
+
81
+ class CreateCoinbaseChargeRequest(BaseModel):
82
+ create_charge_request: Annotated[
83
+ components_createchargerequest.CreateChargeRequest,
84
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
85
+ ]
86
+
87
+ http_referer: Annotated[
88
+ Optional[str],
89
+ pydantic.Field(alias="HTTP-Referer"),
90
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
91
+ ] = None
92
+ r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
93
+ This is used to track API usage per application.
94
+
95
+ """
96
+
97
+ x_title: Annotated[
98
+ Optional[str],
99
+ pydantic.Field(alias="X-Title"),
100
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
101
+ ] = None
102
+ r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
103
+
104
+ """
105
+
106
+
27
107
  class CallDataTypedDict(TypedDict):
28
108
  deadline: str
29
109
  fee_amount: str