Compare commits

..
1 Commits
Author SHA1 Message Date
OpenRouter Team 9bd5d826d8 Commits included in this export:
- 45687f423707f5838461585c568a024a19eb2f06
  - 3103d3ca68b6e42ccdb6136588ec2b6edc8dcab0
  - fd9f991606027cd86116317c71f8eb7b4e2aa3eb
  - 0f312019161edd76c1e5923d142c788d22f096d5
  - 5dbab2094bc744db4a90b3097520d897e5d0d634
  - 4c47d1af1735db18a1c1a7f463e801c7f71ad4e5

GitOrigin-RevId: 45687f423707f5838461585c568a024a19eb2f06
2026-02-20 19:10:44 +00:00
27 changed files with 159 additions and 22 deletions
+4 -3
View File
@@ -1,12 +1,12 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
management: management:
docChecksum: a8fed71df7458c6d948fc393e17aa9bc docChecksum: 44cf69670d08f875912803fcbf819e62
docVersion: 1.0.0 docVersion: 1.0.0
speakeasyVersion: 1.666.0 speakeasyVersion: 1.666.0
generationVersion: 2.768.0 generationVersion: 2.768.0
releaseVersion: 0.7.0 releaseVersion: 0.7.3
configChecksum: fb83a92d2ee84da7390a12353d622d23 configChecksum: b2d1a05e03508d9e74db24120e9e88e2
repoURL: https://github.com/OpenRouterTeam/python-sdk.git repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true published: true
@@ -666,6 +666,7 @@ generatedFiles:
- docs/operations/updatekeysrequestbody.md - docs/operations/updatekeysrequestbody.md
- docs/operations/updatekeysresponse.md - docs/operations/updatekeysresponse.md
- docs/operations/usage.md - docs/operations/usage.md
- docs/operations/usagelimittype.md
- docs/operations/web3data.md - docs/operations/web3data.md
- docs/sdks/analytics/README.md - docs/sdks/analytics/README.md
- docs/sdks/apikeys/README.md - docs/sdks/apikeys/README.md
+1 -1
View File
@@ -31,7 +31,7 @@ generation:
skipResponseBodyAssertions: false skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true preApplyUnionDiscriminators: true
python: python:
version: 0.7.0 version: 0.7.3
additionalDependencies: additionalDependencies:
dev: {} dev: {}
main: {} main: {}
+22 -2
View File
@@ -3574,6 +3574,7 @@ components:
- Inceptron - Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Io Net
- Inflection - Inflection
- Liquid - Liquid
- Mara - Mara
@@ -7545,7 +7546,6 @@ components:
required: required:
- prompt - prompt
- completion - completion
additionalProperties: false
description: Pricing information for the model description: Pricing information for the model
example: example:
prompt: '0.00003' prompt: '0.00003'
@@ -8053,7 +8053,6 @@ components:
required: required:
- prompt - prompt
- completion - completion
additionalProperties: false
provider_name: provider_name:
$ref: '#/components/schemas/ProviderName' $ref: '#/components/schemas/ProviderName'
tag: tag:
@@ -8388,6 +8387,7 @@ components:
- Inceptron - Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Io Net
- Inflection - Inflection
- Liquid - Liquid
- Mara - Mara
@@ -9106,6 +9106,8 @@ components:
- type: 'null' - type: 'null'
required: required:
- name - name
cache_control:
$ref: '#/components/schemas/ChatMessageContentItemCacheControl'
required: required:
- type - type
- function - function
@@ -9299,6 +9301,10 @@ components:
minimum: 0 minimum: 0
maximum: 2 maximum: 2
- type: 'null' - type: 'null'
parallel_tool_calls:
anyOf:
- type: boolean
- type: 'null'
tool_choice: tool_choice:
$ref: '#/components/schemas/ToolChoiceOption' $ref: '#/components/schemas/ToolChoiceOption'
tools: tools:
@@ -10616,6 +10622,7 @@ paths:
- Inceptron - Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Io Net
- Inflection - Inflection
- Liquid - Liquid
- Mara - Mara
@@ -13768,6 +13775,19 @@ paths:
nullable: true nullable: true
format: date-time format: date-time
description: Optional expiration time for the API key to be created description: Optional expiration time for the API key to be created
key_label:
type: string
maxLength: 100
description: Optional custom label for the API key. Defaults to the app name if not provided.
example: My Custom Key
usage_limit_type:
type: string
enum:
- daily
- weekly
- monthly
description: Optional credit limit reset interval. When set, the credit limit resets on this interval.
example: monthly
required: required:
- callback_url - callback_url
example: example:
+23 -2
View File
@@ -3593,6 +3593,7 @@ components:
- Inceptron - Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Io Net
- Inflection - Inflection
- Liquid - Liquid
- Mara - Mara
@@ -7551,7 +7552,6 @@ components:
required: required:
- prompt - prompt
- completion - completion
additionalProperties: false
description: Pricing information for the model description: Pricing information for the model
example: example:
prompt: '0.00003' prompt: '0.00003'
@@ -8065,7 +8065,6 @@ components:
required: required:
- prompt - prompt
- completion - completion
additionalProperties: false
provider_name: provider_name:
$ref: '#/components/schemas/ProviderName' $ref: '#/components/schemas/ProviderName'
tag: tag:
@@ -8384,6 +8383,7 @@ components:
- Inceptron - Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Io Net
- Inflection - Inflection
- Liquid - Liquid
- Mara - Mara
@@ -9110,6 +9110,8 @@ components:
- type: 'null' - type: 'null'
required: required:
- name - name
cache_control:
$ref: '#/components/schemas/ChatMessageContentItemCacheControl'
required: required:
- type - type
- function - function
@@ -9301,6 +9303,10 @@ components:
minimum: 0 minimum: 0
maximum: 2 maximum: 2
- type: 'null' - type: 'null'
parallel_tool_calls:
anyOf:
- type: boolean
- type: 'null'
tool_choice: tool_choice:
$ref: '#/components/schemas/ToolChoiceOption' $ref: '#/components/schemas/ToolChoiceOption'
tools: tools:
@@ -10639,6 +10645,7 @@ paths:
- Inceptron - Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Io Net
- Inflection - Inflection
- Liquid - Liquid
- Mara - Mara
@@ -13827,6 +13834,20 @@ paths:
nullable: true nullable: true
format: date-time format: date-time
description: Optional expiration time for the API key to be created description: Optional expiration time for the API key to be created
key_label:
type: string
maxLength: 100
description: Optional custom label for the API key. Defaults to the app name if not provided.
example: My Custom Key
usage_limit_type:
type: string
enum:
- daily
- weekly
- monthly
description: Optional credit limit reset interval. When set, the credit limit resets on this interval.
example: monthly
x-speakeasy-unknown-values: allow
required: required:
- callback_url - callback_url
example: example:
+5 -5
View File
@@ -8,8 +8,8 @@ sources:
- latest - latest
OpenRouter API: OpenRouter API:
sourceNamespace: open-router-chat-completions-api sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:79b8d064e91a2614d9853eb640f9e7255a8b1e9614882641ab5c75ac071814d6 sourceRevisionDigest: sha256:c35c30cefa7374fca9158283ca25f10c981f1098509d9e4ac03cbfed356479df
sourceBlobDigest: sha256:b74fe6d34af037172e5b80f6d03b85df45eb5360577027682ea7d3fd308e8293 sourceBlobDigest: sha256:c09875e3f18d78b78c948d40ec1a5ac7af9be1725db1ee5c7cd2bbe8bb446ffb
tags: tags:
- latest - latest
- main - main
@@ -18,10 +18,10 @@ targets:
open-router: open-router:
source: OpenRouter API source: OpenRouter API
sourceNamespace: open-router-chat-completions-api sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:79b8d064e91a2614d9853eb640f9e7255a8b1e9614882641ab5c75ac071814d6 sourceRevisionDigest: sha256:c35c30cefa7374fca9158283ca25f10c981f1098509d9e4ac03cbfed356479df
sourceBlobDigest: sha256:b74fe6d34af037172e5b80f6d03b85df45eb5360577027682ea7d3fd308e8293 sourceBlobDigest: sha256:c09875e3f18d78b78c948d40ec1a5ac7af9be1725db1ee5c7cd2bbe8bb446ffb
codeSamplesNamespace: open-router-python-code-samples codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:ff5b83e50996943aaf26b9089fd02488fc49b8c5f742dc432135c8eeb69c7042 codeSamplesRevisionDigest: sha256:0fdbb46fc2029d053bd04962e251a7cd3cfcd96a19a31dcfce59f25cbf30b3b1
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: 1.666.0 speakeasyVersion: 1.666.0
+4
View File
@@ -182,6 +182,8 @@ import os
def main(): def main():
with OpenRouter( with OpenRouter(
http_referer="<value>",
x_title="<value>",
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
# Rest of application here... # Rest of application here...
@@ -191,6 +193,8 @@ def main():
async def amain(): async def amain():
async with OpenRouter( async with OpenRouter(
http_referer="<value>",
x_title="<value>",
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
# Rest of application here... # Rest of application here...
+1
View File
@@ -29,6 +29,7 @@
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A | | `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A | | `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A | | `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
+1
View File
@@ -40,6 +40,7 @@
| `INCEPTRON` | Inceptron | | `INCEPTRON` | Inceptron |
| `INFERENCE_NET` | InferenceNet | | `INFERENCE_NET` | InferenceNet |
| `INFERMATIC` | Infermatic | | `INFERMATIC` | Infermatic |
| `IO_NET` | Io Net |
| `INFLECTION` | Inflection | | `INFLECTION` | Inflection |
| `LIQUID` | Liquid | | `LIQUID` | Liquid |
| `MARA` | Mara | | `MARA` | Mara |
+1
View File
@@ -40,6 +40,7 @@
| `INCEPTRON` | Inceptron | | `INCEPTRON` | Inceptron |
| `INFERENCE_NET` | InferenceNet | | `INFERENCE_NET` | InferenceNet |
| `INFERMATIC` | Infermatic | | `INFERMATIC` | Infermatic |
| `IO_NET` | Io Net |
| `INFLECTION` | Inflection | | `INFLECTION` | Inflection |
| `LIQUID` | Liquid | | `LIQUID` | Liquid |
| `MARA` | Mara | | `MARA` | Mara |
+5 -4
View File
@@ -3,7 +3,8 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `type` | *Literal["function"]* | :heavy_check_mark: | N/A | | `type` | *Literal["function"]* | :heavy_check_mark: | N/A |
| `function` | [components.ToolDefinitionJSONFunction](../components/tooldefinitionjsonfunction.md) | :heavy_check_mark: | N/A | | `function` | [components.ToolDefinitionJSONFunction](../components/tooldefinitionjsonfunction.md) | :heavy_check_mark: | N/A |
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | N/A |
@@ -9,4 +9,6 @@
| `code_challenge` | *Optional[str]* | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM | | `code_challenge` | *Optional[str]* | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM |
| `code_challenge_method` | [Optional[operations.CreateAuthKeysCodeCodeChallengeMethod]](../operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 | | `code_challenge_method` | [Optional[operations.CreateAuthKeysCodeCodeChallengeMethod]](../operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
| `limit` | *Optional[float]* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 | | `limit` | *Optional[float]* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 |
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional expiration time for the API key to be created | | | `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional expiration time for the API key to be created | |
| `key_label` | *Optional[str]* | :heavy_minus_sign: | Optional custom label for the API key. Defaults to the app name if not provided. | My Custom Key |
| `usage_limit_type` | [Optional[operations.UsageLimitType]](../operations/usagelimittype.md) | :heavy_minus_sign: | Optional credit limit reset interval. When set, the credit limit resets on this interval. | monthly |
+1
View File
@@ -68,6 +68,7 @@
| `INCEPTRON` | Inceptron | | `INCEPTRON` | Inceptron |
| `INFERENCE_NET` | InferenceNet | | `INFERENCE_NET` | InferenceNet |
| `INFERMATIC` | Infermatic | | `INFERMATIC` | Infermatic |
| `IO_NET` | Io Net |
| `INFLECTION` | Inflection | | `INFLECTION` | Inflection |
| `LIQUID` | Liquid | | `LIQUID` | Liquid |
| `MARA` | Mara | | `MARA` | Mara |
+12
View File
@@ -0,0 +1,12 @@
# UsageLimitType
Optional credit limit reset interval. When set, the credit limit resets on this interval.
## Values
| Name | Value |
| --------- | --------- |
| `DAILY` | daily |
| `WEEKLY` | weekly |
| `MONTHLY` | monthly |
+1
View File
@@ -64,6 +64,7 @@ with OpenRouter(
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A | | `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A | | `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A | | `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
+2
View File
@@ -95,6 +95,8 @@ with OpenRouter(
| `code_challenge_method` | [Optional[operations.CreateAuthKeysCodeCodeChallengeMethod]](../../operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 | | `code_challenge_method` | [Optional[operations.CreateAuthKeysCodeCodeChallengeMethod]](../../operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
| `limit` | *Optional[float]* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 | | `limit` | *Optional[float]* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 |
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional expiration time for the API key to be created | | | `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional expiration time for the API key to be created | |
| `key_label` | *Optional[str]* | :heavy_minus_sign: | Optional custom label for the API key. Defaults to the app name if not provided. | My Custom Key |
| `usage_limit_type` | [Optional[operations.UsageLimitType]](../../operations/usagelimittype.md) | :heavy_minus_sign: | Optional credit limit reset interval. When set, the credit limit resets on this interval. | monthly |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response ### Response
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "openrouter" name = "openrouter"
version = "0.7.0" version = "0.7.3"
description = "Official Python Client SDK for OpenRouter." description = "Official Python Client SDK for OpenRouter."
authors = [{ name = "OpenRouter" },] authors = [{ name = "OpenRouter" },]
readme = "README-PYPI.md" readme = "README-PYPI.md"
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata import importlib.metadata
__title__: str = "openrouter" __title__: str = "openrouter"
__version__: str = "0.7.0" __version__: str = "0.7.3"
__openapi_doc_version__: str = "1.0.0" __openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.768.0" __gen_version__: str = "2.768.0"
__user_agent__: str = "speakeasy-sdk/python 0.7.0 2.768.0 1.0.0 openrouter" __user_agent__: str = "speakeasy-sdk/python 0.7.3 2.768.0 1.0.0 openrouter"
try: try:
if __package__ is not None: if __package__ is not None:
+14
View File
@@ -60,6 +60,7 @@ class Chat(BaseSDK):
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict] Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET, ] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
parallel_tool_calls: OptionalNullable[bool] = UNSET,
tool_choice: Optional[Any] = None, tool_choice: Optional[Any] = None,
tools: Optional[ tools: Optional[
Union[ Union[
@@ -114,6 +115,7 @@ class Chat(BaseSDK):
:param stream: :param stream:
:param stream_options: :param stream_options:
:param temperature: :param temperature:
:param parallel_tool_calls:
:param tool_choice: :param tool_choice:
:param tools: :param tools:
:param top_p: :param top_p:
@@ -171,6 +173,7 @@ class Chat(BaseSDK):
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict] Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET, ] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
parallel_tool_calls: OptionalNullable[bool] = UNSET,
tool_choice: Optional[Any] = None, tool_choice: Optional[Any] = None,
tools: Optional[ tools: Optional[
Union[ Union[
@@ -225,6 +228,7 @@ class Chat(BaseSDK):
:param stream: :param stream:
:param stream_options: :param stream_options:
:param temperature: :param temperature:
:param parallel_tool_calls:
:param tool_choice: :param tool_choice:
:param tools: :param tools:
:param top_p: :param top_p:
@@ -281,6 +285,7 @@ class Chat(BaseSDK):
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict] Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET, ] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
parallel_tool_calls: OptionalNullable[bool] = UNSET,
tool_choice: Optional[Any] = None, tool_choice: Optional[Any] = None,
tools: Optional[ tools: Optional[
Union[ Union[
@@ -335,6 +340,7 @@ class Chat(BaseSDK):
:param stream: :param stream:
:param stream_options: :param stream_options:
:param temperature: :param temperature:
:param parallel_tool_calls:
:param tool_choice: :param tool_choice:
:param tools: :param tools:
:param top_p: :param top_p:
@@ -395,6 +401,7 @@ class Chat(BaseSDK):
stream_options, OptionalNullable[components.ChatStreamOptions] stream_options, OptionalNullable[components.ChatStreamOptions]
), ),
temperature=temperature, temperature=temperature,
parallel_tool_calls=parallel_tool_calls,
tool_choice=tool_choice, tool_choice=tool_choice,
tools=utils.get_pydantic_model( tools=utils.get_pydantic_model(
tools, Optional[List[components.ToolDefinitionJSON]] tools, Optional[List[components.ToolDefinitionJSON]]
@@ -545,6 +552,7 @@ class Chat(BaseSDK):
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict] Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET, ] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
parallel_tool_calls: OptionalNullable[bool] = UNSET,
tool_choice: Optional[Any] = None, tool_choice: Optional[Any] = None,
tools: Optional[ tools: Optional[
Union[ Union[
@@ -599,6 +607,7 @@ class Chat(BaseSDK):
:param stream: :param stream:
:param stream_options: :param stream_options:
:param temperature: :param temperature:
:param parallel_tool_calls:
:param tool_choice: :param tool_choice:
:param tools: :param tools:
:param top_p: :param top_p:
@@ -656,6 +665,7 @@ class Chat(BaseSDK):
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict] Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET, ] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
parallel_tool_calls: OptionalNullable[bool] = UNSET,
tool_choice: Optional[Any] = None, tool_choice: Optional[Any] = None,
tools: Optional[ tools: Optional[
Union[ Union[
@@ -710,6 +720,7 @@ class Chat(BaseSDK):
:param stream: :param stream:
:param stream_options: :param stream_options:
:param temperature: :param temperature:
:param parallel_tool_calls:
:param tool_choice: :param tool_choice:
:param tools: :param tools:
:param top_p: :param top_p:
@@ -766,6 +777,7 @@ class Chat(BaseSDK):
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict] Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET, ] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
parallel_tool_calls: OptionalNullable[bool] = UNSET,
tool_choice: Optional[Any] = None, tool_choice: Optional[Any] = None,
tools: Optional[ tools: Optional[
Union[ Union[
@@ -820,6 +832,7 @@ class Chat(BaseSDK):
:param stream: :param stream:
:param stream_options: :param stream_options:
:param temperature: :param temperature:
:param parallel_tool_calls:
:param tool_choice: :param tool_choice:
:param tools: :param tools:
:param top_p: :param top_p:
@@ -880,6 +893,7 @@ class Chat(BaseSDK):
stream_options, OptionalNullable[components.ChatStreamOptions] stream_options, OptionalNullable[components.ChatStreamOptions]
), ),
temperature=temperature, temperature=temperature,
parallel_tool_calls=parallel_tool_calls,
tool_choice=tool_choice, tool_choice=tool_choice,
tools=utils.get_pydantic_model( tools=utils.get_pydantic_model(
tools, Optional[List[components.ToolDefinitionJSON]] tools, Optional[List[components.ToolDefinitionJSON]]
+1
View File
@@ -45,6 +45,7 @@ Schema5Enum = Union[
"Inceptron", "Inceptron",
"InferenceNet", "InferenceNet",
"Infermatic", "Infermatic",
"Io Net",
"Inflection", "Inflection",
"Liquid", "Liquid",
"Mara", "Mara",
@@ -404,6 +404,7 @@ class ChatGenerationParamsTypedDict(TypedDict):
stream: NotRequired[bool] stream: NotRequired[bool]
stream_options: NotRequired[Nullable[ChatStreamOptionsTypedDict]] stream_options: NotRequired[Nullable[ChatStreamOptionsTypedDict]]
temperature: NotRequired[Nullable[float]] temperature: NotRequired[Nullable[float]]
parallel_tool_calls: NotRequired[Nullable[bool]]
tool_choice: NotRequired[Any] tool_choice: NotRequired[Any]
tools: NotRequired[List[ToolDefinitionJSONTypedDict]] tools: NotRequired[List[ToolDefinitionJSONTypedDict]]
top_p: NotRequired[Nullable[float]] top_p: NotRequired[Nullable[float]]
@@ -463,6 +464,8 @@ class ChatGenerationParams(BaseModel):
temperature: OptionalNullable[float] = UNSET temperature: OptionalNullable[float] = UNSET
parallel_tool_calls: OptionalNullable[bool] = UNSET
tool_choice: Optional[Any] = None tool_choice: Optional[Any] = None
tools: Optional[List[ToolDefinitionJSON]] = None tools: Optional[List[ToolDefinitionJSON]] = None
@@ -503,6 +506,7 @@ class ChatGenerationParams(BaseModel):
"stream", "stream",
"stream_options", "stream_options",
"temperature", "temperature",
"parallel_tool_calls",
"tool_choice", "tool_choice",
"tools", "tools",
"top_p", "top_p",
@@ -524,6 +528,7 @@ class ChatGenerationParams(BaseModel):
"stop", "stop",
"stream_options", "stream_options",
"temperature", "temperature",
"parallel_tool_calls",
"top_p", "top_p",
] ]
null_default_fields = [] null_default_fields = []
@@ -42,6 +42,7 @@ ProviderName = Union[
"Inceptron", "Inceptron",
"InferenceNet", "InferenceNet",
"Infermatic", "Infermatic",
"Io Net",
"Inflection", "Inflection",
"Liquid", "Liquid",
"Mara", "Mara",
@@ -1,6 +1,10 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations from __future__ import annotations
from .chatmessagecontentitemcachecontrol import (
ChatMessageContentItemCacheControl,
ChatMessageContentItemCacheControlTypedDict,
)
from openrouter.types import ( from openrouter.types import (
BaseModel, BaseModel,
Nullable, Nullable,
@@ -66,6 +70,7 @@ class ToolDefinitionJSONFunction(BaseModel):
class ToolDefinitionJSONTypedDict(TypedDict): class ToolDefinitionJSONTypedDict(TypedDict):
function: ToolDefinitionJSONFunctionTypedDict function: ToolDefinitionJSONFunctionTypedDict
type: Literal["function"] type: Literal["function"]
cache_control: NotRequired[ChatMessageContentItemCacheControlTypedDict]
class ToolDefinitionJSON(BaseModel): class ToolDefinitionJSON(BaseModel):
@@ -75,3 +80,5 @@ class ToolDefinitionJSON(BaseModel):
Annotated[Literal["function"], AfterValidator(validate_const("function"))], Annotated[Literal["function"], AfterValidator(validate_const("function"))],
pydantic.Field(alias="type"), pydantic.Field(alias="type"),
] = "function" ] = "function"
cache_control: Optional[ChatMessageContentItemCacheControl] = None
+12
View File
@@ -297,6 +297,8 @@ class OAuth(BaseSDK):
] = None, ] = None,
limit: Optional[float] = None, limit: Optional[float] = None,
expires_at: OptionalNullable[datetime] = UNSET, expires_at: OptionalNullable[datetime] = UNSET,
key_label: Optional[str] = None,
usage_limit_type: Optional[operations.UsageLimitType] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -316,6 +318,8 @@ class OAuth(BaseSDK):
:param code_challenge_method: The method used to generate the code challenge :param code_challenge_method: The method used to generate the code challenge
:param limit: Credit limit for the API key to be created :param limit: Credit limit for the API key to be created
:param expires_at: Optional expiration time for the API key to be created :param expires_at: Optional expiration time for the API key to be created
:param key_label: Optional custom label for the API key. Defaults to the app name if not provided.
:param usage_limit_type: Optional credit limit reset interval. When set, the credit limit resets on this interval.
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -340,6 +344,8 @@ class OAuth(BaseSDK):
code_challenge_method=code_challenge_method, code_challenge_method=code_challenge_method,
limit=limit, limit=limit,
expires_at=expires_at, expires_at=expires_at,
key_label=key_label,
usage_limit_type=usage_limit_type,
), ),
) )
@@ -439,6 +445,8 @@ class OAuth(BaseSDK):
] = None, ] = None,
limit: Optional[float] = None, limit: Optional[float] = None,
expires_at: OptionalNullable[datetime] = UNSET, expires_at: OptionalNullable[datetime] = UNSET,
key_label: Optional[str] = None,
usage_limit_type: Optional[operations.UsageLimitType] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -458,6 +466,8 @@ class OAuth(BaseSDK):
:param code_challenge_method: The method used to generate the code challenge :param code_challenge_method: The method used to generate the code challenge
:param limit: Credit limit for the API key to be created :param limit: Credit limit for the API key to be created
:param expires_at: Optional expiration time for the API key to be created :param expires_at: Optional expiration time for the API key to be created
:param key_label: Optional custom label for the API key. Defaults to the app name if not provided.
:param usage_limit_type: Optional credit limit reset interval. When set, the credit limit resets on this interval.
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -482,6 +492,8 @@ class OAuth(BaseSDK):
code_challenge_method=code_challenge_method, code_challenge_method=code_challenge_method,
limit=limit, limit=limit,
expires_at=expires_at, expires_at=expires_at,
key_label=key_label,
usage_limit_type=usage_limit_type,
), ),
) )
+3
View File
@@ -58,6 +58,7 @@ if TYPE_CHECKING:
CreateAuthKeysCodeRequestTypedDict, CreateAuthKeysCodeRequestTypedDict,
CreateAuthKeysCodeResponse, CreateAuthKeysCodeResponse,
CreateAuthKeysCodeResponseTypedDict, CreateAuthKeysCodeResponseTypedDict,
UsageLimitType,
) )
from .createcoinbasecharge import ( from .createcoinbasecharge import (
CallData, CallData,
@@ -707,6 +708,7 @@ __all__ = [
"UpdateKeysResponse", "UpdateKeysResponse",
"UpdateKeysResponseTypedDict", "UpdateKeysResponseTypedDict",
"Usage", "Usage",
"UsageLimitType",
"UsageTypedDict", "UsageTypedDict",
"Web3Data", "Web3Data",
"Web3DataTypedDict", "Web3DataTypedDict",
@@ -756,6 +758,7 @@ _dynamic_imports: dict[str, str] = {
"CreateAuthKeysCodeRequestTypedDict": ".createauthkeyscode", "CreateAuthKeysCodeRequestTypedDict": ".createauthkeyscode",
"CreateAuthKeysCodeResponse": ".createauthkeyscode", "CreateAuthKeysCodeResponse": ".createauthkeyscode",
"CreateAuthKeysCodeResponseTypedDict": ".createauthkeyscode", "CreateAuthKeysCodeResponseTypedDict": ".createauthkeyscode",
"UsageLimitType": ".createauthkeyscode",
"CallData": ".createcoinbasecharge", "CallData": ".createcoinbasecharge",
"CallDataTypedDict": ".createcoinbasecharge", "CallDataTypedDict": ".createcoinbasecharge",
"CreateCoinbaseChargeData": ".createcoinbasecharge", "CreateCoinbaseChargeData": ".createcoinbasecharge",
@@ -66,6 +66,17 @@ CreateAuthKeysCodeCodeChallengeMethod = Union[
r"""The method used to generate the code challenge""" r"""The method used to generate the code challenge"""
UsageLimitType = Union[
Literal[
"daily",
"weekly",
"monthly",
],
UnrecognizedStr,
]
r"""Optional credit limit reset interval. When set, the credit limit resets on this interval."""
class CreateAuthKeysCodeRequestBodyTypedDict(TypedDict): class CreateAuthKeysCodeRequestBodyTypedDict(TypedDict):
callback_url: str callback_url: str
r"""The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed.""" r"""The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed."""
@@ -77,6 +88,10 @@ class CreateAuthKeysCodeRequestBodyTypedDict(TypedDict):
r"""Credit limit for the API key to be created""" r"""Credit limit for the API key to be created"""
expires_at: NotRequired[Nullable[datetime]] expires_at: NotRequired[Nullable[datetime]]
r"""Optional expiration time for the API key to be created""" r"""Optional expiration time for the API key to be created"""
key_label: NotRequired[str]
r"""Optional custom label for the API key. Defaults to the app name if not provided."""
usage_limit_type: NotRequired[UsageLimitType]
r"""Optional credit limit reset interval. When set, the credit limit resets on this interval."""
class CreateAuthKeysCodeRequestBody(BaseModel): class CreateAuthKeysCodeRequestBody(BaseModel):
@@ -98,6 +113,14 @@ class CreateAuthKeysCodeRequestBody(BaseModel):
expires_at: OptionalNullable[datetime] = UNSET expires_at: OptionalNullable[datetime] = UNSET
r"""Optional expiration time for the API key to be created""" r"""Optional expiration time for the API key to be created"""
key_label: Optional[str] = None
r"""Optional custom label for the API key. Defaults to the app name if not provided."""
usage_limit_type: Annotated[
Optional[UsageLimitType], PlainValidator(validate_open_enum(False))
] = None
r"""Optional credit limit reset interval. When set, the credit limit resets on this interval."""
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [ optional_fields = [
@@ -105,6 +128,8 @@ class CreateAuthKeysCodeRequestBody(BaseModel):
"code_challenge_method", "code_challenge_method",
"limit", "limit",
"expires_at", "expires_at",
"key_label",
"usage_limit_type",
] ]
nullable_fields = ["expires_at"] nullable_fields = ["expires_at"]
null_default_fields = [] null_default_fields = []
@@ -161,6 +161,7 @@ ProviderName = Union[
"Inceptron", "Inceptron",
"InferenceNet", "InferenceNet",
"Infermatic", "Infermatic",
"Io Net",
"Inflection", "Inflection",
"Liquid", "Liquid",
"Mara", "Mara",
Generated
+1 -1
View File
@@ -211,7 +211,7 @@ wheels = [
[[package]] [[package]]
name = "openrouter" name = "openrouter"
version = "0.2.0" version = "0.7.3"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "httpcore" }, { name = "httpcore" },