diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index 634a15650..29e9740a1 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: 7c797e9d630b4ac23efde564dad59387
+ docChecksum: 8468014ae21c6d6b2cfe530ed4223f06
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
- releaseVersion: 1.3.81
- configChecksum: c9a7846e033503b0d54df9fb56fb137e
+ releaseVersion: 1.3.82
+ configChecksum: 0fd9dd77f08c999b63282b5c5177726c
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: 57d1669c-3cf6-4921-be7c-753022d06708
- pristine_commit_hash: d1a173118275edb594367d35d448136f3c32e1e7
- pristine_tree_hash: 14467bcfa828495c6c19607e8c5dbceef1ba4043
+ generation_id: a2a88003-7157-430f-b02e-6387210a5301
+ pristine_commit_hash: 98a14e7115503da2434094192c1a041349db476b
+ pristine_tree_hash: 8d08efaebbc18f992f0faa62293f44f91b302d85
features:
python:
acceptHeaders: 3.0.0
@@ -974,6 +974,70 @@ trackedFiles:
id: a88929093ec7
last_write_checksum: sha1:ceb005f67bee30def5d9d56599bd96f49d628c71
pristine_git_object: 0f0d20d3d4e7c3ca82573985906c86a793d8cb57
+ docs/components/anthropictoolunion.mdx:
+ id: c08509f94e51
+ last_write_checksum: sha1:f2635a20e04d956c43aa7e4ad77fee510726a2c6
+ pristine_git_object: df7555a806d3ee96ccdda6a886d37e1725b1044d
+ docs/components/anthropictoolunionbash20250124.mdx:
+ id: ff33c94f4591
+ last_write_checksum: sha1:5e415e88ba00fdbc70e1a649753c49f8011884a8
+ pristine_git_object: 2f1cb1cf43fc98e1fe991e586f85b5fde4c51d46
+ docs/components/anthropictoolunioncustom.mdx:
+ id: 4f255e32d114
+ last_write_checksum: sha1:2a999a165bf2663142f5fff7ea93102d1ed3ecd5
+ pristine_git_object: a22312dc9e95d63b5500799aca2ee289f4082256
+ docs/components/anthropictoolunioninputschema.mdx:
+ id: a0741c3b6162
+ last_write_checksum: sha1:a6272f2e73ec5799142d2dd6ba81715e9628399f
+ pristine_git_object: 88153ad2519f6a49d09c826c443622bb854656c1
+ docs/components/anthropictoolunionnamebash.mdx:
+ id: e6028a720551
+ last_write_checksum: sha1:81d190b1863bdd22d29e20e526a709dfea1ec947
+ pristine_git_object: 9a70757d7116c6aca566632cec3ed764d901d02d
+ docs/components/anthropictoolunionnamestrreplaceeditor.mdx:
+ id: f41f606c3d4f
+ last_write_checksum: sha1:da325c48ea320c97f2beb27e889448938f4142b9
+ pristine_git_object: 8f8f732c736eb2e6e6be35ed8f377ba8b78c82e8
+ docs/components/anthropictoolunionnamewebsearch1.mdx:
+ id: 037f7d7c487b
+ last_write_checksum: sha1:f1ac52d481a0686e5bf092b03fb3c5118a11c858
+ pristine_git_object: 880acf5a550d6228a359cc4d2624c65ab16c2575
+ docs/components/anthropictoolunionnamewebsearch2.mdx:
+ id: ea4b63ca17d2
+ last_write_checksum: sha1:8d0fe7387309e44aeafd1a4ae08cff1ce4ec97a0
+ pristine_git_object: c60300a966f8d06e46a9920e37889a101a99e3c6
+ docs/components/anthropictooluniontexteditor20250124.mdx:
+ id: 041db25bee3a
+ last_write_checksum: sha1:52d0c146b37ec46943978e340ff16494f7918f2a
+ pristine_git_object: 9df4a268bbf5f7fcb5f1cd3d507d4ef9d562e4ec
+ docs/components/anthropictooluniontypebash20250124.mdx:
+ id: e008e5914d5d
+ last_write_checksum: sha1:427ab5075aaf9a71cc9e3ece8d7fa0d558137001
+ pristine_git_object: fd65cf097affd1ad8643bf033aba2f08c385ab05
+ docs/components/anthropictooluniontypecustom.mdx:
+ id: c23185328e4c
+ last_write_checksum: sha1:c3af566dd8bd9546befd79d7219909a64cb4cc04
+ pristine_git_object: 9ea3544bdf98f607653554b01efd57a053e7631f
+ docs/components/anthropictooluniontypetexteditor20250124.mdx:
+ id: b0ef109dcc69
+ last_write_checksum: sha1:726c4aab2ef96064ba9236f00c3e91fa41b32060
+ pristine_git_object: 16e986280d7e03f42c57fcaad367e0657f0c4fbc
+ docs/components/anthropictooluniontypewebsearch20250305.mdx:
+ id: 4eb7e5cf0564
+ last_write_checksum: sha1:eec8fc67a15a736e22244079f3106ba90706039e
+ pristine_git_object: f3d7598889ce74fef23ed3bbae30322273147f11
+ docs/components/anthropictooluniontypewebsearch20260209.mdx:
+ id: 153fbb9b793b
+ last_write_checksum: sha1:f7e50c9cc9416bd931e3c4547a190a6dd153163a
+ pristine_git_object: 0e1216ae0ace74284edca4935f39afaf0ceadee0
+ docs/components/anthropictoolunionwebsearch20250305.mdx:
+ id: a9c1bf5858f3
+ last_write_checksum: sha1:f0976ec5be922c34c6d39a4607da0257d9239adb
+ pristine_git_object: 56fd067322b1f1edd631bf28625e902d6b9cbfcf
+ docs/components/anthropictoolunionwebsearch20260209.mdx:
+ id: a6179f32aa23
+ last_write_checksum: sha1:b60bbf3c9e9776402226b626e615680eb953a8d7
+ pristine_git_object: 6d783c21ce5498cd5b24ffa11543b5195d6bfd7d
docs/components/anthropictooluseblock.mdx:
id: e9af90edd76f
last_write_checksum: sha1:2d902832d1a46da7939c2e7cd059cf0ae4e71964
@@ -3854,10 +3918,6 @@ trackedFiles:
id: f23a98f7a3b4
last_write_checksum: sha1:b6b2e91d01493b2be4729979ced0fecf630d0563
pristine_git_object: 02f31a8f6acdb41c9f91080508699b4df98a91bb
- docs/components/inputschema.mdx:
- id: 4cd0b1f16cc2
- last_write_checksum: sha1:da628a51d79cd1b5e9caf6a29eaaa22a4ca18b26
- pristine_git_object: c86a4f23db78b4ee88356a509cc85ab9bd836c03
docs/components/inputscontent1.mdx:
id: 4d067cae8934
last_write_checksum: sha1:63fc75a1cd64347bbd378217fca9d0f6f760aba3
@@ -4374,10 +4434,30 @@ trackedFiles:
id: 762dd6b894c8
last_write_checksum: sha1:4b4122d8b729ac11fa37c87636b3ff844a4ff60a
pristine_git_object: 112001bf627c7d6bc1763873925c4feb16c0c7ae
+ docs/components/messagesrequestinputschema.mdx:
+ id: 2632c649261a
+ last_write_checksum: sha1:5147a2af942bf7bcfc18deebdbc9721d3554ae7b
+ pristine_git_object: d4ec6c85bf44e5f11052ee527cbde7cb7f1b1b7b
docs/components/messagesrequestmetadata.mdx:
id: facdcaeb2576
last_write_checksum: sha1:42bf112bc4f6d259c589906fd5f67c5342ab4c2d
pristine_git_object: fb2a55630750a5c10fe509403c6d95cbfa8373c5
+ docs/components/messagesrequestnamebash.mdx:
+ id: 2ce709532dfd
+ last_write_checksum: sha1:87b1e3297d1cc91158bff72bdceeae2d1a3529ce
+ pristine_git_object: 22054d0b0365da08555b1b3373de763620bbd6a4
+ docs/components/messagesrequestnamestrreplaceeditor.mdx:
+ id: 6cdf0dc71fbd
+ last_write_checksum: sha1:9572d66f2293356cbdcc2ec42af24c88831aee21
+ pristine_git_object: ef56d7ec94b99ba3dc13a918689a4d483d068cbc
+ docs/components/messagesrequestnamewebsearch1.mdx:
+ id: 9d3564d36df5
+ last_write_checksum: sha1:3a5b5e4411f8dd269b631a001f9cea3b094c05aa
+ pristine_git_object: 4075d84dbdfe3c2a02e25ca4e2e8b31f52eba558
+ docs/components/messagesrequestnamewebsearch2.mdx:
+ id: 102a9d2f6427
+ last_write_checksum: sha1:94f9b7844aef182d612e7d26185a1e89975d3cc7
+ pristine_git_object: 46ed36125ddb6f8747a68fd5d1fa27c0cf83ef59
docs/components/messagesrequestplugin.mdx:
id: 45918e4b5c26
last_write_checksum: sha1:113109958fc7bb1df6f501653a83467909b3d4bc
@@ -4416,8 +4496,8 @@ trackedFiles:
pristine_git_object: dea5b508c1b3cbae6eaf880a0ae183ac18a0c30b
docs/components/messagestooladditionblock.mdx:
id: ee6e08ccc2ae
- last_write_checksum: sha1:b56dd3ae6d6e105c57162a705794a799ffd65533
- pristine_git_object: 5a532b3a3467bd87a7be3b53b5678de2f100366a
+ last_write_checksum: sha1:897c20980a313800e749b587003c1591aa024160
+ pristine_git_object: 904f91aef726698456ef587f518ed20f83d4dc9f
docs/components/messagestooladditionblocktoolmcptoolreference.mdx:
id: 9234e01f465c
last_write_checksum: sha1:bd53c613d701f425326a4e3c1f722940b6ce8abc
@@ -4432,8 +4512,8 @@ trackedFiles:
pristine_git_object: f56ec1fdc2a36533dcd3cabc399b02d815896623
docs/components/messagestooladditionblocktoolunion.mdx:
id: 403384c18cfd
- last_write_checksum: sha1:7b1238036e243c5cb6a7f09225880229f0879f5c
- pristine_git_object: fe8e0e549274161ac8c0cab3516a810eeccd4671
+ last_write_checksum: sha1:bdf8c6b82fcc06a5230e4ea1080f4f0514f908c0
+ pristine_git_object: e31d0fb1659d0593462840e87bbc1dcf8e93a62e
docs/components/messagestooladditionblocktypemcptoolreference.mdx:
id: db2ce8be8ba7
last_write_checksum: sha1:116a77b38bdbd09bc9fa94649046157fc89d26fe
@@ -4570,10 +4650,6 @@ trackedFiles:
id: 6898c8bf3d7c
last_write_checksum: sha1:6f709e45a864c33983c27251b70f2b6e4b35ec4b
pristine_git_object: e7df77cc45a770938d6cc6ecd1458a17abbd166a
- docs/components/namebash.mdx:
- id: bd0cc59f80b0
- last_write_checksum: sha1:63ea02d5ce209d316aefd1628ad03e92c90df033
- pristine_git_object: d6efdde4f36aafc14fa58dcc6b8e50f0d1284dbe
docs/components/namespacefunctiontool.mdx:
id: 8bdce4795cea
last_write_checksum: sha1:5e871cf4eb1267922f4004412f227086e35762bc
@@ -4598,18 +4674,6 @@ trackedFiles:
id: 0e2a1ea660ed
last_write_checksum: sha1:79af847acc341f741baf2f84f8851eaf8fc68357
pristine_git_object: 1f14eda8bde7ebf1ceaf2a2a9750b216d8010ba3
- docs/components/namestrreplaceeditor.mdx:
- id: 736fbbfc3973
- last_write_checksum: sha1:862e18830457a1d4b98062ea58b73a2c9d08131f
- pristine_git_object: 5dea596eef6bebddd80300cc2dc8eeb641506fee
- docs/components/namewebsearch1.mdx:
- id: 6e77fbfdffac
- last_write_checksum: sha1:cbbddb1724aff471233aa2e2eccffc6568a504c9
- pristine_git_object: 41ced4e2fff47aefbc3b51e473b84868a3335241
- docs/components/namewebsearch2.mdx:
- id: fb5e85bb77da
- last_write_checksum: sha1:50190d6fb52c7d673ef87f34e39c620460cf932b
- pristine_git_object: f6803b05fdd0332c58b0d07e2aa819de4a8087c5
docs/components/nativesupport.mdx:
id: ec3bab117cd9
last_write_checksum: sha1:3b4d138d8d3c417acd6a724f5029b3365033656b
@@ -7184,8 +7248,8 @@ trackedFiles:
pristine_git_object: cf0c0f91f3714960af42a62f096739f68e9b63c6
docs/components/toolbash20250124.mdx:
id: acc36fba0c55
- last_write_checksum: sha1:b899d22b5559c09fcaa14c5cd3ff18f914ad34d2
- pristine_git_object: d3a3ea6cfbc5118b9adad9c1a8e543e02fd2870f
+ last_write_checksum: sha1:56911f0941f2ad15a6d3df96925c97f45eeee7ca
+ pristine_git_object: 0c4cf1ac7faa6f4a34d5bf0a60d14321d9d11797
docs/components/toolcall.mdx:
id: fa42aff5b218
last_write_checksum: sha1:d525714d89ba4ac83127dc5a86aa30412d20fe48
@@ -7232,8 +7296,8 @@ trackedFiles:
pristine_git_object: 6817216b64de42e834ab68a072287701e621daa8
docs/components/toolcustom.mdx:
id: b3ea2dbc7af5
- last_write_checksum: sha1:3659a42c9b930d77f5aecb8be29aef877d1502de
- pristine_git_object: a4ed39817c997d4e25266c25d12498e648d77190
+ last_write_checksum: sha1:135b294c89939780e9da6c2eb5c47f7b8e2799fe
+ pristine_git_object: db3bd053239862a642fb18065cd761e44b5011c1
docs/components/toolsearchcallitem.mdx:
id: eb95e04d3021
last_write_checksum: sha1:b502fea9779b201737d5049de618e4f1b2595cfa
@@ -7296,12 +7360,32 @@ trackedFiles:
pristine_git_object: 34647574795a17ce650b9dd104e446cc1af79293
docs/components/tooltexteditor20250124.mdx:
id: 58d2a6f35f9f
- last_write_checksum: sha1:c785aecfc38109c995d4d2f825de0f145d3f626a
- pristine_git_object: a7f1a2731ba8ab1deea97b51e63372e70e3afa0e
+ last_write_checksum: sha1:e6732d0814bd1e2fac0f6609caf9a6203b3348b3
+ pristine_git_object: 4c87dc2b9c76afa49e69e20aedb94bffe789f87a
+ docs/components/tooltooldefinition.mdx:
+ id: 05a8b0f04714
+ last_write_checksum: sha1:0a95408a5a0324596b03ffa48b15064de1ace44a
+ pristine_git_object: 77d4f9f4eb979b4029769f96138c93adee708c4c
+ docs/components/tooltypebash20250124.mdx:
+ id: cce956833074
+ last_write_checksum: sha1:d052ab2f7b6056b1aee66fb6d2f0eaf1a6fcfe61
+ pristine_git_object: 87483beff7ab6596b2dc6e24ddc6b21fcda9fc16
docs/components/tooltypecustom.mdx:
id: ac3c7f5f5fa6
last_write_checksum: sha1:bfbecb3b4e70cb8a4aa0379246f4ffbaae71b341
pristine_git_object: f5ff9bfa009e34e0326ff7ef88e82082e54b20cb
+ docs/components/tooltypetexteditor20250124.mdx:
+ id: 52e5854a9fb4
+ last_write_checksum: sha1:f257a3ffe3463ee2bf35f57d1d7b4a784729f912
+ pristine_git_object: 78ff73de14cb403ff900ad5fd0670adaa96b865d
+ docs/components/tooltypewebsearch20250305.mdx:
+ id: b962615ca241
+ last_write_checksum: sha1:6eb2ddc874127ee964a95c3d9483d286a8f972e3
+ pristine_git_object: 3d96273788238373b00fe3a3ffb6dfa27eaec1ad
+ docs/components/tooltypewebsearch20260209.mdx:
+ id: b35c49c36dec
+ last_write_checksum: sha1:7656712f78bd03d1c4c926914c7c601c85c52f5d
+ pristine_git_object: 1abab2e586ef10b94fc15f212bdd46a6ca1a643e
docs/components/tooluses.mdx:
id: f2dd81f9b4e4
last_write_checksum: sha1:2fd614451dd8e83cbddb25b320058b63ba1f10fe
@@ -7320,12 +7404,12 @@ trackedFiles:
pristine_git_object: 6fead4227ab922832021e7c6e50c1dfdfc7afc85
docs/components/toolwebsearch20250305.mdx:
id: e583eb0b3bd1
- last_write_checksum: sha1:a750dd139f327bf53d4cde02e6b897afa274475b
- pristine_git_object: 36a096412525a09d1903488c804648047782b8be
+ last_write_checksum: sha1:f16d76ecb7ae40bc6e999f67fe12cd2e2b42ce25
+ pristine_git_object: 8f28c39172fd223ad8f96687f06d0580c1d1d4d6
docs/components/toolwebsearch20260209.mdx:
id: dfc99c1c297c
- last_write_checksum: sha1:8237527944c9d8670c8c323ce8bec709602d8322
- pristine_git_object: 062b3155e1ffd04dae559ccc126ff8b922616aee
+ last_write_checksum: sha1:09527e41343ae50c40ea0b05392fd4327f66dbe6
+ pristine_git_object: 04a8fc9196e9b8cae08f97757336d9a9963e8338
docs/components/toomanyrequestsresponseerrordata.mdx:
id: 282b92f982c7
last_write_checksum: sha1:9d3b6a16b957f23c20af5cd2c2d86780de35b2e6
@@ -7398,10 +7482,6 @@ trackedFiles:
id: 497347c01b9b
last_write_checksum: sha1:05e7d05deed0895cb806dcccf13c8b5005d6331d
pristine_git_object: bbd9c9abb3d0c1fcd8022730bc01e3ef7efdf0a8
- docs/components/typebash20250124.mdx:
- id: 0f1fed4892ca
- last_write_checksum: sha1:b57f67ff665ddf959a9078d1fcbd2b1eb9df7a6d
- pristine_git_object: 02338a09349f6a610ed5313dd972a509b088b518
docs/components/typebetweentools.mdx:
id: dd3698fc2dc0
last_write_checksum: sha1:28d18c282da04f0ac699c332a67dcdd233bc7626
@@ -7458,14 +7538,14 @@ trackedFiles:
id: 1fbbd27c03b6
last_write_checksum: sha1:003d0b57065e35457a5f365aec76783fd735125c
pristine_git_object: 797eb174cde7ef02e12c4379cb24208c1406bef2
+ docs/components/typeobject.mdx:
+ id: ee4bc5173ad7
+ last_write_checksum: sha1:d9595102607fda26c36801cfacda0c7eb1163757
+ pristine_git_object: 4ab38541a3a289ebf17e9d17610355c0028e04b0
docs/components/typeskipped.mdx:
id: 8f843e75d342
last_write_checksum: sha1:8212acfffc9f3f7b7272dd791b0fffedaf868d58
pristine_git_object: c5ce724db3d2644b7ba6f7c074512a28d584938e
- docs/components/typetexteditor20250124.mdx:
- id: 6104a1c13bf2
- last_write_checksum: sha1:041007e5b9c7d4ef048d0c380cdadedad4c6066e
- pristine_git_object: 21cc14ae46b99547e0304a43c3f8b0333ed624f5
docs/components/typetimeout.mdx:
id: 719dbf6b334c
last_write_checksum: sha1:97c8ec16454e0abc9eb1e4dc271e8f4736bef54c
@@ -7482,6 +7562,10 @@ trackedFiles:
id: 2c9ccb549f63
last_write_checksum: sha1:69f740c7aae3a6d1ed4495e103a28ffa3c587c48
pristine_git_object: a82c82be673f3a09a54d7288e8af181b1c374e78
+ docs/components/typetooldefinition.mdx:
+ id: 3392bc7469ca
+ last_write_checksum: sha1:3430b2784ef389322b8614951a893afb398df31a
+ pristine_git_object: 077961394807791dad58092bf6f754b2552076f8
docs/components/typetoolremoval.mdx:
id: c704bd12a2c9
last_write_checksum: sha1:902e92a1b4a247443b00e255f8c32c416bfc258d
@@ -7498,14 +7582,6 @@ trackedFiles:
id: f5e16e3838f3
last_write_checksum: sha1:4a7a35b4b66c86f65dcafe1e6fa313fcfa17e68a
pristine_git_object: 9d06705d9db71cc0685cc3afc669f965f4a98d0f
- docs/components/typewebsearch20250305.mdx:
- id: c5cd64905a32
- last_write_checksum: sha1:70d29a41edfb246a4e50bf98bfca9df61809d075
- pristine_git_object: 0eb55d9bee04b297fb97d45ca73536d3878481ce
- docs/components/typewebsearch20260209.mdx:
- id: e9da52a275fb
- last_write_checksum: sha1:0199b41c05d93e272bc16f810d6a4c5915a0f05b
- pristine_git_object: f9c864e42773897569d9dda09658306717fbb5cd
docs/components/typewebsearchcitation.mdx:
id: bb828f6f1c61
last_write_checksum: sha1:0adc7248631ed70de2b4c6533afa1216a96d22c7
@@ -9976,8 +10052,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:dc709e21384b23e887bd6d2f586882b22f8d7a6f
- pristine_git_object: d0ee03e5ac9417c2e44f7ff73871c5146575d51d
+ last_write_checksum: sha1:30f518c065a2035ceb1922db0ed2d4c721e5ae9e
+ pristine_git_object: e055e6ffdb236bd945862219a1496ff051c9565e
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -10004,8 +10080,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:ec048140fa9fffd7defdc44c2a54084b693c4a8e
- pristine_git_object: 2484d012047f09f32394bc7904224d7e2f844cd3
+ last_write_checksum: sha1:87b47c2646ed28bff3c322234619bad2e187dbb3
+ pristine_git_object: 0c690e1a9771bdfd13c2432ae60c83b287c06729
src/openrouter/alpha.py:
id: 306c4d93308d
last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a
@@ -10052,8 +10128,8 @@ trackedFiles:
pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1
src/openrouter/components/__init__.py:
id: 81754e97b3f4
- last_write_checksum: sha1:2a8f0287e3b5b6469dd81f3ee023d94ad66b7a6b
- pristine_git_object: 6c2399427a0ddffad32984cd7276da330bd5819e
+ last_write_checksum: sha1:7e3f1389dc13717a35ed760c9186fc7819a8242b
+ pristine_git_object: 27a498a5fc24d45b93b7c86171d4b0707fa6ce1d
src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82
last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c
@@ -10486,6 +10562,10 @@ trackedFiles:
id: 365b2b7933ae
last_write_checksum: sha1:b7c343d99fea7b7c3118cf49303f261609ba5ddd
pristine_git_object: 5ea0f0aff5915a807d131bfc8106ad8f81525537
+ src/openrouter/components/anthropictoolunion.py:
+ id: d8da889e414b
+ last_write_checksum: sha1:9b43ff495c244af9853e2f9a3a21a7b0d3a33cc0
+ pristine_git_object: bd57bde09c31da314aacca650a35a2399a76e2d5
src/openrouter/components/anthropictooluseblock.py:
id: 830184ebabbb
last_write_checksum: sha1:e739a3556da9dcff36e424a8b6d3a11c40ea30c7
@@ -11908,8 +11988,8 @@ trackedFiles:
pristine_git_object: 7e69d1f775baece5f94b03d35bcd884d5e6f519d
src/openrouter/components/messagesrequest.py:
id: 72b1f339024d
- last_write_checksum: sha1:23f209d859436f2fc8f9102f27df98ef7a548de3
- pristine_git_object: fd81e321afdec9175f2b21cdf56581578e787b3c
+ last_write_checksum: sha1:4667937c65f33d988682d35e97c4c8449701f08c
+ pristine_git_object: 021ead331d7ed280f6499ca05b14d8700990ed70
src/openrouter/components/messagessearchmodelsservertool.py:
id: 53d755edb120
last_write_checksum: sha1:389786fc22ba4bb47b0a086b7aa321f2f04fe943
@@ -11920,8 +12000,8 @@ trackedFiles:
pristine_git_object: fb9a1ad813b5f664bd96222b5176fdaed652ba8d
src/openrouter/components/messagestooladditionblock.py:
id: 3fc00d28b82d
- last_write_checksum: sha1:9d58d3e11b4260f7d00efcf0630fe4186b5d01a1
- pristine_git_object: 4c081d8d6f173682a96948b2e5b72231c3ee6bba
+ last_write_checksum: sha1:dcad24962a26fc43662db2a965acba74ee97e345
+ pristine_git_object: 67689db6fa66301dad16c0be4dcdd6411fdd7586
src/openrouter/components/messagestoolremovalblock.py:
id: 4b02812d2191
last_write_checksum: sha1:1e6851ac4b3d1d1d67253357ce9367888663665b
@@ -18593,6 +18673,4 @@ examples:
"500":
application/json: {"error": {"code": 404, "message": "Intern not found"}}
examplesVersion: 1.0.2
-releaseNotes: |
- ## Python SDK Changes:
- * `open_router.video_generation.list_videos_models()`: `response.data[].supported_sizes[]` **Changed**
+releaseNotes: "## Python SDK Changes:\n* `open_router.presets.create_presets_messages()`: \n * `request.messages[].content.union(Array<>)[].union(tool_addition).tool.union(tool_definition)` **Added**\n"
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index 1f73e5ecc..02b324439 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.3.81
+ version: 1.3.82
additionalDependencies:
dev:
pytest: '>=8.3'
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index 2088f07f5..8548581a4 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -2765,6 +2765,153 @@ components:
- 'content'
- 'tool_use_id'
type: 'object'
+ AnthropicToolUnion:
+ description: 'An Anthropic tool definition: a client-defined tool with a JSON Schema `input_schema`, or a server tool (bash, text editor, web search).'
+ example:
+ description: 'Get the current weather for a city.'
+ input_schema:
+ properties:
+ city:
+ type: 'string'
+ required:
+ - 'city'
+ type: 'object'
+ name: 'get_weather'
+ oneOf:
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ defer_loading:
+ type: 'boolean'
+ description:
+ type: 'string'
+ input_schema:
+ additionalProperties: {}
+ properties:
+ properties: {}
+ required:
+ items:
+ type: 'string'
+ type:
+ - 'array'
+ - 'null'
+ type:
+ enum:
+ - 'object'
+ type: 'string'
+ required:
+ - 'type'
+ type: 'object'
+ name:
+ type: 'string'
+ strict:
+ type: 'boolean'
+ type:
+ enum:
+ - 'custom'
+ type: 'string'
+ required:
+ - 'name'
+ - 'input_schema'
+ type: 'object'
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ name:
+ enum:
+ - 'bash'
+ type: 'string'
+ type:
+ enum:
+ - 'bash_20250124'
+ type: 'string'
+ required:
+ - 'type'
+ - 'name'
+ type: 'object'
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ name:
+ enum:
+ - 'str_replace_editor'
+ type: 'string'
+ type:
+ enum:
+ - 'text_editor_20250124'
+ type: 'string'
+ required:
+ - 'type'
+ - 'name'
+ type: 'object'
+ - properties:
+ allowed_domains:
+ items:
+ type: 'string'
+ type:
+ - 'array'
+ - 'null'
+ blocked_domains:
+ items:
+ type: 'string'
+ type:
+ - 'array'
+ - 'null'
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ max_uses:
+ type:
+ - 'integer'
+ - 'null'
+ name:
+ enum:
+ - 'web_search'
+ type: 'string'
+ type:
+ enum:
+ - 'web_search_20250305'
+ type: 'string'
+ user_location:
+ $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation'
+ required:
+ - 'type'
+ - 'name'
+ type: 'object'
+ - properties:
+ allowed_callers:
+ $ref: '#/components/schemas/AnthropicAllowedCallers'
+ allowed_domains:
+ items:
+ type: 'string'
+ type:
+ - 'array'
+ - 'null'
+ blocked_domains:
+ items:
+ type: 'string'
+ type:
+ - 'array'
+ - 'null'
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ max_uses:
+ type:
+ - 'integer'
+ - 'null'
+ name:
+ enum:
+ - 'web_search'
+ type: 'string'
+ type:
+ enum:
+ - 'web_search_20260209'
+ type: 'string'
+ user_location:
+ $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation'
+ required:
+ - 'type'
+ - 'name'
+ type: 'object'
AnthropicToolUseBlock:
example:
caller:
@@ -17985,7 +18132,7 @@ components:
- 'data'
type: 'object'
MessagesToolAdditionBlock:
- description: 'Loads a previously deferred tool (declared in `tools` with `defer_loading: true`) mid-conversation without invalidating the prompt cache. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.'
+ description: 'Adds a tool mid-conversation without invalidating the prompt cache: either a previously deferred tool (declared in `tools` with `defer_loading: true`, referenced by name) or a full inline `tool_definition`. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.'
example:
tool:
name: 'get_forecast'
@@ -18032,6 +18179,17 @@ components:
- 'type'
- 'server_name'
type: 'object'
+ - properties:
+ definition:
+ $ref: '#/components/schemas/AnthropicToolUnion'
+ type:
+ enum:
+ - 'tool_definition'
+ type: 'string'
+ required:
+ - 'type'
+ - 'definition'
+ type: 'object'
type:
enum:
- 'tool_addition'
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 28f3a1535..8058e43d6 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:ee5f48654c6e8f4f447cfbc93f4f85d1c5f5ac1915d31b7ad375974c28cac57e
- sourceBlobDigest: sha256:138d3ed8f13d0140ddf709b0e4503936e094405c46af293f092ada3c97eddcc8
+ sourceRevisionDigest: sha256:038e56b2c3b2cf3c81df89a8a2313957f3613b5e3b0094187e084dc2e8e7e27a
+ sourceBlobDigest: sha256:60ac6a4d7eaa2d67c97a0a2ebe4b776a40ebf0674fa3e717fa9a67f8920fbd45
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:ee5f48654c6e8f4f447cfbc93f4f85d1c5f5ac1915d31b7ad375974c28cac57e
- sourceBlobDigest: sha256:138d3ed8f13d0140ddf709b0e4503936e094405c46af293f092ada3c97eddcc8
+ sourceRevisionDigest: sha256:038e56b2c3b2cf3c81df89a8a2313957f3613b5e3b0094187e084dc2e8e7e27a
+ sourceBlobDigest: sha256:60ac6a4d7eaa2d67c97a0a2ebe4b776a40ebf0674fa3e717fa9a67f8920fbd45
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:85a4f2e4f0cd3a3e0395cea39481be87905a4fd8c36cbdcf47036a85e58fc560
+ codeSamplesRevisionDigest: sha256:d96edd7519c09a0538c39859014b269f5c03fbab1e4ac43c85342e72a7656b7d
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
diff --git a/RELEASES.md b/RELEASES.md
index 2c5b850f3..350b5541b 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -3579,4 +3579,14 @@ Based on:
### Generated
- [python v1.3.81] .
### Releases
-- [PyPI v1.3.81] https://pypi.org/project/openrouter/1.3.81 - .
\ No newline at end of file
+- [PyPI v1.3.81] https://pypi.org/project/openrouter/1.3.81 - .
+
+## 2026-10-26 21:02:38
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.3.82] .
+### Releases
+- [PyPI v1.3.82] https://pypi.org/project/openrouter/1.3.82 - .
\ No newline at end of file
diff --git a/docs/components/anthropictoolunion.mdx b/docs/components/anthropictoolunion.mdx
new file mode 100644
index 000000000..df7555a80
--- /dev/null
+++ b/docs/components/anthropictoolunion.mdx
@@ -0,0 +1,39 @@
+---
+title: "AnthropicToolUnion"
+---
+
+An Anthropic tool definition: a client-defined tool with a JSON Schema `input_schema`, or a server tool (bash, text editor, web search).
+
+
+## Supported Types
+
+### `components.AnthropicToolUnionCustom`
+
+```python
+value: components.AnthropicToolUnionCustom = /* values here */
+```
+
+### `components.AnthropicToolUnionBash20250124`
+
+```python
+value: components.AnthropicToolUnionBash20250124 = /* values here */
+```
+
+### `components.AnthropicToolUnionTextEditor20250124`
+
+```python
+value: components.AnthropicToolUnionTextEditor20250124 = /* values here */
+```
+
+### `components.AnthropicToolUnionWebSearch20250305`
+
+```python
+value: components.AnthropicToolUnionWebSearch20250305 = /* values here */
+```
+
+### `components.AnthropicToolUnionWebSearch20260209`
+
+```python
+value: components.AnthropicToolUnionWebSearch20260209 = /* values here */
+```
+
diff --git a/docs/components/anthropictoolunionbash20250124.mdx b/docs/components/anthropictoolunionbash20250124.mdx
new file mode 100644
index 000000000..5d5e13ee8
--- /dev/null
+++ b/docs/components/anthropictoolunionbash20250124.mdx
@@ -0,0 +1,11 @@
+---
+title: "AnthropicToolUnionBash20250124"
+---
+
+## Fields
+
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
+| `name` | [components.AnthropicToolUnionNameBash](../components/anthropictoolunionnamebash.mdx) | ✅ | N/A | |
+| `type` | [components.AnthropicToolUnionTypeBash20250124](../components/anthropictooluniontypebash20250124.mdx) | ✅ | N/A | |
\ No newline at end of file
diff --git a/docs/components/anthropictoolunioncustom.mdx b/docs/components/anthropictoolunioncustom.mdx
new file mode 100644
index 000000000..31ac14f29
--- /dev/null
+++ b/docs/components/anthropictoolunioncustom.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionCustom"
+---
+
+## Fields
+
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
+| `defer_loading` | *Optional[bool]* | ➖ | N/A | |
+| `description` | *Optional[str]* | ➖ | N/A | |
+| `input_schema` | [components.AnthropicToolUnionInputSchema](../components/anthropictoolunioninputschema.mdx) | ✅ | N/A | |
+| `name` | *str* | ✅ | N/A | |
+| `strict` | *Optional[bool]* | ➖ | N/A | |
+| `type` | [Optional[components.AnthropicToolUnionTypeCustom]](../components/anthropictooluniontypecustom.mdx) | ➖ | N/A | |
\ No newline at end of file
diff --git a/docs/components/anthropictoolunioninputschema.mdx b/docs/components/anthropictoolunioninputschema.mdx
new file mode 100644
index 000000000..263e983a2
--- /dev/null
+++ b/docs/components/anthropictoolunioninputschema.mdx
@@ -0,0 +1,12 @@
+---
+title: "AnthropicToolUnionInputSchema"
+---
+
+## Fields
+
+| Field | Type | Required | Description |
+| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
+| `properties` | *Optional[Any]* | ➖ | N/A |
+| `required` | List[*str*] | ➖ | N/A |
+| `type` | [components.TypeObject](../components/typeobject.mdx) | ✅ | N/A |
+| `__pydantic_extra__` | Dict[str, *Any*] | ➖ | N/A |
\ No newline at end of file
diff --git a/docs/components/anthropictoolunionnamebash.mdx b/docs/components/anthropictoolunionnamebash.mdx
new file mode 100644
index 000000000..9a70757d7
--- /dev/null
+++ b/docs/components/anthropictoolunionnamebash.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionNameBash"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicToolUnionNameBash
+value: AnthropicToolUnionNameBash = "bash"
+```
+
+
+## Values
+
+- `"bash"`
diff --git a/docs/components/anthropictoolunionnamestrreplaceeditor.mdx b/docs/components/anthropictoolunionnamestrreplaceeditor.mdx
new file mode 100644
index 000000000..8f8f732c7
--- /dev/null
+++ b/docs/components/anthropictoolunionnamestrreplaceeditor.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionNameStrReplaceEditor"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicToolUnionNameStrReplaceEditor
+value: AnthropicToolUnionNameStrReplaceEditor = "str_replace_editor"
+```
+
+
+## Values
+
+- `"str_replace_editor"`
diff --git a/docs/components/anthropictoolunionnamewebsearch1.mdx b/docs/components/anthropictoolunionnamewebsearch1.mdx
new file mode 100644
index 000000000..880acf5a5
--- /dev/null
+++ b/docs/components/anthropictoolunionnamewebsearch1.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionNameWebSearch1"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicToolUnionNameWebSearch1
+value: AnthropicToolUnionNameWebSearch1 = "web_search"
+```
+
+
+## Values
+
+- `"web_search"`
diff --git a/docs/components/anthropictoolunionnamewebsearch2.mdx b/docs/components/anthropictoolunionnamewebsearch2.mdx
new file mode 100644
index 000000000..c60300a96
--- /dev/null
+++ b/docs/components/anthropictoolunionnamewebsearch2.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionNameWebSearch2"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicToolUnionNameWebSearch2
+value: AnthropicToolUnionNameWebSearch2 = "web_search"
+```
+
+
+## Values
+
+- `"web_search"`
diff --git a/docs/components/anthropictooluniontexteditor20250124.mdx b/docs/components/anthropictooluniontexteditor20250124.mdx
new file mode 100644
index 000000000..23fe7393b
--- /dev/null
+++ b/docs/components/anthropictooluniontexteditor20250124.mdx
@@ -0,0 +1,11 @@
+---
+title: "AnthropicToolUnionTextEditor20250124"
+---
+
+## Fields
+
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
+| `name` | [components.AnthropicToolUnionNameStrReplaceEditor](../components/anthropictoolunionnamestrreplaceeditor.mdx) | ✅ | N/A | |
+| `type` | [components.AnthropicToolUnionTypeTextEditor20250124](../components/anthropictooluniontypetexteditor20250124.mdx) | ✅ | N/A | |
\ No newline at end of file
diff --git a/docs/components/anthropictooluniontypebash20250124.mdx b/docs/components/anthropictooluniontypebash20250124.mdx
new file mode 100644
index 000000000..fd65cf097
--- /dev/null
+++ b/docs/components/anthropictooluniontypebash20250124.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionTypeBash20250124"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicToolUnionTypeBash20250124
+value: AnthropicToolUnionTypeBash20250124 = "bash_20250124"
+```
+
+
+## Values
+
+- `"bash_20250124"`
diff --git a/docs/components/anthropictooluniontypecustom.mdx b/docs/components/anthropictooluniontypecustom.mdx
new file mode 100644
index 000000000..9ea3544bd
--- /dev/null
+++ b/docs/components/anthropictooluniontypecustom.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionTypeCustom"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicToolUnionTypeCustom
+value: AnthropicToolUnionTypeCustom = "custom"
+```
+
+
+## Values
+
+- `"custom"`
diff --git a/docs/components/anthropictooluniontypetexteditor20250124.mdx b/docs/components/anthropictooluniontypetexteditor20250124.mdx
new file mode 100644
index 000000000..16e986280
--- /dev/null
+++ b/docs/components/anthropictooluniontypetexteditor20250124.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionTypeTextEditor20250124"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicToolUnionTypeTextEditor20250124
+value: AnthropicToolUnionTypeTextEditor20250124 = "text_editor_20250124"
+```
+
+
+## Values
+
+- `"text_editor_20250124"`
diff --git a/docs/components/anthropictooluniontypewebsearch20250305.mdx b/docs/components/anthropictooluniontypewebsearch20250305.mdx
new file mode 100644
index 000000000..f3d759888
--- /dev/null
+++ b/docs/components/anthropictooluniontypewebsearch20250305.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionTypeWebSearch20250305"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicToolUnionTypeWebSearch20250305
+value: AnthropicToolUnionTypeWebSearch20250305 = "web_search_20250305"
+```
+
+
+## Values
+
+- `"web_search_20250305"`
diff --git a/docs/components/anthropictooluniontypewebsearch20260209.mdx b/docs/components/anthropictooluniontypewebsearch20260209.mdx
new file mode 100644
index 000000000..0e1216ae0
--- /dev/null
+++ b/docs/components/anthropictooluniontypewebsearch20260209.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionTypeWebSearch20260209"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicToolUnionTypeWebSearch20260209
+value: AnthropicToolUnionTypeWebSearch20260209 = "web_search_20260209"
+```
+
+
+## Values
+
+- `"web_search_20260209"`
diff --git a/docs/components/anthropictoolunionwebsearch20250305.mdx b/docs/components/anthropictoolunionwebsearch20250305.mdx
new file mode 100644
index 000000000..f9f30a9e2
--- /dev/null
+++ b/docs/components/anthropictoolunionwebsearch20250305.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicToolUnionWebSearch20250305"
+---
+
+## Fields
+
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `allowed_domains` | List[*str*] | ➖ | N/A | |
+| `blocked_domains` | List[*str*] | ➖ | N/A | |
+| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
+| `max_uses` | *OptionalNullable[int]* | ➖ | N/A | |
+| `name` | [components.AnthropicToolUnionNameWebSearch1](../components/anthropictoolunionnamewebsearch1.mdx) | ✅ | N/A | |
+| `type` | [components.AnthropicToolUnionTypeWebSearch20250305](../components/anthropictooluniontypewebsearch20250305.mdx) | ✅ | N/A | |
+| `user_location` | [OptionalNullable[components.AnthropicWebSearchToolUserLocation]](../components/anthropicwebsearchtooluserlocation.mdx) | ➖ | N/A | \{
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} |
\ No newline at end of file
diff --git a/docs/components/anthropictoolunionwebsearch20260209.mdx b/docs/components/anthropictoolunionwebsearch20260209.mdx
new file mode 100644
index 000000000..0b5955782
--- /dev/null
+++ b/docs/components/anthropictoolunionwebsearch20260209.mdx
@@ -0,0 +1,16 @@
+---
+title: "AnthropicToolUnionWebSearch20260209"
+---
+
+## Fields
+
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `allowed_callers` | List[[components.AnthropicAllowedCallers](../components/anthropicallowedcallers.mdx)] | ➖ | N/A | [
"direct"
] |
+| `allowed_domains` | List[*str*] | ➖ | N/A | |
+| `blocked_domains` | List[*str*] | ➖ | N/A | |
+| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
+| `max_uses` | *OptionalNullable[int]* | ➖ | N/A | |
+| `name` | [components.AnthropicToolUnionNameWebSearch2](../components/anthropictoolunionnamewebsearch2.mdx) | ✅ | N/A | |
+| `type` | [components.AnthropicToolUnionTypeWebSearch20260209](../components/anthropictooluniontypewebsearch20260209.mdx) | ✅ | N/A | |
+| `user_location` | [OptionalNullable[components.AnthropicWebSearchToolUserLocation]](../components/anthropicwebsearchtooluserlocation.mdx) | ➖ | N/A | \{
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} |
\ No newline at end of file
diff --git a/docs/components/inputschema.mdx b/docs/components/messagesrequestinputschema.mdx
similarity index 93%
rename from docs/components/inputschema.mdx
rename to docs/components/messagesrequestinputschema.mdx
index 85c82024c..1516a687b 100644
--- a/docs/components/inputschema.mdx
+++ b/docs/components/messagesrequestinputschema.mdx
@@ -1,5 +1,5 @@
---
-title: "InputSchema"
+title: "MessagesRequestInputSchema"
---
## Fields
diff --git a/docs/components/messagesrequestnamebash.mdx b/docs/components/messagesrequestnamebash.mdx
new file mode 100644
index 000000000..22054d0b0
--- /dev/null
+++ b/docs/components/messagesrequestnamebash.mdx
@@ -0,0 +1,15 @@
+---
+title: "MessagesRequestNameBash"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import MessagesRequestNameBash
+value: MessagesRequestNameBash = "bash"
+```
+
+
+## Values
+
+- `"bash"`
diff --git a/docs/components/messagesrequestnamestrreplaceeditor.mdx b/docs/components/messagesrequestnamestrreplaceeditor.mdx
new file mode 100644
index 000000000..ef56d7ec9
--- /dev/null
+++ b/docs/components/messagesrequestnamestrreplaceeditor.mdx
@@ -0,0 +1,15 @@
+---
+title: "MessagesRequestNameStrReplaceEditor"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import MessagesRequestNameStrReplaceEditor
+value: MessagesRequestNameStrReplaceEditor = "str_replace_editor"
+```
+
+
+## Values
+
+- `"str_replace_editor"`
diff --git a/docs/components/messagesrequestnamewebsearch1.mdx b/docs/components/messagesrequestnamewebsearch1.mdx
new file mode 100644
index 000000000..4075d84db
--- /dev/null
+++ b/docs/components/messagesrequestnamewebsearch1.mdx
@@ -0,0 +1,15 @@
+---
+title: "MessagesRequestNameWebSearch1"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import MessagesRequestNameWebSearch1
+value: MessagesRequestNameWebSearch1 = "web_search"
+```
+
+
+## Values
+
+- `"web_search"`
diff --git a/docs/components/messagesrequestnamewebsearch2.mdx b/docs/components/messagesrequestnamewebsearch2.mdx
new file mode 100644
index 000000000..46ed36125
--- /dev/null
+++ b/docs/components/messagesrequestnamewebsearch2.mdx
@@ -0,0 +1,15 @@
+---
+title: "MessagesRequestNameWebSearch2"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import MessagesRequestNameWebSearch2
+value: MessagesRequestNameWebSearch2 = "web_search"
+```
+
+
+## Values
+
+- `"web_search"`
diff --git a/docs/components/messagestooladditionblock.mdx b/docs/components/messagestooladditionblock.mdx
index b9cf44fcb..d07e86d8a 100644
--- a/docs/components/messagestooladditionblock.mdx
+++ b/docs/components/messagestooladditionblock.mdx
@@ -2,7 +2,7 @@
title: "MessagesToolAdditionBlock"
---
-Loads a previously deferred tool (declared in `tools` with `defer_loading: true`) mid-conversation without invalidating the prompt cache. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.
+Adds a tool mid-conversation without invalidating the prompt cache: either a previously deferred tool (declared in `tools` with `defer_loading: true`, referenced by name) or a full inline `tool_definition`. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.
## Fields
diff --git a/docs/components/messagestooladditionblocktoolunion.mdx b/docs/components/messagestooladditionblocktoolunion.mdx
index fe8e0e549..e31d0fb16 100644
--- a/docs/components/messagestooladditionblocktoolunion.mdx
+++ b/docs/components/messagestooladditionblocktoolunion.mdx
@@ -22,3 +22,9 @@ value: components.MessagesToolAdditionBlockToolMcpToolReference = /* values here
value: components.MessagesToolAdditionBlockToolMcpToolsetReference = /* values here */
```
+### `components.ToolToolDefinition`
+
+```python
+value: components.ToolToolDefinition = /* values here */
+```
+
diff --git a/docs/components/namebash.mdx b/docs/components/namebash.mdx
deleted file mode 100644
index d6efdde4f..000000000
--- a/docs/components/namebash.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "NameBash"
----
-
-## Example Usage
-
-```python
-from openrouter.components import NameBash
-value: NameBash = "bash"
-```
-
-
-## Values
-
-- `"bash"`
diff --git a/docs/components/namestrreplaceeditor.mdx b/docs/components/namestrreplaceeditor.mdx
deleted file mode 100644
index 5dea596ee..000000000
--- a/docs/components/namestrreplaceeditor.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "NameStrReplaceEditor"
----
-
-## Example Usage
-
-```python
-from openrouter.components import NameStrReplaceEditor
-value: NameStrReplaceEditor = "str_replace_editor"
-```
-
-
-## Values
-
-- `"str_replace_editor"`
diff --git a/docs/components/namewebsearch1.mdx b/docs/components/namewebsearch1.mdx
deleted file mode 100644
index 41ced4e2f..000000000
--- a/docs/components/namewebsearch1.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "NameWebSearch1"
----
-
-## Example Usage
-
-```python
-from openrouter.components import NameWebSearch1
-value: NameWebSearch1 = "web_search"
-```
-
-
-## Values
-
-- `"web_search"`
diff --git a/docs/components/namewebsearch2.mdx b/docs/components/namewebsearch2.mdx
deleted file mode 100644
index f6803b05f..000000000
--- a/docs/components/namewebsearch2.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "NameWebSearch2"
----
-
-## Example Usage
-
-```python
-from openrouter.components import NameWebSearch2
-value: NameWebSearch2 = "web_search"
-```
-
-
-## Values
-
-- `"web_search"`
diff --git a/docs/components/toolbash20250124.mdx b/docs/components/toolbash20250124.mdx
index 222b4ee4d..cebb5ecd3 100644
--- a/docs/components/toolbash20250124.mdx
+++ b/docs/components/toolbash20250124.mdx
@@ -7,5 +7,5 @@ title: "ToolBash20250124"
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
-| `name` | [components.NameBash](../components/namebash.mdx) | ✅ | N/A | |
-| `type` | [components.TypeBash20250124](../components/typebash20250124.mdx) | ✅ | N/A | |
\ No newline at end of file
+| `name` | [components.MessagesRequestNameBash](../components/messagesrequestnamebash.mdx) | ✅ | N/A | |
+| `type` | [components.ToolTypeBash20250124](../components/tooltypebash20250124.mdx) | ✅ | N/A | |
\ No newline at end of file
diff --git a/docs/components/toolcustom.mdx b/docs/components/toolcustom.mdx
index 58127178b..bb8d90e7e 100644
--- a/docs/components/toolcustom.mdx
+++ b/docs/components/toolcustom.mdx
@@ -9,7 +9,7 @@ title: "ToolCustom"
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
| `defer_loading` | *Optional[bool]* | ➖ | N/A | |
| `description` | *Optional[str]* | ➖ | N/A | |
-| `input_schema` | [components.InputSchema](../components/inputschema.mdx) | ✅ | N/A | |
+| `input_schema` | [components.MessagesRequestInputSchema](../components/messagesrequestinputschema.mdx) | ✅ | N/A | |
| `name` | *str* | ✅ | N/A | |
| `strict` | *Optional[bool]* | ➖ | N/A | |
| `type` | [Optional[components.ToolTypeCustom]](../components/tooltypecustom.mdx) | ➖ | N/A | |
\ No newline at end of file
diff --git a/docs/components/tooltexteditor20250124.mdx b/docs/components/tooltexteditor20250124.mdx
index d12936170..308c54ba3 100644
--- a/docs/components/tooltexteditor20250124.mdx
+++ b/docs/components/tooltexteditor20250124.mdx
@@ -7,5 +7,5 @@ title: "ToolTextEditor20250124"
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
-| `name` | [components.NameStrReplaceEditor](../components/namestrreplaceeditor.mdx) | ✅ | N/A | |
-| `type` | [components.TypeTextEditor20250124](../components/typetexteditor20250124.mdx) | ✅ | N/A | |
\ No newline at end of file
+| `name` | [components.MessagesRequestNameStrReplaceEditor](../components/messagesrequestnamestrreplaceeditor.mdx) | ✅ | N/A | |
+| `type` | [components.ToolTypeTextEditor20250124](../components/tooltypetexteditor20250124.mdx) | ✅ | N/A | |
\ No newline at end of file
diff --git a/docs/components/tooltooldefinition.mdx b/docs/components/tooltooldefinition.mdx
new file mode 100644
index 000000000..854576038
--- /dev/null
+++ b/docs/components/tooltooldefinition.mdx
@@ -0,0 +1,10 @@
+---
+title: "ToolToolDefinition"
+---
+
+## Fields
+
+| Field | Type | Required | Description | Example |
+| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `definition` | [components.AnthropicToolUnion](../components/anthropictoolunion.mdx) | ✅ | An Anthropic tool definition: a client-defined tool with a JSON Schema `input_schema`, or a server tool (bash, text editor, web search). | \{
"description": "Get the current weather for a city.",
"input_schema": \{
"properties": \{
"city": \{
"type": "string"
}
},
"required": [
"city"
],
"type": "object"
},
"name": "get_weather"
} |
+| `type` | [components.TypeToolDefinition](../components/typetooldefinition.mdx) | ✅ | N/A | |
\ No newline at end of file
diff --git a/docs/components/tooltypebash20250124.mdx b/docs/components/tooltypebash20250124.mdx
new file mode 100644
index 000000000..87483beff
--- /dev/null
+++ b/docs/components/tooltypebash20250124.mdx
@@ -0,0 +1,15 @@
+---
+title: "ToolTypeBash20250124"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import ToolTypeBash20250124
+value: ToolTypeBash20250124 = "bash_20250124"
+```
+
+
+## Values
+
+- `"bash_20250124"`
diff --git a/docs/components/tooltypetexteditor20250124.mdx b/docs/components/tooltypetexteditor20250124.mdx
new file mode 100644
index 000000000..78ff73de1
--- /dev/null
+++ b/docs/components/tooltypetexteditor20250124.mdx
@@ -0,0 +1,15 @@
+---
+title: "ToolTypeTextEditor20250124"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import ToolTypeTextEditor20250124
+value: ToolTypeTextEditor20250124 = "text_editor_20250124"
+```
+
+
+## Values
+
+- `"text_editor_20250124"`
diff --git a/docs/components/tooltypewebsearch20250305.mdx b/docs/components/tooltypewebsearch20250305.mdx
new file mode 100644
index 000000000..3d9627378
--- /dev/null
+++ b/docs/components/tooltypewebsearch20250305.mdx
@@ -0,0 +1,15 @@
+---
+title: "ToolTypeWebSearch20250305"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import ToolTypeWebSearch20250305
+value: ToolTypeWebSearch20250305 = "web_search_20250305"
+```
+
+
+## Values
+
+- `"web_search_20250305"`
diff --git a/docs/components/tooltypewebsearch20260209.mdx b/docs/components/tooltypewebsearch20260209.mdx
new file mode 100644
index 000000000..1abab2e58
--- /dev/null
+++ b/docs/components/tooltypewebsearch20260209.mdx
@@ -0,0 +1,15 @@
+---
+title: "ToolTypeWebSearch20260209"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import ToolTypeWebSearch20260209
+value: ToolTypeWebSearch20260209 = "web_search_20260209"
+```
+
+
+## Values
+
+- `"web_search_20260209"`
diff --git a/docs/components/toolwebsearch20250305.mdx b/docs/components/toolwebsearch20250305.mdx
index b302ea6ff..9e1b59dbe 100644
--- a/docs/components/toolwebsearch20250305.mdx
+++ b/docs/components/toolwebsearch20250305.mdx
@@ -10,6 +10,6 @@ title: "ToolWebSearch20250305"
| `blocked_domains` | List[*str*] | ➖ | N/A | |
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
| `max_uses` | *OptionalNullable[int]* | ➖ | N/A | |
-| `name` | [components.NameWebSearch1](../components/namewebsearch1.mdx) | ✅ | N/A | |
-| `type` | [components.TypeWebSearch20250305](../components/typewebsearch20250305.mdx) | ✅ | N/A | |
+| `name` | [components.MessagesRequestNameWebSearch1](../components/messagesrequestnamewebsearch1.mdx) | ✅ | N/A | |
+| `type` | [components.ToolTypeWebSearch20250305](../components/tooltypewebsearch20250305.mdx) | ✅ | N/A | |
| `user_location` | [OptionalNullable[components.AnthropicWebSearchToolUserLocation]](../components/anthropicwebsearchtooluserlocation.mdx) | ➖ | N/A | \{
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} |
\ No newline at end of file
diff --git a/docs/components/toolwebsearch20260209.mdx b/docs/components/toolwebsearch20260209.mdx
index 735d1d2e2..46011a592 100644
--- a/docs/components/toolwebsearch20260209.mdx
+++ b/docs/components/toolwebsearch20260209.mdx
@@ -11,6 +11,6 @@ title: "ToolWebSearch20260209"
| `blocked_domains` | List[*str*] | ➖ | N/A | |
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | ➖ | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} |
| `max_uses` | *OptionalNullable[int]* | ➖ | N/A | |
-| `name` | [components.NameWebSearch2](../components/namewebsearch2.mdx) | ✅ | N/A | |
-| `type` | [components.TypeWebSearch20260209](../components/typewebsearch20260209.mdx) | ✅ | N/A | |
+| `name` | [components.MessagesRequestNameWebSearch2](../components/messagesrequestnamewebsearch2.mdx) | ✅ | N/A | |
+| `type` | [components.ToolTypeWebSearch20260209](../components/tooltypewebsearch20260209.mdx) | ✅ | N/A | |
| `user_location` | [OptionalNullable[components.AnthropicWebSearchToolUserLocation]](../components/anthropicwebsearchtooluserlocation.mdx) | ➖ | N/A | \{
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} |
\ No newline at end of file
diff --git a/docs/components/typebash20250124.mdx b/docs/components/typebash20250124.mdx
deleted file mode 100644
index 02338a093..000000000
--- a/docs/components/typebash20250124.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "TypeBash20250124"
----
-
-## Example Usage
-
-```python
-from openrouter.components import TypeBash20250124
-value: TypeBash20250124 = "bash_20250124"
-```
-
-
-## Values
-
-- `"bash_20250124"`
diff --git a/docs/components/typeobject.mdx b/docs/components/typeobject.mdx
new file mode 100644
index 000000000..4ab38541a
--- /dev/null
+++ b/docs/components/typeobject.mdx
@@ -0,0 +1,15 @@
+---
+title: "TypeObject"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import TypeObject
+value: TypeObject = "object"
+```
+
+
+## Values
+
+- `"object"`
diff --git a/docs/components/typetexteditor20250124.mdx b/docs/components/typetexteditor20250124.mdx
deleted file mode 100644
index 21cc14ae4..000000000
--- a/docs/components/typetexteditor20250124.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "TypeTextEditor20250124"
----
-
-## Example Usage
-
-```python
-from openrouter.components import TypeTextEditor20250124
-value: TypeTextEditor20250124 = "text_editor_20250124"
-```
-
-
-## Values
-
-- `"text_editor_20250124"`
diff --git a/docs/components/typetooldefinition.mdx b/docs/components/typetooldefinition.mdx
new file mode 100644
index 000000000..077961394
--- /dev/null
+++ b/docs/components/typetooldefinition.mdx
@@ -0,0 +1,15 @@
+---
+title: "TypeToolDefinition"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import TypeToolDefinition
+value: TypeToolDefinition = "tool_definition"
+```
+
+
+## Values
+
+- `"tool_definition"`
diff --git a/docs/components/typewebsearch20250305.mdx b/docs/components/typewebsearch20250305.mdx
deleted file mode 100644
index 0eb55d9be..000000000
--- a/docs/components/typewebsearch20250305.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "TypeWebSearch20250305"
----
-
-## Example Usage
-
-```python
-from openrouter.components import TypeWebSearch20250305
-value: TypeWebSearch20250305 = "web_search_20250305"
-```
-
-
-## Values
-
-- `"web_search_20250305"`
diff --git a/docs/components/typewebsearch20260209.mdx b/docs/components/typewebsearch20260209.mdx
deleted file mode 100644
index f9c864e42..000000000
--- a/docs/components/typewebsearch20260209.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "TypeWebSearch20260209"
----
-
-## Example Usage
-
-```python
-from openrouter.components import TypeWebSearch20260209
-value: TypeWebSearch20260209 = "web_search_20260209"
-```
-
-
-## Values
-
-- `"web_search_20260209"`
diff --git a/pyproject.toml b/pyproject.toml
index d0ee03e5a..e055e6ffd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.3.81"
+version = "1.3.82"
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 2484d0120..0c690e1a9 100644
--- a/src/openrouter/_version.py
+++ b/src/openrouter/_version.py
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
-__version__: str = "1.3.81"
+__version__: str = "1.3.82"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
-__user_agent__: str = "speakeasy-sdk/python 1.3.81 2.914.0 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.3.82 2.914.0 1.0.0 openrouter"
try:
if __package__ is not None:
diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py
index 6c2399427..27a498a5f 100644
--- a/src/openrouter/components/__init__.py
+++ b/src/openrouter/components/__init__.py
@@ -518,6 +518,32 @@
AnthropicToolSearchToolResultType,
AnthropicToolSearchToolResultTypedDict,
)
+ from .anthropictoolunion import (
+ AnthropicToolUnion,
+ AnthropicToolUnionBash20250124,
+ AnthropicToolUnionBash20250124TypedDict,
+ AnthropicToolUnionCustom,
+ AnthropicToolUnionCustomTypedDict,
+ AnthropicToolUnionInputSchema,
+ AnthropicToolUnionInputSchemaTypedDict,
+ AnthropicToolUnionNameBash,
+ AnthropicToolUnionNameStrReplaceEditor,
+ AnthropicToolUnionNameWebSearch1,
+ AnthropicToolUnionNameWebSearch2,
+ AnthropicToolUnionTextEditor20250124,
+ AnthropicToolUnionTextEditor20250124TypedDict,
+ AnthropicToolUnionTypeBash20250124,
+ AnthropicToolUnionTypeCustom,
+ AnthropicToolUnionTypeTextEditor20250124,
+ AnthropicToolUnionTypeWebSearch20250305,
+ AnthropicToolUnionTypeWebSearch20260209,
+ AnthropicToolUnionTypedDict,
+ AnthropicToolUnionWebSearch20250305,
+ AnthropicToolUnionWebSearch20250305TypedDict,
+ AnthropicToolUnionWebSearch20260209,
+ AnthropicToolUnionWebSearch20260209TypedDict,
+ TypeObject,
+ )
from .anthropictooluseblock import (
AnthropicToolUseBlock,
AnthropicToolUseBlockType,
@@ -2500,8 +2526,6 @@
EditCompact20260112TypedDict,
EditTypeInputTokens,
EditTypedDict,
- InputSchema,
- InputSchemaTypedDict,
Keep,
KeepAll,
KeepAllTypedDict,
@@ -2509,8 +2533,14 @@
KeepType,
KeepTypedDict,
MessagesRequest,
+ MessagesRequestInputSchema,
+ MessagesRequestInputSchemaTypedDict,
MessagesRequestMetadata,
MessagesRequestMetadataTypedDict,
+ MessagesRequestNameBash,
+ MessagesRequestNameStrReplaceEditor,
+ MessagesRequestNameWebSearch1,
+ MessagesRequestNameWebSearch2,
MessagesRequestPlugin,
MessagesRequestPluginTypedDict,
MessagesRequestTool,
@@ -2519,10 +2549,6 @@
MessagesRequestToolUnionTypedDict,
MessagesRequestTypedDict,
NameAdvisor,
- NameBash,
- NameStrReplaceEditor,
- NameWebSearch1,
- NameWebSearch2,
Speed,
System,
SystemTypedDict,
@@ -2556,7 +2582,11 @@
ToolCustomTypedDict,
ToolTextEditor20250124,
ToolTextEditor20250124TypedDict,
+ ToolTypeBash20250124,
ToolTypeCustom,
+ ToolTypeTextEditor20250124,
+ ToolTypeWebSearch20250305,
+ ToolTypeWebSearch20260209,
ToolWebSearch20250305,
ToolWebSearch20250305TypedDict,
ToolWebSearch20260209,
@@ -2568,17 +2598,13 @@
TypeAdaptive,
TypeAdvisor20260301,
TypeAny,
- TypeBash20250124,
TypeBetweenTools,
TypeClearThinking20251015,
TypeClearToolUses20250919,
TypeCompact20260112,
TypeEnabled,
TypeNone,
- TypeTextEditor20250124,
TypeTool,
- TypeWebSearch20250305,
- TypeWebSearch20260209,
)
from .messagessearchmodelsservertool import (
MessagesSearchModelsServerTool,
@@ -2607,7 +2633,10 @@
MessagesToolAdditionBlockTypeMcpToolsetReference,
MessagesToolAdditionBlockTypeToolReference,
MessagesToolAdditionBlockTypedDict,
+ ToolToolDefinition,
+ ToolToolDefinitionTypedDict,
TypeToolAddition,
+ TypeToolDefinition,
)
from .messagestoolremovalblock import (
MessagesToolRemovalBlock,
@@ -4700,6 +4729,29 @@
"AnthropicToolSearchToolResult",
"AnthropicToolSearchToolResultType",
"AnthropicToolSearchToolResultTypedDict",
+ "AnthropicToolUnion",
+ "AnthropicToolUnionBash20250124",
+ "AnthropicToolUnionBash20250124TypedDict",
+ "AnthropicToolUnionCustom",
+ "AnthropicToolUnionCustomTypedDict",
+ "AnthropicToolUnionInputSchema",
+ "AnthropicToolUnionInputSchemaTypedDict",
+ "AnthropicToolUnionNameBash",
+ "AnthropicToolUnionNameStrReplaceEditor",
+ "AnthropicToolUnionNameWebSearch1",
+ "AnthropicToolUnionNameWebSearch2",
+ "AnthropicToolUnionTextEditor20250124",
+ "AnthropicToolUnionTextEditor20250124TypedDict",
+ "AnthropicToolUnionTypeBash20250124",
+ "AnthropicToolUnionTypeCustom",
+ "AnthropicToolUnionTypeTextEditor20250124",
+ "AnthropicToolUnionTypeWebSearch20250305",
+ "AnthropicToolUnionTypeWebSearch20260209",
+ "AnthropicToolUnionTypedDict",
+ "AnthropicToolUnionWebSearch20250305",
+ "AnthropicToolUnionWebSearch20250305TypedDict",
+ "AnthropicToolUnionWebSearch20260209",
+ "AnthropicToolUnionWebSearch20260209TypedDict",
"AnthropicToolUseBlock",
"AnthropicToolUseBlockType",
"AnthropicToolUseBlockTypedDict",
@@ -5870,8 +5922,6 @@
"InputModality",
"InputReference",
"InputReferenceTypedDict",
- "InputSchema",
- "InputSchemaTypedDict",
"InputText",
"InputTextType",
"InputTextTypedDict",
@@ -6077,8 +6127,14 @@
"MessagesOutputConfigTypeJSONSchema",
"MessagesOutputConfigTypedDict",
"MessagesRequest",
+ "MessagesRequestInputSchema",
+ "MessagesRequestInputSchemaTypedDict",
"MessagesRequestMetadata",
"MessagesRequestMetadataTypedDict",
+ "MessagesRequestNameBash",
+ "MessagesRequestNameStrReplaceEditor",
+ "MessagesRequestNameWebSearch1",
+ "MessagesRequestNameWebSearch2",
"MessagesRequestPlugin",
"MessagesRequestPluginTypedDict",
"MessagesRequestTool",
@@ -6158,10 +6214,6 @@
"MultimodalMedia",
"MultimodalMediaTypedDict",
"NameAdvisor",
- "NameBash",
- "NameStrReplaceEditor",
- "NameWebSearch1",
- "NameWebSearch2",
"NamespaceFunctionTool",
"NamespaceFunctionToolAllowedCaller",
"NamespaceFunctionToolType",
@@ -7224,7 +7276,13 @@
"ToolSearchServerToolTypedDict",
"ToolTextEditor20250124",
"ToolTextEditor20250124TypedDict",
+ "ToolToolDefinition",
+ "ToolToolDefinitionTypedDict",
+ "ToolTypeBash20250124",
"ToolTypeCustom",
+ "ToolTypeTextEditor20250124",
+ "ToolTypeWebSearch20250305",
+ "ToolTypeWebSearch20260209",
"ToolUses",
"ToolUsesEvaluated",
"ToolUsesEvaluatedTypedDict",
@@ -7259,7 +7317,6 @@
"TypeAllowlist",
"TypeAny",
"TypeAvailable",
- "TypeBash20250124",
"TypeBetweenTools",
"TypeClearThinking20251015",
"TypeClearToolUses20250919",
@@ -7274,19 +7331,18 @@
"TypeFileSearch",
"TypeLocalShellCall",
"TypeNone",
+ "TypeObject",
"TypeSkipped",
- "TypeTextEditor20250124",
"TypeTimeout",
"TypeTokens",
"TypeTool",
"TypeToolAddition",
+ "TypeToolDefinition",
"TypeToolRemoval",
"TypeToolResult",
"TypeToolSearchOutput",
"TypeTypedDict",
"TypeUnavailable",
- "TypeWebSearch20250305",
- "TypeWebSearch20260209",
"TypeWebSearchCitation",
"URLCitation",
"URLCitationType",
@@ -7875,6 +7931,30 @@
"AnthropicToolSearchToolResult": ".anthropictoolsearchtoolresult",
"AnthropicToolSearchToolResultType": ".anthropictoolsearchtoolresult",
"AnthropicToolSearchToolResultTypedDict": ".anthropictoolsearchtoolresult",
+ "AnthropicToolUnion": ".anthropictoolunion",
+ "AnthropicToolUnionBash20250124": ".anthropictoolunion",
+ "AnthropicToolUnionBash20250124TypedDict": ".anthropictoolunion",
+ "AnthropicToolUnionCustom": ".anthropictoolunion",
+ "AnthropicToolUnionCustomTypedDict": ".anthropictoolunion",
+ "AnthropicToolUnionInputSchema": ".anthropictoolunion",
+ "AnthropicToolUnionInputSchemaTypedDict": ".anthropictoolunion",
+ "AnthropicToolUnionNameBash": ".anthropictoolunion",
+ "AnthropicToolUnionNameStrReplaceEditor": ".anthropictoolunion",
+ "AnthropicToolUnionNameWebSearch1": ".anthropictoolunion",
+ "AnthropicToolUnionNameWebSearch2": ".anthropictoolunion",
+ "AnthropicToolUnionTextEditor20250124": ".anthropictoolunion",
+ "AnthropicToolUnionTextEditor20250124TypedDict": ".anthropictoolunion",
+ "AnthropicToolUnionTypeBash20250124": ".anthropictoolunion",
+ "AnthropicToolUnionTypeCustom": ".anthropictoolunion",
+ "AnthropicToolUnionTypeTextEditor20250124": ".anthropictoolunion",
+ "AnthropicToolUnionTypeWebSearch20250305": ".anthropictoolunion",
+ "AnthropicToolUnionTypeWebSearch20260209": ".anthropictoolunion",
+ "AnthropicToolUnionTypedDict": ".anthropictoolunion",
+ "AnthropicToolUnionWebSearch20250305": ".anthropictoolunion",
+ "AnthropicToolUnionWebSearch20250305TypedDict": ".anthropictoolunion",
+ "AnthropicToolUnionWebSearch20260209": ".anthropictoolunion",
+ "AnthropicToolUnionWebSearch20260209TypedDict": ".anthropictoolunion",
+ "TypeObject": ".anthropictoolunion",
"AnthropicToolUseBlock": ".anthropictooluseblock",
"AnthropicToolUseBlockType": ".anthropictooluseblock",
"AnthropicToolUseBlockTypedDict": ".anthropictooluseblock",
@@ -9337,8 +9417,6 @@
"EditCompact20260112TypedDict": ".messagesrequest",
"EditTypeInputTokens": ".messagesrequest",
"EditTypedDict": ".messagesrequest",
- "InputSchema": ".messagesrequest",
- "InputSchemaTypedDict": ".messagesrequest",
"Keep": ".messagesrequest",
"KeepAll": ".messagesrequest",
"KeepAllTypedDict": ".messagesrequest",
@@ -9346,8 +9424,14 @@
"KeepType": ".messagesrequest",
"KeepTypedDict": ".messagesrequest",
"MessagesRequest": ".messagesrequest",
+ "MessagesRequestInputSchema": ".messagesrequest",
+ "MessagesRequestInputSchemaTypedDict": ".messagesrequest",
"MessagesRequestMetadata": ".messagesrequest",
"MessagesRequestMetadataTypedDict": ".messagesrequest",
+ "MessagesRequestNameBash": ".messagesrequest",
+ "MessagesRequestNameStrReplaceEditor": ".messagesrequest",
+ "MessagesRequestNameWebSearch1": ".messagesrequest",
+ "MessagesRequestNameWebSearch2": ".messagesrequest",
"MessagesRequestPlugin": ".messagesrequest",
"MessagesRequestPluginTypedDict": ".messagesrequest",
"MessagesRequestTool": ".messagesrequest",
@@ -9356,10 +9440,6 @@
"MessagesRequestToolUnionTypedDict": ".messagesrequest",
"MessagesRequestTypedDict": ".messagesrequest",
"NameAdvisor": ".messagesrequest",
- "NameBash": ".messagesrequest",
- "NameStrReplaceEditor": ".messagesrequest",
- "NameWebSearch1": ".messagesrequest",
- "NameWebSearch2": ".messagesrequest",
"Speed": ".messagesrequest",
"System": ".messagesrequest",
"SystemTypedDict": ".messagesrequest",
@@ -9393,7 +9473,11 @@
"ToolCustomTypedDict": ".messagesrequest",
"ToolTextEditor20250124": ".messagesrequest",
"ToolTextEditor20250124TypedDict": ".messagesrequest",
+ "ToolTypeBash20250124": ".messagesrequest",
"ToolTypeCustom": ".messagesrequest",
+ "ToolTypeTextEditor20250124": ".messagesrequest",
+ "ToolTypeWebSearch20250305": ".messagesrequest",
+ "ToolTypeWebSearch20260209": ".messagesrequest",
"ToolWebSearch20250305": ".messagesrequest",
"ToolWebSearch20250305TypedDict": ".messagesrequest",
"ToolWebSearch20260209": ".messagesrequest",
@@ -9405,17 +9489,13 @@
"TypeAdaptive": ".messagesrequest",
"TypeAdvisor20260301": ".messagesrequest",
"TypeAny": ".messagesrequest",
- "TypeBash20250124": ".messagesrequest",
"TypeBetweenTools": ".messagesrequest",
"TypeClearThinking20251015": ".messagesrequest",
"TypeClearToolUses20250919": ".messagesrequest",
"TypeCompact20260112": ".messagesrequest",
"TypeEnabled": ".messagesrequest",
"TypeNone": ".messagesrequest",
- "TypeTextEditor20250124": ".messagesrequest",
"TypeTool": ".messagesrequest",
- "TypeWebSearch20250305": ".messagesrequest",
- "TypeWebSearch20260209": ".messagesrequest",
"MessagesSearchModelsServerTool": ".messagessearchmodelsservertool",
"MessagesSearchModelsServerToolType": ".messagessearchmodelsservertool",
"MessagesSearchModelsServerToolTypedDict": ".messagessearchmodelsservertool",
@@ -9438,7 +9518,10 @@
"MessagesToolAdditionBlockTypeMcpToolsetReference": ".messagestooladditionblock",
"MessagesToolAdditionBlockTypeToolReference": ".messagestooladditionblock",
"MessagesToolAdditionBlockTypedDict": ".messagestooladditionblock",
+ "ToolToolDefinition": ".messagestooladditionblock",
+ "ToolToolDefinitionTypedDict": ".messagestooladditionblock",
"TypeToolAddition": ".messagestooladditionblock",
+ "TypeToolDefinition": ".messagestooladditionblock",
"MessagesToolRemovalBlock": ".messagestoolremovalblock",
"MessagesToolRemovalBlockToolMcpToolReference": ".messagestoolremovalblock",
"MessagesToolRemovalBlockToolMcpToolReferenceTypedDict": ".messagestoolremovalblock",
diff --git a/src/openrouter/components/anthropictoolunion.py b/src/openrouter/components/anthropictoolunion.py
new file mode 100644
index 000000000..bd57bde09
--- /dev/null
+++ b/src/openrouter/components/anthropictoolunion.py
@@ -0,0 +1,374 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from .anthropicallowedcallers import AnthropicAllowedCallers
+from .anthropiccachecontroldirective import (
+ AnthropicCacheControlDirective,
+ AnthropicCacheControlDirectiveTypedDict,
+)
+from .anthropicwebsearchtooluserlocation import (
+ AnthropicWebSearchToolUserLocation,
+ AnthropicWebSearchToolUserLocationTypedDict,
+)
+from openrouter.types import (
+ BaseModel,
+ Nullable,
+ OptionalNullable,
+ UNSET,
+ UNSET_SENTINEL,
+)
+import pydantic
+from pydantic import ConfigDict, model_serializer
+from typing import Any, Dict, List, Literal, Optional, Union
+from typing_extensions import NotRequired, TypeAliasType, TypedDict
+
+
+AnthropicToolUnionNameWebSearch2 = Literal["web_search",]
+
+
+AnthropicToolUnionTypeWebSearch20260209 = Literal["web_search_20260209",]
+
+
+class AnthropicToolUnionWebSearch20260209TypedDict(TypedDict):
+ name: AnthropicToolUnionNameWebSearch2
+ type: AnthropicToolUnionTypeWebSearch20260209
+ allowed_callers: NotRequired[List[AnthropicAllowedCallers]]
+ allowed_domains: NotRequired[Nullable[List[str]]]
+ blocked_domains: NotRequired[Nullable[List[str]]]
+ cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+ max_uses: NotRequired[Nullable[int]]
+ user_location: NotRequired[Nullable[AnthropicWebSearchToolUserLocationTypedDict]]
+
+
+class AnthropicToolUnionWebSearch20260209(BaseModel):
+ name: AnthropicToolUnionNameWebSearch2
+
+ type: AnthropicToolUnionTypeWebSearch20260209
+
+ allowed_callers: Optional[List[AnthropicAllowedCallers]] = None
+
+ allowed_domains: OptionalNullable[List[str]] = UNSET
+
+ blocked_domains: OptionalNullable[List[str]] = UNSET
+
+ cache_control: Optional[AnthropicCacheControlDirective] = None
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+
+ max_uses: OptionalNullable[int] = UNSET
+
+ user_location: OptionalNullable[AnthropicWebSearchToolUserLocation] = UNSET
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ optional_fields = set(
+ [
+ "allowed_callers",
+ "allowed_domains",
+ "blocked_domains",
+ "cache_control",
+ "max_uses",
+ "user_location",
+ ]
+ )
+ nullable_fields = set(
+ ["allowed_domains", "blocked_domains", "max_uses", "user_location"]
+ )
+ 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))
+ is_nullable_and_explicitly_set = (
+ k in nullable_fields
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
+ )
+
+ if val != UNSET_SENTINEL:
+ if (
+ val is not None
+ or k not in optional_fields
+ or is_nullable_and_explicitly_set
+ ):
+ m[k] = val
+
+ return m
+
+
+AnthropicToolUnionNameWebSearch1 = Literal["web_search",]
+
+
+AnthropicToolUnionTypeWebSearch20250305 = Literal["web_search_20250305",]
+
+
+class AnthropicToolUnionWebSearch20250305TypedDict(TypedDict):
+ name: AnthropicToolUnionNameWebSearch1
+ type: AnthropicToolUnionTypeWebSearch20250305
+ allowed_domains: NotRequired[Nullable[List[str]]]
+ blocked_domains: NotRequired[Nullable[List[str]]]
+ cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+ max_uses: NotRequired[Nullable[int]]
+ user_location: NotRequired[Nullable[AnthropicWebSearchToolUserLocationTypedDict]]
+
+
+class AnthropicToolUnionWebSearch20250305(BaseModel):
+ name: AnthropicToolUnionNameWebSearch1
+
+ type: AnthropicToolUnionTypeWebSearch20250305
+
+ allowed_domains: OptionalNullable[List[str]] = UNSET
+
+ blocked_domains: OptionalNullable[List[str]] = UNSET
+
+ cache_control: Optional[AnthropicCacheControlDirective] = None
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+
+ max_uses: OptionalNullable[int] = UNSET
+
+ user_location: OptionalNullable[AnthropicWebSearchToolUserLocation] = UNSET
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ optional_fields = set(
+ [
+ "allowed_domains",
+ "blocked_domains",
+ "cache_control",
+ "max_uses",
+ "user_location",
+ ]
+ )
+ nullable_fields = set(
+ ["allowed_domains", "blocked_domains", "max_uses", "user_location"]
+ )
+ 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))
+ is_nullable_and_explicitly_set = (
+ k in nullable_fields
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
+ )
+
+ if val != UNSET_SENTINEL:
+ if (
+ val is not None
+ or k not in optional_fields
+ or is_nullable_and_explicitly_set
+ ):
+ m[k] = val
+
+ return m
+
+
+AnthropicToolUnionNameStrReplaceEditor = Literal["str_replace_editor",]
+
+
+AnthropicToolUnionTypeTextEditor20250124 = Literal["text_editor_20250124",]
+
+
+class AnthropicToolUnionTextEditor20250124TypedDict(TypedDict):
+ name: AnthropicToolUnionNameStrReplaceEditor
+ type: AnthropicToolUnionTypeTextEditor20250124
+ cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+
+
+class AnthropicToolUnionTextEditor20250124(BaseModel):
+ name: AnthropicToolUnionNameStrReplaceEditor
+
+ type: AnthropicToolUnionTypeTextEditor20250124
+
+ cache_control: Optional[AnthropicCacheControlDirective] = None
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ optional_fields = set(["cache_control"])
+ 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
+
+
+AnthropicToolUnionNameBash = Literal["bash",]
+
+
+AnthropicToolUnionTypeBash20250124 = Literal["bash_20250124",]
+
+
+class AnthropicToolUnionBash20250124TypedDict(TypedDict):
+ name: AnthropicToolUnionNameBash
+ type: AnthropicToolUnionTypeBash20250124
+ cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+
+
+class AnthropicToolUnionBash20250124(BaseModel):
+ name: AnthropicToolUnionNameBash
+
+ type: AnthropicToolUnionTypeBash20250124
+
+ cache_control: Optional[AnthropicCacheControlDirective] = None
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ optional_fields = set(["cache_control"])
+ 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
+
+
+TypeObject = Literal["object",]
+
+
+class AnthropicToolUnionInputSchemaTypedDict(TypedDict):
+ type: TypeObject
+ properties: NotRequired[Any]
+ required: NotRequired[Nullable[List[str]]]
+
+
+class AnthropicToolUnionInputSchema(BaseModel):
+ model_config = ConfigDict(
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
+ )
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
+
+ type: TypeObject
+
+ properties: Optional[Any] = None
+
+ required: OptionalNullable[List[str]] = UNSET
+
+ @property
+ def additional_properties(self):
+ return self.__pydantic_extra__
+
+ @additional_properties.setter
+ def additional_properties(self, value):
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ optional_fields = set(["properties", "required"])
+ nullable_fields = set(["required"])
+ 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))
+ serialized.pop(k, serialized.pop(n, None))
+ is_nullable_and_explicitly_set = (
+ k in nullable_fields
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
+ )
+
+ if val != UNSET_SENTINEL:
+ if (
+ val is not None
+ or k not in optional_fields
+ or is_nullable_and_explicitly_set
+ ):
+ m[k] = val
+ for k, v in serialized.items():
+ m[k] = v
+
+ return m
+
+
+AnthropicToolUnionTypeCustom = Literal["custom",]
+
+
+class AnthropicToolUnionCustomTypedDict(TypedDict):
+ input_schema: AnthropicToolUnionInputSchemaTypedDict
+ name: str
+ cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+ defer_loading: NotRequired[bool]
+ description: NotRequired[str]
+ strict: NotRequired[bool]
+ type: NotRequired[AnthropicToolUnionTypeCustom]
+
+
+class AnthropicToolUnionCustom(BaseModel):
+ input_schema: AnthropicToolUnionInputSchema
+
+ name: str
+
+ cache_control: Optional[AnthropicCacheControlDirective] = None
+ r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
+
+ defer_loading: Optional[bool] = None
+
+ description: Optional[str] = None
+
+ strict: Optional[bool] = None
+
+ type: Optional[AnthropicToolUnionTypeCustom] = None
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ optional_fields = set(
+ ["cache_control", "defer_loading", "description", "strict", "type"]
+ )
+ 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
+
+
+AnthropicToolUnionTypedDict = TypeAliasType(
+ "AnthropicToolUnionTypedDict",
+ Union[
+ AnthropicToolUnionBash20250124TypedDict,
+ AnthropicToolUnionTextEditor20250124TypedDict,
+ AnthropicToolUnionCustomTypedDict,
+ AnthropicToolUnionWebSearch20250305TypedDict,
+ AnthropicToolUnionWebSearch20260209TypedDict,
+ ],
+)
+r"""An Anthropic tool definition: a client-defined tool with a JSON Schema `input_schema`, or a server tool (bash, text editor, web search)."""
+
+
+AnthropicToolUnion = TypeAliasType(
+ "AnthropicToolUnion",
+ Union[
+ AnthropicToolUnionBash20250124,
+ AnthropicToolUnionTextEditor20250124,
+ AnthropicToolUnionCustom,
+ AnthropicToolUnionWebSearch20250305,
+ AnthropicToolUnionWebSearch20260209,
+ ],
+)
+r"""An Anthropic tool definition: a client-defined tool with a JSON Schema `input_schema`, or a server tool (bash, text editor, web search)."""
diff --git a/src/openrouter/components/messagesrequest.py b/src/openrouter/components/messagesrequest.py
index fd81e321a..021ead331 100644
--- a/src/openrouter/components/messagesrequest.py
+++ b/src/openrouter/components/messagesrequest.py
@@ -776,15 +776,15 @@ def serialize_model(self, handler):
return m
-NameWebSearch2 = Literal["web_search",]
+MessagesRequestNameWebSearch2 = Literal["web_search",]
-TypeWebSearch20260209 = Literal["web_search_20260209",]
+ToolTypeWebSearch20260209 = Literal["web_search_20260209",]
class ToolWebSearch20260209TypedDict(TypedDict):
- name: NameWebSearch2
- type: TypeWebSearch20260209
+ name: MessagesRequestNameWebSearch2
+ type: ToolTypeWebSearch20260209
allowed_callers: NotRequired[List[AnthropicAllowedCallers]]
allowed_domains: NotRequired[Nullable[List[str]]]
blocked_domains: NotRequired[Nullable[List[str]]]
@@ -795,9 +795,9 @@ class ToolWebSearch20260209TypedDict(TypedDict):
class ToolWebSearch20260209(BaseModel):
- name: NameWebSearch2
+ name: MessagesRequestNameWebSearch2
- type: TypeWebSearch20260209
+ type: ToolTypeWebSearch20260209
allowed_callers: Optional[List[AnthropicAllowedCallers]] = None
@@ -849,15 +849,15 @@ def serialize_model(self, handler):
return m
-NameWebSearch1 = Literal["web_search",]
+MessagesRequestNameWebSearch1 = Literal["web_search",]
-TypeWebSearch20250305 = Literal["web_search_20250305",]
+ToolTypeWebSearch20250305 = Literal["web_search_20250305",]
class ToolWebSearch20250305TypedDict(TypedDict):
- name: NameWebSearch1
- type: TypeWebSearch20250305
+ name: MessagesRequestNameWebSearch1
+ type: ToolTypeWebSearch20250305
allowed_domains: NotRequired[Nullable[List[str]]]
blocked_domains: NotRequired[Nullable[List[str]]]
cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
@@ -867,9 +867,9 @@ class ToolWebSearch20250305TypedDict(TypedDict):
class ToolWebSearch20250305(BaseModel):
- name: NameWebSearch1
+ name: MessagesRequestNameWebSearch1
- type: TypeWebSearch20250305
+ type: ToolTypeWebSearch20250305
allowed_domains: OptionalNullable[List[str]] = UNSET
@@ -918,23 +918,23 @@ def serialize_model(self, handler):
return m
-NameStrReplaceEditor = Literal["str_replace_editor",]
+MessagesRequestNameStrReplaceEditor = Literal["str_replace_editor",]
-TypeTextEditor20250124 = Literal["text_editor_20250124",]
+ToolTypeTextEditor20250124 = Literal["text_editor_20250124",]
class ToolTextEditor20250124TypedDict(TypedDict):
- name: NameStrReplaceEditor
- type: TypeTextEditor20250124
+ name: MessagesRequestNameStrReplaceEditor
+ type: ToolTypeTextEditor20250124
cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
class ToolTextEditor20250124(BaseModel):
- name: NameStrReplaceEditor
+ name: MessagesRequestNameStrReplaceEditor
- type: TypeTextEditor20250124
+ type: ToolTypeTextEditor20250124
cache_control: Optional[AnthropicCacheControlDirective] = None
r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
@@ -956,23 +956,23 @@ def serialize_model(self, handler):
return m
-NameBash = Literal["bash",]
+MessagesRequestNameBash = Literal["bash",]
-TypeBash20250124 = Literal["bash_20250124",]
+ToolTypeBash20250124 = Literal["bash_20250124",]
class ToolBash20250124TypedDict(TypedDict):
- name: NameBash
- type: TypeBash20250124
+ name: MessagesRequestNameBash
+ type: ToolTypeBash20250124
cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
class ToolBash20250124(BaseModel):
- name: NameBash
+ name: MessagesRequestNameBash
- type: TypeBash20250124
+ type: ToolTypeBash20250124
cache_control: Optional[AnthropicCacheControlDirective] = None
r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
@@ -994,13 +994,13 @@ def serialize_model(self, handler):
return m
-class InputSchemaTypedDict(TypedDict):
+class MessagesRequestInputSchemaTypedDict(TypedDict):
properties: NotRequired[Any]
required: NotRequired[Nullable[List[str]]]
type: NotRequired[str]
-class InputSchema(BaseModel):
+class MessagesRequestInputSchema(BaseModel):
model_config = ConfigDict(
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
)
@@ -1053,7 +1053,7 @@ def serialize_model(self, handler):
class ToolCustomTypedDict(TypedDict):
- input_schema: InputSchemaTypedDict
+ input_schema: MessagesRequestInputSchemaTypedDict
name: str
cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."""
@@ -1064,7 +1064,7 @@ class ToolCustomTypedDict(TypedDict):
class ToolCustom(BaseModel):
- input_schema: InputSchema
+ input_schema: MessagesRequestInputSchema
name: str
diff --git a/src/openrouter/components/messagestooladditionblock.py b/src/openrouter/components/messagestooladditionblock.py
index 4c081d8d6..67689db6f 100644
--- a/src/openrouter/components/messagestooladditionblock.py
+++ b/src/openrouter/components/messagestooladditionblock.py
@@ -5,6 +5,7 @@
AnthropicCacheControlDirective,
AnthropicCacheControlDirectiveTypedDict,
)
+from .anthropictoolunion import AnthropicToolUnion, AnthropicToolUnionTypedDict
from openrouter.types import BaseModel, UNSET_SENTINEL
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag, model_serializer
@@ -12,6 +13,22 @@
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
+TypeToolDefinition = Literal["tool_definition",]
+
+
+class ToolToolDefinitionTypedDict(TypedDict):
+ definition: AnthropicToolUnionTypedDict
+ r"""An Anthropic tool definition: a client-defined tool with a JSON Schema `input_schema`, or a server tool (bash, text editor, web search)."""
+ type: TypeToolDefinition
+
+
+class ToolToolDefinition(BaseModel):
+ definition: AnthropicToolUnion
+ r"""An Anthropic tool definition: a client-defined tool with a JSON Schema `input_schema`, or a server tool (bash, text editor, web search)."""
+
+ type: TypeToolDefinition
+
+
MessagesToolAdditionBlockTypeMcpToolsetReference = Literal["mcp_toolset_reference",]
@@ -62,6 +79,7 @@ class MessagesToolAdditionBlockToolToolReference(BaseModel):
Union[
MessagesToolAdditionBlockToolToolReferenceTypedDict,
MessagesToolAdditionBlockToolMcpToolsetReferenceTypedDict,
+ ToolToolDefinitionTypedDict,
MessagesToolAdditionBlockToolMcpToolReferenceTypedDict,
],
)
@@ -77,6 +95,7 @@ class MessagesToolAdditionBlockToolToolReference(BaseModel):
MessagesToolAdditionBlockToolMcpToolsetReference,
Tag("mcp_toolset_reference"),
],
+ Annotated[ToolToolDefinition, Tag("tool_definition")],
],
Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
@@ -86,7 +105,7 @@ class MessagesToolAdditionBlockToolToolReference(BaseModel):
class MessagesToolAdditionBlockTypedDict(TypedDict):
- r"""Loads a previously deferred tool (declared in `tools` with `defer_loading: true`) mid-conversation without invalidating the prompt cache. Only valid in `role: \"system\"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8."""
+ r"""Adds a tool mid-conversation without invalidating the prompt cache: either a previously deferred tool (declared in `tools` with `defer_loading: true`, referenced by name) or a full inline `tool_definition`. Only valid in `role: \"system\"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8."""
tool: MessagesToolAdditionBlockToolUnionTypedDict
type: TypeToolAddition
@@ -95,7 +114,7 @@ class MessagesToolAdditionBlockTypedDict(TypedDict):
class MessagesToolAdditionBlock(BaseModel):
- r"""Loads a previously deferred tool (declared in `tools` with `defer_loading: true`) mid-conversation without invalidating the prompt cache. Only valid in `role: \"system\"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8."""
+ r"""Adds a tool mid-conversation without invalidating the prompt cache: either a previously deferred tool (declared in `tools` with `defer_loading: true`, referenced by name) or a full inline `tool_definition`. Only valid in `role: \"system\"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8."""
tool: MessagesToolAdditionBlockToolUnion
diff --git a/uv.lock b/uv.lock
index 729966651..7e0ec7f64 100644
--- a/uv.lock
+++ b/uv.lock
@@ -231,7 +231,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.3.81"
+version = "1.3.82"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },