diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2f37ce9c..6c9c3ef3 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: 6b5d19b1320aae9ec59bd5bc93e4b2ef + docChecksum: 86616cdc9fbc7ca12f50a36123b9bf85 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.86 - configChecksum: 9fb5efeed75ca7f11498acfade7c8c70 + releaseVersion: 1.1.87 + configChecksum: 42086d1b01c190b8433be92d4ef5b28f repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 12541bfd-568a-479a-adbd-3e0d9f758130 - pristine_commit_hash: 81cdfa3d8c75fa66f62f7314446cdc36c15d106a - pristine_tree_hash: 37a5f9ab483b37d0829cbf887d16a6a9f4383349 + generation_id: 094d144c-f0a4-428a-a5e3-b9249aca63b5 + pristine_commit_hash: 27060b31b4a491006ba06f25edfdbb22f3e00fbd + pristine_tree_hash: b4521a8cb923739100486f0978799d2734a46414 features: python: acceptHeaders: 3.0.0 @@ -4426,8 +4426,8 @@ trackedFiles: pristine_git_object: 5aa8e90a6761d61aa63204bc3aa73f4481449d3e docs/components/publicendpoint.mdx: id: ec4843ef5d86 - last_write_checksum: sha1:f38a62ec17ce5e75406d9ce695e3d0bd4f2b1174 - pristine_git_object: 4e41a06c062775d1a31d2f508fa057353244c2c2 + last_write_checksum: sha1:e8078801c9a7135d9f841ac1fffe44e7eabc53be + pristine_git_object: 4201c433326975294dc8b896356859f93bd48368 docs/components/publicpricing.mdx: id: 61fb18b7ff94 last_write_checksum: sha1:e241420249fcbd1bf515b0f5e84934de0b207948 @@ -5278,8 +5278,8 @@ trackedFiles: pristine_git_object: edc2b7de0a732e69c2b1ca68e23805764b7db2e0 docs/components/topproviderinfo.mdx: id: 869c6745d5f7 - last_write_checksum: sha1:6e10b9871f7eb7bf986ef79542e2eaf956a24cc1 - pristine_git_object: 76323666a17efddd3cad64a4803afe612d375e1c + last_write_checksum: sha1:a60336455d87d3e4f319b9715981ac590f03b9aa + pristine_git_object: 0a324fb7774b7fddb74b776a2898d7356a2441b1 docs/components/tournamentstats.mdx: id: 4e7cd43c4bf4 last_write_checksum: sha1:fcf38c7852517cc1ca206d8252d6965a3a6aef73 @@ -7386,8 +7386,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:b90a63cafd4e584737c9ada6a66265ff587e9573 - pristine_git_object: b6bb5fcafbb2e81b5eb1dae54aa8b2753bd50fb3 + last_write_checksum: sha1:3e5febe91c5b2de802c82ad91a301fa9f1adc952 + pristine_git_object: c9e6fb140e4bc11bd7b6e3da8b89cab81cdeed92 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7414,8 +7414,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:8bcf1f2f255e49404d1b8c7560b3d1e0ab6449b2 - pristine_git_object: d6b53c21f23e732ffcff2894fc0e638c26463be7 + last_write_checksum: sha1:f56a4acb66c1cc315351e50b9872113ee1191b26 + pristine_git_object: fdf547e1c0a7410f315aec714b99e3b84ec8a3d9 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 @@ -9294,8 +9294,8 @@ trackedFiles: pristine_git_object: 1798ae9dd8c2e4b629bb99cc5c643827895e8231 src/openrouter/components/publicendpoint.py: id: 848aa2ef9129 - last_write_checksum: sha1:18ea73ebf5aa051d7d2969a4d7b656fcb8450150 - pristine_git_object: a13169bb681ff46f3cc6810f4abee1cb869ab5c6 + last_write_checksum: sha1:314bfa0b6229f9e45f59a0c5a832c8ace8612a52 + pristine_git_object: 403d1434866e32a04dca2c793e70914d924d5ca3 src/openrouter/components/publicpricing.py: id: 96d115d83cc5 last_write_checksum: sha1:fd8c320ac83b282eaf2405045329b55076d4311a @@ -9710,8 +9710,8 @@ trackedFiles: pristine_git_object: 122defa7be3d461999de5f9f169d1c3e8246b876 src/openrouter/components/topproviderinfo.py: id: 0517ce43cc77 - last_write_checksum: sha1:f99bf790e69be8c73a5680b9cfa0b97fc03528f7 - pristine_git_object: 6e119e6b3855709568f41ab53095c41aebd2cc5f + last_write_checksum: sha1:a2b14785ded07cd88475609a3ea23bbb0d5a0b28 + pristine_git_object: cad86b9433dfe9812c740b32676726706bcd0e46 src/openrouter/components/traceconfig.py: id: 19375fa88b9a last_write_checksum: sha1:46fd7fd3f26caebda22604006873317f9aab1480 @@ -12457,10 +12457,3 @@ examples: "503": application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} examplesVersion: 1.0.2 -releaseNotes: | - ## Python SDK Changes: - * `open_router.tts.create_speech()`: `error.status[413]` **Added** - * `open_router.stt.create_transcription()`: `error.status[413]` **Added** - * `open_router.stt.create_transcription_multipart()`: `error.status[413]` **Added** - * `open_router.rerank.rerank()`: `error.status[413]` **Added** - * `open_router.video_generation.generate()`: `error.status[413]` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 65335b19..d7cfff87 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.86 + version: 1.1.87 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index f9fb3b57..e9af7b45 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -21777,6 +21777,7 @@ components: latency_last_30m: $ref: '#/components/schemas/PercentileStats' max_completion_tokens: + description: 'Maximum completion tokens for this endpoint. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens.' type: - 'integer' - 'null' @@ -24784,7 +24785,7 @@ components: example: true type: 'boolean' max_completion_tokens: - description: 'Maximum completion tokens from the top provider' + description: 'Maximum completion tokens from the top provider. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens.' example: 4096 type: - 'integer' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d7591618..3ef19be8 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:ded46b4e1c04095fb0fb5a790cf72e633f103dc9b141c3bfd85f7f91281b49a7 - sourceBlobDigest: sha256:013ff5a1c96453351bc0a8fd32014e2ec7274e6980b8b4df3d6824b231836ea1 + sourceRevisionDigest: sha256:eb7204b42fedc5f113a670e50156dc863a013b5fc2a68331135f418dd204438b + sourceBlobDigest: sha256:debc86279884eb574bb3026bb40019606abaadc7f2e12285deb3b2dd5a0eb20a tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:ded46b4e1c04095fb0fb5a790cf72e633f103dc9b141c3bfd85f7f91281b49a7 - sourceBlobDigest: sha256:013ff5a1c96453351bc0a8fd32014e2ec7274e6980b8b4df3d6824b231836ea1 + sourceRevisionDigest: sha256:eb7204b42fedc5f113a670e50156dc863a013b5fc2a68331135f418dd204438b + sourceBlobDigest: sha256:debc86279884eb574bb3026bb40019606abaadc7f2e12285deb3b2dd5a0eb20a codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:6ca7f203fab6d80273a09d908fce2daae4ae1fc13b770b2d965a4a77dcea066d + codeSamplesRevisionDigest: sha256:6dd2cf495941c5289edf107754f7d059b3b57f489f598c9a00913ce901854994 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 903fb34b..bd3c7848 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1649,4 +1649,14 @@ Based on: ### Generated - [python v1.1.86] . ### Releases -- [PyPI v1.1.86] https://pypi.org/project/openrouter/1.1.86 - . \ No newline at end of file +- [PyPI v1.1.86] https://pypi.org/project/openrouter/1.1.86 - . + +## 2026-08-25 15:28:57 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.87] . +### Releases +- [PyPI v1.1.87] https://pypi.org/project/openrouter/1.1.87 - . \ No newline at end of file diff --git a/docs/components/publicendpoint.mdx b/docs/components/publicendpoint.mdx index 4e41a06c..4201c433 100644 --- a/docs/components/publicendpoint.mdx +++ b/docs/components/publicendpoint.mdx @@ -7,24 +7,24 @@ Information about a specific model endpoint ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `context_length` | *int* | :heavy_check_mark: | N/A | | -| `latency_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.mdx) | :heavy_check_mark: | Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. | \{
"p50": 25.5,
"p75": 35.2,
"p90": 48.7,
"p99": 85.3
} | -| `max_completion_tokens` | *Nullable[int]* | :heavy_check_mark: | N/A | | -| `max_prompt_tokens` | *Nullable[int]* | :heavy_check_mark: | N/A | | -| `model_id` | *str* | :heavy_check_mark: | The unique identifier for the model (permaslug) | openai/gpt-4 | -| `model_name` | *str* | :heavy_check_mark: | N/A | | -| `name` | *str* | :heavy_check_mark: | N/A | | -| `pricing` | [components.Pricing](../components/pricing.mdx) | :heavy_check_mark: | N/A | | -| `provider_name` | [components.ProviderName](../components/providername.mdx) | :heavy_check_mark: | N/A | OpenAI | -| `quantization` | [Nullable[components.Quantization]](../components/quantization.mdx) | :heavy_check_mark: | N/A | fp16 | -| `status` | [Optional[components.EndpointStatus]](../components/endpointstatus.mdx) | :heavy_minus_sign: | N/A | 0 | -| `supported_parameters` | List[[components.Parameter](../components/parameter.mdx)] | :heavy_check_mark: | N/A | | -| `supports_implicit_caching` | *bool* | :heavy_check_mark: | N/A | | -| `supports_voice_cloning` | *Optional[bool]* | :heavy_minus_sign: | Whether this TTS endpoint accepts inline reference audio (`input_references`) for stateless voice cloning. Requests carrying reference audio are only routed to endpoints where this is true. | | -| `tag` | *str* | :heavy_check_mark: | N/A | | -| `throughput_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.mdx) | :heavy_check_mark: | N/A | \{
"p50": 25.5,
"p75": 35.2,
"p90": 48.7,
"p99": 85.3
} | -| `uptime_last_1d` | *Nullable[float]* | :heavy_check_mark: | Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. | | -| `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | | -| `uptime_last_5m` | *Nullable[float]* | :heavy_check_mark: | Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `context_length` | *int* | :heavy_check_mark: | N/A | | +| `latency_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.mdx) | :heavy_check_mark: | Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. | \{
"p50": 25.5,
"p75": 35.2,
"p90": 48.7,
"p99": 85.3
} | +| `max_completion_tokens` | *Nullable[int]* | :heavy_check_mark: | Maximum completion tokens for this endpoint. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens. | | +| `max_prompt_tokens` | *Nullable[int]* | :heavy_check_mark: | N/A | | +| `model_id` | *str* | :heavy_check_mark: | The unique identifier for the model (permaslug) | openai/gpt-4 | +| `model_name` | *str* | :heavy_check_mark: | N/A | | +| `name` | *str* | :heavy_check_mark: | N/A | | +| `pricing` | [components.Pricing](../components/pricing.mdx) | :heavy_check_mark: | N/A | | +| `provider_name` | [components.ProviderName](../components/providername.mdx) | :heavy_check_mark: | N/A | OpenAI | +| `quantization` | [Nullable[components.Quantization]](../components/quantization.mdx) | :heavy_check_mark: | N/A | fp16 | +| `status` | [Optional[components.EndpointStatus]](../components/endpointstatus.mdx) | :heavy_minus_sign: | N/A | 0 | +| `supported_parameters` | List[[components.Parameter](../components/parameter.mdx)] | :heavy_check_mark: | N/A | | +| `supports_implicit_caching` | *bool* | :heavy_check_mark: | N/A | | +| `supports_voice_cloning` | *Optional[bool]* | :heavy_minus_sign: | Whether this TTS endpoint accepts inline reference audio (`input_references`) for stateless voice cloning. Requests carrying reference audio are only routed to endpoints where this is true. | | +| `tag` | *str* | :heavy_check_mark: | N/A | | +| `throughput_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.mdx) | :heavy_check_mark: | N/A | \{
"p50": 25.5,
"p75": 35.2,
"p90": 48.7,
"p99": 85.3
} | +| `uptime_last_1d` | *Nullable[float]* | :heavy_check_mark: | Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. | | +| `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | | +| `uptime_last_5m` | *Nullable[float]* | :heavy_check_mark: | Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. | | \ No newline at end of file diff --git a/docs/components/topproviderinfo.mdx b/docs/components/topproviderinfo.mdx index 76323666..0a324fb7 100644 --- a/docs/components/topproviderinfo.mdx +++ b/docs/components/topproviderinfo.mdx @@ -7,8 +7,8 @@ Information about the top provider for this model ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | -| `context_length` | *OptionalNullable[int]* | :heavy_minus_sign: | Context length from the top provider | 8192 | -| `is_moderated` | *bool* | :heavy_check_mark: | Whether the top provider moderates content | true | -| `max_completion_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Maximum completion tokens from the top provider | 4096 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `context_length` | *OptionalNullable[int]* | :heavy_minus_sign: | Context length from the top provider | 8192 | +| `is_moderated` | *bool* | :heavy_check_mark: | Whether the top provider moderates content | true | +| `max_completion_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Maximum completion tokens from the top provider. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens. | 4096 | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b6bb5fca..c9e6fb14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.86" +version = "1.1.87" 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 d6b53c21..fdf547e1 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.86" +__version__: str = "1.1.87" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.86 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.87 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/publicendpoint.py b/src/openrouter/components/publicendpoint.py index a13169bb..403d1434 100644 --- a/src/openrouter/components/publicendpoint.py +++ b/src/openrouter/components/publicendpoint.py @@ -138,6 +138,7 @@ class PublicEndpointTypedDict(TypedDict): latency_last_30m: Nullable[PercentileStatsTypedDict] r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.""" max_completion_tokens: Nullable[int] + r"""Maximum completion tokens for this endpoint. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens.""" max_prompt_tokens: Nullable[int] model_id: str r"""The unique identifier for the model (permaslug)""" @@ -169,6 +170,7 @@ class PublicEndpoint(BaseModel): r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.""" max_completion_tokens: Nullable[int] + r"""Maximum completion tokens for this endpoint. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens.""" max_prompt_tokens: Nullable[int] diff --git a/src/openrouter/components/topproviderinfo.py b/src/openrouter/components/topproviderinfo.py index 6e119e6b..cad86b94 100644 --- a/src/openrouter/components/topproviderinfo.py +++ b/src/openrouter/components/topproviderinfo.py @@ -20,7 +20,7 @@ class TopProviderInfoTypedDict(TypedDict): context_length: NotRequired[Nullable[int]] r"""Context length from the top provider""" max_completion_tokens: NotRequired[Nullable[int]] - r"""Maximum completion tokens from the top provider""" + r"""Maximum completion tokens from the top provider. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens.""" class TopProviderInfo(BaseModel): @@ -33,7 +33,7 @@ class TopProviderInfo(BaseModel): r"""Context length from the top provider""" max_completion_tokens: OptionalNullable[int] = UNSET - r"""Maximum completion tokens from the top provider""" + r"""Maximum completion tokens from the top provider. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/uv.lock b/uv.lock index fbe55168..d6c54aef 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.86" +version = "1.1.87" source = { editable = "." } dependencies = [ { name = "httpcore" },