diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index 9ea14791..b8698a21 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: 28a6d2f2807bdc9333f5dc042fb9e003
+ docChecksum: b431fc9cfc2b55f32d6aab1774955326
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
- releaseVersion: 1.1.12
- configChecksum: cd9558c65fd6616a3b38c9fad48d8aab
+ releaseVersion: 1.1.13
+ configChecksum: 88ec6fe9bd229f08276aa4317354d590
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: a35e8ac7-f059-4ec4-a0e3-88f070a12533
- pristine_commit_hash: 2ebbd6665a75e69bb066ded7a2d78d4b14382e35
- pristine_tree_hash: e0c63b3884b40d36059664bb93ad1723e1825016
+ generation_id: a3ac8261-d0d7-452a-9d8e-70b44e95972a
+ pristine_commit_hash: 320557cfe72f3805621c879a9de1f50ee75710bf
+ pristine_tree_hash: e1eef35e9fa65278ee9b4e4b7697eea357de7268
features:
python:
acceptHeaders: 3.0.0
@@ -320,6 +320,22 @@ trackedFiles:
id: 0fe41665501a
last_write_checksum: sha1:b986c4111210ece695b40750d8006f103caf5735
pristine_git_object: 644c8db7053f3a75bf33bb2430c53183bfca2e22
+ docs/components/anthropicfile.mdx:
+ id: 8bb5aaf1161f
+ last_write_checksum: sha1:51e452a4c1ea01174be02723e7a09a3ddc4d23f2
+ pristine_git_object: 7e1012dc71b22246c9486f2a0f1b3ba2a562c216
+ docs/components/anthropicfiledeleted.mdx:
+ id: 83cf8c714571
+ last_write_checksum: sha1:75cb289d5728da4e1c4c7b8e3ccbbd04291e7c4d
+ pristine_git_object: 2e4f7895252b7fdd3b7ed439a407efc020681280
+ docs/components/anthropicfiledeletedshape.mdx:
+ id: b583d6821153
+ last_write_checksum: sha1:2dedb14222d01f51390f5ef2386977d58ef970d2
+ pristine_git_object: 949ee14e91c0d7a52a833877021325bba7d85bfd
+ docs/components/anthropicfiledeletedtype.mdx:
+ id: 7a4278fb6bf7
+ last_write_checksum: sha1:8688caeb61bf2a9a7025f49566ef5953b2383818
+ pristine_git_object: e2a1aa629b4927a83a1aec2176bdf68d95338a86
docs/components/anthropicfiledocumentsource.mdx:
id: 3cf4c2213084
last_write_checksum: sha1:1f490c185f0c5599669591755da9bd6500406812
@@ -328,6 +344,22 @@ trackedFiles:
id: 911db198eb3b
last_write_checksum: sha1:491e11043880ae4e97048c0a7eb3b878214c7d83
pristine_git_object: c86bc52963eca6a9de705f418c56d17a4bf8ebc6
+ docs/components/anthropicfilelist.mdx:
+ id: e3cd108707ee
+ last_write_checksum: sha1:d0807459d230ae77d31cc99bdf743851d3e844a0
+ pristine_git_object: 59fc87350fa3fcaaf1ab7e202f79a954746b079f
+ docs/components/anthropicfilelistshape.mdx:
+ id: 330bbac8002b
+ last_write_checksum: sha1:75e845e77b8a03ec120a48597b0d8b4ad0789ae0
+ pristine_git_object: 4032de06cdbc2d52547fd84228ff193d911322b1
+ docs/components/anthropicfileshape.mdx:
+ id: 0aa35681e4e6
+ last_write_checksum: sha1:6df7d738557203356647bf30e97c3135098a9fbd
+ pristine_git_object: 1f97f541034da7a3a90b4c1992578ae7b2f30497
+ docs/components/anthropicfiletype.mdx:
+ id: f2b258ace4f1
+ last_write_checksum: sha1:fcf5ced0aeb27d8ad69d4a05a679e10254932f25
+ pristine_git_object: 98c29b8863f0c9ee52634854e746c1fff15499aa
docs/components/anthropicimageblockparam.mdx:
id: a85ff43edd3a
last_write_checksum: sha1:32a650d11a80f74059407954fa86eba2247fdf03
@@ -1766,24 +1798,12 @@ trackedFiles:
pristine_git_object: 2450e43778e482e31b4ccf29287d0a029120ba5c
docs/components/filedeleteresponse.mdx:
id: 5f7dc2e707ae
- last_write_checksum: sha1:586c8e036c9bd5bff72f8ba8c817527997ee2c53
- pristine_git_object: f9fa432587770f2613bf1fa4354e66202d15c83f
- docs/components/filedeleteresponsetype.mdx:
- id: 5f7a73962d48
- last_write_checksum: sha1:ddaf4610d5e53795b50cf54bdfb59ce7f09a43b8
- pristine_git_object: 978f7962bbd31d7427d9abf4af239efd5ae16226
+ last_write_checksum: sha1:b29a108d3073c53be3d6ba52444a446165e9c493
+ pristine_git_object: f14b9e846497db3f3e4cb13c4f4988985c748593
docs/components/filelistresponse.mdx:
id: ca063283734e
- last_write_checksum: sha1:05fbc7f5d1656f7ba4b41fa3c4071fdf20ff9c72
- pristine_git_object: ec3829978213a2daea4ced16b4c30405c3687532
- docs/components/filemetadata.mdx:
- id: 1de063910c9b
- last_write_checksum: sha1:97e9ea9294549ec49126fead9f95bdd2aad8af61
- pristine_git_object: cfb23fb248c4473425f52bfb4576a09951163d75
- docs/components/filemetadatatype.mdx:
- id: 334463560a36
- last_write_checksum: sha1:8fb5050aa4a7dd6395c24ecf4dd3bca517494b31
- pristine_git_object: e67003057312f7d56f3b3ba0197a93624755175b
+ last_write_checksum: sha1:90c78c93e506aaa17e951b91d220bec14f600185
+ pristine_git_object: ab7c43a2e6897abaff9286f15a12204c3e1f5d14
docs/components/fileparserplugin.mdx:
id: 083d2a50302f
last_write_checksum: sha1:a5be0e9c85ac7f425996982662606fb34b25fbd3
@@ -1800,6 +1820,14 @@ trackedFiles:
id: 5051caffff88
last_write_checksum: sha1:84b7b63066020a2a297ce511261f272767df2c10
pristine_git_object: fa448d3f72ed18b2a8894a949bbc8df5dfebf281
+ docs/components/fileprovider.mdx:
+ id: 92af9c0db568
+ last_write_checksum: sha1:5492b0286c6dadc14380bccc548a277069ff68f8
+ pristine_git_object: 1623be5d30e0945a83e9ec457ad0868c021cc87b
+ docs/components/fileresponse.mdx:
+ id: 4ef5af39a50d
+ last_write_checksum: sha1:908b807972593e70256e3c4b6d0a27e2a24f1f5f
+ pristine_git_object: cd95d88afa32c9a57bc5a227912d03568da1073e
docs/components/filesearchservertool.mdx:
id: 5d9983161437
last_write_checksum: sha1:29b0b6df7c1cead82c312595d8809e5a3234562f
@@ -3252,6 +3280,46 @@ trackedFiles:
id: 35262d81b0a1
last_write_checksum: sha1:53220ed66cf059d9f06df81b7f5bb0f2d87f5283
pristine_git_object: bf3c27b8d2da352bd80bb18179159839e69b9b0a
+ docs/components/openaifile.mdx:
+ id: 455c97feac56
+ last_write_checksum: sha1:177e114084bb0761a3c7b1a1c419048dabb55d18
+ pristine_git_object: 83aa79140e3e2f88d36d7c209eb9181fce163599
+ docs/components/openaifiledeleted.mdx:
+ id: 641538ca2183
+ last_write_checksum: sha1:be5d870746725d1aa8ed231c7ef847633b9d863c
+ pristine_git_object: 24db73f81761a886afc9d7d7ba6229a53c018980
+ docs/components/openaifiledeletedobject.mdx:
+ id: 0a518d04b385
+ last_write_checksum: sha1:a637d18a643f2b590be482876531685d0ac729dc
+ pristine_git_object: c0f35ed5c170e1be5009335e66f78b4ae424dcb6
+ docs/components/openaifiledeletedshape.mdx:
+ id: 79200a3e072a
+ last_write_checksum: sha1:43aace376987b14fd66cff12df8b7ffe51aadeee
+ pristine_git_object: 9fdf1917a11561ffdc05a413f802394d32b809b0
+ docs/components/openaifilelist.mdx:
+ id: a961217cedc0
+ last_write_checksum: sha1:5cb4f6c6f5ddfc20b135056b6d0bd1bdf7ffdfda
+ pristine_git_object: d365da303c1f8739af9e0a5cb7e122d7ca045d29
+ docs/components/openaifilelistobject.mdx:
+ id: 36e19d6b12f9
+ last_write_checksum: sha1:9aa59789f55e10732dbfbbc12d1d35b1bc631acb
+ pristine_git_object: 17348c68e6f23d1d16c69591eb23c26ece6a3177
+ docs/components/openaifilelistshape.mdx:
+ id: 7e5b2f1ba46f
+ last_write_checksum: sha1:c72b9b0c15b3419f314a39b5bf981655f65091a3
+ pristine_git_object: 6f7954ba61f59f3ae207dfb26e39ca1cf7b7db85
+ docs/components/openaifileobject.mdx:
+ id: c018977d3d7d
+ last_write_checksum: sha1:3e2394bb72ceb90af8230a3a5b43c0ca7c4aad59
+ pristine_git_object: 097202739c28a07add8da1c3bb788660192e4967
+ docs/components/openaifileshape.mdx:
+ id: 75c23e6b2ff5
+ last_write_checksum: sha1:eb3950898ed711c6f3d2d4c4d2cfdc1da6151dda
+ pristine_git_object: de4df8904188d1bd0061f5aefc49258cae89d304
+ docs/components/openaifilestatus.mdx:
+ id: 152b17664c32
+ last_write_checksum: sha1:79a21ae388b4fe0fac92e8f8abf69125429469ad
+ pristine_git_object: c9c31255e2cd59c5517333b91bcf798ac71ae36d
docs/components/openairesponsecustomtoolcall.mdx:
id: 090c07768006
last_write_checksum: sha1:34b7e423654fb097e3420b2fa3ef010f15821796
@@ -3436,6 +3504,38 @@ trackedFiles:
id: 59f334d128a7
last_write_checksum: sha1:c74e9c086d4911223620a11dcd45c5eb9b9160fb
pristine_git_object: 6ef2ae2c930d1279df1f2f68348c8bf3583c2a7c
+ docs/components/openrouterfile.mdx:
+ id: 190a66b8ac85
+ last_write_checksum: sha1:55e54ca3ef094ac4061e2d7322c9b8e5393d3d48
+ pristine_git_object: f7335e372784d395da64cb596d895b7f18483bdf
+ docs/components/openrouterfiledeleted.mdx:
+ id: 17fcf704b657
+ last_write_checksum: sha1:cc1fa7ea0e52f9a8fcec74702d28374ebe89de22
+ pristine_git_object: af6a578a5fbb0a56c23bbff4c68e6d118c1596b9
+ docs/components/openrouterfiledeletedshape.mdx:
+ id: f2e3ef69a4da
+ last_write_checksum: sha1:3247efa73d32ec7a046477b43f3d4a4acb3bcecd
+ pristine_git_object: 1d666d496d77dca1add1a1290a2510cc95ec839a
+ docs/components/openrouterfiledeletedtype.mdx:
+ id: 5ab71d05a594
+ last_write_checksum: sha1:581953c53c3d9cf3593553d9b12252b920d574be
+ pristine_git_object: b5dfbefc2ee652ef5a969bc9a065166a79d208b2
+ docs/components/openrouterfilelist.mdx:
+ id: 759778b60979
+ last_write_checksum: sha1:b63f8611de484a60ee6a5af52cd445c09599edd8
+ pristine_git_object: 16ebdba6b16c3a95a77f704c04bb2900f6112b8d
+ docs/components/openrouterfilelistshape.mdx:
+ id: 8a4ebc3aa7e7
+ last_write_checksum: sha1:d175faba77d8df99dc1abeb8add2614827e23ebf
+ pristine_git_object: 815aa5b5b92585258320c8bf6243e2419b7a1fd6
+ docs/components/openrouterfileshape.mdx:
+ id: c90a9bb5f140
+ last_write_checksum: sha1:1495ff50263260e6d98c282e04ed662035784392
+ pristine_git_object: 66c6c68b718b95f699d97cf1e24d68ee49e57813
+ docs/components/openrouterfiletype.mdx:
+ id: e1b25d15519d
+ last_write_checksum: sha1:db270dbe481f469ad3d719a569ae445240848210
+ pristine_git_object: fe4a1888643f81ea25e2271c592f98482ba3b83e
docs/components/openroutermetadata.mdx:
id: 355be2e7788c
last_write_checksum: sha1:c5ed476aab215597dd1af37fe1fd7e99a0ac6c88
@@ -4124,6 +4224,10 @@ trackedFiles:
id: 61fb18b7ff94
last_write_checksum: sha1:e241420249fcbd1bf515b0f5e84934de0b207948
pristine_git_object: 894ca95c033795d50895fec5b8a6a18cd4a459c3
+ docs/components/purpose.mdx:
+ id: ae295e1d0077
+ last_write_checksum: sha1:0254976b545dce44c49a9bff2cdfbe687d5fe749
+ pristine_git_object: 19da770f06021e253f4e2ca68d11740dffcf9ccf
docs/components/quantization.mdx:
id: 9d062e4ee362
last_write_checksum: sha1:0baac45af2448938fb70f2076caaac66834bd3ce
@@ -5786,8 +5890,8 @@ trackedFiles:
pristine_git_object: 7cab840ae2623e4f8ccd5d34b4997e8243cd72d8
docs/operations/deletefilerequest.mdx:
id: fa38696c8455
- last_write_checksum: sha1:001d42b9af6e87c48c58c00b08a519db30a508d4
- pristine_git_object: a41b1ee131eef8ef7d2c6be1f2030f86041ee14c
+ last_write_checksum: sha1:776756c3e07cefc528bdceb05e356384035b9329
+ pristine_git_object: acff81d0d425b5d40abf9cb7acb749c3e9c2c634
docs/operations/deleteguardrailglobals.mdx:
id: f3c051209faf
last_write_checksum: sha1:1b12ecd3f259ec98d2377fceeb967163ddaba3cb
@@ -5866,8 +5970,8 @@ trackedFiles:
pristine_git_object: 8415a66852abad293076598cc27010eddfcfa130
docs/operations/downloadfilecontentrequest.mdx:
id: 04df99863d55
- last_write_checksum: sha1:e5a85a6a6732effe878ee459804e4a84fbcbd1fd
- pristine_git_object: 8b858feced07daaed68ce83fa477ee27796904e7
+ last_write_checksum: sha1:159fcd5fefb7050b22caf66819479e922ef58047
+ pristine_git_object: 4e0f83f3709a3122fd26e0795cd3834cb2931844
docs/operations/embedding.mdx:
id: 591dd7891964
last_write_checksum: sha1:8c8196e7ea5cf8a0a43a4495d721e4fa19530ffc
@@ -5990,8 +6094,8 @@ trackedFiles:
pristine_git_object: 4b9270d76df3ac3ff1402b6ae3c5132d54c666fe
docs/operations/getfilemetadatarequest.mdx:
id: "092777656353"
- last_write_checksum: sha1:719dc08ca7076a0a75063fae9c9cbc23bfac2ab4
- pristine_git_object: 4cf0f5421df690c9f3e2c5ec44276a1b59581abd
+ last_write_checksum: sha1:9de0cc6362e1c98dbb27ec50e349a3faa46b9c62
+ pristine_git_object: 429a0f54772b016b1ab07c016ccaff9715e0ab3e
docs/operations/getgenerationglobals.mdx:
id: 43ac280f4639
last_write_checksum: sha1:1e3b8a4dcd3f112ae32edfca342dd01cc9bde7bd
@@ -6206,12 +6310,12 @@ trackedFiles:
pristine_git_object: 5e86176bf6809f16e19cd7006288ea8d55911070
docs/operations/listfilesrequest.mdx:
id: 86c9594f103f
- last_write_checksum: sha1:7ed07315e04db865877d2ad1c9be84c4977fe28b
- pristine_git_object: a5a1b70a9b38f2563fea202a52adc0fe8ab7f60d
+ last_write_checksum: sha1:3c7e072bd648cd6ea082b7eede3ff02255618b46
+ pristine_git_object: df4338da015925ab79fac4afbd0b4eaf9738c6b0
docs/operations/listfilesresponse.mdx:
id: b2a0050d55de
- last_write_checksum: sha1:ffd1ee4a12704d53dc63b7133965b334d32844be
- pristine_git_object: 6cb55f6d74e06eb9b6c948f6dac304d2f3379582
+ last_write_checksum: sha1:297925ca08fc84cbae8f6023a98b7da0de81dca2
+ pristine_git_object: bc29d45a6fd604a9bb148e9b42c38e160b785d97
docs/operations/listgenerationcontentglobals.mdx:
id: 37713baa8939
last_write_checksum: sha1:f893103835ccc22cc34baa4dce22480a7c000f0a
@@ -6480,6 +6584,10 @@ trackedFiles:
id: cd9b4abc3c86
last_write_checksum: sha1:80ba4042763e10684eebd2c8da7ea75416cd15f7
pristine_git_object: 8acee540065370db1e6eb01bfa0b044a603e2fd6
+ docs/operations/order.mdx:
+ id: 68bcbfae42c2
+ last_write_checksum: sha1:1c11e84b0517b74ed96d801a54c929c5b178c539
+ pristine_git_object: 600110da52f1e3daf913078e88da5b61b374e37b
docs/operations/orderby.mdx:
id: 5465d93e546d
last_write_checksum: sha1:5788c1fe076463a57ad4220f0f35e0ce15f44209
@@ -6654,8 +6762,8 @@ trackedFiles:
pristine_git_object: 41aa595e25196c37fde92a5e7ec72a55d77c8472
docs/operations/uploadfilerequest.mdx:
id: b4dafdae4a55
- last_write_checksum: sha1:bec419780da7e4692473dc623f7c5f869e851269
- pristine_git_object: 70188129763ff300a0f3faa45134f7299c9bdf39
+ last_write_checksum: sha1:84b0d4e49ae9c6c1e08551bd88c963c8ee4a14e5
+ pristine_git_object: 16d9fbce09b5966eb9b77160003a93ce237f77a9
docs/operations/uploadfilerequestbody.mdx:
id: fde4cc558d95
last_write_checksum: sha1:84cd9ecf7c776cba269dbc3c6b970b906bd0030d
@@ -6746,8 +6854,8 @@ trackedFiles:
pristine_git_object: f8cebc2061d7428904766956be45ca70e5519be4
docs/sdks/files/README.mdx:
id: 1a0c257e330c
- last_write_checksum: sha1:21cf411ff5c897140db8611e612d082ab923ccce
- pristine_git_object: b0cde3e3a703132befdb96ad10c17bf036b7464a
+ last_write_checksum: sha1:de776967e4a75eaa47f3652f11dbbb1958f08c81
+ pristine_git_object: d953a363ad8ad5ebdc689a75d5b4753ec0069e79
docs/sdks/generations/README.mdx:
id: a754fecc8514
last_write_checksum: sha1:b5f8035c676b5eb050472ed9697b64718aed8f17
@@ -6814,8 +6922,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:f1ea89560be04f6e082044917ded457ff2ae6fcd
- pristine_git_object: 0ac27011d8c3f2dee7ef6b842b31e1a7f98c14de
+ last_write_checksum: sha1:b081ccece9d496acc6c4d7d86cbf51f860209c33
+ pristine_git_object: 907de0161af7a4407b8b791ca14e088dc97d7977
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -6842,8 +6950,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:d06b3323bcd1fa508ab40232dba1df26d15e3cdd
- pristine_git_object: c009a9e6319ae40eeb71248d6552da4a8c73cc44
+ last_write_checksum: sha1:df58acfa72145e3100f5c3a8707c3acda291f888
+ pristine_git_object: 18c2e2b4b20740c74dc07f3b2c993098ca2de95c
src/openrouter/analytics.py:
id: cb406b5aaabb
last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841
@@ -6886,8 +6994,8 @@ trackedFiles:
pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1
src/openrouter/components/__init__.py:
id: 81754e97b3f4
- last_write_checksum: sha1:cae2fd824842d8e2f392569cbafa46609fb3afb3
- pristine_git_object: 2656d514ecabf8534e0e625b8a4f977cecb46498
+ last_write_checksum: sha1:2b45dd5f3f29cb5bc620170622c6c9a9982a32ae
+ pristine_git_object: 2eac3e35d33bae3a4a83215c1dafdb977d716f41
src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82
last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c
@@ -6984,10 +7092,22 @@ trackedFiles:
id: 2c3093530540
last_write_checksum: sha1:43f9b964f383ea77663e47c9a1e1cd76b7457d2c
pristine_git_object: be2d48fefcffa05ca80bfa647f77fafe60872a7d
+ src/openrouter/components/anthropicfile.py:
+ id: 9208bdd187dd
+ last_write_checksum: sha1:9b0879ff204549046e6cf2a7e861a9ca7f592a52
+ pristine_git_object: 6446c73d6a2344b65a2142c15176d24edf5ce110
+ src/openrouter/components/anthropicfiledeleted.py:
+ id: 615e4e481e1e
+ last_write_checksum: sha1:586ac045d40f7e5087b83c9bd0eec5649a782326
+ pristine_git_object: fb4749adf1df0d11e0f0b03100468f3745089b7e
src/openrouter/components/anthropicfiledocumentsource.py:
id: d824b52285d7
last_write_checksum: sha1:5d3c89e2d60df0116aed28d9a2274cf61536af41
pristine_git_object: 06ab054ee7227cb2186c19c108145d8e19646044
+ src/openrouter/components/anthropicfilelist.py:
+ id: fc22d6ad8230
+ last_write_checksum: sha1:e1440e42e1f03e1d2dd9bd407f40e57e85bf9cca
+ pristine_git_object: def29ec5aec5f4cf84cb62c7dc6eb7c00f40ab5d
src/openrouter/components/anthropicimageblockparam.py:
id: 71cab07562d1
last_write_checksum: sha1:fbdb3a017bc51cb2848933aca87023159951a2aa
@@ -7654,16 +7774,12 @@ trackedFiles:
pristine_git_object: 7217c3099593e28e52a784193364285f101d7318
src/openrouter/components/filedeleteresponse.py:
id: 45d467f4500a
- last_write_checksum: sha1:cab7fd623f6e61fd80f2fb3490599e236e599203
- pristine_git_object: ee75b85ee8d580fb1fb71bee31adbfd2552885c3
+ last_write_checksum: sha1:eaf65d6b05a9e5cf05cfa22983d397399391c136
+ pristine_git_object: 72903987af6161101c2c891a4603e52f99f839e7
src/openrouter/components/filelistresponse.py:
id: d0c949679c66
- last_write_checksum: sha1:b0f20d6162369b24e09e5d9c5121077e2f6d3f3c
- pristine_git_object: 3b40324c33b8a4fa19d3940a5cc797bf2f75d202
- src/openrouter/components/filemetadata.py:
- id: 31b55c7f5dbd
- last_write_checksum: sha1:2543bac9ec9d7174e47fe375a5eb936fd5e5f720
- pristine_git_object: e128dc9b415b5eb362a076ac1c1c59b500792c96
+ last_write_checksum: sha1:fea389c3096622f3ead0405b48f904463321d453
+ pristine_git_object: 6c22b2c492213c334cddfcb3a681a96bf9982629
src/openrouter/components/fileparserplugin.py:
id: 1120c86c0856
last_write_checksum: sha1:9738be43f64002d681539c37cc3dd882a00670f5
@@ -7672,6 +7788,14 @@ trackedFiles:
id: 9e37fa73a86a
last_write_checksum: sha1:65fe062e78f2716c180230379cbd3419f8b36e49
pristine_git_object: fc29881e08f5804dd5ba0ab66572d6c74f83e0c4
+ src/openrouter/components/fileprovider.py:
+ id: 39b3c6c91784
+ last_write_checksum: sha1:70d2f5a554d9d12938781a5669a3531c17e770c7
+ pristine_git_object: 86f13260a7797154cd62af61b558847fb7899551
+ src/openrouter/components/fileresponse.py:
+ id: 099fb816ea9c
+ last_write_checksum: sha1:87f799c886ce1433ff6c802ace0c7a466efccb54
+ pristine_git_object: 9d7d5b885f4f34749cbcf7416cef124a99101fb3
src/openrouter/components/filesearchservertool.py:
id: 8ecc4d4a0ddd
last_write_checksum: sha1:0cb000d6cf7ce3680e33fa9ae92deb4ca91a120f
@@ -8252,6 +8376,18 @@ trackedFiles:
id: 2f942be86581
last_write_checksum: sha1:03c3c17e3dea02893688ce46784f9ea8461bacc4
pristine_git_object: 344abac0c40b1b4e21d986e70be1e7ee80fc2b4d
+ src/openrouter/components/openaifile.py:
+ id: fd021f0cb031
+ last_write_checksum: sha1:b44d0b18a4c9b119382e224786191e8d5c49960b
+ pristine_git_object: 0b55319dcda9ebc3f2c826c6487d398c16f4928d
+ src/openrouter/components/openaifiledeleted.py:
+ id: 4dad9151358a
+ last_write_checksum: sha1:3e95d39ea330a24e24997afe2e5f0b9f3bf1ba0a
+ pristine_git_object: a047881c37be364e2e601502b843cd9d314f3fce
+ src/openrouter/components/openaifilelist.py:
+ id: c004ff62333c
+ last_write_checksum: sha1:ca07aab74139d6a847f50addfce8f561308f77f1
+ pristine_git_object: 528583a74010f621aa922914421dfaf7ba8cb87d
src/openrouter/components/openairesponsecustomtoolcall.py:
id: b1a8a20b6710
last_write_checksum: sha1:700948fc28ef6c2c4ae5774fc02e256fabbbfced
@@ -8304,6 +8440,18 @@ trackedFiles:
id: 78f7e33b19e6
last_write_checksum: sha1:35ed4f39bfe05c8d56e14166be09adc76b3fb0ec
pristine_git_object: f3be4e665351b3b08a77a2fa324ca88aad4ec4e9
+ src/openrouter/components/openrouterfile.py:
+ id: df1961bcb130
+ last_write_checksum: sha1:1a9a1b1e640f4d0ef78ce0caa160b5ab342f02cc
+ pristine_git_object: a2621ac641683938a48c0a0ca9418e669c12c843
+ src/openrouter/components/openrouterfiledeleted.py:
+ id: ea21dd1030c6
+ last_write_checksum: sha1:14736d234a75af01da92f84f4852effafbead2df
+ pristine_git_object: d0100baed241db2522eeb75ef7aadebe7ae5f728
+ src/openrouter/components/openrouterfilelist.py:
+ id: e229c4e23762
+ last_write_checksum: sha1:e535445c49bd1f21ac7b75c1042e78cc72acd577
+ pristine_git_object: f5cf39efc3f9d3de11167f4b5f48124d07d0a588
src/openrouter/components/openroutermetadata.py:
id: 87062f38be59
last_write_checksum: sha1:65c4b563aea67eb15f1fc6d859856a081a1cc78f
@@ -9254,8 +9402,8 @@ trackedFiles:
pristine_git_object: 51b56d9ca5e27c49a98d05f0414573ac5243c580
src/openrouter/files.py:
id: 7baf7ee1f5b3
- last_write_checksum: sha1:10faee867c6c2c4e4c91fd7b8d7baf29a90b8301
- pristine_git_object: 0eb6e27617d4874a5d0cb825d536d6021b7e699d
+ last_write_checksum: sha1:647c71674fef51cb83996b3a8dafa1e04cd156ee
+ pristine_git_object: abd0225d2d8651a20369fcedd1ca6fe7f02aa342
src/openrouter/generations.py:
id: 70e1c21042bc
last_write_checksum: sha1:00b190db603c57571f77ccfe5d5612a3f42c62a0
@@ -9298,8 +9446,8 @@ trackedFiles:
pristine_git_object: 0f62389a8410522fe76eed82c64227903a8605c5
src/openrouter/operations/__init__.py:
id: 9afcea1e7161
- last_write_checksum: sha1:e56a2031fc05ced63f1e1c769fc3407b290890a8
- pristine_git_object: 95999d265d654c5c2adab6aaf93bab0e75376e3d
+ last_write_checksum: sha1:6c6afd7330b690e2bd2bae3ffd586a1d28456319
+ pristine_git_object: 1044a7cfabd59c96334c9119c647622d3947e9f3
src/openrouter/operations/bulkaddworkspacemembers.py:
id: e0ed56117619
last_write_checksum: sha1:5c44eb0d40fdece3ac084615f6c6082be4cf1d5a
@@ -9398,8 +9546,8 @@ trackedFiles:
pristine_git_object: 2148ca98c6cde1506783e9c5f2f522226a27e428
src/openrouter/operations/deletefile.py:
id: 7035af059141
- last_write_checksum: sha1:4f596bb18e5215da2066466ec7b6be7374a64d44
- pristine_git_object: ea64b3b8d043b0c5593817d7e7a7abdbcc96cb05
+ last_write_checksum: sha1:9eef35ceee470a0dceb64d463ec499a2e8bad9b5
+ pristine_git_object: 846f9c41478dfa2c5d1b10b9418fdd422851fdb7
src/openrouter/operations/deleteguardrail.py:
id: 1fbdb98bbb85
last_write_checksum: sha1:9205bdbe64c2902d51ac7c6bddc8677af5b14ed7
@@ -9422,8 +9570,8 @@ trackedFiles:
pristine_git_object: b61191d8c3c9ab9da453e46c871231bda0e2628c
src/openrouter/operations/downloadfilecontent.py:
id: 6ff3d391a23f
- last_write_checksum: sha1:0f210f7c9b84c8c8e3ab32ae4ad16b6169880ccb
- pristine_git_object: 8da6ef059396e5e5127957f698930b4737470e1b
+ last_write_checksum: sha1:a1152e6af4d5a47bdaaab7ef35dfed739f1abff4
+ pristine_git_object: 47e67150e4cbfc92be1fb932bf0898a34e115e23
src/openrouter/operations/exchangeauthcodeforapikey.py:
id: 37bdd1517a07
last_write_checksum: sha1:fb531dadbabcc38e5a57b0bd3eda846790fac93a
@@ -9454,8 +9602,8 @@ trackedFiles:
pristine_git_object: d0062378b98ef20bf17dcc00a219edaa1da24424
src/openrouter/operations/getfilemetadata.py:
id: 408c34486769
- last_write_checksum: sha1:d2c26949cad5e845994a582591f439ac052d3052
- pristine_git_object: 4614554b2cb444352d81ccb398f414a566b03f91
+ last_write_checksum: sha1:592b6646b4ff082d8427ea08e79e6b34be490857
+ pristine_git_object: 2aaecb5530a0be594ce176f41572f6441ba962f4
src/openrouter/operations/getgeneration.py:
id: d7c64961334f
last_write_checksum: sha1:c593bd5ddf5d9d0424a4b84401785cfddc90049f
@@ -9530,8 +9678,8 @@ trackedFiles:
pristine_git_object: f5bd1f67dc835230e6d282e0500cbf3b5781eab4
src/openrouter/operations/listfiles.py:
id: fd89527f4236
- last_write_checksum: sha1:89b86758d80347b2ac21f01eae0a835884527c23
- pristine_git_object: 75fdf629ea1573a1bf6962a862cecaa7c050a4bd
+ last_write_checksum: sha1:b4a0b5c4b4152ed8c2766afbaf9d9557ceb347f3
+ pristine_git_object: 624ca31cccb4b8f5b4db5c676f44574d92ae3fc7
src/openrouter/operations/listgenerationcontent.py:
id: 2f086d74631c
last_write_checksum: sha1:d2792123b36f31d0bcb2ba00e1843a1b04287983
@@ -9646,8 +9794,8 @@ trackedFiles:
pristine_git_object: 4441056786e1495816e8dc057a29795e86380ab1
src/openrouter/operations/uploadfile.py:
id: f9dc565da045
- last_write_checksum: sha1:fba1a6cb4299c240b32bae8628b5e583e914182a
- pristine_git_object: fa8f9261c002709027180b7db501f3c6face90ea
+ last_write_checksum: sha1:29c8233db3b2e32df2e694db32ece55219377015
+ pristine_git_object: 19ee8e8e2a645f6a40d3874320a04cf66334b1c6
src/openrouter/operations/upsertworkspacebudget.py:
id: 67d4a2962257
last_write_checksum: sha1:e251aa9f18cef5e265ef4d65cfbda42af411d2a3
@@ -11097,7 +11245,7 @@ examples:
speakeasy-default-list-files:
responses:
"200":
- application/json: {"cursor": null, "data": [{"created_at": "2025-01-01T00:00:00Z", "downloadable": false, "filename": "document.pdf", "id": "or_file_011CNha8iCJcU1wXNR6q4V8w", "mime_type": "application/pdf", "size_bytes": 1024000, "type": "file"}], "first_id": "or_file_011CNha8iCJcU1wXNR6q4V8w", "has_more": false, "last_id": "or_file_011CNha8iCJcU1wXNR6q4V8w"}
+ application/json: {"_shape": "openrouter", "cursor": null, "data": [], "first_id": null, "has_more": false, "last_id": null}
"400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"401":
@@ -11106,13 +11254,19 @@ examples:
application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}}
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
+ "403":
+ application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}}
+ "502":
+ application/json: {"error": {"code": 502, "message": "Provider returned error"}}
+ "503":
+ application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}}
uploadFile:
speakeasy-default-upload-file:
requestBody:
multipart/form-data: {"file": "x-file: example.file"}
responses:
"200":
- application/json: {"created_at": "2025-01-01T00:00:00Z", "downloadable": false, "filename": "document.pdf", "id": "or_file_011CNha8iCJcU1wXNR6q4V8w", "mime_type": "application/pdf", "size_bytes": 1024000, "type": "file"}
+ application/json: {"_shape": "openrouter", "created_at": "2025-01-01T00:00:00Z", "downloadable": false, "filename": "document.pdf", "id": "or_file_011CNha8iCJcU1wXNR6q4V8w", "mime_type": "application/pdf", "size_bytes": 1024000, "type": "file"}
"400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"401":
@@ -11125,6 +11279,10 @@ examples:
application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}}
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
+ "502":
+ application/json: {"error": {"code": 502, "message": "Provider returned error"}}
+ "503":
+ application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}}
deleteFile:
speakeasy-default-delete-file:
parameters:
@@ -11132,7 +11290,7 @@ examples:
file_id: "file_011CNha8iCJcU1wXNR6q4V8w"
responses:
"200":
- application/json: {"id": "or_file_011CNha8iCJcU1wXNR6q4V8w", "type": "file_deleted"}
+ application/json: {"_shape": "openrouter", "id": "or_file_011CNha8iCJcU1wXNR6q4V8w", "type": "file_deleted"}
"401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"404":
@@ -11141,6 +11299,12 @@ examples:
application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}}
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
+ "403":
+ application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}}
+ "502":
+ application/json: {"error": {"code": 502, "message": "Provider returned error"}}
+ "503":
+ application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}}
getFileMetadata:
speakeasy-default-get-file-metadata:
parameters:
@@ -11148,7 +11312,7 @@ examples:
file_id: "file_011CNha8iCJcU1wXNR6q4V8w"
responses:
"200":
- application/json: {"created_at": "2025-01-01T00:00:00Z", "downloadable": false, "filename": "document.pdf", "id": "or_file_011CNha8iCJcU1wXNR6q4V8w", "mime_type": "application/pdf", "size_bytes": 1024000, "type": "file"}
+ application/json: {"_shape": "openrouter", "created_at": "2025-01-01T00:00:00Z", "downloadable": false, "filename": "document.pdf", "id": "or_file_011CNha8iCJcU1wXNR6q4V8w", "mime_type": "application/pdf", "size_bytes": 1024000, "type": "file"}
"401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"404":
@@ -11157,6 +11321,12 @@ examples:
application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}}
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
+ "403":
+ application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}}
+ "502":
+ application/json: {"error": {"code": 502, "message": "Provider returned error"}}
+ "503":
+ application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}}
downloadFileContent:
speakeasy-default-download-file-content:
parameters:
@@ -11175,6 +11345,12 @@ examples:
application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}}
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
+ "403":
+ application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}}
+ "502":
+ application/json: {"error": {"code": 502, "message": "Provider returned error"}}
+ "503":
+ application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}}
getModel:
speakeasy-default-get-model:
parameters:
@@ -11353,4 +11529,4 @@ examples:
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2
-releaseNotes: "## Python SDK Changes:\n* `open_router.benchmarks.get_benchmarks()`: \n * `request.source` **Changed**\n * `response` **Changed**\n"
+releaseNotes: "## Python SDK Changes:\n* `open_router.files.list()`: \n * `request` **Changed**\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `open_router.files.upload()`: \n * `request.provider` **Added**\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `open_router.files.delete()`: \n * `request.provider` **Added**\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `open_router.files.retrieve()`: \n * `request.provider` **Added**\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `open_router.files.download()`: \n * `request.provider` **Added**\n * `error` **Changed**\n"
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index 12440489..385dd2a5 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.1.12
+ version: 1.1.13
additionalDependencies:
dev: {}
main: {}
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index 4fa7ead7..1c9c3dab 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -1396,6 +1396,70 @@ components:
- 'stderr'
- 'type'
type: 'object'
+ AnthropicFile:
+ description: 'A stored file in Anthropic''s Files API shape.'
+ example:
+ _shape: 'anthropic'
+ created_at: '2025-01-01T00:00:00Z'
+ downloadable: false
+ filename: 'document.pdf'
+ id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ mime_type: 'application/pdf'
+ size_bytes: 1024000
+ type: 'file'
+ properties:
+ _shape:
+ enum:
+ - 'anthropic'
+ type: 'string'
+ created_at:
+ type: 'string'
+ downloadable:
+ type: 'boolean'
+ filename:
+ type: 'string'
+ id:
+ type: 'string'
+ mime_type:
+ type: 'string'
+ size_bytes:
+ type: 'integer'
+ type:
+ enum:
+ - 'file'
+ type: 'string'
+ required:
+ - '_shape'
+ - 'id'
+ - 'type'
+ - 'filename'
+ - 'mime_type'
+ - 'size_bytes'
+ - 'created_at'
+ - 'downloadable'
+ type: 'object'
+ AnthropicFileDeleted:
+ description: 'Deletion result in Anthropic''s shape.'
+ example:
+ _shape: 'anthropic'
+ id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ type: 'file_deleted'
+ properties:
+ _shape:
+ enum:
+ - 'anthropic'
+ type: 'string'
+ id:
+ type: 'string'
+ type:
+ enum:
+ - 'file_deleted'
+ type: 'string'
+ required:
+ - '_shape'
+ - 'id'
+ - 'type'
+ type: 'object'
AnthropicFileDocumentSource:
example:
file_id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
@@ -1411,6 +1475,40 @@ components:
- 'type'
- 'file_id'
type: 'object'
+ AnthropicFileList:
+ description: 'A page of files in Anthropic''s shape.'
+ example:
+ _shape: 'anthropic'
+ data: []
+ first_id: null
+ has_more: false
+ last_id: null
+ properties:
+ _shape:
+ enum:
+ - 'anthropic'
+ type: 'string'
+ data:
+ items:
+ $ref: '#/components/schemas/AnthropicFile'
+ type: 'array'
+ first_id:
+ type:
+ - 'string'
+ - 'null'
+ has_more:
+ type: 'boolean'
+ last_id:
+ type:
+ - 'string'
+ - 'null'
+ required:
+ - '_shape'
+ - 'data'
+ - 'has_more'
+ - 'first_id'
+ - 'last_id'
+ type: 'object'
AnthropicImageBlockParam:
example:
source:
@@ -7885,99 +7983,40 @@ components:
- 'index'
type: 'object'
FileDeleteResponse:
- description: 'Confirmation that a file was deleted.'
+ description: 'Confirmation that a file was deleted, in the negotiated shape.'
+ discriminator:
+ mapping:
+ anthropic: '#/components/schemas/AnthropicFileDeleted'
+ openai: '#/components/schemas/OpenAIFileDeleted'
+ openrouter: '#/components/schemas/OpenRouterFileDeleted'
+ propertyName: '_shape'
example:
+ _shape: 'openrouter'
id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
type: 'file_deleted'
- properties:
- id:
- type: 'string'
- type:
- enum:
- - 'file_deleted'
- type: 'string'
- required:
- - 'id'
- - 'type'
- type: 'object'
+ oneOf:
+ - $ref: '#/components/schemas/OpenRouterFileDeleted'
+ - $ref: '#/components/schemas/OpenAIFileDeleted'
+ - $ref: '#/components/schemas/AnthropicFileDeleted'
FileListResponse:
- description: 'A page of files belonging to the requesting workspace.'
+ description: 'A page of files, in the negotiated shape.'
+ discriminator:
+ mapping:
+ anthropic: '#/components/schemas/AnthropicFileList'
+ openai: '#/components/schemas/OpenAIFileList'
+ openrouter: '#/components/schemas/OpenRouterFileList'
+ propertyName: '_shape'
example:
+ _shape: 'openrouter'
cursor: null
- data:
- - created_at: '2025-01-01T00:00:00Z'
- downloadable: false
- filename: 'document.pdf'
- id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
- mime_type: 'application/pdf'
- size_bytes: 1024000
- type: 'file'
- first_id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ data: []
+ first_id: null
has_more: false
- last_id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
- properties:
- cursor:
- description: 'Opaque cursor for the next page; null when there are no more results.'
- type:
- - 'string'
- - 'null'
- data:
- items:
- $ref: '#/components/schemas/FileMetadata'
- type: 'array'
- first_id:
- type:
- - 'string'
- - 'null'
- has_more:
- type: 'boolean'
- last_id:
- type:
- - 'string'
- - 'null'
- required:
- - 'data'
- - 'has_more'
- - 'first_id'
- - 'last_id'
- - 'cursor'
- type: 'object'
- FileMetadata:
- description: 'Metadata describing a stored file.'
- example:
- created_at: '2025-01-01T00:00:00Z'
- downloadable: false
- filename: 'document.pdf'
- id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
- mime_type: 'application/pdf'
- size_bytes: 1024000
- type: 'file'
- properties:
- created_at:
- type: 'string'
- downloadable:
- type: 'boolean'
- filename:
- type: 'string'
- id:
- type: 'string'
- mime_type:
- type: 'string'
- size_bytes:
- type: 'integer'
- type:
- enum:
- - 'file'
- type: 'string'
- required:
- - 'id'
- - 'type'
- - 'filename'
- - 'mime_type'
- - 'size_bytes'
- - 'created_at'
- - 'downloadable'
- type: 'object'
+ last_id: null
+ oneOf:
+ - $ref: '#/components/schemas/OpenRouterFileList'
+ - $ref: '#/components/schemas/OpenAIFileList'
+ - $ref: '#/components/schemas/AnthropicFileList'
FileParserPlugin:
example:
enabled: true
@@ -8016,6 +8055,35 @@ components:
- 'file_id'
- 'index'
type: 'object'
+ FileProvider:
+ description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.'
+ enum:
+ - 'openai'
+ - 'anthropic'
+ example: 'openai'
+ type: 'string'
+ x-speakeasy-unknown-values: allow
+ FileResponse:
+ description: 'A stored file. The shape is negotiated per request — see the endpoint description.'
+ discriminator:
+ mapping:
+ anthropic: '#/components/schemas/AnthropicFile'
+ openai: '#/components/schemas/OpenAIFile'
+ openrouter: '#/components/schemas/OpenRouterFile'
+ propertyName: '_shape'
+ example:
+ _shape: 'openrouter'
+ created_at: '2025-01-01T00:00:00Z'
+ downloadable: false
+ filename: 'document.pdf'
+ id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ mime_type: 'application/pdf'
+ size_bytes: 1024000
+ type: 'file'
+ oneOf:
+ - $ref: '#/components/schemas/OpenRouterFile'
+ - $ref: '#/components/schemas/OpenAIFile'
+ - $ref: '#/components/schemas/AnthropicFile'
FileSearchServerTool:
description: 'File search tool configuration'
example:
@@ -16122,75 +16190,197 @@ components:
- 'type'
- 'config'
type: 'object'
- OpenAIResponseCustomToolCall:
+ OpenAIFile:
+ description: 'A stored file in OpenAI''s Files API shape.'
example:
- call_id: 'call-abc123'
- id: 'ctc-abc123'
- input: "*** Begin Patch\n*** End Patch"
- name: 'apply_patch'
- type: 'custom_tool_call'
+ _shape: 'openai'
+ bytes: 1024000
+ created_at: 1735689600
+ filename: 'document.pdf'
+ id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ object: 'file'
+ purpose: 'user_data'
+ status: 'processed'
properties:
- call_id:
+ _shape:
+ enum:
+ - 'openai'
type: 'string'
- id:
+ bytes:
+ type: 'integer'
+ created_at:
+ type: 'integer'
+ filename:
type: 'string'
- input:
+ id:
type: 'string'
- name:
+ object:
+ enum:
+ - 'file'
type: 'string'
- namespace:
- description: 'Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)'
+ purpose:
+ enum:
+ - 'assistants'
+ - 'batch'
+ - 'fine-tune'
+ - 'vision'
+ - 'user_data'
+ - 'evals'
+ - 'assistants_output'
+ - 'batch_output'
+ - 'fine-tune-results'
type: 'string'
- type:
+ x-speakeasy-unknown-values: allow
+ status:
enum:
- - 'custom_tool_call'
+ - 'processed'
type: 'string'
required:
- - 'type'
- - 'call_id'
- - 'name'
- - 'input'
+ - '_shape'
+ - 'id'
+ - 'object'
+ - 'bytes'
+ - 'created_at'
+ - 'filename'
+ - 'purpose'
+ - 'status'
type: 'object'
- OpenAIResponseCustomToolCallOutput:
+ OpenAIFileDeleted:
+ description: 'Deletion result in OpenAI''s shape.'
example:
- call_id: 'call-abc123'
- output: 'patch applied successfully'
- type: 'custom_tool_call_output'
+ _shape: 'openai'
+ deleted: true
+ id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ object: 'file'
properties:
- call_id:
+ _shape:
+ enum:
+ - 'openai'
type: 'string'
+ deleted:
+ const: true
+ type: 'boolean'
id:
type: 'string'
- output:
- anyOf:
- - type: 'string'
- - items:
- discriminator:
- mapping:
- input_file: '#/components/schemas/InputFile'
- input_image: '#/components/schemas/InputImage'
- input_text: '#/components/schemas/InputText'
- propertyName: 'type'
- oneOf:
- - $ref: '#/components/schemas/InputText'
- - $ref: '#/components/schemas/InputImage'
- - $ref: '#/components/schemas/InputFile'
- type: 'array'
- type:
+ object:
enum:
- - 'custom_tool_call_output'
+ - 'file'
type: 'string'
required:
- - 'type'
- - 'call_id'
- - 'output'
+ - '_shape'
+ - 'id'
+ - 'object'
+ - 'deleted'
type: 'object'
- OpenAIResponseFunctionToolCall:
+ OpenAIFileList:
+ description: 'A page of files in OpenAI''s shape.'
example:
- arguments: '{"location":"San Francisco"}'
- call_id: 'call-abc123'
- id: 'fc-abc123'
- name: 'get_weather'
+ _shape: 'openai'
+ data: []
+ first_id: null
+ has_more: false
+ last_id: null
+ object: 'list'
+ properties:
+ _shape:
+ enum:
+ - 'openai'
+ type: 'string'
+ data:
+ items:
+ $ref: '#/components/schemas/OpenAIFile'
+ type: 'array'
+ first_id:
+ type:
+ - 'string'
+ - 'null'
+ has_more:
+ type: 'boolean'
+ last_id:
+ type:
+ - 'string'
+ - 'null'
+ object:
+ enum:
+ - 'list'
+ type: 'string'
+ required:
+ - '_shape'
+ - 'object'
+ - 'data'
+ - 'has_more'
+ - 'first_id'
+ - 'last_id'
+ type: 'object'
+ OpenAIResponseCustomToolCall:
+ example:
+ call_id: 'call-abc123'
+ id: 'ctc-abc123'
+ input: "*** Begin Patch\n*** End Patch"
+ name: 'apply_patch'
+ type: 'custom_tool_call'
+ properties:
+ call_id:
+ type: 'string'
+ id:
+ type: 'string'
+ input:
+ type: 'string'
+ name:
+ type: 'string'
+ namespace:
+ description: 'Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)'
+ type: 'string'
+ type:
+ enum:
+ - 'custom_tool_call'
+ type: 'string'
+ required:
+ - 'type'
+ - 'call_id'
+ - 'name'
+ - 'input'
+ type: 'object'
+ OpenAIResponseCustomToolCallOutput:
+ example:
+ call_id: 'call-abc123'
+ output: 'patch applied successfully'
+ type: 'custom_tool_call_output'
+ properties:
+ call_id:
+ type: 'string'
+ id:
+ type: 'string'
+ output:
+ anyOf:
+ - type: 'string'
+ - items:
+ discriminator:
+ mapping:
+ input_file: '#/components/schemas/InputFile'
+ input_image: '#/components/schemas/InputImage'
+ input_text: '#/components/schemas/InputText'
+ propertyName: 'type'
+ oneOf:
+ - $ref: '#/components/schemas/InputText'
+ - $ref: '#/components/schemas/InputImage'
+ - $ref: '#/components/schemas/InputFile'
+ type: 'array'
+ type:
+ enum:
+ - 'custom_tool_call_output'
+ type: 'string'
+ required:
+ - 'type'
+ - 'call_id'
+ - 'output'
+ type: 'object'
+ OpenAIResponseFunctionToolCall:
+ example:
+ arguments: '{"location":"San Francisco"}'
+ call_id: 'call-abc123'
+ id: 'fc-abc123'
+ name: 'get_weather'
status: 'completed'
type: 'function_call'
properties:
@@ -16773,6 +16963,111 @@ components:
token:
type: 'string'
type: 'object'
+ OpenRouterFile:
+ description: 'A stored file in the OpenRouter superset shape: Anthropic-shaped, plus OpenRouter-only fields.'
+ example:
+ _shape: 'openrouter'
+ created_at: '2025-01-01T00:00:00Z'
+ downloadable: false
+ filename: 'document.pdf'
+ id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ mime_type: 'application/pdf'
+ size_bytes: 1024000
+ type: 'file'
+ properties:
+ _shape:
+ enum:
+ - 'openrouter'
+ type: 'string'
+ created_at:
+ type: 'string'
+ downloadable:
+ type: 'boolean'
+ filename:
+ type: 'string'
+ id:
+ type: 'string'
+ mime_type:
+ type: 'string'
+ size_bytes:
+ type: 'integer'
+ type:
+ enum:
+ - 'file'
+ type: 'string'
+ required:
+ - '_shape'
+ - 'id'
+ - 'type'
+ - 'filename'
+ - 'mime_type'
+ - 'size_bytes'
+ - 'created_at'
+ - 'downloadable'
+ type: 'object'
+ OpenRouterFileDeleted:
+ description: 'Deletion result in the OpenRouter shape.'
+ example:
+ _shape: 'openrouter'
+ id: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ type: 'file_deleted'
+ properties:
+ _shape:
+ enum:
+ - 'openrouter'
+ type: 'string'
+ id:
+ type: 'string'
+ type:
+ enum:
+ - 'file_deleted'
+ type: 'string'
+ required:
+ - '_shape'
+ - 'id'
+ - 'type'
+ type: 'object'
+ OpenRouterFileList:
+ description: 'A page of files in the OpenRouter shape.'
+ example:
+ _shape: 'openrouter'
+ cursor: null
+ data: []
+ first_id: null
+ has_more: false
+ last_id: null
+ properties:
+ _shape:
+ enum:
+ - 'openrouter'
+ type: 'string'
+ cursor:
+ description: 'Opaque cursor for the next page; null when there are no more results.'
+ type:
+ - 'string'
+ - 'null'
+ data:
+ items:
+ $ref: '#/components/schemas/OpenRouterFile'
+ type: 'array'
+ first_id:
+ type:
+ - 'string'
+ - 'null'
+ has_more:
+ type: 'boolean'
+ last_id:
+ type:
+ - 'string'
+ - 'null'
+ required:
+ - '_shape'
+ - 'data'
+ - 'has_more'
+ - 'first_id'
+ - 'last_id'
+ - 'cursor'
+ type: 'object'
OpenRouterMetadata:
example:
attempt: 1
@@ -27982,6 +28277,49 @@ paths:
example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7'
format: 'uuid'
type: 'string'
+ - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.'
+ example: 'openai'
+ in: 'query'
+ name: 'provider'
+ required: false
+ schema:
+ $ref: '#/components/schemas/FileProvider'
+ - description: 'OpenAI-style forward cursor: the id to list after.'
+ in: 'query'
+ name: 'after'
+ required: false
+ schema:
+ description: 'OpenAI-style forward cursor: the id to list after.'
+ example: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ type: 'string'
+ - description: 'Anthropic-style forward cursor: the id to list after.'
+ in: 'query'
+ name: 'after_id'
+ required: false
+ schema:
+ description: 'Anthropic-style forward cursor: the id to list after.'
+ example: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ type: 'string'
+ - description: 'Anthropic-style reverse cursor. Not supported by OpenRouter storage.'
+ in: 'query'
+ name: 'before_id'
+ required: false
+ schema:
+ description: 'Anthropic-style reverse cursor. Not supported by OpenRouter storage.'
+ example: 'or_file_011CNha8iCJcU1wXNR6q4V8w'
+ type: 'string'
+ - description: 'Sort direction. Only `asc` is supported by OpenRouter storage.'
+ in: 'query'
+ name: 'order'
+ required: false
+ schema:
+ description: 'Sort direction. Only `asc` is supported by OpenRouter storage.'
+ enum:
+ - 'asc'
+ - 'desc'
+ example: 'asc'
+ type: 'string'
+ x-speakeasy-unknown-values: allow
responses:
'200':
content:
@@ -28022,6 +28360,16 @@ paths:
schema:
$ref: '#/components/schemas/UnauthorizedResponse'
description: 'Unauthorized - Authentication required or invalid credentials'
+ '403':
+ content:
+ application/json:
+ example:
+ error:
+ code: 403
+ message: 'Only management keys can perform this operation'
+ schema:
+ $ref: '#/components/schemas/ForbiddenResponse'
+ description: 'Forbidden - Authentication successful but insufficient permissions'
'429':
content:
application/json:
@@ -28042,6 +28390,26 @@ paths:
schema:
$ref: '#/components/schemas/InternalServerResponse'
description: 'Internal Server Error - Unexpected server error'
+ '502':
+ content:
+ application/json:
+ example:
+ error:
+ code: 502
+ message: 'Provider returned error'
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: 'Bad Gateway - Provider/upstream API failure'
+ '503':
+ content:
+ application/json:
+ example:
+ error:
+ code: 503
+ message: 'Service temporarily unavailable'
+ schema:
+ $ref: '#/components/schemas/ServiceUnavailableResponse'
+ description: 'Service Unavailable - Service temporarily unavailable'
summary: 'List files'
tags:
- 'Files'
@@ -28069,6 +28437,13 @@ paths:
example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7'
format: 'uuid'
type: 'string'
+ - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.'
+ example: 'openai'
+ in: 'query'
+ name: 'provider'
+ required: false
+ schema:
+ $ref: '#/components/schemas/FileProvider'
requestBody:
content:
multipart/form-data:
@@ -28096,7 +28471,7 @@ paths:
size_bytes: 1024000
type: 'file'
schema:
- $ref: '#/components/schemas/FileMetadata'
+ $ref: '#/components/schemas/FileResponse'
description: 'The uploaded file metadata.'
'400':
content:
@@ -28158,6 +28533,26 @@ paths:
schema:
$ref: '#/components/schemas/InternalServerResponse'
description: 'Internal Server Error - Unexpected server error'
+ '502':
+ content:
+ application/json:
+ example:
+ error:
+ code: 502
+ message: 'Provider returned error'
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: 'Bad Gateway - Provider/upstream API failure'
+ '503':
+ content:
+ application/json:
+ example:
+ error:
+ code: 503
+ message: 'Service temporarily unavailable'
+ schema:
+ $ref: '#/components/schemas/ServiceUnavailableResponse'
+ description: 'Service Unavailable - Service temporarily unavailable'
summary: 'Upload a file'
tags:
- 'Files'
@@ -28187,6 +28582,13 @@ paths:
example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7'
format: 'uuid'
type: 'string'
+ - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.'
+ example: 'openai'
+ in: 'query'
+ name: 'provider'
+ required: false
+ schema:
+ $ref: '#/components/schemas/FileProvider'
responses:
'200':
content:
@@ -28207,6 +28609,16 @@ paths:
schema:
$ref: '#/components/schemas/UnauthorizedResponse'
description: 'Unauthorized - Authentication required or invalid credentials'
+ '403':
+ content:
+ application/json:
+ example:
+ error:
+ code: 403
+ message: 'Only management keys can perform this operation'
+ schema:
+ $ref: '#/components/schemas/ForbiddenResponse'
+ description: 'Forbidden - Authentication successful but insufficient permissions'
'404':
content:
application/json:
@@ -28237,6 +28649,26 @@ paths:
schema:
$ref: '#/components/schemas/InternalServerResponse'
description: 'Internal Server Error - Unexpected server error'
+ '502':
+ content:
+ application/json:
+ example:
+ error:
+ code: 502
+ message: 'Provider returned error'
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: 'Bad Gateway - Provider/upstream API failure'
+ '503':
+ content:
+ application/json:
+ example:
+ error:
+ code: 503
+ message: 'Service temporarily unavailable'
+ schema:
+ $ref: '#/components/schemas/ServiceUnavailableResponse'
+ description: 'Service Unavailable - Service temporarily unavailable'
summary: 'Delete a file'
tags:
- 'Files'
@@ -28261,6 +28693,13 @@ paths:
example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7'
format: 'uuid'
type: 'string'
+ - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.'
+ example: 'openai'
+ in: 'query'
+ name: 'provider'
+ required: false
+ schema:
+ $ref: '#/components/schemas/FileProvider'
responses:
'200':
content:
@@ -28274,7 +28713,7 @@ paths:
size_bytes: 1024000
type: 'file'
schema:
- $ref: '#/components/schemas/FileMetadata'
+ $ref: '#/components/schemas/FileResponse'
description: 'The file metadata.'
'401':
content:
@@ -28286,6 +28725,16 @@ paths:
schema:
$ref: '#/components/schemas/UnauthorizedResponse'
description: 'Unauthorized - Authentication required or invalid credentials'
+ '403':
+ content:
+ application/json:
+ example:
+ error:
+ code: 403
+ message: 'Only management keys can perform this operation'
+ schema:
+ $ref: '#/components/schemas/ForbiddenResponse'
+ description: 'Forbidden - Authentication successful but insufficient permissions'
'404':
content:
application/json:
@@ -28316,6 +28765,26 @@ paths:
schema:
$ref: '#/components/schemas/InternalServerResponse'
description: 'Internal Server Error - Unexpected server error'
+ '502':
+ content:
+ application/json:
+ example:
+ error:
+ code: 502
+ message: 'Provider returned error'
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: 'Bad Gateway - Provider/upstream API failure'
+ '503':
+ content:
+ application/json:
+ example:
+ error:
+ code: 503
+ message: 'Service temporarily unavailable'
+ schema:
+ $ref: '#/components/schemas/ServiceUnavailableResponse'
+ description: 'Service Unavailable - Service temporarily unavailable'
summary: 'Get file metadata'
tags:
- 'Files'
@@ -28345,6 +28814,13 @@ paths:
example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7'
format: 'uuid'
type: 'string'
+ - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.'
+ example: 'openai'
+ in: 'query'
+ name: 'provider'
+ required: false
+ schema:
+ $ref: '#/components/schemas/FileProvider'
responses:
'200':
content:
@@ -28374,6 +28850,16 @@ paths:
schema:
$ref: '#/components/schemas/UnauthorizedResponse'
description: 'Unauthorized - Authentication required or invalid credentials'
+ '403':
+ content:
+ application/json:
+ example:
+ error:
+ code: 403
+ message: 'Only management keys can perform this operation'
+ schema:
+ $ref: '#/components/schemas/ForbiddenResponse'
+ description: 'Forbidden - Authentication successful but insufficient permissions'
'404':
content:
application/json:
@@ -28404,6 +28890,26 @@ paths:
schema:
$ref: '#/components/schemas/InternalServerResponse'
description: 'Internal Server Error - Unexpected server error'
+ '502':
+ content:
+ application/json:
+ example:
+ error:
+ code: 502
+ message: 'Provider returned error'
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: 'Bad Gateway - Provider/upstream API failure'
+ '503':
+ content:
+ application/json:
+ example:
+ error:
+ code: 503
+ message: 'Service temporarily unavailable'
+ schema:
+ $ref: '#/components/schemas/ServiceUnavailableResponse'
+ description: 'Service Unavailable - Service temporarily unavailable'
summary: 'Download file content'
tags:
- 'Files'
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 3654318e..06feb9f6 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:84a508bd3595c87832f549d5fc3f1ac5fd440f5165c2995ba3093637555e646c
- sourceBlobDigest: sha256:7eefcb515776fd515194da57fd4588ddb6d49151afa71f044f3c485c55730d50
+ sourceRevisionDigest: sha256:aa12cc112c23a77dfc1e10bf22756b6bd1975957da8bea3f11fafcefd3359811
+ sourceBlobDigest: sha256:6bdf84189b2aa0a695d778dc3d73a700de1fef130cdc93b96935bfba582cfb91
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:84a508bd3595c87832f549d5fc3f1ac5fd440f5165c2995ba3093637555e646c
- sourceBlobDigest: sha256:7eefcb515776fd515194da57fd4588ddb6d49151afa71f044f3c485c55730d50
+ sourceRevisionDigest: sha256:aa12cc112c23a77dfc1e10bf22756b6bd1975957da8bea3f11fafcefd3359811
+ sourceBlobDigest: sha256:6bdf84189b2aa0a695d778dc3d73a700de1fef130cdc93b96935bfba582cfb91
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:ebd98981d15a77b71da4a71cd315c29260c58c5db75262df616cd11d56e412d9
+ codeSamplesRevisionDigest: sha256:a787dfbbc918360e86780e75413b597b8ff9d2118d77c0fbe692b645362f2979
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
diff --git a/RELEASES.md b/RELEASES.md
index e7525e79..ca440e66 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -919,4 +919,14 @@ Based on:
### Generated
- [python v1.1.12] .
### Releases
-- [PyPI v1.1.12] https://pypi.org/project/openrouter/1.1.12 - .
\ No newline at end of file
+- [PyPI v1.1.12] https://pypi.org/project/openrouter/1.1.12 - .
+
+## 2026-07-29 14:16:00
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.1.13] .
+### Releases
+- [PyPI v1.1.13] https://pypi.org/project/openrouter/1.1.13 - .
\ No newline at end of file
diff --git a/docs/components/anthropicfile.mdx b/docs/components/anthropicfile.mdx
new file mode 100644
index 00000000..7e1012dc
--- /dev/null
+++ b/docs/components/anthropicfile.mdx
@@ -0,0 +1,19 @@
+---
+title: "AnthropicFile"
+---
+
+A stored file in Anthropic's Files API shape.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
+| `shape` | [components.AnthropicFileShape](../components/anthropicfileshape.mdx) | :heavy_check_mark: | N/A |
+| `created_at` | *str* | :heavy_check_mark: | N/A |
+| `downloadable` | *bool* | :heavy_check_mark: | N/A |
+| `filename` | *str* | :heavy_check_mark: | N/A |
+| `id` | *str* | :heavy_check_mark: | N/A |
+| `mime_type` | *str* | :heavy_check_mark: | N/A |
+| `size_bytes` | *int* | :heavy_check_mark: | N/A |
+| `type` | [components.AnthropicFileType](../components/anthropicfiletype.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/anthropicfiledeleted.mdx b/docs/components/anthropicfiledeleted.mdx
new file mode 100644
index 00000000..2e4f7895
--- /dev/null
+++ b/docs/components/anthropicfiledeleted.mdx
@@ -0,0 +1,14 @@
+---
+title: "AnthropicFileDeleted"
+---
+
+Deletion result in Anthropic's shape.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
+| `shape` | [components.AnthropicFileDeletedShape](../components/anthropicfiledeletedshape.mdx) | :heavy_check_mark: | N/A |
+| `id` | *str* | :heavy_check_mark: | N/A |
+| `type` | [components.AnthropicFileDeletedType](../components/anthropicfiledeletedtype.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/anthropicfiledeletedshape.mdx b/docs/components/anthropicfiledeletedshape.mdx
new file mode 100644
index 00000000..949ee14e
--- /dev/null
+++ b/docs/components/anthropicfiledeletedshape.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicFileDeletedShape"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicFileDeletedShape
+value: AnthropicFileDeletedShape = "anthropic"
+```
+
+
+## Values
+
+- `"anthropic"`
diff --git a/docs/components/anthropicfiledeletedtype.mdx b/docs/components/anthropicfiledeletedtype.mdx
new file mode 100644
index 00000000..e2a1aa62
--- /dev/null
+++ b/docs/components/anthropicfiledeletedtype.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicFileDeletedType"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicFileDeletedType
+value: AnthropicFileDeletedType = "file_deleted"
+```
+
+
+## Values
+
+- `"file_deleted"`
diff --git a/docs/components/anthropicfilelist.mdx b/docs/components/anthropicfilelist.mdx
new file mode 100644
index 00000000..59fc8735
--- /dev/null
+++ b/docs/components/anthropicfilelist.mdx
@@ -0,0 +1,16 @@
+---
+title: "AnthropicFileList"
+---
+
+A page of files in Anthropic's shape.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
+| `shape` | [components.AnthropicFileListShape](../components/anthropicfilelistshape.mdx) | :heavy_check_mark: | N/A |
+| `data` | List[[components.AnthropicFile](../components/anthropicfile.mdx)] | :heavy_check_mark: | N/A |
+| `first_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
+| `has_more` | *bool* | :heavy_check_mark: | N/A |
+| `last_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/anthropicfilelistshape.mdx b/docs/components/anthropicfilelistshape.mdx
new file mode 100644
index 00000000..4032de06
--- /dev/null
+++ b/docs/components/anthropicfilelistshape.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicFileListShape"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicFileListShape
+value: AnthropicFileListShape = "anthropic"
+```
+
+
+## Values
+
+- `"anthropic"`
diff --git a/docs/components/anthropicfileshape.mdx b/docs/components/anthropicfileshape.mdx
new file mode 100644
index 00000000..1f97f541
--- /dev/null
+++ b/docs/components/anthropicfileshape.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicFileShape"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicFileShape
+value: AnthropicFileShape = "anthropic"
+```
+
+
+## Values
+
+- `"anthropic"`
diff --git a/docs/components/anthropicfiletype.mdx b/docs/components/anthropicfiletype.mdx
new file mode 100644
index 00000000..98c29b88
--- /dev/null
+++ b/docs/components/anthropicfiletype.mdx
@@ -0,0 +1,15 @@
+---
+title: "AnthropicFileType"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import AnthropicFileType
+value: AnthropicFileType = "file"
+```
+
+
+## Values
+
+- `"file"`
diff --git a/docs/components/filedeleteresponse.mdx b/docs/components/filedeleteresponse.mdx
index f9fa4325..f14b9e84 100644
--- a/docs/components/filedeleteresponse.mdx
+++ b/docs/components/filedeleteresponse.mdx
@@ -2,12 +2,26 @@
title: "FileDeleteResponse"
---
-Confirmation that a file was deleted.
+Confirmation that a file was deleted, in the negotiated shape.
-## Fields
+## Supported Types
+
+### `components.AnthropicFileDeleted`
+
+```python
+value: components.AnthropicFileDeleted = /* values here */
+```
+
+### `components.OpenAIFileDeleted`
+
+```python
+value: components.OpenAIFileDeleted = /* values here */
+```
+
+### `components.OpenRouterFileDeleted`
+
+```python
+value: components.OpenRouterFileDeleted = /* values here */
+```
-| Field | Type | Required | Description |
-| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
-| `id` | *str* | :heavy_check_mark: | N/A |
-| `type` | [components.FileDeleteResponseType](../components/filedeleteresponsetype.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/filedeleteresponsetype.mdx b/docs/components/filedeleteresponsetype.mdx
deleted file mode 100644
index 978f7962..00000000
--- a/docs/components/filedeleteresponsetype.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "FileDeleteResponseType"
----
-
-## Example Usage
-
-```python
-from openrouter.components import FileDeleteResponseType
-value: FileDeleteResponseType = "file_deleted"
-```
-
-
-## Values
-
-- `"file_deleted"`
diff --git a/docs/components/filelistresponse.mdx b/docs/components/filelistresponse.mdx
index ec382997..ab7c43a2 100644
--- a/docs/components/filelistresponse.mdx
+++ b/docs/components/filelistresponse.mdx
@@ -2,15 +2,26 @@
title: "FileListResponse"
---
-A page of files belonging to the requesting workspace.
+A page of files, in the negotiated shape.
-## Fields
+## Supported Types
+
+### `components.AnthropicFileList`
+
+```python
+value: components.AnthropicFileList = /* values here */
+```
+
+### `components.OpenAIFileList`
+
+```python
+value: components.OpenAIFileList = /* values here */
+```
+
+### `components.OpenRouterFileList`
+
+```python
+value: components.OpenRouterFileList = /* values here */
+```
-| Field | Type | Required | Description |
-| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
-| `cursor` | *Nullable[str]* | :heavy_check_mark: | Opaque cursor for the next page; null when there are no more results. |
-| `data` | List[[components.FileMetadata](../components/filemetadata.mdx)] | :heavy_check_mark: | N/A |
-| `first_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
-| `has_more` | *bool* | :heavy_check_mark: | N/A |
-| `last_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/filemetadatatype.mdx b/docs/components/filemetadatatype.mdx
deleted file mode 100644
index e6700305..00000000
--- a/docs/components/filemetadatatype.mdx
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "FileMetadataType"
----
-
-## Example Usage
-
-```python
-from openrouter.components import FileMetadataType
-value: FileMetadataType = "file"
-```
-
-
-## Values
-
-- `"file"`
diff --git a/docs/components/fileprovider.mdx b/docs/components/fileprovider.mdx
new file mode 100644
index 00000000..1623be5d
--- /dev/null
+++ b/docs/components/fileprovider.mdx
@@ -0,0 +1,22 @@
+---
+title: "FileProvider"
+---
+
+Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
+
+## Example Usage
+
+```python
+from openrouter.components import FileProvider
+
+# Open enum: unrecognized values are captured as UnrecognizedStr
+value: FileProvider = "openai"
+```
+
+
+## Values
+
+This is an open enum. Unrecognized values will not fail type checks.
+
+- `"openai"`
+- `"anthropic"`
diff --git a/docs/components/fileresponse.mdx b/docs/components/fileresponse.mdx
new file mode 100644
index 00000000..cd95d88a
--- /dev/null
+++ b/docs/components/fileresponse.mdx
@@ -0,0 +1,27 @@
+---
+title: "FileResponse"
+---
+
+A stored file. The shape is negotiated per request — see the endpoint description.
+
+
+## Supported Types
+
+### `components.AnthropicFile`
+
+```python
+value: components.AnthropicFile = /* values here */
+```
+
+### `components.OpenAIFile`
+
+```python
+value: components.OpenAIFile = /* values here */
+```
+
+### `components.OpenRouterFile`
+
+```python
+value: components.OpenRouterFile = /* values here */
+```
+
diff --git a/docs/components/filemetadata.mdx b/docs/components/openaifile.mdx
similarity index 57%
rename from docs/components/filemetadata.mdx
rename to docs/components/openaifile.mdx
index cfb23fb2..83aa7914 100644
--- a/docs/components/filemetadata.mdx
+++ b/docs/components/openaifile.mdx
@@ -1,18 +1,19 @@
---
-title: "FileMetadata"
+title: "OpenAIFile"
---
-Metadata describing a stored file.
+A stored file in OpenAI's Files API shape.
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
-| `created_at` | *str* | :heavy_check_mark: | N/A |
-| `downloadable` | *bool* | :heavy_check_mark: | N/A |
+| `shape` | [components.OpenAIFileShape](../components/openaifileshape.mdx) | :heavy_check_mark: | N/A |
+| `bytes_` | *int* | :heavy_check_mark: | N/A |
+| `created_at` | *int* | :heavy_check_mark: | N/A |
| `filename` | *str* | :heavy_check_mark: | N/A |
| `id` | *str* | :heavy_check_mark: | N/A |
-| `mime_type` | *str* | :heavy_check_mark: | N/A |
-| `size_bytes` | *int* | :heavy_check_mark: | N/A |
-| `type` | [components.FileMetadataType](../components/filemetadatatype.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
+| `object` | [components.OpenAIFileObject](../components/openaifileobject.mdx) | :heavy_check_mark: | N/A |
+| `purpose` | [components.Purpose](../components/purpose.mdx) | :heavy_check_mark: | N/A |
+| `status` | [components.OpenAIFileStatus](../components/openaifilestatus.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/openaifiledeleted.mdx b/docs/components/openaifiledeleted.mdx
new file mode 100644
index 00000000..24db73f8
--- /dev/null
+++ b/docs/components/openaifiledeleted.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenAIFileDeleted"
+---
+
+Deletion result in OpenAI's shape.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
+| `shape` | [components.OpenAIFileDeletedShape](../components/openaifiledeletedshape.mdx) | :heavy_check_mark: | N/A |
+| `deleted` | *Literal[True]* | :heavy_check_mark: | N/A |
+| `id` | *str* | :heavy_check_mark: | N/A |
+| `object` | [components.OpenAIFileDeletedObject](../components/openaifiledeletedobject.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/openaifiledeletedobject.mdx b/docs/components/openaifiledeletedobject.mdx
new file mode 100644
index 00000000..c0f35ed5
--- /dev/null
+++ b/docs/components/openaifiledeletedobject.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenAIFileDeletedObject"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenAIFileDeletedObject
+value: OpenAIFileDeletedObject = "file"
+```
+
+
+## Values
+
+- `"file"`
diff --git a/docs/components/openaifiledeletedshape.mdx b/docs/components/openaifiledeletedshape.mdx
new file mode 100644
index 00000000..9fdf1917
--- /dev/null
+++ b/docs/components/openaifiledeletedshape.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenAIFileDeletedShape"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenAIFileDeletedShape
+value: OpenAIFileDeletedShape = "openai"
+```
+
+
+## Values
+
+- `"openai"`
diff --git a/docs/components/openaifilelist.mdx b/docs/components/openaifilelist.mdx
new file mode 100644
index 00000000..d365da30
--- /dev/null
+++ b/docs/components/openaifilelist.mdx
@@ -0,0 +1,17 @@
+---
+title: "OpenAIFileList"
+---
+
+A page of files in OpenAI's shape.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
+| `shape` | [components.OpenAIFileListShape](../components/openaifilelistshape.mdx) | :heavy_check_mark: | N/A |
+| `data` | List[[components.OpenAIFile](../components/openaifile.mdx)] | :heavy_check_mark: | N/A |
+| `first_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
+| `has_more` | *bool* | :heavy_check_mark: | N/A |
+| `last_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
+| `object` | [components.OpenAIFileListObject](../components/openaifilelistobject.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/openaifilelistobject.mdx b/docs/components/openaifilelistobject.mdx
new file mode 100644
index 00000000..17348c68
--- /dev/null
+++ b/docs/components/openaifilelistobject.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenAIFileListObject"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenAIFileListObject
+value: OpenAIFileListObject = "list"
+```
+
+
+## Values
+
+- `"list"`
diff --git a/docs/components/openaifilelistshape.mdx b/docs/components/openaifilelistshape.mdx
new file mode 100644
index 00000000..6f7954ba
--- /dev/null
+++ b/docs/components/openaifilelistshape.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenAIFileListShape"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenAIFileListShape
+value: OpenAIFileListShape = "openai"
+```
+
+
+## Values
+
+- `"openai"`
diff --git a/docs/components/openaifileobject.mdx b/docs/components/openaifileobject.mdx
new file mode 100644
index 00000000..09720273
--- /dev/null
+++ b/docs/components/openaifileobject.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenAIFileObject"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenAIFileObject
+value: OpenAIFileObject = "file"
+```
+
+
+## Values
+
+- `"file"`
diff --git a/docs/components/openaifileshape.mdx b/docs/components/openaifileshape.mdx
new file mode 100644
index 00000000..de4df890
--- /dev/null
+++ b/docs/components/openaifileshape.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenAIFileShape"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenAIFileShape
+value: OpenAIFileShape = "openai"
+```
+
+
+## Values
+
+- `"openai"`
diff --git a/docs/components/openaifilestatus.mdx b/docs/components/openaifilestatus.mdx
new file mode 100644
index 00000000..c9c31255
--- /dev/null
+++ b/docs/components/openaifilestatus.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenAIFileStatus"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenAIFileStatus
+value: OpenAIFileStatus = "processed"
+```
+
+
+## Values
+
+- `"processed"`
diff --git a/docs/components/openrouterfile.mdx b/docs/components/openrouterfile.mdx
new file mode 100644
index 00000000..f7335e37
--- /dev/null
+++ b/docs/components/openrouterfile.mdx
@@ -0,0 +1,19 @@
+---
+title: "OpenRouterFile"
+---
+
+A stored file in the OpenRouter superset shape: Anthropic-shaped, plus OpenRouter-only fields.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
+| `shape` | [components.OpenRouterFileShape](../components/openrouterfileshape.mdx) | :heavy_check_mark: | N/A |
+| `created_at` | *str* | :heavy_check_mark: | N/A |
+| `downloadable` | *bool* | :heavy_check_mark: | N/A |
+| `filename` | *str* | :heavy_check_mark: | N/A |
+| `id` | *str* | :heavy_check_mark: | N/A |
+| `mime_type` | *str* | :heavy_check_mark: | N/A |
+| `size_bytes` | *int* | :heavy_check_mark: | N/A |
+| `type` | [components.OpenRouterFileType](../components/openrouterfiletype.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/openrouterfiledeleted.mdx b/docs/components/openrouterfiledeleted.mdx
new file mode 100644
index 00000000..af6a578a
--- /dev/null
+++ b/docs/components/openrouterfiledeleted.mdx
@@ -0,0 +1,14 @@
+---
+title: "OpenRouterFileDeleted"
+---
+
+Deletion result in the OpenRouter shape.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
+| `shape` | [components.OpenRouterFileDeletedShape](../components/openrouterfiledeletedshape.mdx) | :heavy_check_mark: | N/A |
+| `id` | *str* | :heavy_check_mark: | N/A |
+| `type` | [components.OpenRouterFileDeletedType](../components/openrouterfiledeletedtype.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/openrouterfiledeletedshape.mdx b/docs/components/openrouterfiledeletedshape.mdx
new file mode 100644
index 00000000..1d666d49
--- /dev/null
+++ b/docs/components/openrouterfiledeletedshape.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenRouterFileDeletedShape"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenRouterFileDeletedShape
+value: OpenRouterFileDeletedShape = "openrouter"
+```
+
+
+## Values
+
+- `"openrouter"`
diff --git a/docs/components/openrouterfiledeletedtype.mdx b/docs/components/openrouterfiledeletedtype.mdx
new file mode 100644
index 00000000..b5dfbefc
--- /dev/null
+++ b/docs/components/openrouterfiledeletedtype.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenRouterFileDeletedType"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenRouterFileDeletedType
+value: OpenRouterFileDeletedType = "file_deleted"
+```
+
+
+## Values
+
+- `"file_deleted"`
diff --git a/docs/components/openrouterfilelist.mdx b/docs/components/openrouterfilelist.mdx
new file mode 100644
index 00000000..16ebdba6
--- /dev/null
+++ b/docs/components/openrouterfilelist.mdx
@@ -0,0 +1,17 @@
+---
+title: "OpenRouterFileList"
+---
+
+A page of files in the OpenRouter shape.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
+| `shape` | [components.OpenRouterFileListShape](../components/openrouterfilelistshape.mdx) | :heavy_check_mark: | N/A |
+| `cursor` | *Nullable[str]* | :heavy_check_mark: | Opaque cursor for the next page; null when there are no more results. |
+| `data` | List[[components.OpenRouterFile](../components/openrouterfile.mdx)] | :heavy_check_mark: | N/A |
+| `first_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
+| `has_more` | *bool* | :heavy_check_mark: | N/A |
+| `last_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/components/openrouterfilelistshape.mdx b/docs/components/openrouterfilelistshape.mdx
new file mode 100644
index 00000000..815aa5b5
--- /dev/null
+++ b/docs/components/openrouterfilelistshape.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenRouterFileListShape"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenRouterFileListShape
+value: OpenRouterFileListShape = "openrouter"
+```
+
+
+## Values
+
+- `"openrouter"`
diff --git a/docs/components/openrouterfileshape.mdx b/docs/components/openrouterfileshape.mdx
new file mode 100644
index 00000000..66c6c68b
--- /dev/null
+++ b/docs/components/openrouterfileshape.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenRouterFileShape"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenRouterFileShape
+value: OpenRouterFileShape = "openrouter"
+```
+
+
+## Values
+
+- `"openrouter"`
diff --git a/docs/components/openrouterfiletype.mdx b/docs/components/openrouterfiletype.mdx
new file mode 100644
index 00000000..fe4a1888
--- /dev/null
+++ b/docs/components/openrouterfiletype.mdx
@@ -0,0 +1,15 @@
+---
+title: "OpenRouterFileType"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import OpenRouterFileType
+value: OpenRouterFileType = "file"
+```
+
+
+## Values
+
+- `"file"`
diff --git a/docs/components/purpose.mdx b/docs/components/purpose.mdx
new file mode 100644
index 00000000..19da770f
--- /dev/null
+++ b/docs/components/purpose.mdx
@@ -0,0 +1,27 @@
+---
+title: "Purpose"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import Purpose
+
+# Open enum: unrecognized values are captured as UnrecognizedStr
+value: Purpose = "assistants"
+```
+
+
+## Values
+
+This is an open enum. Unrecognized values will not fail type checks.
+
+- `"assistants"`
+- `"batch"`
+- `"fine-tune"`
+- `"vision"`
+- `"user_data"`
+- `"evals"`
+- `"assistants_output"`
+- `"batch_output"`
+- `"fine-tune-results"`
diff --git a/docs/operations/deletefilerequest.mdx b/docs/operations/deletefilerequest.mdx
index a41b1ee1..acff81d0 100644
--- a/docs/operations/deletefilerequest.mdx
+++ b/docs/operations/deletefilerequest.mdx
@@ -10,4 +10,5 @@ title: "DeleteFileRequest"
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `file_id` | *str* | :heavy_check_mark: | N/A | or_file_011CNha8iCJcU1wXNR6q4V8w |
-| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
\ No newline at end of file
+| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
\ No newline at end of file
diff --git a/docs/operations/downloadfilecontentrequest.mdx b/docs/operations/downloadfilecontentrequest.mdx
index 8b858fec..4e0f83f3 100644
--- a/docs/operations/downloadfilecontentrequest.mdx
+++ b/docs/operations/downloadfilecontentrequest.mdx
@@ -10,4 +10,5 @@ title: "DownloadFileContentRequest"
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `file_id` | *str* | :heavy_check_mark: | N/A | or_file_011CNha8iCJcU1wXNR6q4V8w |
-| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
\ No newline at end of file
+| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
\ No newline at end of file
diff --git a/docs/operations/getfilemetadatarequest.mdx b/docs/operations/getfilemetadatarequest.mdx
index 4cf0f542..429a0f54 100644
--- a/docs/operations/getfilemetadatarequest.mdx
+++ b/docs/operations/getfilemetadatarequest.mdx
@@ -10,4 +10,5 @@ title: "GetFileMetadataRequest"
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `file_id` | *str* | :heavy_check_mark: | N/A | or_file_011CNha8iCJcU1wXNR6q4V8w |
-| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
\ No newline at end of file
+| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
\ No newline at end of file
diff --git a/docs/operations/listfilesrequest.mdx b/docs/operations/listfilesrequest.mdx
index a5a1b70a..df4338da 100644
--- a/docs/operations/listfilesrequest.mdx
+++ b/docs/operations/listfilesrequest.mdx
@@ -11,4 +11,9 @@ title: "ListFilesRequest"
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of files to return (1–1000). | 100 |
| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | eyJjdXJzb3IiOiJvcl9maWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9 |
-| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
\ No newline at end of file
+| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
+| `after` | *Optional[str]* | :heavy_minus_sign: | OpenAI-style forward cursor: the id to list after. | or_file_011CNha8iCJcU1wXNR6q4V8w |
+| `after_id` | *Optional[str]* | :heavy_minus_sign: | Anthropic-style forward cursor: the id to list after. | or_file_011CNha8iCJcU1wXNR6q4V8w |
+| `before_id` | *Optional[str]* | :heavy_minus_sign: | Anthropic-style reverse cursor. Not supported by OpenRouter storage. | or_file_011CNha8iCJcU1wXNR6q4V8w |
+| `order` | [Optional[operations.Order]](../operations/order.mdx) | :heavy_minus_sign: | Sort direction. Only `asc` is supported by OpenRouter storage. | asc |
\ No newline at end of file
diff --git a/docs/operations/listfilesresponse.mdx b/docs/operations/listfilesresponse.mdx
index 6cb55f6d..bc29d45a 100644
--- a/docs/operations/listfilesresponse.mdx
+++ b/docs/operations/listfilesresponse.mdx
@@ -4,6 +4,6 @@ title: "ListFilesResponse"
## Fields
-| Field | Type | Required | Description | Example |
-| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `result` | [components.FileListResponse](../components/filelistresponse.mdx) | :heavy_check_mark: | N/A | \{
"cursor": null,
"data": [
\{
"created_at": "2025-01-01T00:00:00Z",
"downloadable": false,
"filename": "document.pdf",
"id": "or_file_011CNha8iCJcU1wXNR6q4V8w",
"mime_type": "application/pdf",
"size_bytes": 1024000,
"type": "file"
}
],
"first_id": "or_file_011CNha8iCJcU1wXNR6q4V8w",
"has_more": false,
"last_id": "or_file_011CNha8iCJcU1wXNR6q4V8w"
} |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
+| `result` | [components.FileListResponse](../components/filelistresponse.mdx) | :heavy_check_mark: | N/A | \{
"_shape": "openrouter",
"cursor": null,
"data": [],
"first_id": null,
"has_more": false,
"last_id": null
} |
\ No newline at end of file
diff --git a/docs/operations/order.mdx b/docs/operations/order.mdx
new file mode 100644
index 00000000..600110da
--- /dev/null
+++ b/docs/operations/order.mdx
@@ -0,0 +1,22 @@
+---
+title: "Order"
+---
+
+Sort direction. Only `asc` is supported by OpenRouter storage.
+
+## Example Usage
+
+```python
+from openrouter.operations import Order
+
+# Open enum: unrecognized values are captured as UnrecognizedStr
+value: Order = "asc"
+```
+
+
+## Values
+
+This is an open enum. Unrecognized values will not fail type checks.
+
+- `"asc"`
+- `"desc"`
diff --git a/docs/operations/uploadfilerequest.mdx b/docs/operations/uploadfilerequest.mdx
index 70188129..16d9fbce 100644
--- a/docs/operations/uploadfilerequest.mdx
+++ b/docs/operations/uploadfilerequest.mdx
@@ -10,4 +10,5 @@ title: "UploadFileRequest"
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
| `request_body` | [operations.UploadFileRequestBody](../operations/uploadfilerequestbody.mdx) | :heavy_check_mark: | N/A | |
\ No newline at end of file
diff --git a/docs/sdks/files/README.mdx b/docs/sdks/files/README.mdx
index b0cde3e3..d953a363 100644
--- a/docs/sdks/files/README.mdx
+++ b/docs/sdks/files/README.mdx
@@ -33,7 +33,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
- res = open_router.files.list()
+ res = open_router.files.list(provider="openai")
while res is not None:
# Handle items
@@ -52,6 +52,11 @@ with OpenRouter(
| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of files to return (1–1000). | 100 |
| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | eyJjdXJzb3IiOiJvcl9maWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9 |
| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
+| `after` | *Optional[str]* | :heavy_minus_sign: | OpenAI-style forward cursor: the id to list after. | or_file_011CNha8iCJcU1wXNR6q4V8w |
+| `after_id` | *Optional[str]* | :heavy_minus_sign: | Anthropic-style forward cursor: the id to list after. | or_file_011CNha8iCJcU1wXNR6q4V8w |
+| `before_id` | *Optional[str]* | :heavy_minus_sign: | Anthropic-style reverse cursor. Not supported by OpenRouter storage. | or_file_011CNha8iCJcU1wXNR6q4V8w |
+| `order` | [Optional[operations.Order]](../../operations/order.mdx) | :heavy_minus_sign: | Sort direction. Only `asc` is supported by OpenRouter storage. | asc |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
@@ -60,13 +65,16 @@ with OpenRouter(
### Errors
-| Error Type | Status Code | Content Type |
-| ----------------------------------- | ----------------------------------- | ----------------------------------- |
-| errors.BadRequestResponseError | 400 | application/json |
-| errors.UnauthorizedResponseError | 401 | application/json |
-| errors.TooManyRequestsResponseError | 429 | application/json |
-| errors.InternalServerResponseError | 500 | application/json |
-| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
+| Error Type | Status Code | Content Type |
+| -------------------------------------- | -------------------------------------- | -------------------------------------- |
+| errors.BadRequestResponseError | 400 | application/json |
+| errors.UnauthorizedResponseError | 401 | application/json |
+| errors.ForbiddenResponseError | 403 | application/json |
+| errors.TooManyRequestsResponseError | 429 | application/json |
+| errors.InternalServerResponseError | 500 | application/json |
+| errors.BadGatewayResponseError | 502 | application/json |
+| errors.ServiceUnavailableResponseError | 503 | application/json |
+| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
## upload
@@ -89,7 +97,7 @@ with OpenRouter(
res = open_router.files.upload(file={
"file_name": "example.file",
"content": open("example.file", "rb"),
- })
+ }, provider="openai")
# Handle response
print(res)
@@ -105,23 +113,26 @@ with OpenRouter(
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
-**[components.FileMetadata](../../components/filemetadata.mdx)**
+**[components.FileResponse](../../components/fileresponse.mdx)**
### Errors
-| Error Type | Status Code | Content Type |
-| ----------------------------------- | ----------------------------------- | ----------------------------------- |
-| errors.BadRequestResponseError | 400 | application/json |
-| errors.UnauthorizedResponseError | 401 | application/json |
-| errors.ForbiddenResponseError | 403 | application/json |
-| errors.PayloadTooLargeResponseError | 413 | application/json |
-| errors.TooManyRequestsResponseError | 429 | application/json |
-| errors.InternalServerResponseError | 500 | application/json |
-| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
+| Error Type | Status Code | Content Type |
+| -------------------------------------- | -------------------------------------- | -------------------------------------- |
+| errors.BadRequestResponseError | 400 | application/json |
+| errors.UnauthorizedResponseError | 401 | application/json |
+| errors.ForbiddenResponseError | 403 | application/json |
+| errors.PayloadTooLargeResponseError | 413 | application/json |
+| errors.TooManyRequestsResponseError | 429 | application/json |
+| errors.InternalServerResponseError | 500 | application/json |
+| errors.BadGatewayResponseError | 502 | application/json |
+| errors.ServiceUnavailableResponseError | 503 | application/json |
+| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
## delete
@@ -141,7 +152,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
- res = open_router.files.delete(file_id="file_011CNha8iCJcU1wXNR6q4V8w")
+ res = open_router.files.delete(file_id="file_011CNha8iCJcU1wXNR6q4V8w", provider="openai")
# Handle response
print(res)
@@ -157,6 +168,7 @@ with OpenRouter(
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
@@ -165,13 +177,16 @@ with OpenRouter(
### Errors
-| Error Type | Status Code | Content Type |
-| ----------------------------------- | ----------------------------------- | ----------------------------------- |
-| errors.UnauthorizedResponseError | 401 | application/json |
-| errors.NotFoundResponseError | 404 | application/json |
-| errors.TooManyRequestsResponseError | 429 | application/json |
-| errors.InternalServerResponseError | 500 | application/json |
-| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
+| Error Type | Status Code | Content Type |
+| -------------------------------------- | -------------------------------------- | -------------------------------------- |
+| errors.UnauthorizedResponseError | 401 | application/json |
+| errors.ForbiddenResponseError | 403 | application/json |
+| errors.NotFoundResponseError | 404 | application/json |
+| errors.TooManyRequestsResponseError | 429 | application/json |
+| errors.InternalServerResponseError | 500 | application/json |
+| errors.BadGatewayResponseError | 502 | application/json |
+| errors.ServiceUnavailableResponseError | 503 | application/json |
+| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
## retrieve
@@ -191,7 +206,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
- res = open_router.files.retrieve(file_id="file_011CNha8iCJcU1wXNR6q4V8w")
+ res = open_router.files.retrieve(file_id="file_011CNha8iCJcU1wXNR6q4V8w", provider="openai")
# Handle response
print(res)
@@ -207,21 +222,25 @@ with OpenRouter(
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
-**[components.FileMetadata](../../components/filemetadata.mdx)**
+**[components.FileResponse](../../components/fileresponse.mdx)**
### Errors
-| Error Type | Status Code | Content Type |
-| ----------------------------------- | ----------------------------------- | ----------------------------------- |
-| errors.UnauthorizedResponseError | 401 | application/json |
-| errors.NotFoundResponseError | 404 | application/json |
-| errors.TooManyRequestsResponseError | 429 | application/json |
-| errors.InternalServerResponseError | 500 | application/json |
-| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
+| Error Type | Status Code | Content Type |
+| -------------------------------------- | -------------------------------------- | -------------------------------------- |
+| errors.UnauthorizedResponseError | 401 | application/json |
+| errors.ForbiddenResponseError | 403 | application/json |
+| errors.NotFoundResponseError | 404 | application/json |
+| errors.TooManyRequestsResponseError | 429 | application/json |
+| errors.InternalServerResponseError | 500 | application/json |
+| errors.BadGatewayResponseError | 502 | application/json |
+| errors.ServiceUnavailableResponseError | 503 | application/json |
+| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
## download
@@ -241,7 +260,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
- res = open_router.files.download(file_id="file_011CNha8iCJcU1wXNR6q4V8w")
+ res = open_router.files.download(file_id="file_011CNha8iCJcU1wXNR6q4V8w", provider="openai")
# Handle response
print(res)
@@ -257,6 +276,7 @@ with OpenRouter(
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 |
+| `provider` | [Optional[components.FileProvider]](../../components/fileprovider.mdx) | :heavy_minus_sign: | Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage. | openai |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
@@ -265,11 +285,14 @@ with OpenRouter(
### Errors
-| Error Type | Status Code | Content Type |
-| ----------------------------------- | ----------------------------------- | ----------------------------------- |
-| errors.BadRequestResponseError | 400 | application/json |
-| errors.UnauthorizedResponseError | 401 | application/json |
-| errors.NotFoundResponseError | 404 | application/json |
-| errors.TooManyRequestsResponseError | 429 | application/json |
-| errors.InternalServerResponseError | 500 | application/json |
-| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
\ No newline at end of file
+| Error Type | Status Code | Content Type |
+| -------------------------------------- | -------------------------------------- | -------------------------------------- |
+| errors.BadRequestResponseError | 400 | application/json |
+| errors.UnauthorizedResponseError | 401 | application/json |
+| errors.ForbiddenResponseError | 403 | application/json |
+| errors.NotFoundResponseError | 404 | application/json |
+| errors.TooManyRequestsResponseError | 429 | application/json |
+| errors.InternalServerResponseError | 500 | application/json |
+| errors.BadGatewayResponseError | 502 | application/json |
+| errors.ServiceUnavailableResponseError | 503 | application/json |
+| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 0ac27011..907de016 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.1.12"
+version = "1.1.13"
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 c009a9e6..18c2e2b4 100644
--- a/src/openrouter/_version.py
+++ b/src/openrouter/_version.py
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
-__version__: str = "1.1.12"
+__version__: str = "1.1.13"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
-__user_agent__: str = "speakeasy-sdk/python 1.1.12 2.914.0 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.1.13 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 2656d514..2eac3e35 100644
--- a/src/openrouter/components/__init__.py
+++ b/src/openrouter/components/__init__.py
@@ -130,11 +130,28 @@
SourceType,
TypeDocument,
)
+ from .anthropicfile import (
+ AnthropicFile,
+ AnthropicFileShape,
+ AnthropicFileType,
+ AnthropicFileTypedDict,
+ )
+ from .anthropicfiledeleted import (
+ AnthropicFileDeleted,
+ AnthropicFileDeletedShape,
+ AnthropicFileDeletedType,
+ AnthropicFileDeletedTypedDict,
+ )
from .anthropicfiledocumentsource import (
AnthropicFileDocumentSource,
AnthropicFileDocumentSourceType,
AnthropicFileDocumentSourceTypedDict,
)
+ from .anthropicfilelist import (
+ AnthropicFileList,
+ AnthropicFileListShape,
+ AnthropicFileListTypedDict,
+ )
from .anthropicimageblockparam import (
AnthropicImageBlockParam,
AnthropicImageBlockParamSource,
@@ -925,17 +942,22 @@
from .filecitation import FileCitation, FileCitationType, FileCitationTypedDict
from .filedeleteresponse import (
FileDeleteResponse,
- FileDeleteResponseType,
FileDeleteResponseTypedDict,
+ UnknownFileDeleteResponse,
+ )
+ from .filelistresponse import (
+ FileListResponse,
+ FileListResponseTypedDict,
+ UnknownFileListResponse,
)
- from .filelistresponse import FileListResponse, FileListResponseTypedDict
- from .filemetadata import FileMetadata, FileMetadataType, FileMetadataTypedDict
from .fileparserplugin import (
FileParserPlugin,
FileParserPluginID,
FileParserPluginTypedDict,
)
from .filepath import FilePath, FilePathType, FilePathTypedDict
+ from .fileprovider import FileProvider
+ from .fileresponse import FileResponse, FileResponseTypedDict, UnknownFileResponse
from .filesearchservertool import (
FileSearchServerTool,
FileSearchServerToolTypedDict,
@@ -1853,6 +1875,26 @@
ObservabilityWebhookDestinationType,
ObservabilityWebhookDestinationTypedDict,
)
+ from .openaifile import (
+ OpenAIFile,
+ OpenAIFileObject,
+ OpenAIFileShape,
+ OpenAIFileStatus,
+ OpenAIFileTypedDict,
+ Purpose,
+ )
+ from .openaifiledeleted import (
+ OpenAIFileDeleted,
+ OpenAIFileDeletedObject,
+ OpenAIFileDeletedShape,
+ OpenAIFileDeletedTypedDict,
+ )
+ from .openaifilelist import (
+ OpenAIFileList,
+ OpenAIFileListObject,
+ OpenAIFileListShape,
+ OpenAIFileListTypedDict,
+ )
from .openairesponsecustomtoolcall import (
OpenAIResponseCustomToolCall,
OpenAIResponseCustomToolCallType,
@@ -1959,6 +2001,23 @@
UsageCostDetailsTypedDict,
UsageTypedDict,
)
+ from .openrouterfile import (
+ OpenRouterFile,
+ OpenRouterFileShape,
+ OpenRouterFileType,
+ OpenRouterFileTypedDict,
+ )
+ from .openrouterfiledeleted import (
+ OpenRouterFileDeleted,
+ OpenRouterFileDeletedShape,
+ OpenRouterFileDeletedType,
+ OpenRouterFileDeletedTypedDict,
+ )
+ from .openrouterfilelist import (
+ OpenRouterFileList,
+ OpenRouterFileListShape,
+ OpenRouterFileListTypedDict,
+ )
from .openroutermetadata import OpenRouterMetadata, OpenRouterMetadataTypedDict
from .openrouterwebsearchservertool import (
OpenRouterWebSearchServerTool,
@@ -3010,9 +3069,20 @@
"AnthropicDocumentBlockParamSourceUnion",
"AnthropicDocumentBlockParamSourceUnionTypedDict",
"AnthropicDocumentBlockParamTypedDict",
+ "AnthropicFile",
+ "AnthropicFileDeleted",
+ "AnthropicFileDeletedShape",
+ "AnthropicFileDeletedType",
+ "AnthropicFileDeletedTypedDict",
"AnthropicFileDocumentSource",
"AnthropicFileDocumentSourceType",
"AnthropicFileDocumentSourceTypedDict",
+ "AnthropicFileList",
+ "AnthropicFileListShape",
+ "AnthropicFileListTypedDict",
+ "AnthropicFileShape",
+ "AnthropicFileType",
+ "AnthropicFileTypedDict",
"AnthropicImageBlockParam",
"AnthropicImageBlockParamSource",
"AnthropicImageBlockParamSourceTypedDict",
@@ -3585,19 +3655,18 @@
"FileCitationType",
"FileCitationTypedDict",
"FileDeleteResponse",
- "FileDeleteResponseType",
"FileDeleteResponseTypedDict",
"FileListResponse",
"FileListResponseTypedDict",
- "FileMetadata",
- "FileMetadataType",
- "FileMetadataTypedDict",
"FileParserPlugin",
"FileParserPluginID",
"FileParserPluginTypedDict",
"FilePath",
"FilePathType",
"FilePathTypedDict",
+ "FileProvider",
+ "FileResponse",
+ "FileResponseTypedDict",
"FileSearchServerTool",
"FileSearchServerToolTypedDict",
"FileSearchServerToolValue1",
@@ -4190,6 +4259,19 @@
"ObservabilityWebhookDestinationConfigTypedDict",
"ObservabilityWebhookDestinationType",
"ObservabilityWebhookDestinationTypedDict",
+ "OpenAIFile",
+ "OpenAIFileDeleted",
+ "OpenAIFileDeletedObject",
+ "OpenAIFileDeletedShape",
+ "OpenAIFileDeletedTypedDict",
+ "OpenAIFileList",
+ "OpenAIFileListObject",
+ "OpenAIFileListShape",
+ "OpenAIFileListTypedDict",
+ "OpenAIFileObject",
+ "OpenAIFileShape",
+ "OpenAIFileStatus",
+ "OpenAIFileTypedDict",
"OpenAIResponseCustomToolCall",
"OpenAIResponseCustomToolCallOutput",
"OpenAIResponseCustomToolCallOutputOutput1",
@@ -4259,6 +4341,17 @@
"OpenResponsesResultToolUnionTypedDict",
"OpenResponsesResultType",
"OpenResponsesResultTypedDict",
+ "OpenRouterFile",
+ "OpenRouterFileDeleted",
+ "OpenRouterFileDeletedShape",
+ "OpenRouterFileDeletedType",
+ "OpenRouterFileDeletedTypedDict",
+ "OpenRouterFileList",
+ "OpenRouterFileListShape",
+ "OpenRouterFileListTypedDict",
+ "OpenRouterFileShape",
+ "OpenRouterFileType",
+ "OpenRouterFileTypedDict",
"OpenRouterMetadata",
"OpenRouterMetadataTypedDict",
"OpenRouterWebSearchServerTool",
@@ -4527,6 +4620,7 @@
"PublicEndpointTypedDict",
"PublicPricing",
"PublicPricingTypedDict",
+ "Purpose",
"Quantization",
"RangeCapability",
"RangeCapabilityType",
@@ -4921,6 +5015,9 @@
"UnknownChatContentItems",
"UnknownContentPartAddedEventPart",
"UnknownContentPartDoneEventPart",
+ "UnknownFileDeleteResponse",
+ "UnknownFileListResponse",
+ "UnknownFileResponse",
"UnknownFormat",
"UnknownFormats",
"UnknownImageStreamingResponseData",
@@ -5139,9 +5236,20 @@
"SourceContentTypedDict": ".anthropicdocumentblockparam",
"SourceType": ".anthropicdocumentblockparam",
"TypeDocument": ".anthropicdocumentblockparam",
+ "AnthropicFile": ".anthropicfile",
+ "AnthropicFileShape": ".anthropicfile",
+ "AnthropicFileType": ".anthropicfile",
+ "AnthropicFileTypedDict": ".anthropicfile",
+ "AnthropicFileDeleted": ".anthropicfiledeleted",
+ "AnthropicFileDeletedShape": ".anthropicfiledeleted",
+ "AnthropicFileDeletedType": ".anthropicfiledeleted",
+ "AnthropicFileDeletedTypedDict": ".anthropicfiledeleted",
"AnthropicFileDocumentSource": ".anthropicfiledocumentsource",
"AnthropicFileDocumentSourceType": ".anthropicfiledocumentsource",
"AnthropicFileDocumentSourceTypedDict": ".anthropicfiledocumentsource",
+ "AnthropicFileList": ".anthropicfilelist",
+ "AnthropicFileListShape": ".anthropicfilelist",
+ "AnthropicFileListTypedDict": ".anthropicfilelist",
"AnthropicImageBlockParam": ".anthropicimageblockparam",
"AnthropicImageBlockParamSource": ".anthropicimageblockparam",
"AnthropicImageBlockParamSourceTypedDict": ".anthropicimageblockparam",
@@ -5692,19 +5800,21 @@
"FileCitationType": ".filecitation",
"FileCitationTypedDict": ".filecitation",
"FileDeleteResponse": ".filedeleteresponse",
- "FileDeleteResponseType": ".filedeleteresponse",
"FileDeleteResponseTypedDict": ".filedeleteresponse",
+ "UnknownFileDeleteResponse": ".filedeleteresponse",
"FileListResponse": ".filelistresponse",
"FileListResponseTypedDict": ".filelistresponse",
- "FileMetadata": ".filemetadata",
- "FileMetadataType": ".filemetadata",
- "FileMetadataTypedDict": ".filemetadata",
+ "UnknownFileListResponse": ".filelistresponse",
"FileParserPlugin": ".fileparserplugin",
"FileParserPluginID": ".fileparserplugin",
"FileParserPluginTypedDict": ".fileparserplugin",
"FilePath": ".filepath",
"FilePathType": ".filepath",
"FilePathTypedDict": ".filepath",
+ "FileProvider": ".fileprovider",
+ "FileResponse": ".fileresponse",
+ "FileResponseTypedDict": ".fileresponse",
+ "UnknownFileResponse": ".fileresponse",
"FileSearchServerTool": ".filesearchservertool",
"FileSearchServerToolTypedDict": ".filesearchservertool",
"FileSearchServerToolValue1": ".filesearchservertool",
@@ -6427,6 +6537,20 @@
"ObservabilityWebhookDestinationConfigTypedDict": ".observabilitywebhookdestination",
"ObservabilityWebhookDestinationType": ".observabilitywebhookdestination",
"ObservabilityWebhookDestinationTypedDict": ".observabilitywebhookdestination",
+ "OpenAIFile": ".openaifile",
+ "OpenAIFileObject": ".openaifile",
+ "OpenAIFileShape": ".openaifile",
+ "OpenAIFileStatus": ".openaifile",
+ "OpenAIFileTypedDict": ".openaifile",
+ "Purpose": ".openaifile",
+ "OpenAIFileDeleted": ".openaifiledeleted",
+ "OpenAIFileDeletedObject": ".openaifiledeleted",
+ "OpenAIFileDeletedShape": ".openaifiledeleted",
+ "OpenAIFileDeletedTypedDict": ".openaifiledeleted",
+ "OpenAIFileList": ".openaifilelist",
+ "OpenAIFileListObject": ".openaifilelist",
+ "OpenAIFileListShape": ".openaifilelist",
+ "OpenAIFileListTypedDict": ".openaifilelist",
"OpenAIResponseCustomToolCall": ".openairesponsecustomtoolcall",
"OpenAIResponseCustomToolCallType": ".openairesponsecustomtoolcall",
"OpenAIResponseCustomToolCallTypedDict": ".openairesponsecustomtoolcall",
@@ -6511,6 +6635,17 @@
"UsageCostDetails": ".openresponsesresult",
"UsageCostDetailsTypedDict": ".openresponsesresult",
"UsageTypedDict": ".openresponsesresult",
+ "OpenRouterFile": ".openrouterfile",
+ "OpenRouterFileShape": ".openrouterfile",
+ "OpenRouterFileType": ".openrouterfile",
+ "OpenRouterFileTypedDict": ".openrouterfile",
+ "OpenRouterFileDeleted": ".openrouterfiledeleted",
+ "OpenRouterFileDeletedShape": ".openrouterfiledeleted",
+ "OpenRouterFileDeletedType": ".openrouterfiledeleted",
+ "OpenRouterFileDeletedTypedDict": ".openrouterfiledeleted",
+ "OpenRouterFileList": ".openrouterfilelist",
+ "OpenRouterFileListShape": ".openrouterfilelist",
+ "OpenRouterFileListTypedDict": ".openrouterfilelist",
"OpenRouterMetadata": ".openroutermetadata",
"OpenRouterMetadataTypedDict": ".openroutermetadata",
"OpenRouterWebSearchServerTool": ".openrouterwebsearchservertool",
diff --git a/src/openrouter/components/anthropicfile.py b/src/openrouter/components/anthropicfile.py
new file mode 100644
index 00000000..6446c73d
--- /dev/null
+++ b/src/openrouter/components/anthropicfile.py
@@ -0,0 +1,52 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import BaseModel
+import pydantic
+from typing import Literal
+from typing_extensions import Annotated, TypedDict
+
+
+AnthropicFileShape = Literal["anthropic",]
+
+
+AnthropicFileType = Literal["file",]
+
+
+class AnthropicFileTypedDict(TypedDict):
+ r"""A stored file in Anthropic's Files API shape."""
+
+ shape: AnthropicFileShape
+ created_at: str
+ downloadable: bool
+ filename: str
+ id: str
+ mime_type: str
+ size_bytes: int
+ type: AnthropicFileType
+
+
+class AnthropicFile(BaseModel):
+ r"""A stored file in Anthropic's Files API shape."""
+
+ shape: Annotated[AnthropicFileShape, pydantic.Field(alias="_shape")]
+
+ created_at: str
+
+ downloadable: bool
+
+ filename: str
+
+ id: str
+
+ mime_type: str
+
+ size_bytes: int
+
+ type: AnthropicFileType
+
+
+try:
+ AnthropicFile.model_rebuild()
+except NameError:
+ pass
diff --git a/src/openrouter/components/anthropicfiledeleted.py b/src/openrouter/components/anthropicfiledeleted.py
new file mode 100644
index 00000000..fb4749ad
--- /dev/null
+++ b/src/openrouter/components/anthropicfiledeleted.py
@@ -0,0 +1,37 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import BaseModel
+import pydantic
+from typing import Literal
+from typing_extensions import Annotated, TypedDict
+
+
+AnthropicFileDeletedShape = Literal["anthropic",]
+
+
+AnthropicFileDeletedType = Literal["file_deleted",]
+
+
+class AnthropicFileDeletedTypedDict(TypedDict):
+ r"""Deletion result in Anthropic's shape."""
+
+ shape: AnthropicFileDeletedShape
+ id: str
+ type: AnthropicFileDeletedType
+
+
+class AnthropicFileDeleted(BaseModel):
+ r"""Deletion result in Anthropic's shape."""
+
+ shape: Annotated[AnthropicFileDeletedShape, pydantic.Field(alias="_shape")]
+
+ id: str
+
+ type: AnthropicFileDeletedType
+
+
+try:
+ AnthropicFileDeleted.model_rebuild()
+except NameError:
+ pass
diff --git a/src/openrouter/components/anthropicfilelist.py b/src/openrouter/components/anthropicfilelist.py
new file mode 100644
index 00000000..def29ec5
--- /dev/null
+++ b/src/openrouter/components/anthropicfilelist.py
@@ -0,0 +1,56 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from .anthropicfile import AnthropicFile, AnthropicFileTypedDict
+from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
+import pydantic
+from pydantic import model_serializer
+from typing import List, Literal
+from typing_extensions import Annotated, TypedDict
+
+
+AnthropicFileListShape = Literal["anthropic",]
+
+
+class AnthropicFileListTypedDict(TypedDict):
+ r"""A page of files in Anthropic's shape."""
+
+ shape: AnthropicFileListShape
+ data: List[AnthropicFileTypedDict]
+ first_id: Nullable[str]
+ has_more: bool
+ last_id: Nullable[str]
+
+
+class AnthropicFileList(BaseModel):
+ r"""A page of files in Anthropic's shape."""
+
+ shape: Annotated[AnthropicFileListShape, pydantic.Field(alias="_shape")]
+
+ data: List[AnthropicFile]
+
+ first_id: Nullable[str]
+
+ has_more: bool
+
+ last_id: Nullable[str]
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ 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:
+ m[k] = val
+
+ return m
+
+
+try:
+ AnthropicFileList.model_rebuild()
+except NameError:
+ pass
diff --git a/src/openrouter/components/filedeleteresponse.py b/src/openrouter/components/filedeleteresponse.py
index ee75b85e..72903987 100644
--- a/src/openrouter/components/filedeleteresponse.py
+++ b/src/openrouter/components/filedeleteresponse.py
@@ -1,24 +1,61 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
+from .anthropicfiledeleted import AnthropicFileDeleted, AnthropicFileDeletedTypedDict
+from .openaifiledeleted import OpenAIFileDeleted, OpenAIFileDeletedTypedDict
+from .openrouterfiledeleted import OpenRouterFileDeleted, OpenRouterFileDeletedTypedDict
+from functools import partial
from openrouter.types import BaseModel
-from typing import Literal
-from typing_extensions import TypedDict
-
-
-FileDeleteResponseType = Literal["file_deleted",]
-
-
-class FileDeleteResponseTypedDict(TypedDict):
- r"""Confirmation that a file was deleted."""
-
- id: str
- type: FileDeleteResponseType
-
-
-class FileDeleteResponse(BaseModel):
- r"""Confirmation that a file was deleted."""
-
- id: str
-
- type: FileDeleteResponseType
+from openrouter.utils.unions import parse_open_union
+from pydantic import ConfigDict
+from pydantic.functional_validators import BeforeValidator
+from typing import Any, Literal, Union
+from typing_extensions import Annotated, TypeAliasType
+
+
+FileDeleteResponseTypedDict = TypeAliasType(
+ "FileDeleteResponseTypedDict",
+ Union[
+ OpenRouterFileDeletedTypedDict,
+ AnthropicFileDeletedTypedDict,
+ OpenAIFileDeletedTypedDict,
+ ],
+)
+r"""Confirmation that a file was deleted, in the negotiated shape."""
+
+
+class UnknownFileDeleteResponse(BaseModel):
+ r"""A FileDeleteResponse variant the SDK doesn't recognize. Preserves the raw payload."""
+
+ shape: Literal["UNKNOWN"] = "UNKNOWN"
+ raw: Any
+ is_unknown: Literal[True] = True
+
+ model_config = ConfigDict(frozen=True)
+
+
+_FILE_DELETE_RESPONSE_VARIANTS: dict[str, Any] = {
+ "anthropic": AnthropicFileDeleted,
+ "openai": OpenAIFileDeleted,
+ "openrouter": OpenRouterFileDeleted,
+}
+
+
+FileDeleteResponse = Annotated[
+ Union[
+ AnthropicFileDeleted,
+ OpenAIFileDeleted,
+ OpenRouterFileDeleted,
+ UnknownFileDeleteResponse,
+ ],
+ BeforeValidator(
+ partial(
+ parse_open_union,
+ disc_key="_shape",
+ variants=_FILE_DELETE_RESPONSE_VARIANTS,
+ unknown_cls=UnknownFileDeleteResponse,
+ union_name="FileDeleteResponse",
+ )
+ ),
+]
+r"""Confirmation that a file was deleted, in the negotiated shape."""
diff --git a/src/openrouter/components/filelistresponse.py b/src/openrouter/components/filelistresponse.py
index 3b40324c..6c22b2c4 100644
--- a/src/openrouter/components/filelistresponse.py
+++ b/src/openrouter/components/filelistresponse.py
@@ -1,48 +1,56 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
-from .filemetadata import FileMetadata, FileMetadataTypedDict
-from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
-from pydantic import model_serializer
-from typing import List
-from typing_extensions import TypedDict
-
-
-class FileListResponseTypedDict(TypedDict):
- r"""A page of files belonging to the requesting workspace."""
-
- cursor: Nullable[str]
- r"""Opaque cursor for the next page; null when there are no more results."""
- data: List[FileMetadataTypedDict]
- first_id: Nullable[str]
- has_more: bool
- last_id: Nullable[str]
-
-
-class FileListResponse(BaseModel):
- r"""A page of files belonging to the requesting workspace."""
-
- cursor: Nullable[str]
- r"""Opaque cursor for the next page; null when there are no more results."""
-
- data: List[FileMetadata]
-
- first_id: Nullable[str]
-
- has_more: bool
-
- last_id: Nullable[str]
-
- @model_serializer(mode="wrap")
- def serialize_model(self, handler):
- 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:
- m[k] = val
-
- return m
+from .anthropicfilelist import AnthropicFileList, AnthropicFileListTypedDict
+from .openaifilelist import OpenAIFileList, OpenAIFileListTypedDict
+from .openrouterfilelist import OpenRouterFileList, OpenRouterFileListTypedDict
+from functools import partial
+from openrouter.types import BaseModel
+from openrouter.utils.unions import parse_open_union
+from pydantic import ConfigDict
+from pydantic.functional_validators import BeforeValidator
+from typing import Any, Literal, Union
+from typing_extensions import Annotated, TypeAliasType
+
+
+FileListResponseTypedDict = TypeAliasType(
+ "FileListResponseTypedDict",
+ Union[
+ AnthropicFileListTypedDict, OpenRouterFileListTypedDict, OpenAIFileListTypedDict
+ ],
+)
+r"""A page of files, in the negotiated shape."""
+
+
+class UnknownFileListResponse(BaseModel):
+ r"""A FileListResponse variant the SDK doesn't recognize. Preserves the raw payload."""
+
+ shape: Literal["UNKNOWN"] = "UNKNOWN"
+ raw: Any
+ is_unknown: Literal[True] = True
+
+ model_config = ConfigDict(frozen=True)
+
+
+_FILE_LIST_RESPONSE_VARIANTS: dict[str, Any] = {
+ "anthropic": AnthropicFileList,
+ "openai": OpenAIFileList,
+ "openrouter": OpenRouterFileList,
+}
+
+
+FileListResponse = Annotated[
+ Union[
+ AnthropicFileList, OpenAIFileList, OpenRouterFileList, UnknownFileListResponse
+ ],
+ BeforeValidator(
+ partial(
+ parse_open_union,
+ disc_key="_shape",
+ variants=_FILE_LIST_RESPONSE_VARIANTS,
+ unknown_cls=UnknownFileListResponse,
+ union_name="FileListResponse",
+ )
+ ),
+]
+r"""A page of files, in the negotiated shape."""
diff --git a/src/openrouter/components/filemetadata.py b/src/openrouter/components/filemetadata.py
deleted file mode 100644
index e128dc9b..00000000
--- a/src/openrouter/components/filemetadata.py
+++ /dev/null
@@ -1,39 +0,0 @@
-"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
-
-from __future__ import annotations
-from openrouter.types import BaseModel
-from typing import Literal
-from typing_extensions import TypedDict
-
-
-FileMetadataType = Literal["file",]
-
-
-class FileMetadataTypedDict(TypedDict):
- r"""Metadata describing a stored file."""
-
- created_at: str
- downloadable: bool
- filename: str
- id: str
- mime_type: str
- size_bytes: int
- type: FileMetadataType
-
-
-class FileMetadata(BaseModel):
- r"""Metadata describing a stored file."""
-
- created_at: str
-
- downloadable: bool
-
- filename: str
-
- id: str
-
- mime_type: str
-
- size_bytes: int
-
- type: FileMetadataType
diff --git a/src/openrouter/components/fileprovider.py b/src/openrouter/components/fileprovider.py
new file mode 100644
index 00000000..86f13260
--- /dev/null
+++ b/src/openrouter/components/fileprovider.py
@@ -0,0 +1,15 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import UnrecognizedStr
+from typing import Literal, Union
+
+
+FileProvider = Union[
+ Literal[
+ "openai",
+ "anthropic",
+ ],
+ UnrecognizedStr,
+]
+r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
diff --git a/src/openrouter/components/fileresponse.py b/src/openrouter/components/fileresponse.py
new file mode 100644
index 00000000..9d7d5b88
--- /dev/null
+++ b/src/openrouter/components/fileresponse.py
@@ -0,0 +1,52 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from .anthropicfile import AnthropicFile, AnthropicFileTypedDict
+from .openaifile import OpenAIFile, OpenAIFileTypedDict
+from .openrouterfile import OpenRouterFile, OpenRouterFileTypedDict
+from functools import partial
+from openrouter.types import BaseModel
+from openrouter.utils.unions import parse_open_union
+from pydantic import ConfigDict
+from pydantic.functional_validators import BeforeValidator
+from typing import Any, Literal, Union
+from typing_extensions import Annotated, TypeAliasType
+
+
+FileResponseTypedDict = TypeAliasType(
+ "FileResponseTypedDict",
+ Union[OpenRouterFileTypedDict, OpenAIFileTypedDict, AnthropicFileTypedDict],
+)
+r"""A stored file. The shape is negotiated per request — see the endpoint description."""
+
+
+class UnknownFileResponse(BaseModel):
+ r"""A FileResponse variant the SDK doesn't recognize. Preserves the raw payload."""
+
+ shape: Literal["UNKNOWN"] = "UNKNOWN"
+ raw: Any
+ is_unknown: Literal[True] = True
+
+ model_config = ConfigDict(frozen=True)
+
+
+_FILE_RESPONSE_VARIANTS: dict[str, Any] = {
+ "anthropic": AnthropicFile,
+ "openai": OpenAIFile,
+ "openrouter": OpenRouterFile,
+}
+
+
+FileResponse = Annotated[
+ Union[AnthropicFile, OpenAIFile, OpenRouterFile, UnknownFileResponse],
+ BeforeValidator(
+ partial(
+ parse_open_union,
+ disc_key="_shape",
+ variants=_FILE_RESPONSE_VARIANTS,
+ unknown_cls=UnknownFileResponse,
+ union_name="FileResponse",
+ )
+ ),
+]
+r"""A stored file. The shape is negotiated per request — see the endpoint description."""
diff --git a/src/openrouter/components/openaifile.py b/src/openrouter/components/openaifile.py
new file mode 100644
index 00000000..0b55319d
--- /dev/null
+++ b/src/openrouter/components/openaifile.py
@@ -0,0 +1,71 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import BaseModel, UnrecognizedStr
+import pydantic
+from typing import Literal, Union
+from typing_extensions import Annotated, TypedDict
+
+
+OpenAIFileShape = Literal["openai",]
+
+
+OpenAIFileObject = Literal["file",]
+
+
+Purpose = Union[
+ Literal[
+ "assistants",
+ "batch",
+ "fine-tune",
+ "vision",
+ "user_data",
+ "evals",
+ "assistants_output",
+ "batch_output",
+ "fine-tune-results",
+ ],
+ UnrecognizedStr,
+]
+
+
+OpenAIFileStatus = Literal["processed",]
+
+
+class OpenAIFileTypedDict(TypedDict):
+ r"""A stored file in OpenAI's Files API shape."""
+
+ shape: OpenAIFileShape
+ bytes_: int
+ created_at: int
+ filename: str
+ id: str
+ object: OpenAIFileObject
+ purpose: Purpose
+ status: OpenAIFileStatus
+
+
+class OpenAIFile(BaseModel):
+ r"""A stored file in OpenAI's Files API shape."""
+
+ shape: Annotated[OpenAIFileShape, pydantic.Field(alias="_shape")]
+
+ bytes_: Annotated[int, pydantic.Field(alias="bytes")]
+
+ created_at: int
+
+ filename: str
+
+ id: str
+
+ object: OpenAIFileObject
+
+ purpose: Purpose
+
+ status: OpenAIFileStatus
+
+
+try:
+ OpenAIFile.model_rebuild()
+except NameError:
+ pass
diff --git a/src/openrouter/components/openaifiledeleted.py b/src/openrouter/components/openaifiledeleted.py
new file mode 100644
index 00000000..a047881c
--- /dev/null
+++ b/src/openrouter/components/openaifiledeleted.py
@@ -0,0 +1,45 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import BaseModel
+from openrouter.utils import validate_const
+import pydantic
+from pydantic.functional_validators import AfterValidator
+from typing import Literal
+from typing_extensions import Annotated, TypedDict
+
+
+OpenAIFileDeletedShape = Literal["openai",]
+
+
+OpenAIFileDeletedObject = Literal["file",]
+
+
+class OpenAIFileDeletedTypedDict(TypedDict):
+ r"""Deletion result in OpenAI's shape."""
+
+ shape: OpenAIFileDeletedShape
+ id: str
+ object: OpenAIFileDeletedObject
+ deleted: Literal[True]
+
+
+class OpenAIFileDeleted(BaseModel):
+ r"""Deletion result in OpenAI's shape."""
+
+ shape: Annotated[OpenAIFileDeletedShape, pydantic.Field(alias="_shape")]
+
+ id: str
+
+ object: OpenAIFileDeletedObject
+
+ DELETED: Annotated[
+ Annotated[Literal[True], AfterValidator(validate_const(True))],
+ pydantic.Field(alias="deleted"),
+ ] = True
+
+
+try:
+ OpenAIFileDeleted.model_rebuild()
+except NameError:
+ pass
diff --git a/src/openrouter/components/openaifilelist.py b/src/openrouter/components/openaifilelist.py
new file mode 100644
index 00000000..528583a7
--- /dev/null
+++ b/src/openrouter/components/openaifilelist.py
@@ -0,0 +1,62 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from .openaifile import OpenAIFile, OpenAIFileTypedDict
+from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
+import pydantic
+from pydantic import model_serializer
+from typing import List, Literal
+from typing_extensions import Annotated, TypedDict
+
+
+OpenAIFileListShape = Literal["openai",]
+
+
+OpenAIFileListObject = Literal["list",]
+
+
+class OpenAIFileListTypedDict(TypedDict):
+ r"""A page of files in OpenAI's shape."""
+
+ shape: OpenAIFileListShape
+ data: List[OpenAIFileTypedDict]
+ first_id: Nullable[str]
+ has_more: bool
+ last_id: Nullable[str]
+ object: OpenAIFileListObject
+
+
+class OpenAIFileList(BaseModel):
+ r"""A page of files in OpenAI's shape."""
+
+ shape: Annotated[OpenAIFileListShape, pydantic.Field(alias="_shape")]
+
+ data: List[OpenAIFile]
+
+ first_id: Nullable[str]
+
+ has_more: bool
+
+ last_id: Nullable[str]
+
+ object: OpenAIFileListObject
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ 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:
+ m[k] = val
+
+ return m
+
+
+try:
+ OpenAIFileList.model_rebuild()
+except NameError:
+ pass
diff --git a/src/openrouter/components/openrouterfile.py b/src/openrouter/components/openrouterfile.py
new file mode 100644
index 00000000..a2621ac6
--- /dev/null
+++ b/src/openrouter/components/openrouterfile.py
@@ -0,0 +1,52 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import BaseModel
+import pydantic
+from typing import Literal
+from typing_extensions import Annotated, TypedDict
+
+
+OpenRouterFileShape = Literal["openrouter",]
+
+
+OpenRouterFileType = Literal["file",]
+
+
+class OpenRouterFileTypedDict(TypedDict):
+ r"""A stored file in the OpenRouter superset shape: Anthropic-shaped, plus OpenRouter-only fields."""
+
+ shape: OpenRouterFileShape
+ created_at: str
+ downloadable: bool
+ filename: str
+ id: str
+ mime_type: str
+ size_bytes: int
+ type: OpenRouterFileType
+
+
+class OpenRouterFile(BaseModel):
+ r"""A stored file in the OpenRouter superset shape: Anthropic-shaped, plus OpenRouter-only fields."""
+
+ shape: Annotated[OpenRouterFileShape, pydantic.Field(alias="_shape")]
+
+ created_at: str
+
+ downloadable: bool
+
+ filename: str
+
+ id: str
+
+ mime_type: str
+
+ size_bytes: int
+
+ type: OpenRouterFileType
+
+
+try:
+ OpenRouterFile.model_rebuild()
+except NameError:
+ pass
diff --git a/src/openrouter/components/openrouterfiledeleted.py b/src/openrouter/components/openrouterfiledeleted.py
new file mode 100644
index 00000000..d0100bae
--- /dev/null
+++ b/src/openrouter/components/openrouterfiledeleted.py
@@ -0,0 +1,37 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import BaseModel
+import pydantic
+from typing import Literal
+from typing_extensions import Annotated, TypedDict
+
+
+OpenRouterFileDeletedShape = Literal["openrouter",]
+
+
+OpenRouterFileDeletedType = Literal["file_deleted",]
+
+
+class OpenRouterFileDeletedTypedDict(TypedDict):
+ r"""Deletion result in the OpenRouter shape."""
+
+ shape: OpenRouterFileDeletedShape
+ id: str
+ type: OpenRouterFileDeletedType
+
+
+class OpenRouterFileDeleted(BaseModel):
+ r"""Deletion result in the OpenRouter shape."""
+
+ shape: Annotated[OpenRouterFileDeletedShape, pydantic.Field(alias="_shape")]
+
+ id: str
+
+ type: OpenRouterFileDeletedType
+
+
+try:
+ OpenRouterFileDeleted.model_rebuild()
+except NameError:
+ pass
diff --git a/src/openrouter/components/openrouterfilelist.py b/src/openrouter/components/openrouterfilelist.py
new file mode 100644
index 00000000..f5cf39ef
--- /dev/null
+++ b/src/openrouter/components/openrouterfilelist.py
@@ -0,0 +1,61 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from .openrouterfile import OpenRouterFile, OpenRouterFileTypedDict
+from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
+import pydantic
+from pydantic import model_serializer
+from typing import List, Literal
+from typing_extensions import Annotated, TypedDict
+
+
+OpenRouterFileListShape = Literal["openrouter",]
+
+
+class OpenRouterFileListTypedDict(TypedDict):
+ r"""A page of files in the OpenRouter shape."""
+
+ shape: OpenRouterFileListShape
+ cursor: Nullable[str]
+ r"""Opaque cursor for the next page; null when there are no more results."""
+ data: List[OpenRouterFileTypedDict]
+ first_id: Nullable[str]
+ has_more: bool
+ last_id: Nullable[str]
+
+
+class OpenRouterFileList(BaseModel):
+ r"""A page of files in the OpenRouter shape."""
+
+ shape: Annotated[OpenRouterFileListShape, pydantic.Field(alias="_shape")]
+
+ cursor: Nullable[str]
+ r"""Opaque cursor for the next page; null when there are no more results."""
+
+ data: List[OpenRouterFile]
+
+ first_id: Nullable[str]
+
+ has_more: bool
+
+ last_id: Nullable[str]
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ 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:
+ m[k] = val
+
+ return m
+
+
+try:
+ OpenRouterFileList.model_rebuild()
+except NameError:
+ pass
diff --git a/src/openrouter/files.py b/src/openrouter/files.py
index 0eb6e276..abd0225d 100644
--- a/src/openrouter/files.py
+++ b/src/openrouter/files.py
@@ -23,6 +23,11 @@ def list(
limit: Optional[int] = None,
cursor: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
+ after: Optional[str] = None,
+ after_id: Optional[str] = None,
+ before_id: Optional[str] = None,
+ order: Optional[operations.Order] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -42,6 +47,11 @@ def list(
:param limit: Maximum number of files to return (1–1000).
:param cursor: Opaque pagination cursor from a previous response.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
+ :param after: OpenAI-style forward cursor: the id to list after.
+ :param after_id: Anthropic-style forward cursor: the id to list after.
+ :param before_id: Anthropic-style reverse cursor. Not supported by OpenRouter storage.
+ :param order: Sort direction. Only `asc` is supported by OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -64,6 +74,11 @@ def list(
limit=limit,
cursor=cursor,
workspace_id=workspace_id,
+ provider=provider,
+ after=after,
+ after_id=after_id,
+ before_id=before_id,
+ order=order,
)
req = self._build_request(
@@ -139,6 +154,11 @@ def next_func() -> Optional[operations.ListFilesResponse]:
limit=limit,
cursor=next_cursor,
workspace_id=workspace_id,
+ provider=provider,
+ after=after,
+ after_id=after_id,
+ before_id=before_id,
+ order=order,
retries=retries,
server_url=server_url,
timeout_ms=timeout_ms,
@@ -161,6 +181,11 @@ def next_func() -> Optional[operations.ListFilesResponse]:
errors.UnauthorizedResponseErrorData, http_res
)
raise errors.UnauthorizedResponseError(response_data, http_res)
+ if utils.match_response(http_res, "403", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ForbiddenResponseErrorData, http_res
+ )
+ raise errors.ForbiddenResponseError(response_data, http_res)
if utils.match_response(http_res, "429", "application/json"):
response_data = unmarshal_json_response(
errors.TooManyRequestsResponseErrorData, http_res
@@ -171,6 +196,16 @@ def next_func() -> Optional[operations.ListFilesResponse]:
errors.InternalServerResponseErrorData, http_res
)
raise errors.InternalServerResponseError(response_data, http_res)
+ if utils.match_response(http_res, "502", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res)
+ if utils.match_response(http_res, "503", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res
+ )
+ raise errors.ServiceUnavailableResponseError(response_data, http_res)
if utils.match_response(http_res, "4XX", "*"):
http_res_text = utils.stream_to_text(http_res)
raise errors.OpenRouterDefaultError(
@@ -193,6 +228,11 @@ async def list_async(
limit: Optional[int] = None,
cursor: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
+ after: Optional[str] = None,
+ after_id: Optional[str] = None,
+ before_id: Optional[str] = None,
+ order: Optional[operations.Order] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -212,6 +252,11 @@ async def list_async(
:param limit: Maximum number of files to return (1–1000).
:param cursor: Opaque pagination cursor from a previous response.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
+ :param after: OpenAI-style forward cursor: the id to list after.
+ :param after_id: Anthropic-style forward cursor: the id to list after.
+ :param before_id: Anthropic-style reverse cursor. Not supported by OpenRouter storage.
+ :param order: Sort direction. Only `asc` is supported by OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -234,6 +279,11 @@ async def list_async(
limit=limit,
cursor=cursor,
workspace_id=workspace_id,
+ provider=provider,
+ after=after,
+ after_id=after_id,
+ before_id=before_id,
+ order=order,
)
req = self._build_request_async(
@@ -312,6 +362,11 @@ async def empty_result():
limit=limit,
cursor=next_cursor,
workspace_id=workspace_id,
+ provider=provider,
+ after=after,
+ after_id=after_id,
+ before_id=before_id,
+ order=order,
retries=retries,
server_url=server_url,
timeout_ms=timeout_ms,
@@ -334,6 +389,11 @@ async def empty_result():
errors.UnauthorizedResponseErrorData, http_res
)
raise errors.UnauthorizedResponseError(response_data, http_res)
+ if utils.match_response(http_res, "403", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ForbiddenResponseErrorData, http_res
+ )
+ raise errors.ForbiddenResponseError(response_data, http_res)
if utils.match_response(http_res, "429", "application/json"):
response_data = unmarshal_json_response(
errors.TooManyRequestsResponseErrorData, http_res
@@ -344,6 +404,16 @@ async def empty_result():
errors.InternalServerResponseErrorData, http_res
)
raise errors.InternalServerResponseError(response_data, http_res)
+ if utils.match_response(http_res, "502", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res)
+ if utils.match_response(http_res, "503", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res
+ )
+ raise errors.ServiceUnavailableResponseError(response_data, http_res)
if utils.match_response(http_res, "4XX", "*"):
http_res_text = await utils.stream_to_text_async(http_res)
raise errors.OpenRouterDefaultError(
@@ -365,11 +435,12 @@ def upload(
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
http_headers: Optional[Mapping[str, str]] = None,
- ) -> components.FileMetadata:
+ ) -> components.FileResponse:
r"""Upload a file
Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB.
@@ -383,6 +454,7 @@ def upload(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -403,6 +475,7 @@ def upload(
x_open_router_title=x_open_router_title,
x_open_router_categories=x_open_router_categories,
workspace_id=workspace_id,
+ provider=provider,
request_body=operations.UploadFileRequestBody(
file=utils.get_pydantic_model(file, operations.UploadFileFile),
),
@@ -468,7 +541,7 @@ def upload(
response_data: Any = None
if utils.match_response(http_res, "200", "application/json"):
- return unmarshal_json_response(components.FileMetadata, http_res)
+ return unmarshal_json_response(components.FileResponse, http_res)
if utils.match_response(http_res, "400", "application/json"):
response_data = unmarshal_json_response(
errors.BadRequestResponseErrorData, http_res
@@ -499,6 +572,16 @@ def upload(
errors.InternalServerResponseErrorData, http_res
)
raise errors.InternalServerResponseError(response_data, http_res)
+ if utils.match_response(http_res, "502", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res)
+ if utils.match_response(http_res, "503", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res
+ )
+ raise errors.ServiceUnavailableResponseError(response_data, http_res)
if utils.match_response(http_res, "4XX", "*"):
http_res_text = utils.stream_to_text(http_res)
raise errors.OpenRouterDefaultError(
@@ -520,11 +603,12 @@ async def upload_async(
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
http_headers: Optional[Mapping[str, str]] = None,
- ) -> components.FileMetadata:
+ ) -> components.FileResponse:
r"""Upload a file
Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB.
@@ -538,6 +622,7 @@ async def upload_async(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -558,6 +643,7 @@ async def upload_async(
x_open_router_title=x_open_router_title,
x_open_router_categories=x_open_router_categories,
workspace_id=workspace_id,
+ provider=provider,
request_body=operations.UploadFileRequestBody(
file=utils.get_pydantic_model(file, operations.UploadFileFile),
),
@@ -623,7 +709,7 @@ async def upload_async(
response_data: Any = None
if utils.match_response(http_res, "200", "application/json"):
- return unmarshal_json_response(components.FileMetadata, http_res)
+ return unmarshal_json_response(components.FileResponse, http_res)
if utils.match_response(http_res, "400", "application/json"):
response_data = unmarshal_json_response(
errors.BadRequestResponseErrorData, http_res
@@ -654,6 +740,16 @@ async def upload_async(
errors.InternalServerResponseErrorData, http_res
)
raise errors.InternalServerResponseError(response_data, http_res)
+ if utils.match_response(http_res, "502", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res)
+ if utils.match_response(http_res, "503", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res
+ )
+ raise errors.ServiceUnavailableResponseError(response_data, http_res)
if utils.match_response(http_res, "4XX", "*"):
http_res_text = await utils.stream_to_text_async(http_res)
raise errors.OpenRouterDefaultError(
@@ -675,6 +771,7 @@ def delete(
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -693,6 +790,7 @@ def delete(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -714,6 +812,7 @@ def delete(
x_open_router_categories=x_open_router_categories,
file_id=file_id,
workspace_id=workspace_id,
+ provider=provider,
)
req = self._build_request(
@@ -775,6 +874,11 @@ def delete(
errors.UnauthorizedResponseErrorData, http_res
)
raise errors.UnauthorizedResponseError(response_data, http_res)
+ if utils.match_response(http_res, "403", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ForbiddenResponseErrorData, http_res
+ )
+ raise errors.ForbiddenResponseError(response_data, http_res)
if utils.match_response(http_res, "404", "application/json"):
response_data = unmarshal_json_response(
errors.NotFoundResponseErrorData, http_res
@@ -790,6 +894,16 @@ def delete(
errors.InternalServerResponseErrorData, http_res
)
raise errors.InternalServerResponseError(response_data, http_res)
+ if utils.match_response(http_res, "502", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res)
+ if utils.match_response(http_res, "503", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res
+ )
+ raise errors.ServiceUnavailableResponseError(response_data, http_res)
if utils.match_response(http_res, "4XX", "*"):
http_res_text = utils.stream_to_text(http_res)
raise errors.OpenRouterDefaultError(
@@ -811,6 +925,7 @@ async def delete_async(
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -829,6 +944,7 @@ async def delete_async(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -850,6 +966,7 @@ async def delete_async(
x_open_router_categories=x_open_router_categories,
file_id=file_id,
workspace_id=workspace_id,
+ provider=provider,
)
req = self._build_request_async(
@@ -911,6 +1028,11 @@ async def delete_async(
errors.UnauthorizedResponseErrorData, http_res
)
raise errors.UnauthorizedResponseError(response_data, http_res)
+ if utils.match_response(http_res, "403", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ForbiddenResponseErrorData, http_res
+ )
+ raise errors.ForbiddenResponseError(response_data, http_res)
if utils.match_response(http_res, "404", "application/json"):
response_data = unmarshal_json_response(
errors.NotFoundResponseErrorData, http_res
@@ -926,6 +1048,16 @@ async def delete_async(
errors.InternalServerResponseErrorData, http_res
)
raise errors.InternalServerResponseError(response_data, http_res)
+ if utils.match_response(http_res, "502", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res)
+ if utils.match_response(http_res, "503", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res
+ )
+ raise errors.ServiceUnavailableResponseError(response_data, http_res)
if utils.match_response(http_res, "4XX", "*"):
http_res_text = await utils.stream_to_text_async(http_res)
raise errors.OpenRouterDefaultError(
@@ -947,11 +1079,12 @@ def retrieve(
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
http_headers: Optional[Mapping[str, str]] = None,
- ) -> components.FileMetadata:
+ ) -> components.FileResponse:
r"""Get file metadata
Retrieves metadata for a single file owned by the requesting workspace.
@@ -965,6 +1098,7 @@ def retrieve(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -986,6 +1120,7 @@ def retrieve(
x_open_router_categories=x_open_router_categories,
file_id=file_id,
workspace_id=workspace_id,
+ provider=provider,
)
req = self._build_request(
@@ -1041,12 +1176,17 @@ def retrieve(
response_data: Any = None
if utils.match_response(http_res, "200", "application/json"):
- return unmarshal_json_response(components.FileMetadata, http_res)
+ return unmarshal_json_response(components.FileResponse, http_res)
if utils.match_response(http_res, "401", "application/json"):
response_data = unmarshal_json_response(
errors.UnauthorizedResponseErrorData, http_res
)
raise errors.UnauthorizedResponseError(response_data, http_res)
+ if utils.match_response(http_res, "403", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ForbiddenResponseErrorData, http_res
+ )
+ raise errors.ForbiddenResponseError(response_data, http_res)
if utils.match_response(http_res, "404", "application/json"):
response_data = unmarshal_json_response(
errors.NotFoundResponseErrorData, http_res
@@ -1062,6 +1202,16 @@ def retrieve(
errors.InternalServerResponseErrorData, http_res
)
raise errors.InternalServerResponseError(response_data, http_res)
+ if utils.match_response(http_res, "502", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res)
+ if utils.match_response(http_res, "503", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res
+ )
+ raise errors.ServiceUnavailableResponseError(response_data, http_res)
if utils.match_response(http_res, "4XX", "*"):
http_res_text = utils.stream_to_text(http_res)
raise errors.OpenRouterDefaultError(
@@ -1083,11 +1233,12 @@ async def retrieve_async(
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
http_headers: Optional[Mapping[str, str]] = None,
- ) -> components.FileMetadata:
+ ) -> components.FileResponse:
r"""Get file metadata
Retrieves metadata for a single file owned by the requesting workspace.
@@ -1101,6 +1252,7 @@ async def retrieve_async(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -1122,6 +1274,7 @@ async def retrieve_async(
x_open_router_categories=x_open_router_categories,
file_id=file_id,
workspace_id=workspace_id,
+ provider=provider,
)
req = self._build_request_async(
@@ -1177,12 +1330,17 @@ async def retrieve_async(
response_data: Any = None
if utils.match_response(http_res, "200", "application/json"):
- return unmarshal_json_response(components.FileMetadata, http_res)
+ return unmarshal_json_response(components.FileResponse, http_res)
if utils.match_response(http_res, "401", "application/json"):
response_data = unmarshal_json_response(
errors.UnauthorizedResponseErrorData, http_res
)
raise errors.UnauthorizedResponseError(response_data, http_res)
+ if utils.match_response(http_res, "403", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ForbiddenResponseErrorData, http_res
+ )
+ raise errors.ForbiddenResponseError(response_data, http_res)
if utils.match_response(http_res, "404", "application/json"):
response_data = unmarshal_json_response(
errors.NotFoundResponseErrorData, http_res
@@ -1198,6 +1356,16 @@ async def retrieve_async(
errors.InternalServerResponseErrorData, http_res
)
raise errors.InternalServerResponseError(response_data, http_res)
+ if utils.match_response(http_res, "502", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res)
+ if utils.match_response(http_res, "503", "application/json"):
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res
+ )
+ raise errors.ServiceUnavailableResponseError(response_data, http_res)
if utils.match_response(http_res, "4XX", "*"):
http_res_text = await utils.stream_to_text_async(http_res)
raise errors.OpenRouterDefaultError(
@@ -1219,6 +1387,7 @@ def download(
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -1237,6 +1406,7 @@ def download(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -1258,6 +1428,7 @@ def download(
x_open_router_categories=x_open_router_categories,
file_id=file_id,
workspace_id=workspace_id,
+ provider=provider,
)
req = self._build_request(
@@ -1329,6 +1500,12 @@ def download(
raise errors.UnauthorizedResponseError(
response_data, http_res, http_res_text
)
+ if utils.match_response(http_res, "403", "application/json"):
+ http_res_text = utils.stream_to_text(http_res)
+ response_data = unmarshal_json_response(
+ errors.ForbiddenResponseErrorData, http_res, http_res_text
+ )
+ raise errors.ForbiddenResponseError(response_data, http_res, http_res_text)
if utils.match_response(http_res, "404", "application/json"):
http_res_text = utils.stream_to_text(http_res)
response_data = unmarshal_json_response(
@@ -1351,6 +1528,20 @@ def download(
raise errors.InternalServerResponseError(
response_data, http_res, http_res_text
)
+ if utils.match_response(http_res, "502", "application/json"):
+ http_res_text = utils.stream_to_text(http_res)
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res, http_res_text
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res, http_res_text)
+ if utils.match_response(http_res, "503", "application/json"):
+ http_res_text = utils.stream_to_text(http_res)
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res, http_res_text
+ )
+ raise errors.ServiceUnavailableResponseError(
+ response_data, http_res, http_res_text
+ )
if utils.match_response(http_res, "4XX", "*"):
http_res_text = utils.stream_to_text(http_res)
raise errors.OpenRouterDefaultError(
@@ -1375,6 +1566,7 @@ async def download_async(
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
workspace_id: Optional[str] = None,
+ provider: Optional[components.FileProvider] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -1393,6 +1585,7 @@ async def download_async(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param workspace_id: Workspace to scope the request to. Defaults to the caller’s default workspace.
+ :param provider: Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -1414,6 +1607,7 @@ async def download_async(
x_open_router_categories=x_open_router_categories,
file_id=file_id,
workspace_id=workspace_id,
+ provider=provider,
)
req = self._build_request_async(
@@ -1485,6 +1679,12 @@ async def download_async(
raise errors.UnauthorizedResponseError(
response_data, http_res, http_res_text
)
+ if utils.match_response(http_res, "403", "application/json"):
+ http_res_text = await utils.stream_to_text_async(http_res)
+ response_data = unmarshal_json_response(
+ errors.ForbiddenResponseErrorData, http_res, http_res_text
+ )
+ raise errors.ForbiddenResponseError(response_data, http_res, http_res_text)
if utils.match_response(http_res, "404", "application/json"):
http_res_text = await utils.stream_to_text_async(http_res)
response_data = unmarshal_json_response(
@@ -1507,6 +1707,20 @@ async def download_async(
raise errors.InternalServerResponseError(
response_data, http_res, http_res_text
)
+ if utils.match_response(http_res, "502", "application/json"):
+ http_res_text = await utils.stream_to_text_async(http_res)
+ response_data = unmarshal_json_response(
+ errors.BadGatewayResponseErrorData, http_res, http_res_text
+ )
+ raise errors.BadGatewayResponseError(response_data, http_res, http_res_text)
+ if utils.match_response(http_res, "503", "application/json"):
+ http_res_text = await utils.stream_to_text_async(http_res)
+ response_data = unmarshal_json_response(
+ errors.ServiceUnavailableResponseErrorData, http_res, http_res_text
+ )
+ raise errors.ServiceUnavailableResponseError(
+ response_data, http_res, http_res_text
+ )
if utils.match_response(http_res, "4XX", "*"):
http_res_text = await utils.stream_to_text_async(http_res)
raise errors.OpenRouterDefaultError(
diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py
index 95999d26..1044a7cf 100644
--- a/src/openrouter/operations/__init__.py
+++ b/src/openrouter/operations/__init__.py
@@ -497,6 +497,7 @@
ListFilesRequestTypedDict,
ListFilesResponse,
ListFilesResponseTypedDict,
+ Order,
)
from .listgenerationcontent import (
ListGenerationContentGlobals,
@@ -1247,6 +1248,7 @@
"Operator",
"OperatorName",
"OperatorTypedDict",
+ "Order",
"OrderBy",
"OrderByTypedDict",
"Period",
@@ -1719,6 +1721,7 @@
"ListFilesRequestTypedDict": ".listfiles",
"ListFilesResponse": ".listfiles",
"ListFilesResponseTypedDict": ".listfiles",
+ "Order": ".listfiles",
"ListGenerationContentGlobals": ".listgenerationcontent",
"ListGenerationContentGlobalsTypedDict": ".listgenerationcontent",
"ListGenerationContentRequest": ".listgenerationcontent",
diff --git a/src/openrouter/operations/deletefile.py b/src/openrouter/operations/deletefile.py
index ea64b3b8..846f9c41 100644
--- a/src/openrouter/operations/deletefile.py
+++ b/src/openrouter/operations/deletefile.py
@@ -1,6 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
+from openrouter.components import fileprovider as components_fileprovider
from openrouter.types import BaseModel, UNSET_SENTINEL
from openrouter.utils import (
FieldMetadata,
@@ -95,6 +96,8 @@ class DeleteFileRequestTypedDict(TypedDict):
"""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: NotRequired[components_fileprovider.FileProvider]
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
class DeleteFileRequest(BaseModel):
@@ -136,6 +139,12 @@ class DeleteFileRequest(BaseModel):
] = None
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: Annotated[
+ Optional[components_fileprovider.FileProvider],
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
+ ] = None
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
+
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
@@ -144,6 +153,7 @@ def serialize_model(self, handler):
"X-OpenRouter-Title",
"X-OpenRouter-Categories",
"workspace_id",
+ "provider",
]
)
serialized = handler(self)
diff --git a/src/openrouter/operations/downloadfilecontent.py b/src/openrouter/operations/downloadfilecontent.py
index 8da6ef05..47e67150 100644
--- a/src/openrouter/operations/downloadfilecontent.py
+++ b/src/openrouter/operations/downloadfilecontent.py
@@ -1,6 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
+from openrouter.components import fileprovider as components_fileprovider
from openrouter.types import BaseModel, UNSET_SENTINEL
from openrouter.utils import (
FieldMetadata,
@@ -95,6 +96,8 @@ class DownloadFileContentRequestTypedDict(TypedDict):
"""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: NotRequired[components_fileprovider.FileProvider]
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
class DownloadFileContentRequest(BaseModel):
@@ -136,6 +139,12 @@ class DownloadFileContentRequest(BaseModel):
] = None
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: Annotated[
+ Optional[components_fileprovider.FileProvider],
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
+ ] = None
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
+
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
@@ -144,6 +153,7 @@ def serialize_model(self, handler):
"X-OpenRouter-Title",
"X-OpenRouter-Categories",
"workspace_id",
+ "provider",
]
)
serialized = handler(self)
diff --git a/src/openrouter/operations/getfilemetadata.py b/src/openrouter/operations/getfilemetadata.py
index 4614554b..2aaecb55 100644
--- a/src/openrouter/operations/getfilemetadata.py
+++ b/src/openrouter/operations/getfilemetadata.py
@@ -1,6 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
+from openrouter.components import fileprovider as components_fileprovider
from openrouter.types import BaseModel, UNSET_SENTINEL
from openrouter.utils import (
FieldMetadata,
@@ -95,6 +96,8 @@ class GetFileMetadataRequestTypedDict(TypedDict):
"""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: NotRequired[components_fileprovider.FileProvider]
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
class GetFileMetadataRequest(BaseModel):
@@ -136,6 +139,12 @@ class GetFileMetadataRequest(BaseModel):
] = None
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: Annotated[
+ Optional[components_fileprovider.FileProvider],
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
+ ] = None
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
+
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
@@ -144,6 +153,7 @@ def serialize_model(self, handler):
"X-OpenRouter-Title",
"X-OpenRouter-Categories",
"workspace_id",
+ "provider",
]
)
serialized = handler(self)
diff --git a/src/openrouter/operations/listfiles.py b/src/openrouter/operations/listfiles.py
index 75fdf629..624ca31c 100644
--- a/src/openrouter/operations/listfiles.py
+++ b/src/openrouter/operations/listfiles.py
@@ -1,12 +1,15 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
-from openrouter.components import filelistresponse as components_filelistresponse
-from openrouter.types import BaseModel, UNSET_SENTINEL
+from openrouter.components import (
+ filelistresponse as components_filelistresponse,
+ fileprovider as components_fileprovider,
+)
+from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
import pydantic
from pydantic import model_serializer
-from typing import Awaitable, Callable, Optional, Union
+from typing import Awaitable, Callable, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
@@ -74,6 +77,16 @@ def serialize_model(self, handler):
return m
+Order = Union[
+ Literal[
+ "asc",
+ "desc",
+ ],
+ UnrecognizedStr,
+]
+r"""Sort direction. Only `asc` is supported by OpenRouter storage."""
+
+
class ListFilesRequestTypedDict(TypedDict):
http_referer: NotRequired[str]
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
@@ -94,6 +107,16 @@ class ListFilesRequestTypedDict(TypedDict):
r"""Opaque pagination cursor from a previous response."""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: NotRequired[components_fileprovider.FileProvider]
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
+ after: NotRequired[str]
+ r"""OpenAI-style forward cursor: the id to list after."""
+ after_id: NotRequired[str]
+ r"""Anthropic-style forward cursor: the id to list after."""
+ before_id: NotRequired[str]
+ r"""Anthropic-style reverse cursor. Not supported by OpenRouter storage."""
+ order: NotRequired[Order]
+ r"""Sort direction. Only `asc` is supported by OpenRouter storage."""
class ListFilesRequest(BaseModel):
@@ -143,6 +166,36 @@ class ListFilesRequest(BaseModel):
] = None
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: Annotated[
+ Optional[components_fileprovider.FileProvider],
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
+ ] = None
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
+
+ after: Annotated[
+ Optional[str],
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
+ ] = None
+ r"""OpenAI-style forward cursor: the id to list after."""
+
+ after_id: Annotated[
+ Optional[str],
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
+ ] = None
+ r"""Anthropic-style forward cursor: the id to list after."""
+
+ before_id: Annotated[
+ Optional[str],
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
+ ] = None
+ r"""Anthropic-style reverse cursor. Not supported by OpenRouter storage."""
+
+ order: Annotated[
+ Optional[Order],
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
+ ] = None
+ r"""Sort direction. Only `asc` is supported by OpenRouter storage."""
+
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
@@ -153,6 +206,11 @@ def serialize_model(self, handler):
"limit",
"cursor",
"workspace_id",
+ "provider",
+ "after",
+ "after_id",
+ "before_id",
+ "order",
]
)
serialized = handler(self)
diff --git a/src/openrouter/operations/uploadfile.py b/src/openrouter/operations/uploadfile.py
index fa8f9261..19ee8e8e 100644
--- a/src/openrouter/operations/uploadfile.py
+++ b/src/openrouter/operations/uploadfile.py
@@ -2,6 +2,7 @@
from __future__ import annotations
import io
+from openrouter.components import fileprovider as components_fileprovider
from openrouter.types import BaseModel, UNSET_SENTINEL
from openrouter.utils import (
FieldMetadata,
@@ -147,6 +148,8 @@ class UploadFileRequestTypedDict(TypedDict):
"""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: NotRequired[components_fileprovider.FileProvider]
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
class UploadFileRequest(BaseModel):
@@ -189,6 +192,12 @@ class UploadFileRequest(BaseModel):
] = None
r"""Workspace to scope the request to. Defaults to the caller’s default workspace."""
+ provider: Annotated[
+ Optional[components_fileprovider.FileProvider],
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
+ ] = None
+ r"""Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage."""
+
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
@@ -197,6 +206,7 @@ def serialize_model(self, handler):
"X-OpenRouter-Title",
"X-OpenRouter-Categories",
"workspace_id",
+ "provider",
]
)
serialized = handler(self)
diff --git a/uv.lock b/uv.lock
index 66727e17..5e380a2d 100644
--- a/uv.lock
+++ b/uv.lock
@@ -213,7 +213,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.1.12"
+version = "1.1.13"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },