diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 96b7c6c4..58abd137 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: c48cf606-fb42-4a45-9c23-8f0555307828 management: - docChecksum: 45f28287fc894e5f53c0213327d3336f + docChecksum: 9a21da776a63d8a1ab383c6a36668bf0 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.79 - configChecksum: 73a54cee83ddedc18a6df9d73800d4e2 + releaseVersion: 1.1.80 + configChecksum: e088bba216f88d55dcc05d4f3b5a999b repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 29835c42-7944-4058-b133-37fe92227dab - pristine_commit_hash: 1b4ebed440b4d6ce9f812b4994fddae919c22183 - pristine_tree_hash: 47b87eb2c3fb89a7e7b7e90bb4511994ad04d765 + generation_id: d2dc66ab-efe1-4319-b859-f7f49d99fec9 + pristine_commit_hash: d3a4e608a61c13740ca17462131298598ba29467 + pristine_tree_hash: b47f1a2e14b773ff8c6cd889832e02ced561f59a features: python: acceptHeaders: 3.0.0 @@ -4334,8 +4334,8 @@ trackedFiles: pristine_git_object: e60ec6cfd7c0882a02067bfbe246e5cf6d5208c0 docs/components/pricingoverride.mdx: id: 74675f38c1c6 - last_write_checksum: sha1:ca4bf606df26dd9e2b636d7d9e9f0fd183b21145 - pristine_git_object: 5fb1b765b2b0e46d40042f341bbcc91aa0d92762 + last_write_checksum: sha1:eeb486b65e66a55269aeafcc60f310501a98dbd6 + pristine_git_object: b7d539e20f7337822a45f726f451fac321f875f6 docs/components/primarymetric.mdx: id: c6ec097bacaf last_write_checksum: sha1:fc7d89ac02ff585424b5bc8cc9b0ac82338c7b6f @@ -5604,6 +5604,10 @@ trackedFiles: id: d197ccf2b36c last_write_checksum: sha1:c7078ea2cd00c001dcef6ce68c790b9d3d718e2b pristine_git_object: 2b1814dbe5bc4583007dd638b6a4a9c08c0c81ce + docs/components/utcday.mdx: + id: a0c417921ea8 + last_write_checksum: sha1:dba97f2b96e20e9ea4c21f9298e0be1d2a0d5966 + pristine_git_object: 535f547efad65780088e6098364532ec4c91a6dc docs/components/variables.mdx: id: 3312b9777716 last_write_checksum: sha1:6ba9bb63173376b0dcb7ac22b859bfef3e3820eb @@ -7354,8 +7358,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:ef8b1ed8326062d20ca9d33b92592e6d531a0887 - pristine_git_object: ef555080ec91fb70f367d33d4e2c4eaea4353041 + last_write_checksum: sha1:4ad2ac0d52d1828dbb9feca2f7fa39206819134e + pristine_git_object: c6e255a167228b021666d308a5c52de689f8b63c scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7382,8 +7386,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:c3c8b84937417ea8966f8668493e9042cff43012 - pristine_git_object: 99b80e5df96cadcdc9d243d57ca666bd5dc0ab00 + last_write_checksum: sha1:7895593dcf93d43e317d6822db9b29cb6b1caf28 + pristine_git_object: 18d71c63114f8321bdd7ae5a9019589fb4a5cd1c src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 @@ -7422,8 +7426,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:d888cd088a96b318e3627db8b63566b319bd7ac9 - pristine_git_object: a83396ab5dadab0e7dc11e20256867d319c7b9d4 + last_write_checksum: sha1:ebd95cc90194d32d4141fc2396523f97938d7a21 + pristine_git_object: 0d8caf88d87547770651198530fbddaaa428cb16 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -9214,8 +9218,8 @@ trackedFiles: pristine_git_object: 90bdb267893360608210843a5da0d5d68e80d41e src/openrouter/components/pricingoverride.py: id: 8984e4cc7422 - last_write_checksum: sha1:0f72b9806164907aacce785f2d0c79a3e9374ac9 - pristine_git_object: a7c4599ac6ab794f54968f12cd6b15c3137a5159 + last_write_checksum: sha1:e12629320e02396a2aa1dfcbacd6873fba0d4aba + pristine_git_object: e86eb424bc592492f2903c8b3e30ec23de814991 src/openrouter/components/promptcachebreakpoint.py: id: f1e589a13300 last_write_checksum: sha1:ea0f5d81093058c261edd1937b4c7148989a203a @@ -12382,4 +12386,11 @@ examples: "503": application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.api_keys.list()`: `response.data[].external_user` **Added**\n* `open_router.api_keys.create()`: \n * `request.external_user` **Added**\n * `response.data.external_user` **Added**\n* `open_router.api_keys.get()`: `response.data.external_user` **Added**\n* `open_router.api_keys.update()`: `response.data.external_user` **Added**\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.embeddings.list_models()`: `response.data[].pricing.overrides[].utc_days` **Added** + * `open_router.endpoints.list_zdr_endpoints()`: `response.data[].pricing.overrides[].utc_days` **Added** + * `open_router.endpoints.list()`: `response.data.endpoints[].pricing.overrides[].utc_days` **Added** + * `open_router.models.get()`: `response.data.pricing.overrides[].utc_days` **Added** + * `open_router.models.list()`: `response.data[].pricing.overrides[].utc_days` **Added** + * `open_router.models.list_for_user()`: `response.data[].pricing.overrides[].utc_days` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 0395f991..efa57a72 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.79 + version: 1.1.80 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index c7a53941..fa206a56 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -20704,6 +20704,21 @@ components: prompt: description: 'Overridden price in USD per token for prompt (input) processing' type: 'string' + utc_days: + description: 'Condition: UTC weekdays the entry applies on, evaluated at the request instant. Scopes the utc_start/utc_end window (or, without a window, the whole UTC day) to the listed days. Absent means every day.' + items: + enum: + - 'monday' + - 'tuesday' + - 'wednesday' + - 'thursday' + - 'friday' + - 'saturday' + - 'sunday' + type: 'string' + x-speakeasy-unknown-values: allow + minItems: 1 + type: 'array' utc_end: description: 'Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)' format: 'double' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 124fa455..9decd51b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:36607bb1ee0f8771c1af0da1b9a9fe072e5761cf4604980b25ab981833a26569 - sourceBlobDigest: sha256:feb9ccfde88d5358904e6a3b8ae255e6183ba70c6f5cd8078906aa54f572ee50 + sourceRevisionDigest: sha256:27ac577c51d9c3dd8ac762c0f89bf31858843e5f97f72a10dc8fa759a70f0b29 + sourceBlobDigest: sha256:189a5c201cb62e161821ada4cca930ea7ae4711df3dcf9001eac70ed152d61ac tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:36607bb1ee0f8771c1af0da1b9a9fe072e5761cf4604980b25ab981833a26569 - sourceBlobDigest: sha256:feb9ccfde88d5358904e6a3b8ae255e6183ba70c6f5cd8078906aa54f572ee50 + sourceRevisionDigest: sha256:27ac577c51d9c3dd8ac762c0f89bf31858843e5f97f72a10dc8fa759a70f0b29 + sourceBlobDigest: sha256:189a5c201cb62e161821ada4cca930ea7ae4711df3dcf9001eac70ed152d61ac codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:5c7956c63c0575911fdfb8a083ed89ac9153a446d4396a0372b4dee36a360108 + codeSamplesRevisionDigest: sha256:330bb94775f6450f65513e23e20a997ecd5d7cecd4a44f29a2ae282ace81ffed workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index eb11c8a1..538ecc87 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1579,4 +1579,14 @@ Based on: ### Generated - [python v1.1.79] . ### Releases -- [PyPI v1.1.79] https://pypi.org/project/openrouter/1.1.79 - . \ No newline at end of file +- [PyPI v1.1.79] https://pypi.org/project/openrouter/1.1.79 - . + +## 2026-08-24 19:33:30 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.80] . +### Releases +- [PyPI v1.1.80] https://pypi.org/project/openrouter/1.1.80 - . \ No newline at end of file diff --git a/docs/components/pricingoverride.mdx b/docs/components/pricingoverride.mdx index 5fb1b765..b7d539e2 100644 --- a/docs/components/pricingoverride.mdx +++ b/docs/components/pricingoverride.mdx @@ -17,5 +17,6 @@ A conditional override of the base pricing. An entry applies only when all of it | `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per 1-hour cache-write token | | `min_prompt_tokens` | *Optional[float]* | :heavy_minus_sign: | Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold | | `prompt` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per token for prompt (input) processing | +| `utc_days` | List[[components.UtcDay](../components/utcday.mdx)] | :heavy_minus_sign: | Condition: UTC weekdays the entry applies on, evaluated at the request instant. Scopes the utc_start/utc_end window (or, without a window, the whole UTC day) to the listed days. Absent means every day. | | `utc_end` | *Optional[float]* | :heavy_minus_sign: | Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00) | | `utc_start` | *Optional[float]* | :heavy_minus_sign: | Condition: inclusive start of a daily UTC time window as an HHMM clock number (e.g. 100 = 01:00, 1030 = 10:30). The entry applies while the current UTC time is inside the half-open window [utc_start, utc_end), which may wrap past midnight (utc_start > utc_end). | \ No newline at end of file diff --git a/docs/components/utcday.mdx b/docs/components/utcday.mdx new file mode 100644 index 00000000..535f547e --- /dev/null +++ b/docs/components/utcday.mdx @@ -0,0 +1,25 @@ +--- +title: "UtcDay" +--- + +## Example Usage + +```python +from openrouter.components import UtcDay + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: UtcDay = "monday" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"monday"` +- `"tuesday"` +- `"wednesday"` +- `"thursday"` +- `"friday"` +- `"saturday"` +- `"sunday"` diff --git a/pyproject.toml b/pyproject.toml index ef555080..c6e255a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.79" +version = "1.1.80" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index 99b80e5d..18d71c63 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.1.79" +__version__: str = "1.1.80" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.79 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.80 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index a83396ab..0d8caf88 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -2459,7 +2459,7 @@ PreviewWebSearchUserLocationType, PreviewWebSearchUserLocationTypedDict, ) - from .pricingoverride import PricingOverride, PricingOverrideTypedDict + from .pricingoverride import PricingOverride, PricingOverrideTypedDict, UtcDay from .promptcachebreakpoint import ( PromptCacheBreakpoint, PromptCacheBreakpointMode, @@ -5367,6 +5367,7 @@ "UsageTypedDict", "UserLocation", "UserLocationTypedDict", + "UtcDay", "Variables", "VariablesTypedDict", "Verbosity", @@ -7264,6 +7265,7 @@ "PreviewWebSearchUserLocationTypedDict": ".preview_websearchuserlocation", "PricingOverride": ".pricingoverride", "PricingOverrideTypedDict": ".pricingoverride", + "UtcDay": ".pricingoverride", "PromptCacheBreakpoint": ".promptcachebreakpoint", "PromptCacheBreakpointMode": ".promptcachebreakpoint", "PromptCacheBreakpointTypedDict": ".promptcachebreakpoint", diff --git a/src/openrouter/components/pricingoverride.py b/src/openrouter/components/pricingoverride.py index a7c4599a..e86eb424 100644 --- a/src/openrouter/components/pricingoverride.py +++ b/src/openrouter/components/pricingoverride.py @@ -1,12 +1,26 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr from pydantic import model_serializer -from typing import Optional +from typing import List, Literal, Optional, Union from typing_extensions import NotRequired, TypedDict +UtcDay = Union[ + Literal[ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday", + ], + UnrecognizedStr, +] + + class PricingOverrideTypedDict(TypedDict): r"""A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.""" @@ -26,6 +40,8 @@ class PricingOverrideTypedDict(TypedDict): r"""Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold""" prompt: NotRequired[str] r"""Overridden price in USD per token for prompt (input) processing""" + utc_days: NotRequired[List[UtcDay]] + r"""Condition: UTC weekdays the entry applies on, evaluated at the request instant. Scopes the utc_start/utc_end window (or, without a window, the whole UTC day) to the listed days. Absent means every day.""" utc_end: NotRequired[float] r"""Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)""" utc_start: NotRequired[float] @@ -59,6 +75,9 @@ class PricingOverride(BaseModel): prompt: Optional[str] = None r"""Overridden price in USD per token for prompt (input) processing""" + utc_days: Optional[List[UtcDay]] = None + r"""Condition: UTC weekdays the entry applies on, evaluated at the request instant. Scopes the utc_start/utc_end window (or, without a window, the whole UTC day) to the listed days. Absent means every day.""" + utc_end: Optional[float] = None r"""Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)""" @@ -77,6 +96,7 @@ def serialize_model(self, handler): "input_cache_write_1h", "min_prompt_tokens", "prompt", + "utc_days", "utc_end", "utc_start", ] diff --git a/uv.lock b/uv.lock index 10dc5fd3..d95c0f96 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.79" +version = "1.1.80" source = { editable = "." } dependencies = [ { name = "httpcore" },