diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index d6af9c3d..c4c4cf13 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: 391051bbe72c2ad9d26d4bcc8bdc9a54
+ docChecksum: b002127df9dff8bca921a5301f7a36ed
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
- releaseVersion: 1.1.112
- configChecksum: 51428b5e8a27ddf2788d8d5c76bb9db2
+ releaseVersion: 1.1.113
+ configChecksum: 0250e77937cc0d157589b7bc4e0a40ef
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: b2dd422a-ced6-4187-ab9a-62ac3c0e5087
- pristine_commit_hash: 253ef389d0a7f9e472554be901e41616bba27ddc
- pristine_tree_hash: 5b7a07d09178eb51eb08b64ebc9b0cd0a1636eb1
+ generation_id: c791fa1c-d5a4-4047-8325-b971f499d770
+ pristine_commit_hash: e0d142b3bbe8c2b2512e6908f4f9d3c79ace8f93
+ pristine_tree_hash: f3e10f9d7eca1a441f4b617ae5837a6527bdb022
features:
python:
acceptHeaders: 3.0.0
@@ -1210,8 +1210,8 @@ trackedFiles:
pristine_git_object: 48386287b072381a9b59de6ae804b0ffbbab221a
docs/components/chatusage.mdx:
id: d7c2bc8b3eb2
- last_write_checksum: sha1:15255340388de8352f60d78e04e8cff33b50daf8
- pristine_git_object: e6412c87ff834c3727d6c5820171250cf1d8ada6
+ last_write_checksum: sha1:94539927996d770b9629c64bde6d8188976eec1d
+ pristine_git_object: a32fff446094a26dfa62cdfcd02b5bc3c1293a72
docs/components/chatusagecompletiontokensdetails.mdx:
id: 0274e721a9d9
last_write_checksum: sha1:77e7b8ae3c4456f4284f4fbd0093d00fdefd06c9
@@ -1598,8 +1598,8 @@ trackedFiles:
pristine_git_object: df0f53d79f8acca641d7f13a00c706f2c7883752
docs/components/costdetails.mdx:
id: 15349f1e1877
- last_write_checksum: sha1:82388f28c4c4274307084c3dcf79c08756801f6f
- pristine_git_object: a253de5165a3148b8321c0c7daa418551e65b8b8
+ last_write_checksum: sha1:52fbeb13368062cb38360de781a64f54f2c1bf43
+ pristine_git_object: eeda364d2acbb840c15a3f5cc143cf10d1044c74
docs/components/createbyokkeyrequest.mdx:
id: 2af3019aa2a7
last_write_checksum: sha1:a61a6569552f17904c29e6ed273c6e0faef04926
@@ -2458,8 +2458,8 @@ trackedFiles:
pristine_git_object: cabf0cccfa7d7bee9faa823d66650bc395220966
docs/components/imagegenerationusage.mdx:
id: 0f8faafc5148
- last_write_checksum: sha1:d33384d2c9ad53fd06bbfd012480d9f07aa99511
- pristine_git_object: 2785a73830d811d113ae81de25dff213b86f1195
+ last_write_checksum: sha1:7662a98019e0fb829b124d14f938ee07f5ef5519
+ pristine_git_object: cb01cf31c16ba5f1caea0be6b376e83ee0d82b59
docs/components/imagegenerationusagecompletiontokensdetails.mdx:
id: 71ecb25e164d
last_write_checksum: sha1:f0843acffd7d7540b07bb384f299557e7309950d
@@ -3682,8 +3682,8 @@ trackedFiles:
pristine_git_object: 09effe2d3fe45536c8b0aa0f23c02ce19b15f62c
docs/components/openresponsesresult.mdx:
id: d0fed85674d2
- last_write_checksum: sha1:3a89b8dea8dca1fafc0941a83dd6e38e085b7fc4
- pristine_git_object: 55c8be43f6c7b07dbd479d524faa05bb91e5a1bd
+ last_write_checksum: sha1:3bc26b772dfc3397c0da7b769b16d938eede91fb
+ pristine_git_object: f5c81b7142316cd4a6ec8a96c192b682a1a34ff8
docs/components/openresponsesresultobject.mdx:
id: 93b1fcc70132
last_write_checksum: sha1:7579ee1bb9e0d20c55cf54a8ca2ccbc950d2921d
@@ -5686,8 +5686,8 @@ trackedFiles:
pristine_git_object: bdccd14638993ccc967858574f6891c7033dc78d
docs/components/usagecostdetails.mdx:
id: 95d8a52fead9
- last_write_checksum: sha1:4ff989240588aff3fa1f6766735744e8add8b4b5
- pristine_git_object: 79a3f1a3b42c6c7e91fc4f2f0703a83d8362887a
+ last_write_checksum: sha1:a219616ceea34ec8687c7fda95c9214404978d19
+ pristine_git_object: f7efeafacd0f11565d6bcf8e44011cc64a6a7cdb
docs/components/userlocation.mdx:
id: d197ccf2b36c
last_write_checksum: sha1:c7078ea2cd00c001dcef6ce68c790b9d3d718e2b
@@ -6146,8 +6146,8 @@ trackedFiles:
pristine_git_object: 4efeda7aa813ebf97131645e6af8e49853731100
docs/operations/createembeddingsusage.mdx:
id: 4f9205ca2bb9
- last_write_checksum: sha1:a8e6161d696082a97e88aad4486af964de493a9b
- pristine_git_object: 0bfcb70713b28628e0f01d74d44349aeb76c1b3a
+ last_write_checksum: sha1:8156e256387b12cc08a5a92f9e9332ec2b35a2af
+ pristine_git_object: 1218cf960cbc2285120cb399596e0bc73b44aa9f
docs/operations/createguardrailglobals.mdx:
id: ce6e792df15c
last_write_checksum: sha1:6542508eed5dbd74bf6812b8cc0cc9cfd3157d06
@@ -7458,8 +7458,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:22be002a440c13f8a9a4ac3df57128b2120cdb71
- pristine_git_object: b06eb5aba73cf71602d0a12055e249e4d48678eb
+ last_write_checksum: sha1:864c9c2dd1b9e238561b3b05c2215f2306b365c3
+ pristine_git_object: 557f846b36ed91a83ce9fc38f1ce7acebcdef317
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -7486,8 +7486,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:a6466e2fb6b09ffa28b5a3039bd0ee92eed793dc
- pristine_git_object: acf7031462e82a81914ac31b23acf7fb36d856aa
+ last_write_checksum: sha1:f0dc7bf4a152a2658bda4f4add4a8fb8cc9b08df
+ pristine_git_object: dad408a9fafc28fde91e474c45c690b2d8d130ff
src/openrouter/analytics.py:
id: cb406b5aaabb
last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9
@@ -8230,8 +8230,8 @@ trackedFiles:
pristine_git_object: f6e8d18d3b51501a3a2b7d7527a64fa02b9b1726
src/openrouter/components/costdetails.py:
id: 513b4309de6e
- last_write_checksum: sha1:77d14d6491dfe72141a0ee708b719ad5f2974838
- pristine_git_object: 7e114e7ff311b65b7f8d3865d6df5f3501c9d704
+ last_write_checksum: sha1:86be7d0f74dc9f95fff4dbafed62541a353a0e8b
+ pristine_git_object: 15b66bb18088bd61cccfa17e1cb5ef26c02abc84
src/openrouter/components/createbyokkeyrequest.py:
id: 238e868445b4
last_write_checksum: sha1:5320d73056ed0e00b264e7dda3d7f6086fc6664a
@@ -9078,8 +9078,8 @@ trackedFiles:
pristine_git_object: 08d990d8cc07b7928158fc55784cd9d613f4c58b
src/openrouter/components/openresponsesresult.py:
id: 78f7e33b19e6
- last_write_checksum: sha1:5c97217073a3863866f16b9fe8dc77f222f50cab
- pristine_git_object: 57b085a5447e7c3ab3ef867293dd37c6620ae2be
+ last_write_checksum: sha1:097994d2b5fe6a30c8711454cb14487f18b010e5
+ pristine_git_object: 00a824eb35427b2660fb4cb705d55c601670bfa1
src/openrouter/components/openrouterfile.py:
id: df1961bcb130
last_write_checksum: sha1:1a9a1b1e640f4d0ef78ce0caa160b5ab342f02cc
@@ -12549,6 +12549,3 @@ examples:
"503":
application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}}
examplesVersion: 1.0.2
-releaseNotes: |
- ## Python SDK Changes:
- * `open_router.presets.create_presets_messages()`: `request` **Changed**
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index 95ad8fee..9537009f 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.1.112
+ version: 1.1.113
additionalDependencies:
dev: {}
main: {}
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index d557d19b..dc1fb363 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -7199,13 +7199,12 @@ components:
CostDetails:
description: 'Breakdown of upstream inference costs'
example:
- server_tool_cost: null
upstream_inference_completions_cost: 0.0004
upstream_inference_cost: null
upstream_inference_prompt_cost: 0.0008
properties:
server_tool_cost:
- description: 'Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly.'
+ description: 'Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran.'
format: 'double'
type:
- 'number'
@@ -26349,7 +26348,7 @@ components:
cost_details:
properties:
server_tool_cost:
- description: 'Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly.'
+ description: 'Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran.'
format: 'double'
type:
- 'number'
@@ -26380,7 +26379,6 @@ components:
example:
cost: 0.0012
cost_details:
- server_tool_cost: null
upstream_inference_cost: null
upstream_inference_input_cost: 0.0008
upstream_inference_output_cost: 0.0004
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 39919240..66a5b7d6 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:3938ad2e3c92f8987a92156cab37108879cd9a562f632d7e879510073773f644
- sourceBlobDigest: sha256:f3d63f1beba255b5508085865039251cc3b27078e7c6c794ad385f1a7100406c
+ sourceRevisionDigest: sha256:b193e864103dfe5dbd12f6cc86d7b43aed39fba3b7395ee95093174312d0bc3b
+ sourceBlobDigest: sha256:0cdfc5409c94c34f73dc5f96dcf7a16e48891a674b673dd0904f15c2ff2f2806
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:3938ad2e3c92f8987a92156cab37108879cd9a562f632d7e879510073773f644
- sourceBlobDigest: sha256:f3d63f1beba255b5508085865039251cc3b27078e7c6c794ad385f1a7100406c
+ sourceRevisionDigest: sha256:b193e864103dfe5dbd12f6cc86d7b43aed39fba3b7395ee95093174312d0bc3b
+ sourceBlobDigest: sha256:0cdfc5409c94c34f73dc5f96dcf7a16e48891a674b673dd0904f15c2ff2f2806
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:95852bded8c80af34c4659490932163f1964d4639ae466559ca1ec0715a34040
+ codeSamplesRevisionDigest: sha256:b860210485dca6172d1d568535349488c06d6fc92f4c3a661c9e4a6d40ac484c
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
diff --git a/RELEASES.md b/RELEASES.md
index dade8223..4f5de007 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1909,4 +1909,14 @@ Based on:
### Generated
- [python v1.1.112] .
### Releases
-- [PyPI v1.1.112] https://pypi.org/project/openrouter/1.1.112 - .
\ No newline at end of file
+- [PyPI v1.1.112] https://pypi.org/project/openrouter/1.1.112 - .
+
+## 2026-09-02 04:33:44
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.1.113] .
+### Releases
+- [PyPI v1.1.113] https://pypi.org/project/openrouter/1.1.113 - .
\ No newline at end of file
diff --git a/docs/components/chatusage.mdx b/docs/components/chatusage.mdx
index e6412c87..a32fff44 100644
--- a/docs/components/chatusage.mdx
+++ b/docs/components/chatusage.mdx
@@ -7,14 +7,14 @@ Token usage statistics
## Fields
-| Field | Type | Required | Description | Example |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `completion_tokens` | *int* | :heavy_check_mark: | Number of tokens in the completion | |
-| `completion_tokens_details` | [OptionalNullable[components.ChatUsageCompletionTokensDetails]](../components/chatusagecompletiontokensdetails.mdx) | :heavy_minus_sign: | Detailed completion token usage | |
-| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | |
-| `cost_details` | [OptionalNullable[components.CostDetails]](../components/costdetails.mdx) | :heavy_minus_sign: | Breakdown of upstream inference costs | \{
"server_tool_cost": null,
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} |
-| `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | |
-| `prompt_tokens` | *int* | :heavy_check_mark: | Number of tokens in the prompt | |
-| `prompt_tokens_details` | [OptionalNullable[components.ChatUsagePromptTokensDetails]](../components/chatusageprompttokensdetails.mdx) | :heavy_minus_sign: | Detailed prompt token usage | |
-| `server_tool_use_details` | [OptionalNullable[components.ServerToolUseDetails]](../components/servertoolusedetails.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | \{
"tool_calls_executed": 2,
"tool_calls_requested": 2,
"web_search_requests": 2
} |
-| `total_tokens` | *int* | :heavy_check_mark: | Total number of tokens | |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| `completion_tokens` | *int* | :heavy_check_mark: | Number of tokens in the completion | |
+| `completion_tokens_details` | [OptionalNullable[components.ChatUsageCompletionTokensDetails]](../components/chatusagecompletiontokensdetails.mdx) | :heavy_minus_sign: | Detailed completion token usage | |
+| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | |
+| `cost_details` | [OptionalNullable[components.CostDetails]](../components/costdetails.mdx) | :heavy_minus_sign: | Breakdown of upstream inference costs | \{
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} |
+| `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | |
+| `prompt_tokens` | *int* | :heavy_check_mark: | Number of tokens in the prompt | |
+| `prompt_tokens_details` | [OptionalNullable[components.ChatUsagePromptTokensDetails]](../components/chatusageprompttokensdetails.mdx) | :heavy_minus_sign: | Detailed prompt token usage | |
+| `server_tool_use_details` | [OptionalNullable[components.ServerToolUseDetails]](../components/servertoolusedetails.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | \{
"tool_calls_executed": 2,
"tool_calls_requested": 2,
"web_search_requests": 2
} |
+| `total_tokens` | *int* | :heavy_check_mark: | Total number of tokens | |
\ No newline at end of file
diff --git a/docs/components/costdetails.mdx b/docs/components/costdetails.mdx
index a253de51..eeda364d 100644
--- a/docs/components/costdetails.mdx
+++ b/docs/components/costdetails.mdx
@@ -7,9 +7,9 @@ Breakdown of upstream inference costs
## Fields
-| Field | Type | Required | Description |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `server_tool_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. |
-| `upstream_inference_completions_cost` | *float* | :heavy_check_mark: | N/A |
-| `upstream_inference_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
-| `upstream_inference_prompt_cost` | *float* | :heavy_check_mark: | N/A |
\ No newline at end of file
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `server_tool_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran. |
+| `upstream_inference_completions_cost` | *float* | :heavy_check_mark: | N/A |
+| `upstream_inference_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
+| `upstream_inference_prompt_cost` | *float* | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/imagegenerationusage.mdx b/docs/components/imagegenerationusage.mdx
index 2785a738..cb01cf31 100644
--- a/docs/components/imagegenerationusage.mdx
+++ b/docs/components/imagegenerationusage.mdx
@@ -7,18 +7,18 @@ Token and cost usage for the image generation request, when available
## Fields
-| Field | Type | Required | Description | Example |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `cache_creation` | [OptionalNullable[components.AnthropicCacheCreation]](../components/anthropiccachecreation.mdx) | :heavy_minus_sign: | N/A | \{
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 100
} |
-| `completion_tokens` | *int* | :heavy_check_mark: | The tokens generated | |
-| `completion_tokens_details` | [OptionalNullable[components.ImageGenerationUsageCompletionTokensDetails]](../components/imagegenerationusagecompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | |
-| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | |
-| `cost_details` | [OptionalNullable[components.CostDetails]](../components/costdetails.mdx) | :heavy_minus_sign: | Breakdown of upstream inference costs | \{
"server_tool_cost": null,
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} |
-| `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | |
-| `iterations` | List[[components.AnthropicUsageIteration](../components/anthropicusageiteration.mdx)] | :heavy_minus_sign: | N/A | |
-| `prompt_tokens` | *int* | :heavy_check_mark: | Including images, input audio, and tools if any | |
-| `prompt_tokens_details` | [OptionalNullable[components.ImageGenerationUsagePromptTokensDetails]](../components/imagegenerationusageprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | |
-| `server_tool_use` | [OptionalNullable[components.ServerToolUse]](../components/servertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | |
-| `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | |
-| `speed` | [OptionalNullable[components.AnthropicSpeed]](../components/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard |
-| `total_tokens` | *int* | :heavy_check_mark: | Sum of the above two fields | |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
+| `cache_creation` | [OptionalNullable[components.AnthropicCacheCreation]](../components/anthropiccachecreation.mdx) | :heavy_minus_sign: | N/A | \{
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 100
} |
+| `completion_tokens` | *int* | :heavy_check_mark: | The tokens generated | |
+| `completion_tokens_details` | [OptionalNullable[components.ImageGenerationUsageCompletionTokensDetails]](../components/imagegenerationusagecompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | |
+| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | |
+| `cost_details` | [OptionalNullable[components.CostDetails]](../components/costdetails.mdx) | :heavy_minus_sign: | Breakdown of upstream inference costs | \{
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} |
+| `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | |
+| `iterations` | List[[components.AnthropicUsageIteration](../components/anthropicusageiteration.mdx)] | :heavy_minus_sign: | N/A | |
+| `prompt_tokens` | *int* | :heavy_check_mark: | Including images, input audio, and tools if any | |
+| `prompt_tokens_details` | [OptionalNullable[components.ImageGenerationUsagePromptTokensDetails]](../components/imagegenerationusageprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | |
+| `server_tool_use` | [OptionalNullable[components.ServerToolUse]](../components/servertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | |
+| `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | |
+| `speed` | [OptionalNullable[components.AnthropicSpeed]](../components/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard |
+| `total_tokens` | *int* | :heavy_check_mark: | Sum of the above two fields | |
\ No newline at end of file
diff --git a/docs/components/openresponsesresult.mdx b/docs/components/openresponsesresult.mdx
index 55c8be43..f5c81b71 100644
--- a/docs/components/openresponsesresult.mdx
+++ b/docs/components/openresponsesresult.mdx
@@ -7,42 +7,42 @@ Complete non-streaming response from the Responses API
## Fields
-| Field | Type | Required | Description | Example |
-| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
-| `completed_at` | *Nullable[int]* | :heavy_check_mark: | N/A | |
-| `created_at` | *int* | :heavy_check_mark: | N/A | |
-| `error` | [Nullable[components.ResponsesErrorField]](../components/responseserrorfield.mdx) | :heavy_check_mark: | Error information returned from the API | \{
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Please try again later."
} |
-| `frequency_penalty` | *Nullable[float]* | :heavy_check_mark: | N/A | |
-| `id` | *str* | :heavy_check_mark: | N/A | |
-| `incomplete_details` | [Nullable[components.IncompleteDetails]](../components/incompletedetails.mdx) | :heavy_check_mark: | N/A | \{
"reason": "max_output_tokens"
} |
-| `instructions` | [Nullable[components.BaseInputsUnion]](../components/baseinputsunion.mdx) | :heavy_check_mark: | N/A | [
\{
"content": "What is the weather today?",
"role": "user"
}
] |
-| `max_output_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
-| `max_tool_calls` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
-| `metadata` | Dict[str, *str*] | :heavy_check_mark: | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | \{
"session_id": "abc-def-ghi",
"user_id": "123"
} |
-| `model` | *str* | :heavy_check_mark: | N/A | |
-| `object` | [components.OpenResponsesResultObject](../components/openresponsesresultobject.mdx) | :heavy_check_mark: | N/A | |
-| `output` | List[[components.OutputItems](../components/outputitems.mdx)] | :heavy_check_mark: | N/A | |
-| `output_text` | *Optional[str]* | :heavy_minus_sign: | N/A | |
-| `parallel_tool_calls` | *bool* | :heavy_check_mark: | N/A | |
-| `presence_penalty` | *Nullable[float]* | :heavy_check_mark: | N/A | |
-| `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
-| `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../components/storedprompttemplate.mdx) | :heavy_minus_sign: | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} |
-| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
-| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} |
-| `reasoning` | [OptionalNullable[components.BaseReasoningConfig]](../components/basereasoningconfig.mdx) | :heavy_minus_sign: | N/A | \{
"effort": "medium",
"summary": "auto"
} |
-| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
-| `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
-| `status` | [components.OpenAIResponsesResponseStatus](../components/openairesponsesresponsestatus.mdx) | :heavy_check_mark: | N/A | completed |
-| `store` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
-| `temperature` | *Nullable[float]* | :heavy_check_mark: | N/A | |
-| `text` | [Optional[components.TextExtendedConfig]](../components/textextendedconfig.mdx) | :heavy_minus_sign: | Text output configuration including format and verbosity | \{
"format": \{
"type": "text"
}
} |
-| `tool_choice` | [components.OpenAIResponsesToolChoiceUnion](../components/openairesponsestoolchoiceunion.mdx) | :heavy_check_mark: | N/A | auto |
-| `tools` | List[[components.OpenResponsesResultToolUnion](../components/openresponsesresulttoolunion.mdx)] | :heavy_check_mark: | N/A | |
-| `top_logprobs` | *Optional[int]* | :heavy_minus_sign: | N/A | |
-| `top_p` | *Nullable[float]* | :heavy_check_mark: | N/A | |
-| `truncation` | [OptionalNullable[components.Truncation]](../components/truncation.mdx) | :heavy_minus_sign: | N/A | auto |
-| `usage` | [OptionalNullable[components.Usage]](../components/usage.mdx) | :heavy_minus_sign: | Token usage information for the response | \{
"cost": 0.0012,
"cost_details": \{
"server_tool_cost": null,
"upstream_inference_cost": null,
"upstream_inference_input_cost": 0.0008,
"upstream_inference_output_cost": 0.0004
},
"input_tokens": 10,
"input_tokens_details": \{
"cached_tokens": 0
},
"output_tokens": 25,
"output_tokens_details": \{
"reasoning_tokens": 0
},
"total_tokens": 35
} |
-| `user` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
-| `error_type` | [Optional[components.APIErrorType]](../components/apierrortype.mdx) | :heavy_minus_sign: | Canonical OpenRouter error type, stable across all API formats | rate_limit_exceeded |
-| `openrouter_metadata` | [Optional[components.OpenRouterMetadata]](../components/openroutermetadata.mdx) | :heavy_minus_sign: | N/A | \{
"attempt": 1,
"endpoints": \{
"available": [
\{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
+| `completed_at` | *Nullable[int]* | :heavy_check_mark: | N/A | |
+| `created_at` | *int* | :heavy_check_mark: | N/A | |
+| `error` | [Nullable[components.ResponsesErrorField]](../components/responseserrorfield.mdx) | :heavy_check_mark: | Error information returned from the API | \{
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Please try again later."
} |
+| `frequency_penalty` | *Nullable[float]* | :heavy_check_mark: | N/A | |
+| `id` | *str* | :heavy_check_mark: | N/A | |
+| `incomplete_details` | [Nullable[components.IncompleteDetails]](../components/incompletedetails.mdx) | :heavy_check_mark: | N/A | \{
"reason": "max_output_tokens"
} |
+| `instructions` | [Nullable[components.BaseInputsUnion]](../components/baseinputsunion.mdx) | :heavy_check_mark: | N/A | [
\{
"content": "What is the weather today?",
"role": "user"
}
] |
+| `max_output_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
+| `max_tool_calls` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
+| `metadata` | Dict[str, *str*] | :heavy_check_mark: | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | \{
"session_id": "abc-def-ghi",
"user_id": "123"
} |
+| `model` | *str* | :heavy_check_mark: | N/A | |
+| `object` | [components.OpenResponsesResultObject](../components/openresponsesresultobject.mdx) | :heavy_check_mark: | N/A | |
+| `output` | List[[components.OutputItems](../components/outputitems.mdx)] | :heavy_check_mark: | N/A | |
+| `output_text` | *Optional[str]* | :heavy_minus_sign: | N/A | |
+| `parallel_tool_calls` | *bool* | :heavy_check_mark: | N/A | |
+| `presence_penalty` | *Nullable[float]* | :heavy_check_mark: | N/A | |
+| `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+| `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../components/storedprompttemplate.mdx) | :heavy_minus_sign: | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} |
+| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} |
+| `reasoning` | [OptionalNullable[components.BaseReasoningConfig]](../components/basereasoningconfig.mdx) | :heavy_minus_sign: | N/A | \{
"effort": "medium",
"summary": "auto"
} |
+| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+| `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+| `status` | [components.OpenAIResponsesResponseStatus](../components/openairesponsesresponsestatus.mdx) | :heavy_check_mark: | N/A | completed |
+| `store` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
+| `temperature` | *Nullable[float]* | :heavy_check_mark: | N/A | |
+| `text` | [Optional[components.TextExtendedConfig]](../components/textextendedconfig.mdx) | :heavy_minus_sign: | Text output configuration including format and verbosity | \{
"format": \{
"type": "text"
}
} |
+| `tool_choice` | [components.OpenAIResponsesToolChoiceUnion](../components/openairesponsestoolchoiceunion.mdx) | :heavy_check_mark: | N/A | auto |
+| `tools` | List[[components.OpenResponsesResultToolUnion](../components/openresponsesresulttoolunion.mdx)] | :heavy_check_mark: | N/A | |
+| `top_logprobs` | *Optional[int]* | :heavy_minus_sign: | N/A | |
+| `top_p` | *Nullable[float]* | :heavy_check_mark: | N/A | |
+| `truncation` | [OptionalNullable[components.Truncation]](../components/truncation.mdx) | :heavy_minus_sign: | N/A | auto |
+| `usage` | [OptionalNullable[components.Usage]](../components/usage.mdx) | :heavy_minus_sign: | Token usage information for the response | \{
"cost": 0.0012,
"cost_details": \{
"upstream_inference_cost": null,
"upstream_inference_input_cost": 0.0008,
"upstream_inference_output_cost": 0.0004
},
"input_tokens": 10,
"input_tokens_details": \{
"cached_tokens": 0
},
"output_tokens": 25,
"output_tokens_details": \{
"reasoning_tokens": 0
},
"total_tokens": 35
} |
+| `user` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+| `error_type` | [Optional[components.APIErrorType]](../components/apierrortype.mdx) | :heavy_minus_sign: | Canonical OpenRouter error type, stable across all API formats | rate_limit_exceeded |
+| `openrouter_metadata` | [Optional[components.OpenRouterMetadata]](../components/openroutermetadata.mdx) | :heavy_minus_sign: | N/A | \{
"attempt": 1,
"endpoints": \{
"available": [
\{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} |
\ No newline at end of file
diff --git a/docs/components/usagecostdetails.mdx b/docs/components/usagecostdetails.mdx
index 79a3f1a3..f7efeafa 100644
--- a/docs/components/usagecostdetails.mdx
+++ b/docs/components/usagecostdetails.mdx
@@ -4,9 +4,9 @@ title: "UsageCostDetails"
## Fields
-| Field | Type | Required | Description |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `server_tool_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. |
-| `upstream_inference_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
-| `upstream_inference_input_cost` | *float* | :heavy_check_mark: | N/A |
-| `upstream_inference_output_cost` | *float* | :heavy_check_mark: | N/A |
\ No newline at end of file
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `server_tool_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran. |
+| `upstream_inference_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
+| `upstream_inference_input_cost` | *float* | :heavy_check_mark: | N/A |
+| `upstream_inference_output_cost` | *float* | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/operations/createembeddingsusage.mdx b/docs/operations/createembeddingsusage.mdx
index 0bfcb707..1218cf96 100644
--- a/docs/operations/createembeddingsusage.mdx
+++ b/docs/operations/createembeddingsusage.mdx
@@ -10,7 +10,7 @@ Token usage statistics
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cost` | *Optional[float]* | :heavy_minus_sign: | Cost of the request in credits | 0.0001 |
-| `cost_details` | [OptionalNullable[components.CostDetails]](../components/costdetails.mdx) | :heavy_minus_sign: | Breakdown of upstream inference costs | \{
"server_tool_cost": null,
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} |
+| `cost_details` | [OptionalNullable[components.CostDetails]](../components/costdetails.mdx) | :heavy_minus_sign: | Breakdown of upstream inference costs | \{
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} |
| `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | |
| `prompt_tokens` | *int* | :heavy_check_mark: | Number of tokens in the input | 8 |
| `prompt_tokens_details` | [Optional[operations.PromptTokensDetails]](../operations/prompttokensdetails.mdx) | :heavy_minus_sign: | Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included. | |
diff --git a/pyproject.toml b/pyproject.toml
index b06eb5ab..557f846b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.1.112"
+version = "1.1.113"
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 acf70314..dad408a9 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.112"
+__version__: str = "1.1.113"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
-__user_agent__: str = "speakeasy-sdk/python 1.1.112 2.914.0 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.1.113 2.914.0 1.0.0 openrouter"
try:
if __package__ is not None:
diff --git a/src/openrouter/components/costdetails.py b/src/openrouter/components/costdetails.py
index 7e114e7f..15b66bb1 100644
--- a/src/openrouter/components/costdetails.py
+++ b/src/openrouter/components/costdetails.py
@@ -18,7 +18,7 @@ class CostDetailsTypedDict(TypedDict):
upstream_inference_completions_cost: float
upstream_inference_prompt_cost: float
server_tool_cost: NotRequired[Nullable[float]]
- r"""Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly."""
+ r"""Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran."""
upstream_inference_cost: NotRequired[Nullable[float]]
@@ -30,7 +30,7 @@ class CostDetails(BaseModel):
upstream_inference_prompt_cost: float
server_tool_cost: OptionalNullable[float] = UNSET
- r"""Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly."""
+ r"""Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran."""
upstream_inference_cost: OptionalNullable[float] = UNSET
diff --git a/src/openrouter/components/openresponsesresult.py b/src/openrouter/components/openresponsesresult.py
index 57b085a5..00a824eb 100644
--- a/src/openrouter/components/openresponsesresult.py
+++ b/src/openrouter/components/openresponsesresult.py
@@ -252,7 +252,7 @@ class UsageCostDetailsTypedDict(TypedDict):
upstream_inference_input_cost: float
upstream_inference_output_cost: float
server_tool_cost: NotRequired[Nullable[float]]
- r"""Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly."""
+ r"""Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran."""
upstream_inference_cost: NotRequired[Nullable[float]]
@@ -262,7 +262,7 @@ class UsageCostDetails(BaseModel):
upstream_inference_output_cost: float
server_tool_cost: OptionalNullable[float] = UNSET
- r"""Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly."""
+ r"""Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran."""
upstream_inference_cost: OptionalNullable[float] = UNSET
diff --git a/uv.lock b/uv.lock
index d256c405..7da646dc 100644
--- a/uv.lock
+++ b/uv.lock
@@ -213,7 +213,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.1.112"
+version = "1.1.113"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },