chore: 🐝 Update SDK - Generate (spec change merged) 0.11.26 (#440)

Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
Co-authored-by: speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2026-07-13 19:31:52 +00:00
committed by GitHub
co-authored by speakeasybot speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
parent 8016b15284
commit f24188c135
15 changed files with 260 additions and 67 deletions
+34 -21
View File
@@ -1,19 +1,19 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: c48cf606-fb42-4a45-9c23-8f0555307828 id: c48cf606-fb42-4a45-9c23-8f0555307828
management: management:
docChecksum: a444511ee53d41b62d62b2d23ddd3b64 docChecksum: 7263f7a45045933c0fa87b21e7e6fd9b
docVersion: 1.0.0 docVersion: 1.0.0
speakeasyVersion: 1.787.0 speakeasyVersion: 1.787.0
generationVersion: 2.914.0 generationVersion: 2.914.0
releaseVersion: 0.11.25 releaseVersion: 0.11.26
configChecksum: b10f43281932fd64b0c43f8577a40816 configChecksum: 2a949e81cf5d40ef993b72355e7e75eb
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
persistentEdits: persistentEdits:
generation_id: 554b7889-8ccd-4aef-a14b-c347df957007 generation_id: 7695231f-3e30-4c88-921a-f9175c463593
pristine_commit_hash: 95be3ea8a18d40e9df231449f23161356fdfd5ff pristine_commit_hash: 5ccb0c48efa3160204f8671518dd705cc930a0a7
pristine_tree_hash: e9b22615b85a97ffd1078604414fc174d55b227f pristine_tree_hash: 111ea5b13d73fd98a6d6c24a7a46a513a3104a9c
features: features:
python: python:
acceptHeaders: 3.0.0 acceptHeaders: 3.0.0
@@ -3886,8 +3886,12 @@ trackedFiles:
pristine_git_object: 3d340325d192b54a5d039336cce2bd35d12445ac pristine_git_object: 3d340325d192b54a5d039336cce2bd35d12445ac
docs/components/pricing.mdx: docs/components/pricing.mdx:
id: 6816d700f8b1 id: 6816d700f8b1
last_write_checksum: sha1:ac5c56af4e56eb98da5686e33a224950dfbb8207 last_write_checksum: sha1:c9f49a270c1ddcaf2b354b2c0f7ceb277ca5eff4
pristine_git_object: 78ac34b5053103dc4261c2fbeb9833f97ef109db pristine_git_object: 0ca9bdf9bf2b1909a4a78e99b58fde78b311becd
docs/components/pricingoverride.mdx:
id: 74675f38c1c6
last_write_checksum: sha1:5e64e9edbb013f04ee3741fe7c5dbd2fa54b544b
pristine_git_object: f8291256ac4a4aeed8bf79f1bad1e3b45cbaa354
docs/components/promptcachebreakpoint.mdx: docs/components/promptcachebreakpoint.mdx:
id: c135956dc623 id: c135956dc623
last_write_checksum: sha1:1b0c9884eb9b6fe1d4fdf822c75cb566ead67e07 last_write_checksum: sha1:1b0c9884eb9b6fe1d4fdf822c75cb566ead67e07
@@ -3966,8 +3970,8 @@ trackedFiles:
pristine_git_object: 4498d08fd82f26a210eeed2b9659e6a0b321f9ef pristine_git_object: 4498d08fd82f26a210eeed2b9659e6a0b321f9ef
docs/components/publicpricing.mdx: docs/components/publicpricing.mdx:
id: 61fb18b7ff94 id: 61fb18b7ff94
last_write_checksum: sha1:41c3b03c9eb4883d41e128e1b2d549ddb608c317 last_write_checksum: sha1:53550f414931189b91a148ca9039aefb5899a7ee
pristine_git_object: 0d8f6cf2cca158ec93dd8afdc29c0cb377053fbd pristine_git_object: 4a17b2b3dd05ea85ea9847689c13692540007f07
docs/components/quantization.mdx: docs/components/quantization.mdx:
id: 9d062e4ee362 id: 9d062e4ee362
last_write_checksum: sha1:4cb3588933fe1ca8592669f8ec1bef1cf0986e28 last_write_checksum: sha1:4cb3588933fe1ca8592669f8ec1bef1cf0986e28
@@ -6658,8 +6662,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml: pyproject.toml:
id: 5d07e7d72637 id: 5d07e7d72637
last_write_checksum: sha1:ecba4ec7fe5c538617fb6e42582204ae5711d106 last_write_checksum: sha1:a62f150fb014bd2f019526c2847cab9afcd90648
pristine_git_object: 6804383f389474f6b72740ce0a281ba45ed8251d pristine_git_object: bcd7637f7dd41ea5aa8e3374fbafe096f1d44c11
scripts/prepare_readme.py: scripts/prepare_readme.py:
id: e0c5957a6035 id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -6686,8 +6690,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py: src/openrouter/_version.py:
id: d8d15ad6c586 id: d8d15ad6c586
last_write_checksum: sha1:a776602f2cf82d2f44e51bbbd69dfeee7a7f46f3 last_write_checksum: sha1:806eecfbfbd9862cf0fb64efad4b401f93c78e3e
pristine_git_object: d272f6c0b2f426b678e025f6181287b08ea995ed pristine_git_object: b634472cdb3fe62a8422bdd27d30a770bdf652a2
src/openrouter/analytics.py: src/openrouter/analytics.py:
id: cb406b5aaabb id: cb406b5aaabb
last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841 last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841
@@ -6726,8 +6730,8 @@ trackedFiles:
pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1
src/openrouter/components/__init__.py: src/openrouter/components/__init__.py:
id: 81754e97b3f4 id: 81754e97b3f4
last_write_checksum: sha1:045cf74eb4e03399ac8521ff3db0a2ed9f33b002 last_write_checksum: sha1:5208f1af2c3420c74d0a23810dcf68807b95a130
pristine_git_object: 43900430f099cab065756d44e23f9c4118c99180 pristine_git_object: 92d0e11add040db79f1848e7f697605a0b2e129c
src/openrouter/components/aabenchmarkentry.py: src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82 id: e2e0f0b48c82
last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c
@@ -8344,6 +8348,10 @@ trackedFiles:
id: 40414eada27a id: 40414eada27a
last_write_checksum: sha1:0e241830bf9014e8ea814465c573711d8a7caa2c last_write_checksum: sha1:0e241830bf9014e8ea814465c573711d8a7caa2c
pristine_git_object: 90bdb267893360608210843a5da0d5d68e80d41e pristine_git_object: 90bdb267893360608210843a5da0d5d68e80d41e
src/openrouter/components/pricingoverride.py:
id: 8984e4cc7422
last_write_checksum: sha1:0e2c06a0d510bb2fcf64b03f74c693f26c9825ad
pristine_git_object: 21c25933126937fe7c1d10898a42bbe711cf7b9f
src/openrouter/components/promptcachebreakpoint.py: src/openrouter/components/promptcachebreakpoint.py:
id: f1e589a13300 id: f1e589a13300
last_write_checksum: sha1:458ef5170c7c9ea1367dcfb090b1b28333aff73d last_write_checksum: sha1:458ef5170c7c9ea1367dcfb090b1b28333aff73d
@@ -8386,12 +8394,12 @@ trackedFiles:
pristine_git_object: 1798ae9dd8c2e4b629bb99cc5c643827895e8231 pristine_git_object: 1798ae9dd8c2e4b629bb99cc5c643827895e8231
src/openrouter/components/publicendpoint.py: src/openrouter/components/publicendpoint.py:
id: 848aa2ef9129 id: 848aa2ef9129
last_write_checksum: sha1:d8788cb95c89974e6339ecaccc6202dfae871225 last_write_checksum: sha1:a94a8a30e3656955780285fa004a2b7e5d162c57
pristine_git_object: 270a46db728bbf80ab3c89fde25d71c61f93434e pristine_git_object: b647b5f88242565b228e6d0bf11d151e6650f6f8
src/openrouter/components/publicpricing.py: src/openrouter/components/publicpricing.py:
id: 96d115d83cc5 id: 96d115d83cc5
last_write_checksum: sha1:41f834b27573c1f621c99883d27e231a1384c846 last_write_checksum: sha1:a3733ee6d92eda73562ea1fa2bc834e3a14ac6db
pristine_git_object: fc3f2cdb028345dbeda1c0a6a1493647286f1cc9 pristine_git_object: 037f4b4e9aa72510a4021e695fe39516eb88d1f3
src/openrouter/components/quantization.py: src/openrouter/components/quantization.py:
id: bde317b3d703 id: bde317b3d703
last_write_checksum: sha1:96b042899bfb818f20d282be76ad37fc948a599d last_write_checksum: sha1:96b042899bfb818f20d282be76ad37fc948a599d
@@ -11131,4 +11139,9 @@ examples:
examplesVersion: 1.0.2 examplesVersion: 1.0.2
releaseNotes: | releaseNotes: |
## Python SDK Changes: ## Python SDK Changes:
* `open_router.images.generate()`: `request.provider` **Changed** * `open_router.embeddings.list_models()`: `response.data[].pricing.overrides` **Added**
* `open_router.endpoints.list_zdr_endpoints()`: `response.data[].pricing.overrides` **Added**
* `open_router.endpoints.list()`: `response.data.endpoints[].pricing.overrides` **Added**
* `open_router.models.get()`: `response.data.pricing.overrides` **Added**
* `open_router.models.list()`: `response.data[].pricing.overrides` **Added**
* `open_router.models.list_for_user()`: `response.data[].pricing.overrides` **Added**
+1 -1
View File
@@ -36,7 +36,7 @@ generation:
documentation: mintlify documentation: mintlify
preApplyUnionDiscriminators: true preApplyUnionDiscriminators: true
python: python:
version: 0.11.25 version: 0.11.26
additionalDependencies: additionalDependencies:
dev: {} dev: {}
main: {} main: {}
+47
View File
@@ -18289,6 +18289,41 @@ components:
required: required:
- type - type
type: object type: object
PricingOverride:
description: >-
A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.
example:
completion: '0.00002'
min_prompt_tokens: 200000
prompt: '0.000005'
properties:
audio:
description: Overridden price in USD per audio input token
type: string
completion:
description: Overridden price in USD per token for completion (output) generation
type: string
input_audio_cache:
description: Overridden price in USD per cached audio input token
type: string
input_cache_read:
description: Overridden price in USD per cached input token (read)
type: string
input_cache_write:
description: Overridden price in USD per cache-write token
type: string
input_cache_write_1h:
description: Overridden price in USD per 1-hour cache-write token
type: string
min_prompt_tokens:
description: >-
Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold
format: double
type: number
prompt:
description: Overridden price in USD per token for prompt (input) processing
type: string
type: object
PromptCacheBreakpoint: PromptCacheBreakpoint:
description: >- description: >-
Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer. Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer.
@@ -19397,6 +19432,12 @@ components:
internal_reasoning: internal_reasoning:
description: Price in USD per internal reasoning token description: Price in USD per internal reasoning token
type: string type: string
overrides:
description: >-
Conditional overrides of the base pricing (e.g. long-context pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.
items:
$ref: '#/components/schemas/PricingOverride'
type: array
prompt: prompt:
description: Price in USD per token for prompt (input) processing description: Price in USD per token for prompt (input) processing
type: string type: string
@@ -19514,6 +19555,12 @@ components:
internal_reasoning: internal_reasoning:
description: Price in USD per internal reasoning token description: Price in USD per internal reasoning token
type: string type: string
overrides:
description: >-
Conditional overrides of the base pricing (e.g. long-context pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.
items:
$ref: '#/components/schemas/PricingOverride'
type: array
prompt: prompt:
description: Price in USD per token for prompt (input) processing description: Price in USD per token for prompt (input) processing
type: string type: string
+5 -5
View File
@@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0
sources: sources:
OpenRouter API: OpenRouter API:
sourceNamespace: open-router-chat-completions-api sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:c4b604e524d65fc80cad85d0620c391b70d087ed384bbb1ed03166267524ec3d sourceRevisionDigest: sha256:9f8353c6af76d729784ad0e73d4c232043cf6f308a01acd3975ec748a1751559
sourceBlobDigest: sha256:59fc42341a3b4ae0f2344e88df306b70fb85b526e84e1c274c006afb7d99153b sourceBlobDigest: sha256:d2e958ad60806d999cd37686274fff162f0dd4e52954a1edb49f19e037eeda6e
tags: tags:
- latest - latest
- 1.0.0 - 1.0.0
@@ -11,10 +11,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:c4b604e524d65fc80cad85d0620c391b70d087ed384bbb1ed03166267524ec3d sourceRevisionDigest: sha256:9f8353c6af76d729784ad0e73d4c232043cf6f308a01acd3975ec748a1751559
sourceBlobDigest: sha256:59fc42341a3b4ae0f2344e88df306b70fb85b526e84e1c274c006afb7d99153b sourceBlobDigest: sha256:d2e958ad60806d999cd37686274fff162f0dd4e52954a1edb49f19e037eeda6e
codeSamplesNamespace: open-router-python-code-samples codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:b959c03fc95af18ab71b3e8edc54d3a74d06d0a3f0d786576f3ab1a1c049cdd0 codeSamplesRevisionDigest: sha256:f68472bc77963d676f750b164b9991d49fc9b394fb05f7aba9907616cdaa54b1
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: 1.787.0 speakeasyVersion: 1.787.0
+11 -1
View File
@@ -358,4 +358,14 @@ Based on:
### Generated ### Generated
- [python v0.11.25] . - [python v0.11.25] .
### Releases ### Releases
- [PyPI v0.11.25] https://pypi.org/project/openrouter/0.11.25 - . - [PyPI v0.11.25] https://pypi.org/project/openrouter/0.11.25 - .
## 2026-07-13 19:27:34
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.11.26] .
### Releases
- [PyPI v0.11.26] https://pypi.org/project/openrouter/0.11.26 - .
+18 -17
View File
@@ -4,20 +4,21 @@ title: "Pricing"
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token | | `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token |
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token | | `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token |
| `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation | | `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation |
| `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) | | `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) |
| `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image | | `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image |
| `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image | | `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image |
| `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token | | `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token |
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token | | `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token |
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) | | `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) |
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. | | `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. |
| `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. | | `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. |
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token | | `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token |
| `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing | | `overrides` | List[[components.PricingOverride](../components/pricingoverride.mdx)] | :heavy_minus_sign: | Conditional overrides of the base pricing (e.g. long-context pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions. |
| `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request | | `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing |
| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search | | `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request |
| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search |
+19
View File
@@ -0,0 +1,19 @@
---
title: "PricingOverride"
---
A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `audio` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per audio input token |
| `completion` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per token for completion (output) generation |
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per cached audio input token |
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per cached input token (read) |
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per cache-write token |
| `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 |
+18 -17
View File
@@ -7,20 +7,21 @@ Pricing information for the model
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token | | `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token |
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token | | `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token |
| `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation | | `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation |
| `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) | | `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) |
| `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image | | `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image |
| `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image | | `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image |
| `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token | | `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token |
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token | | `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token |
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) | | `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) |
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. | | `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. |
| `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. | | `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. |
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token | | `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token |
| `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing | | `overrides` | List[[components.PricingOverride](../components/pricingoverride.mdx)] | :heavy_minus_sign: | Conditional overrides of the base pricing (e.g. long-context pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions. |
| `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request | | `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing |
| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search | | `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request |
| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search |
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "openrouter" name = "openrouter"
version = "0.11.25" version = "0.11.26"
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.11.25" __version__: str = "0.11.26"
__openapi_doc_version__: str = "1.0.0" __openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0" __gen_version__: str = "2.914.0"
__user_agent__: str = "speakeasy-sdk/python 0.11.25 2.914.0 1.0.0 openrouter" __user_agent__: str = "speakeasy-sdk/python 0.11.26 2.914.0 1.0.0 openrouter"
try: try:
if __package__ is not None: if __package__ is not None:
+5
View File
@@ -2203,6 +2203,7 @@ if TYPE_CHECKING:
PreviewWebSearchUserLocationType, PreviewWebSearchUserLocationType,
PreviewWebSearchUserLocationTypedDict, PreviewWebSearchUserLocationTypedDict,
) )
from .pricingoverride import PricingOverride, PricingOverrideTypedDict
from .promptcachebreakpoint import ( from .promptcachebreakpoint import (
PromptCacheBreakpoint, PromptCacheBreakpoint,
PromptCacheBreakpointMode, PromptCacheBreakpointMode,
@@ -4346,6 +4347,8 @@ __all__ = [
"PreviewWebSearchUserLocationTypedDict", "PreviewWebSearchUserLocationTypedDict",
"PriceSource", "PriceSource",
"Pricing", "Pricing",
"PricingOverride",
"PricingOverrideTypedDict",
"PricingTypedDict", "PricingTypedDict",
"PromptCacheBreakpoint", "PromptCacheBreakpoint",
"PromptCacheBreakpointMode", "PromptCacheBreakpointMode",
@@ -6542,6 +6545,8 @@ _dynamic_imports: dict[str, str] = {
"PreviewWebSearchUserLocation": ".preview_websearchuserlocation", "PreviewWebSearchUserLocation": ".preview_websearchuserlocation",
"PreviewWebSearchUserLocationType": ".preview_websearchuserlocation", "PreviewWebSearchUserLocationType": ".preview_websearchuserlocation",
"PreviewWebSearchUserLocationTypedDict": ".preview_websearchuserlocation", "PreviewWebSearchUserLocationTypedDict": ".preview_websearchuserlocation",
"PricingOverride": ".pricingoverride",
"PricingOverrideTypedDict": ".pricingoverride",
"PromptCacheBreakpoint": ".promptcachebreakpoint", "PromptCacheBreakpoint": ".promptcachebreakpoint",
"PromptCacheBreakpointMode": ".promptcachebreakpoint", "PromptCacheBreakpointMode": ".promptcachebreakpoint",
"PromptCacheBreakpointTypedDict": ".promptcachebreakpoint", "PromptCacheBreakpointTypedDict": ".promptcachebreakpoint",
@@ -0,0 +1,83 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel, UNSET_SENTINEL
from pydantic import model_serializer
from typing import Optional
from typing_extensions import NotRequired, TypedDict
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) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price."""
audio: NotRequired[str]
r"""Overridden price in USD per audio input token"""
completion: NotRequired[str]
r"""Overridden price in USD per token for completion (output) generation"""
input_audio_cache: NotRequired[str]
r"""Overridden price in USD per cached audio input token"""
input_cache_read: NotRequired[str]
r"""Overridden price in USD per cached input token (read)"""
input_cache_write: NotRequired[str]
r"""Overridden price in USD per cache-write token"""
input_cache_write_1h: NotRequired[str]
r"""Overridden price in USD per 1-hour cache-write token"""
min_prompt_tokens: NotRequired[float]
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"""
class PricingOverride(BaseModel):
r"""A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price."""
audio: Optional[str] = None
r"""Overridden price in USD per audio input token"""
completion: Optional[str] = None
r"""Overridden price in USD per token for completion (output) generation"""
input_audio_cache: Optional[str] = None
r"""Overridden price in USD per cached audio input token"""
input_cache_read: Optional[str] = None
r"""Overridden price in USD per cached input token (read)"""
input_cache_write: Optional[str] = None
r"""Overridden price in USD per cache-write token"""
input_cache_write_1h: Optional[str] = None
r"""Overridden price in USD per 1-hour cache-write token"""
min_prompt_tokens: Optional[float] = None
r"""Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold"""
prompt: Optional[str] = None
r"""Overridden price in USD per token for prompt (input) processing"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
[
"audio",
"completion",
"input_audio_cache",
"input_cache_read",
"input_cache_write",
"input_cache_write_1h",
"min_prompt_tokens",
"prompt",
]
)
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k, serialized.get(n))
if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val
return m
@@ -4,6 +4,7 @@ from __future__ import annotations
from .endpointstatus import EndpointStatus from .endpointstatus import EndpointStatus
from .parameter import Parameter from .parameter import Parameter
from .percentilestats import PercentileStats, PercentileStatsTypedDict from .percentilestats import PercentileStats, PercentileStatsTypedDict
from .pricingoverride import PricingOverride, PricingOverrideTypedDict
from .providername import ProviderName from .providername import ProviderName
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr
from pydantic import model_serializer from pydantic import model_serializer
@@ -38,6 +39,8 @@ class PricingTypedDict(TypedDict):
r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.""" r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic."""
internal_reasoning: NotRequired[str] internal_reasoning: NotRequired[str]
r"""Price in USD per internal reasoning token""" r"""Price in USD per internal reasoning token"""
overrides: NotRequired[List[PricingOverrideTypedDict]]
r"""Conditional overrides of the base pricing (e.g. long-context pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions."""
request: NotRequired[str] request: NotRequired[str]
r"""Price in USD per request""" r"""Price in USD per request"""
web_search: NotRequired[str] web_search: NotRequired[str]
@@ -84,6 +87,9 @@ class Pricing(BaseModel):
internal_reasoning: Optional[str] = None internal_reasoning: Optional[str] = None
r"""Price in USD per internal reasoning token""" r"""Price in USD per internal reasoning token"""
overrides: Optional[List[PricingOverride]] = None
r"""Conditional overrides of the base pricing (e.g. long-context pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions."""
request: Optional[str] = None request: Optional[str] = None
r"""Price in USD per request""" r"""Price in USD per request"""
@@ -105,6 +111,7 @@ class Pricing(BaseModel):
"input_cache_write", "input_cache_write",
"input_cache_write_1h", "input_cache_write_1h",
"internal_reasoning", "internal_reasoning",
"overrides",
"request", "request",
"web_search", "web_search",
] ]
+8 -1
View File
@@ -1,9 +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 .pricingoverride import PricingOverride, PricingOverrideTypedDict
from openrouter.types import BaseModel, UNSET_SENTINEL from openrouter.types import BaseModel, UNSET_SENTINEL
from pydantic import model_serializer from pydantic import model_serializer
from typing import Optional from typing import List, Optional
from typing_extensions import NotRequired, TypedDict from typing_extensions import NotRequired, TypedDict
@@ -36,6 +37,8 @@ class PublicPricingTypedDict(TypedDict):
r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.""" r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic."""
internal_reasoning: NotRequired[str] internal_reasoning: NotRequired[str]
r"""Price in USD per internal reasoning token""" r"""Price in USD per internal reasoning token"""
overrides: NotRequired[List[PricingOverrideTypedDict]]
r"""Conditional overrides of the base pricing (e.g. long-context pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions."""
request: NotRequired[str] request: NotRequired[str]
r"""Price in USD per request""" r"""Price in USD per request"""
web_search: NotRequired[str] web_search: NotRequired[str]
@@ -84,6 +87,9 @@ class PublicPricing(BaseModel):
internal_reasoning: Optional[str] = None internal_reasoning: Optional[str] = None
r"""Price in USD per internal reasoning token""" r"""Price in USD per internal reasoning token"""
overrides: Optional[List[PricingOverride]] = None
r"""Conditional overrides of the base pricing (e.g. long-context pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions."""
request: Optional[str] = None request: Optional[str] = None
r"""Price in USD per request""" r"""Price in USD per request"""
@@ -105,6 +111,7 @@ class PublicPricing(BaseModel):
"input_cache_write", "input_cache_write",
"input_cache_write_1h", "input_cache_write_1h",
"internal_reasoning", "internal_reasoning",
"overrides",
"request", "request",
"web_search", "web_search",
] ]
Generated
+1 -1
View File
@@ -213,7 +213,7 @@ wheels = [
[[package]] [[package]]
name = "openrouter" name = "openrouter"
version = "0.11.25" version = "0.11.26"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "httpcore" }, { name = "httpcore" },