From 6494cfaaa26f4be3e1aa0d9db56da18cd7a6ab84 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 30 Oct 2026 00:02:43 +0000 Subject: [PATCH 1/2] =?UTF-8?q?##=20Python=20SDK=20Changes:=20*=20`open=5F?= =?UTF-8?q?router.analytics.query=5Fanalytics()`:=20=20`request`=20**Chang?= =?UTF-8?q?ed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .speakeasy/gen.lock | 279 +++++++++++------ .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 287 ++++++++++++------ .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- docs/components/classifierfiltersfilter.mdx | 18 ++ docs/components/classifierscalarfilter.mdx | 11 + .../classifierscalarfilteroperator.mdx | 22 ++ .../classifierscalarfiltervalue.mdx} | 5 +- docs/components/classifiersetfilter.mdx | 11 + .../classifiersetfilteroperator.mdx | 22 ++ .../classifiersetfiltervalue.mdx} | 2 +- docs/components/filter_.mdx | 18 ++ docs/components/imagegenerationrequest.mdx | 38 +-- docs/components/operator.mdx | 31 +- docs/components/operatorenum.mdx | 31 ++ .../operatorname.mdx | 2 +- docs/components/rule.mdx | 2 +- .../scalarfilter.mdx} | 13 +- docs/components/scalarfilteroperator.mdx | 26 ++ docs/components/scalarfiltervalue.mdx | 21 ++ docs/components/setfilter.mdx | 12 + docs/components/setfilteroperator.mdx | 22 ++ docs/components/setfiltervalue.mdx | 21 ++ docs/{operations => components}/valuetype.mdx | 2 +- docs/components/vaultsecretwriterequest.mdx | 2 +- docs/operations/classifierfilters.mdx | 2 +- docs/operations/classifierfiltersfilter.mdx | 11 - docs/operations/classifierfiltersvalue.mdx | 27 -- .../deleteinternvaultsecretrequest.mdx | 2 +- docs/operations/deletevaultsecretrequest.mdx | 2 +- docs/operations/getanalyticsmetadata.mdx | 2 +- docs/operations/granularity.mdx | 8 +- .../{granularityname.mdx => name.mdx} | 6 +- docs/operations/operator.mdx | 10 - docs/operations/queryanalyticsrequestbody.mdx | 2 +- docs/operations/value1.mdx | 27 -- docs/sdks/analytics/README.mdx | 2 +- docs/sdks/images/README.mdx | 46 +-- docs/sdks/vault/README.mdx | 8 +- pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/analytics.py | 8 +- src/openrouter/components/__init__.py | 94 +++++- .../components/classifierfiltersfilter.py | 21 ++ .../components/classifierscalarfilter.py | 39 +++ .../classifierscalarfilteroperator.py | 15 + .../components/classifiersetfilter.py | 35 +++ .../components/classifiersetfilteroperator.py | 15 + src/openrouter/components/filter_.py | 15 + .../components/imagegenerationrequest.py | 8 +- .../observabilityfilterrulegroup.py | 6 +- src/openrouter/components/operator.py | 47 +++ src/openrouter/components/scalarfilter.py | 37 +++ .../components/scalarfilteroperator.py | 19 ++ src/openrouter/components/setfilter.py | 55 ++++ .../components/setfilteroperator.py | 15 + .../components/vaultsecretwriterequest.py | 4 +- src/openrouter/images.py | 32 +- src/openrouter/operations/__init__.py | 54 +--- .../operations/deleteinternvaultsecret.py | 4 +- .../operations/deletevaultsecret.py | 4 +- src/openrouter/operations/getanalyticsmeta.py | 52 +--- src/openrouter/operations/queryanalytics.py | 112 +------ src/openrouter/vault.py | 16 +- uv.lock | 2 +- 66 files changed, 1164 insertions(+), 628 deletions(-) create mode 100644 docs/components/classifierfiltersfilter.mdx create mode 100644 docs/components/classifierscalarfilter.mdx create mode 100644 docs/components/classifierscalarfilteroperator.mdx rename docs/{operations/valueclassifierfilters.mdx => components/classifierscalarfiltervalue.mdx} (65%) create mode 100644 docs/components/classifiersetfilter.mdx create mode 100644 docs/components/classifiersetfilteroperator.mdx rename docs/{operations/value2.mdx => components/classifiersetfiltervalue.mdx} (81%) create mode 100644 docs/components/filter_.mdx create mode 100644 docs/components/operatorenum.mdx rename docs/{operations => components}/operatorname.mdx (88%) rename docs/{operations/filter_.mdx => components/scalarfilter.mdx} (67%) create mode 100644 docs/components/scalarfilteroperator.mdx create mode 100644 docs/components/scalarfiltervalue.mdx create mode 100644 docs/components/setfilter.mdx create mode 100644 docs/components/setfilteroperator.mdx create mode 100644 docs/components/setfiltervalue.mdx rename docs/{operations => components}/valuetype.mdx (87%) delete mode 100644 docs/operations/classifierfiltersfilter.mdx delete mode 100644 docs/operations/classifierfiltersvalue.mdx rename docs/operations/{granularityname.mdx => name.mdx} (71%) delete mode 100644 docs/operations/operator.mdx delete mode 100644 docs/operations/value1.mdx create mode 100644 src/openrouter/components/classifierfiltersfilter.py create mode 100644 src/openrouter/components/classifierscalarfilter.py create mode 100644 src/openrouter/components/classifierscalarfilteroperator.py create mode 100644 src/openrouter/components/classifiersetfilter.py create mode 100644 src/openrouter/components/classifiersetfilteroperator.py create mode 100644 src/openrouter/components/filter_.py create mode 100644 src/openrouter/components/operator.py create mode 100644 src/openrouter/components/scalarfilter.py create mode 100644 src/openrouter/components/scalarfilteroperator.py create mode 100644 src/openrouter/components/setfilter.py create mode 100644 src/openrouter/components/setfilteroperator.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 36362f266..ffbc41b1f 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: 4404e70bf2386dde99635a700b2cb6b3 + docChecksum: bf7efebbd1334a05c1d10f0179e02638 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.96 - configChecksum: 322b8429a6ef3ce666a73239095e5385 + releaseVersion: 1.3.97 + configChecksum: 144876b9db2a6c6394375ec606f1c8e1 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 6488ed5b-6e07-472d-8d06-73ce5b9b4b5d - pristine_commit_hash: 0f6018fb2e036f393c7fb582101fb7910cc58387 - pristine_tree_hash: 050bf44de832952ab9a2f46c34ba3c47189f58a2 + generation_id: fb7705d3-ce5f-404f-ba0d-243370cdd3e2 + pristine_commit_hash: 8d60b162a4f57caa5b7d01b6fc8a6cbcf0455d7c + pristine_tree_hash: 20c9709ca0b5a07cd16df04f7a498bb8be745b1f features: python: acceptHeaders: 3.0.0 @@ -2234,6 +2234,34 @@ trackedFiles: id: 9a5f3d4dc85e last_write_checksum: sha1:caaf7b5e9d578c27e3347b6a74151450df7b979b pristine_git_object: 262286806c125e7b4e306e43f29f964459157382 + docs/components/classifierfiltersfilter.mdx: + id: 256440334d98 + last_write_checksum: sha1:7ee587401d2767ed7fd73354e961c8db1bc3ebfa + pristine_git_object: 1b7f00e8af74a91c41a68e5538aa2627ef36d8bc + docs/components/classifierscalarfilter.mdx: + id: d529c0390681 + last_write_checksum: sha1:b13dfb5d113aa8bb1bfe661205d54c6425c15704 + pristine_git_object: a7c6a74730150fc33e38531467ef7b445614a762 + docs/components/classifierscalarfilteroperator.mdx: + id: e72718994edf + last_write_checksum: sha1:e62b3d3e4178feced3ba4475558582cecc4911bb + pristine_git_object: 6b34924a4a7493070e2bf5a8306cac8afd96d314 + docs/components/classifierscalarfiltervalue.mdx: + id: 5210503dc7d6 + last_write_checksum: sha1:eb109b290469297f8756241ce94ef0947882223d + pristine_git_object: 01cc4ee5afac755f9ac62544c36ffa1a4d930c3f + docs/components/classifiersetfilter.mdx: + id: f27db008ffee + last_write_checksum: sha1:af79336e6395ec9a1eb25b52c1dd4852f37640ec + pristine_git_object: b821ac79947fdebe336cbd777b1f10dca13bc68d + docs/components/classifiersetfilteroperator.mdx: + id: 46d3f56ab4a5 + last_write_checksum: sha1:256f0b69cd86708abea6ef2a459080b27c00d62e + pristine_git_object: b1b28a9a551ba94cbfc52a9e30f4c634d1e93b22 + docs/components/classifiersetfiltervalue.mdx: + id: 19378437712b + last_write_checksum: sha1:c17234ed636e619877ea49da183c154bf5da5484 + pristine_git_object: bbaebfede32300bd4a1fbe57e6a09aebfab9a770 docs/components/cleartoolinputs.mdx: id: 4e474b90f4b7 last_write_checksum: sha1:383680c2c4a38d12044cbec51ba60afa28191e27 @@ -3266,6 +3294,10 @@ trackedFiles: id: 80a5415c1336 last_write_checksum: sha1:98b061b2d33ce279c3fdeac14b5c2360fe910ccc pristine_git_object: 87fc5863dd67cc33d4fa20e6c3ebb011fe1a235d + docs/components/filter_.mdx: + id: 0e851bc3315b + last_write_checksum: sha1:86a7f3feb78697e9c1b9c55103f776563806f105 + pristine_git_object: 35621a5055168d1dc1e44f5cc431ab09490ca62e docs/components/filters.mdx: id: eb61c97e25a7 last_write_checksum: sha1:40b9c398a5e1422b2d9f0250df5766323ae3e83c @@ -3720,8 +3752,8 @@ trackedFiles: pristine_git_object: bccd158982dba4b4ed810b98b5f7d4a6c04afaa7 docs/components/imagegenerationrequest.mdx: id: b093cb0f5e81 - last_write_checksum: sha1:3525767a1dc92565bacb46a5c69126d5e1ed72e3 - pristine_git_object: 18d32fa5ca563aebff19340c1234905132f6c9e9 + last_write_checksum: sha1:e959f62cf9d792b98fff4b9049397af6feffdfa0 + pristine_git_object: dd4b81c7691e25e1253570f1c26a4b4c9e0a93cc docs/components/imagegenerationrequestaspectratio.mdx: id: bda89377f32d last_write_checksum: sha1:58af560f1182c30c06f8d9413e9e7073038cdc99 @@ -5316,8 +5348,16 @@ trackedFiles: pristine_git_object: f130490926a4c7cd1676dacdabd9f21230194c73 docs/components/operator.mdx: id: f88a0ae3ee7d - last_write_checksum: sha1:196dfc00e44fa232c6e4f0f496f265a163ffe66b - pristine_git_object: b4df5fb4757522576e8452d88f22499cee204278 + last_write_checksum: sha1:f3e002c66a93f82012a3076d69f64c5096b324cb + pristine_git_object: c420c90945d27e4e838ed3bb56d322de1a84b450 + docs/components/operatorenum.mdx: + id: c07db61ea5d2 + last_write_checksum: sha1:a3a3b21a41ffe4a6b1d7831825d74defcb1b1e14 + pristine_git_object: 29cd518509f48b0b3a1656a5a42c282d4d27ecda + docs/components/operatorname.mdx: + id: 1a860ce02a19 + last_write_checksum: sha1:0632509d853cb3f0918a6f595241432b72366e0d + pristine_git_object: 1cc22734e712365d156d69c96820f06ba2b223a0 docs/components/oranthropicbashtoolresult.mdx: id: 3f208e7cd614 last_write_checksum: sha1:93f89f414dc924ae3440e93234e964bf3dd9d794 @@ -6772,8 +6812,20 @@ trackedFiles: pristine_git_object: 02852267fa52361a11f7732afe1e7818105196f0 docs/components/rule.mdx: id: 652b4ec56a02 - last_write_checksum: sha1:1ed5b4c6ac1089efd54341bc0f31d5cad26cfa4d - pristine_git_object: 508f3a7f5a0c4a036fdf083b5c48e99df1113251 + last_write_checksum: sha1:47f5888fd83bda5ac55389ee62a0c169f0bb483a + pristine_git_object: 12534180cdaf849a518397394dc9211c04173023 + docs/components/scalarfilter.mdx: + id: fe82695596c3 + last_write_checksum: sha1:17128639fe1189ebb0917fa1820de6e740ed3d5b + pristine_git_object: 9eea77dc84eeb876c1caa5188a4d66a1cb92c5dd + docs/components/scalarfilteroperator.mdx: + id: 9bcb57925f34 + last_write_checksum: sha1:b0736b4f004a79b56a94301c115f3053e4414f4b + pristine_git_object: 84711d6b243af91f08e6610161ce5794a882dbe2 + docs/components/scalarfiltervalue.mdx: + id: 4b983382548d + last_write_checksum: sha1:49a8b76b0dbb5db23d48a810d2038fee486ea5c7 + pristine_git_object: 2990666b8043c110aac529e0217e0d988e99ba80 docs/components/scimgroup.mdx: id: bc553f57b8ab last_write_checksum: sha1:768cf359184a60ded6ab1fc3a0b652c884e55381 @@ -6922,6 +6974,18 @@ trackedFiles: id: 6d7d7e41fc60 last_write_checksum: sha1:ccb8e78e56039dba98e6aff35000505b6ba0e9fc pristine_git_object: 71622f241763f3fb1d6974d0a38b8129db0c362c + docs/components/setfilter.mdx: + id: bf11f09be893 + last_write_checksum: sha1:6c14987f248141b4811214aa3b621a61e0f9cede + pristine_git_object: 0514c9cf197c69b970216533f5eb6599860f58f1 + docs/components/setfilteroperator.mdx: + id: a2529f8f6d79 + last_write_checksum: sha1:bfe4af8452d5368569d29badfc4fd9e6d49f7405 + pristine_git_object: 2d5068bff82640f3eb9b53e07d773580593c9df2 + docs/components/setfiltervalue.mdx: + id: a8e70d75bb37 + last_write_checksum: sha1:19f2647442ca5baef3416528e39a56d3569adb76 + pristine_git_object: 65e77725eef0c6d7cf76895493880fb2536988b1 docs/components/shadowedby.mdx: id: d9b334d895bf last_write_checksum: sha1:fc573e646e802d34cacbc9ded956e89c22eddea1 @@ -8006,6 +8070,10 @@ trackedFiles: id: 6737c84d8bbd last_write_checksum: sha1:c812def34024d0a22a1d50f449ae7be5b8850d52 pristine_git_object: affe6fee1f9b7264607cc187b9e2dd223b0e5838 + docs/components/valuetype.mdx: + id: 33007664668f + last_write_checksum: sha1:b851b017a8a572fa1ad619796f0258349cf6e6dc + pristine_git_object: a6a99bc12c1ce8eb711213ad91ff18832343a83e docs/components/variables.mdx: id: 3312b9777716 last_write_checksum: sha1:6ba9bb63173376b0dcb7ac22b859bfef3e3820eb @@ -8048,8 +8116,8 @@ trackedFiles: pristine_git_object: c023117829dbd37ff2339cd2733c805c41322445 docs/components/vaultsecretwriterequest.mdx: id: 8d1688364ae0 - last_write_checksum: sha1:458fc88ac488e6d604d591e3d2321bc35ba57b07 - pristine_git_object: 997936057859851e422fc61559a8c8f491f262a7 + last_write_checksum: sha1:f3a8dabe602ad81143302e4c2b12ef0c87c26a95 + pristine_git_object: 8571f480370ff088ea02fe1f7c1795b009280803 docs/components/verbosity.mdx: id: 8dacec626dda last_write_checksum: sha1:77a815930df06dc0c0534ad059e49368be46d94d @@ -8464,16 +8532,8 @@ trackedFiles: pristine_git_object: 7b0ca3b16fa5ffb64372d295bd65d8e7bfe2f005 docs/operations/classifierfilters.mdx: id: bf2b4d539ad0 - last_write_checksum: sha1:ab00e524e91d923b0be361490278db4f99f8b009 - pristine_git_object: f7fc5d6ae677356f1813db465db3a18e86f053fe - docs/operations/classifierfiltersfilter.mdx: - id: 4c60b258249e - last_write_checksum: sha1:cff35161a86bfb8b00c8ead0800e3ee44dcd12f4 - pristine_git_object: 91b515f29f06bbe7813f90dd06d2cc328b394415 - docs/operations/classifierfiltersvalue.mdx: - id: 0701a4bb73c4 - last_write_checksum: sha1:077df057506e544243ecc2e6ab055cadee049035 - pristine_git_object: 47e7dc4e537b1c7392c04f36a7c6c8f45847ee29 + last_write_checksum: sha1:e85f7cb32b6cf92a993f1fb472f71bf5593a0aee + pristine_git_object: 91ffad70186d34bf8103f1988bdbdd258e1cfbfb docs/operations/content.mdx: id: 6f64feb2d798 last_write_checksum: sha1:329d9719c9e25478666963df7b79710aa626d988 @@ -8848,8 +8908,8 @@ trackedFiles: pristine_git_object: 2be53f3baf9230d36c063d2af5bbe8c3e43c0b8e docs/operations/deleteinternvaultsecretrequest.mdx: id: 665a068f6d79 - last_write_checksum: sha1:e639048ff9af68c4197d4fce111d9921d3c2cb41 - pristine_git_object: a564cf90a3d48b94fadda85cc1b92f167138ef76 + last_write_checksum: sha1:7b65de82cf0191790fd0adb4a0400f881fb307a3 + pristine_git_object: 2f3ca02c9a0b439a743cea9a1cc201fc543a78ba docs/operations/deletekeysglobals.mdx: id: fd6447706ee1 last_write_checksum: sha1:367073ebb289671441b50b397a0b790dc8a5c0af @@ -8908,8 +8968,8 @@ trackedFiles: pristine_git_object: c6c4e88b1d9d4078129fc591275b1f220224e74c docs/operations/deletevaultsecretrequest.mdx: id: 1bc3371915d0 - last_write_checksum: sha1:f621faa5690957460386c0f20a6bebe9e0781c88 - pristine_git_object: 08b8f8f6e97ffa4165373fe1f3ec3a5fcb34a21c + last_write_checksum: sha1:66658094f806601b3f7dba4eaa158f0f7844b45e + pristine_git_object: c378b120fd4514f232eb1295e631ce5f6bace848 docs/operations/deleteworkspacebudgetglobals.mdx: id: c1b4f6dabfee last_write_checksum: sha1:e65b08b6711e21da4db4e3d33f66ee3696944d78 @@ -9022,14 +9082,10 @@ trackedFiles: id: d59b0279f5bf last_write_checksum: sha1:affed3d5a7a7836b86f2a1d08b91d27dc3a339a9 pristine_git_object: 6db632a69c936d370ba30706b7af866d46c86342 - docs/operations/filter_.mdx: - id: 79b9c7c02d3b - last_write_checksum: sha1:9684f56fef7f0618f0d04f7e9466eb1d26d960d9 - pristine_git_object: 1472b37b7eba04a10b7823b2177940c87beeac02 docs/operations/getanalyticsmetadata.mdx: id: 7c66572b759d - last_write_checksum: sha1:4bea8ee1e4991dd352fe3ec8a01c497c918790ac - pristine_git_object: 35590a7d44bdcf4012d5bf329255378e4fae1064 + last_write_checksum: sha1:44fd50ddc12b6437003661e942b56121a51bb4ee + pristine_git_object: 1cef92eb6c2a9d28765bdf75383c28bf63736d12 docs/operations/getanalyticsmetaglobals.mdx: id: 8bafe89a1a85 last_write_checksum: sha1:306ad5f4d61368b6212ca44fb7eb6b4136137b40 @@ -9356,12 +9412,8 @@ trackedFiles: pristine_git_object: fac536b909f7247003819c59d6ea7bfde336e618 docs/operations/granularity.mdx: id: 2506cdfb4560 - last_write_checksum: sha1:ffec588cb5955b2408e18550a6590ded6f326975 - pristine_git_object: d7d4230727ef19deebb9548e2ade69f2f03f5a13 - docs/operations/granularityname.mdx: - id: 94405df5bc6d - last_write_checksum: sha1:8411fa2c4566737be150bf3d64bb792f0a3eb650 - pristine_git_object: 9d6dfd531f49a6b16998c97e5749cf4ea761dd94 + last_write_checksum: sha1:e901aaa216fc1c3ae0aaa9293f50121cb476670e + pristine_git_object: 0ad551f769082f797b8363d9bb3c7e97c8e9e48d docs/operations/groupby.mdx: id: 5c9addfe5341 last_write_checksum: sha1:f07eaef53c2338de9c74f947eb8e98875d7dfdd9 @@ -9850,6 +9902,10 @@ trackedFiles: id: b6e20b489278 last_write_checksum: sha1:7914d5e12a4b5a623f277722ae09e1e27d7d6a08 pristine_git_object: 63f8e9856e57d9736628dcd45b24b6c5646f4a35 + docs/operations/name.mdx: + id: d365c8e35a30 + last_write_checksum: sha1:eee529c9a21f3548d92211ceff8470216e0bd256 + pristine_git_object: 6cbc2d707b7eb01cd00d6ab8a91b7d731b69d492 docs/operations/object.mdx: id: 6fa1fcf5620b last_write_checksum: sha1:3727111f1223b76f5a9f21c89fba6c59ea31d428 @@ -9858,14 +9914,6 @@ trackedFiles: id: 7b3f50b8bbce last_write_checksum: sha1:117a05f19125765347ad14820ef173667a7b681b pristine_git_object: cd96e8c7a7669ec2320a1672eb70aedd7b5a17ef - docs/operations/operator.mdx: - id: 20ee6b4b086c - last_write_checksum: sha1:0c6cb5f4f626a1f6be3ab5ad40e32bbf488521ce - pristine_git_object: 72095eea815aa20696c480ac551718970e0dc5e8 - docs/operations/operatorname.mdx: - id: cd9b4abc3c86 - last_write_checksum: sha1:80ba4042763e10684eebd2c8da7ea75416cd15f7 - pristine_git_object: 8acee540065370db1e6eb01bfa0b044a603e2fd6 docs/operations/order.mdx: id: 68bcbfae42c2 last_write_checksum: sha1:1c11e84b0517b74ed96d801a54c929c5b178c539 @@ -9912,8 +9960,8 @@ trackedFiles: pristine_git_object: 5111d4142ba2b4e1113f98b47e00d53e77176dd7 docs/operations/queryanalyticsrequestbody.mdx: id: 1b8d33b6ac1b - last_write_checksum: sha1:9a5f829e715dbfb7d320f4450fafb923b0190f10 - pristine_git_object: 71359d67e553762769cb94b32a7880632e2686b6 + last_write_checksum: sha1:05657894920bc680a58bc99693c0c1509c431d9b + pristine_git_object: 09d27e7e5cc92be736a3db295a77c417e9b7b682 docs/operations/queryanalyticsresponse.mdx: id: 26c4b637ce33 last_write_checksum: sha1:df7654f3f2086a50e9f8b56aeb1ba1a54d8c89ef @@ -10166,22 +10214,6 @@ trackedFiles: id: 11e224cdab3c last_write_checksum: sha1:6166c87ba26da5ef5f754195074264bf466d85e1 pristine_git_object: bffe0e5d76aac876860b6e3be42a9ebecf40e871 - docs/operations/value1.mdx: - id: 447e93c2bc33 - last_write_checksum: sha1:7bd609444ab271023bd5496797ec18383fd2670d - pristine_git_object: 329fc8cb9f8922893a29848212bc2a41c31d2835 - docs/operations/value2.mdx: - id: ebf32fddf22e - last_write_checksum: sha1:18f440dbfdcb2498771fe53a98b054d4d76f283c - pristine_git_object: f72dd54a6f1db3e758a924691b07ec17f38bc01e - docs/operations/valueclassifierfilters.mdx: - id: 258cd046e559 - last_write_checksum: sha1:013f0a03f199fa6d2b2a256acd8af403fdd51c5a - pristine_git_object: 9280541b880980bbf528c00ea7c3eb3cc7b4f54c - docs/operations/valuetype.mdx: - id: 29a8210305d2 - last_write_checksum: sha1:5ea5c9a100089970356c552e3d9792c6657d0143 - pristine_git_object: 87a439af5a321a5133bcbe2e5cb5b15ca45a8e7d docs/operations/window.mdx: id: cdb33aa5c15a last_write_checksum: sha1:36234c180ece9d264d313db08936d040af86cb8f @@ -10192,8 +10224,8 @@ trackedFiles: pristine_git_object: f265978fdb338b412232349476bf1e874833c9f8 docs/sdks/analytics/README.mdx: id: 281aa5320be1 - last_write_checksum: sha1:75a919fe85f63e8004d26cca6245c767d9e4381c - pristine_git_object: 45489cdc2cda64d91f80f405a248cbdbf078bcd8 + last_write_checksum: sha1:43f108861cfaea86e8fa9984a6174d9fa4b7dc64 + pristine_git_object: 2cfd14c40ab962877968c79c6c958ea432a4f083 docs/sdks/apikeys/README.mdx: id: 27fcaae1c346 last_write_checksum: sha1:6142567ac9c61aecbccc8e177cf5486b15fc26dd @@ -10264,8 +10296,8 @@ trackedFiles: pristine_git_object: 2070c1e37b4c54161bd06d5bac7313c5030d3e45 docs/sdks/images/README.mdx: id: 534a6c102c4f - last_write_checksum: sha1:d8aaee6e0a4c15b49f2d323cbc93ad6d8b8326de - pristine_git_object: faf1c8eddb7c4dd6741db10f2c1bc1c279ded95a + last_write_checksum: sha1:9a94123859c352dbc08387e1ea59756fd0f347db + pristine_git_object: fa46dc09c893aadcb2c56921b973a019603010e1 docs/sdks/models/README.mdx: id: 58f1ca464e0b last_write_checksum: sha1:38f37d2391b43875af1434037061826f9f00d10c @@ -10328,8 +10360,8 @@ trackedFiles: pristine_git_object: 7a8a90fa57464364c2072ee857fe7070b4a62ba7 docs/sdks/vault/README.mdx: id: 3738c6722acd - last_write_checksum: sha1:4688ae4e0f11468b5cd1f1eb443e19c3b06a6861 - pristine_git_object: 4b397ebbe2bb430363f1cabddb195da2fbdb2098 + last_write_checksum: sha1:290b439ff730b9eabf4a6ef93737d1c61006b0fa + pristine_git_object: 63da02745c8b365676c3a049a527dc6964b1480b docs/sdks/videogeneration/README.mdx: id: 9a8fa04c3872 last_write_checksum: sha1:30ed7b9ca5b81dc78c655c832082cfcadc654af5 @@ -10344,8 +10376,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:42d993f11316b11379f1ee358baceddb7f10f24d - pristine_git_object: af8e076cf46eb077285a84765fd91bb4894e8b80 + last_write_checksum: sha1:8fad3cffe46f4d50ce3f0511b448b8109420f471 + pristine_git_object: 8b292d5ab165cd664d3d5b99e83a409a3c63bb95 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10372,16 +10404,16 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:36f39aac046e8eacc586ecdb2a975cca7a705577 - pristine_git_object: 035c1db1f1b17a739346236053f46069dbceb615 + last_write_checksum: sha1:dc0b44bcd636ba335341a17cb308842f88808a29 + pristine_git_object: 7efe4512397baf1d7f754381ec04f0f2ad8393d1 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a pristine_git_object: ae90121fa5d2d4bab7294f22f42d2251bce6690d src/openrouter/analytics.py: id: cb406b5aaabb - last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 - pristine_git_object: 9587309db4d5e25a00131a48788456139c25e4c0 + last_write_checksum: sha1:0ae5a0c89591d8bc3982d4e7c526a3ac66b7d845 + pristine_git_object: 0e567f3a37cc6aeb45a2551d0d500412e4b7796d src/openrouter/api_keys.py: id: 876fac88fff6 last_write_checksum: sha1:d1f1037e108264d868284f3fd867e1f36739fca3 @@ -10420,8 +10452,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:55547b25a2b110e7341b0a7526a0a2e5456b70f0 - pristine_git_object: 7ddf8fc900cfc9414fa6b106149ea5c10d7fbd0e + last_write_checksum: sha1:e278fd9116c324be177d7d66c415be9ee80632b0 + pristine_git_object: 5dc45660695b98d93b66093eab5d57d8bfc22335 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -11338,6 +11370,26 @@ trackedFiles: id: 13091b97a3f6 last_write_checksum: sha1:83e12cc51d69ec1ad7e3fab39d14c8606d6e9e77 pristine_git_object: 6a437157e04f64a44db854d68c55bc2e47e05cfc + src/openrouter/components/classifierfiltersfilter.py: + id: fccbd583dd7b + last_write_checksum: sha1:755720fc2e3dcd0e1a9a7e8402d2d60f2debdfdb + pristine_git_object: aa59c71bae8a2d8820be3f0d5bee59dc7775ebc8 + src/openrouter/components/classifierscalarfilter.py: + id: f29dd0000207 + last_write_checksum: sha1:18e3d2d0e40bd605c4df8232e7ff236f00084a5d + pristine_git_object: 093a1972e299a2d65a01fe79b1d43875f163faa5 + src/openrouter/components/classifierscalarfilteroperator.py: + id: 86e229696890 + last_write_checksum: sha1:e37f17856da53602db74b0031ee95d98ae77e044 + pristine_git_object: d832f6ac860983b42f20dd14bc11f18875109d52 + src/openrouter/components/classifiersetfilter.py: + id: 4b47266ddb4f + last_write_checksum: sha1:11ffa3c7ff62a21056ee3904772c74fb4cd73641 + pristine_git_object: 5d181bb4d16d21ebddbeb36dc45e6459eda080af + src/openrouter/components/classifiersetfilteroperator.py: + id: 96c684766d6d + last_write_checksum: sha1:6d547800e2b4fcdbed68f77804d888864da40fa0 + pristine_git_object: 449a67a205323a0638968eea258d6e01d25308cc src/openrouter/components/clientclosedrequestresponseerrordata.py: id: b1a795f24e24 last_write_checksum: sha1:7a4bf8b05ce68e676fb5812d48356c254567c46b @@ -11778,6 +11830,10 @@ trackedFiles: id: 8353a3e97cfc last_write_checksum: sha1:8cbb3c05f6f3304e3f54c0f8bfb8d11a0ac0cdc3 pristine_git_object: bca5442a696e2489662d71d5bd7e26fb4c0eaeaa + src/openrouter/components/filter_.py: + id: ef35ec2bbef4 + last_write_checksum: sha1:154d5d31dc01afd0811332083a05fa9e8173abe1 + pristine_git_object: 407533538231735253ad45fe23f839e0ccbea9ba src/openrouter/components/finishreason.py: id: 427351f6ddd1 last_write_checksum: sha1:71f5cbb61df831a1e9ce63f281ab29b3ed86b039 @@ -11996,8 +12052,8 @@ trackedFiles: pristine_git_object: 71017e79d84adfa0fa9aaad505c11702bcd59b24 src/openrouter/components/imagegenerationrequest.py: id: f8291a7be9a0 - last_write_checksum: sha1:5594779ac114f113c508b0eb75ad355a50a3d76e - pristine_git_object: a3aad180f29d2fe9416574e4c649976fae6ba276 + last_write_checksum: sha1:a2edac94246c81c7f86f92f1a66896eca2200965 + pristine_git_object: 10ece11aa6634f6b76db832d62bc42e359238342 src/openrouter/components/imagegenerationresponse.py: id: 53354cd0cbfc last_write_checksum: sha1:53f1cde7b8bfe4f9e786a76f6e57b0a1f76aced2 @@ -12408,8 +12464,8 @@ trackedFiles: pristine_git_object: b7a1d2f385159ff27bde884ad290db7878ccdfb1 src/openrouter/components/observabilityfilterrulegroup.py: id: f1fcf7b3732d - last_write_checksum: sha1:752f7a5db8f00c94443cc70f1c8cd1217c83e0b9 - pristine_git_object: 576d6a303f41aec506ccc7eb44c254ae5fb3064d + last_write_checksum: sha1:df8d2b4ab1c661e8c19011c97685084a2f20a9d3 + pristine_git_object: 01199189262dfe9f6f74e88100e40d148cf9c452 src/openrouter/components/observabilityfilterrulesconfig.py: id: 98476c1c326b last_write_checksum: sha1:2ce6d9001db7a4fec752c3bb8898574be738ddef @@ -12562,6 +12618,10 @@ trackedFiles: id: f5400a5de3cd last_write_checksum: sha1:5b8eab2b521a639688131143ee39e513e6da524a pristine_git_object: 73c09231284a8f982d7770a7a78fca403b374826 + src/openrouter/components/operator.py: + id: 92539f00b3d5 + last_write_checksum: sha1:be9aa88345f24f4b83b6a2e3d3ce495010fc4f4b + pristine_git_object: d5a4e7dd5840ca408bd6792582244893dfddec71 src/openrouter/components/oranthropicbashtoolresult.py: id: 96aaf647f72b last_write_checksum: sha1:5936ab54d7660c9c4698422247b225a8f909fb28 @@ -13142,6 +13202,14 @@ trackedFiles: id: 553fefb9814c last_write_checksum: sha1:5db57f3fb6368777e8c2713eba613830d4f647fb pristine_git_object: 2f0e24f4e60f92151982237f1b2e871fbbf03278 + src/openrouter/components/scalarfilter.py: + id: d97d4448f04c + last_write_checksum: sha1:d11ec8a9567f394c34f72a522bfcd9521dfdbb5c + pristine_git_object: e2491d6c226ea3f175bcb3da8e6a72fb44404773 + src/openrouter/components/scalarfilteroperator.py: + id: 44f10928fcd3 + last_write_checksum: sha1:c5676b72e58af607e812e9efc2dde3e05b96ad97 + pristine_git_object: e0b02c320f1da59d87823d8daa1e03adc4b8ab1b src/openrouter/components/scimgroup.py: id: 2c6efb2db9c3 last_write_checksum: sha1:b9309eab6d218c56eed1fc32a452e3ac5e89e2a2 @@ -13230,6 +13298,14 @@ trackedFiles: id: 7a486a18368e last_write_checksum: sha1:e68458021c6529e032194cc740887a45e11c7549 pristine_git_object: e105a7eb1936e652dadb95209bfa1f5258a2fb4b + src/openrouter/components/setfilter.py: + id: 1727f9828594 + last_write_checksum: sha1:c73105c30a9dd8dd1b84a60a9484f50e9883df03 + pristine_git_object: 34228f6b07edda884e90c67a99723221baa1ed6e + src/openrouter/components/setfilteroperator.py: + id: fb4f07b1c742 + last_write_checksum: sha1:fbac51c67a2b128197c0604c3dae15bc90e7e327 + pristine_git_object: d3a2534833ad0d4007c0793344c74b0ab4df9c0d src/openrouter/components/shellcallitem.py: id: 0b3b4f503413 last_write_checksum: sha1:a38ef2249c5b8a7e20f61bac58c0816c4b76fc47 @@ -13668,8 +13744,8 @@ trackedFiles: pristine_git_object: ec329629236dfe3490753b322124d1b2321a2ebf src/openrouter/components/vaultsecretwriterequest.py: id: cbb498111508 - last_write_checksum: sha1:72526fd27fea161dd2701080c2674dc96e046462 - pristine_git_object: b4a3db2fc4c7edf92a475be2952f01b5e2070205 + last_write_checksum: sha1:1b9b952ac06a26237868303362363618c8252f0b + pristine_git_object: 70de1bfb3bfb30aaafa4e08251eb7a6cace15be8 src/openrouter/components/videogenerationrequest.py: id: 70e3c9ff288c last_write_checksum: sha1:0d81c292d718b413e5c051ce2a5ebb4dd03c998d @@ -13948,8 +14024,8 @@ trackedFiles: pristine_git_object: 89560b566073785535643e694c112bedbd3db13d src/openrouter/images.py: id: c4d7adf63ae0 - last_write_checksum: sha1:adc4c03f5bbc670f202c475721c524d8c651c3f3 - pristine_git_object: 50643a126668498dd668c7cceb9f78c03d413d32 + last_write_checksum: sha1:9bd5680ead1e403f61d81743e01dcb887b98363c + pristine_git_object: c21152bd7ce24419c1952a778fb14b14e8381b12 src/openrouter/models/__init__.py: id: ed73b93abb3f last_write_checksum: sha1:932a790ae66ccd7d7022b39c659bcf72a664ebea @@ -13976,8 +14052,8 @@ trackedFiles: pristine_git_object: 4a35ede011d09dddab042e2c00413ce4f6be655e src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:89297246dcf99e732af65e39891f728958c602d3 - pristine_git_object: 35c06702f9988c078731aa444a188aad52c4078b + last_write_checksum: sha1:c0be70a8c0ce2dd43ff95886f8974298fb2ea1ee + pristine_git_object: fa711f8146d00f5432e71959bd70ce6e3c08da33 src/openrouter/operations/activateprivateendpoint.py: id: 3b39eec5d66f last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 @@ -14136,8 +14212,8 @@ trackedFiles: pristine_git_object: a8c58e7fa8dd7e781d70c87ecc427f3fdff59ce9 src/openrouter/operations/deleteinternvaultsecret.py: id: ffac57160027 - last_write_checksum: sha1:bc0d5957e085421f3a82cddc86d2bb6139a3d0f9 - pristine_git_object: 40dffe39c9ba070ee8897e4361a4478d8fb1cd0f + last_write_checksum: sha1:cbb98b19770e6da5cac8786cd531a4f0ebac7997 + pristine_git_object: 445c7df3d33fbdf2fc1acdd9a16268569271bf6f src/openrouter/operations/deletekeys.py: id: 0bd72d53b0a0 last_write_checksum: sha1:afcea9fd7d8e963f8a73c4f025b83bf6455dd45c @@ -14160,8 +14236,8 @@ trackedFiles: pristine_git_object: fec5503fa15f0f9588686f364f2066bf55f3ea80 src/openrouter/operations/deletevaultsecret.py: id: 1a7a4e95df3d - last_write_checksum: sha1:7d5caa272c0e080ce2708b82cde04a65e838bc65 - pristine_git_object: 8db5088e3e9c120394e5399bc580e2c09364ba15 + last_write_checksum: sha1:5e63aac783c783de8171d4d4b35d11a77867f151 + pristine_git_object: 94d21d87d042097f4f6fd8106dd0441043ebec14 src/openrouter/operations/deleteworkspace.py: id: f92017ce65e8 last_write_checksum: sha1:17f00e42bab5a0356a1057f53f6840a3bd3685d2 @@ -14192,8 +14268,8 @@ trackedFiles: pristine_git_object: b6895f4b95be5ea3777e7b3004cd267795637bf9 src/openrouter/operations/getanalyticsmeta.py: id: 013673a37aa5 - last_write_checksum: sha1:800b8064b10a9323e0ab4e5b983df631bac8c2df - pristine_git_object: dc728a09fb420c00c185bcffec5fc2e2dab64d1d + last_write_checksum: sha1:600dfdcb385f5116c32cdf6a6b53db925a1b6c72 + pristine_git_object: d4b717427347a5183eff59d470945a183af4607d src/openrouter/operations/getapprankings.py: id: 5ffd23dafcc1 last_write_checksum: sha1:ab86de57d9c8502a130a61f4405f3ca40c2ff5dc @@ -14476,8 +14552,8 @@ trackedFiles: pristine_git_object: 6ab264885a9454b195955adba4b65e01f2abf223 src/openrouter/operations/queryanalytics.py: id: d76c63ff66f6 - last_write_checksum: sha1:d166f291e1b720de07ceb8f684bd1d876213843e - pristine_git_object: 8eb73dfdcdbad8e062224f1cbf59f825d102556d + last_write_checksum: sha1:7902d3cac3a3efda6358b9d55f633c2820f6c0be + pristine_git_object: ffee192330d5854fb37564c66bf370bb37c8a243 src/openrouter/operations/sendchatcompletionrequest.py: id: d9fee71bb577 last_write_checksum: sha1:0cba4011b8e305270ac30f88cb7ab59b6aefe619 @@ -14704,8 +14780,8 @@ trackedFiles: pristine_git_object: 094755b73f7f9382d8df997602080c82a55896fd src/openrouter/vault.py: id: 0645fe426ac1 - last_write_checksum: sha1:21d1c8ec3cda05a73c0a0604a15d847f15ac146d - pristine_git_object: 5883820d10bafb218a9a86b36d003e11517f7fc0 + last_write_checksum: sha1:4a44276d329a8a489dd784d931d8baee7ac610b1 + pristine_git_object: 301f5a486f27e1dcfcb4c9029b47d6df7b683d95 src/openrouter/video_generation.py: id: d0a90c1b8efe last_write_checksum: sha1:e5fc6c816742687bad4a0ae9a9d9232945f04815 @@ -19221,3 +19297,6 @@ examples: "502": application/json: {"error": {"code": 502, "message": "Provider returned error"}} examplesVersion: 1.0.2 +releaseNotes: | + ## Python SDK Changes: + * `open_router.analytics.query_analytics()`: `request` **Changed** (Breaking ⚠️) diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 26a552798..e59f6f70b 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.96 + version: 1.3.97 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 031dcba03..913562328 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -8849,6 +8849,72 @@ components: required: - 'type' type: 'object' + ClassifierFiltersFilter: + anyOf: + - $ref: '#/components/schemas/ClassifierScalarFilter' + - $ref: '#/components/schemas/ClassifierSetFilter' + ClassifierScalarFilter: + properties: + field: + description: 'Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type").' + example: 'department' + pattern: '^[a-zA-Z_][a-zA-Z0-9_]{0,63}$' + type: 'string' + operator: + $ref: '#/components/schemas/ClassifierScalarFilterOperator' + value: + anyOf: + - type: 'string' + - format: 'double' + type: 'number' + description: 'Scalar (string or number) filter value.' + example: 'Engineering' + required: + - 'field' + - 'operator' + - 'value' + type: 'object' + ClassifierScalarFilterOperator: + description: 'Equality operator taking a scalar filter value. Ordered comparisons are not available because classification values are strings.' + enum: + - 'eq' + - 'neq' + example: 'eq' + type: 'string' + x-speakeasy-unknown-values: allow + ClassifierSetFilter: + properties: + field: + description: 'Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type").' + example: 'department' + pattern: '^[a-zA-Z_][a-zA-Z0-9_]{0,63}$' + type: 'string' + operator: + $ref: '#/components/schemas/ClassifierSetFilterOperator' + value: + description: 'Array of scalar filter values.' + example: + - 'Engineering' + - 'Support' + items: + anyOf: + - type: 'string' + - format: 'double' + type: 'number' + type: 'array' + required: + - 'field' + - 'operator' + - 'value' + type: 'object' + ClassifierSetFilterOperator: + description: 'Set-membership operator taking an array filter value.' + enum: + - 'in' + - 'not_in' + example: 'in' + type: 'string' + x-speakeasy-unknown-values: allow ClientClosedRequestResponse: description: 'Client Closed Request - The caller cancelled the request' example: @@ -9967,7 +10033,7 @@ components: example: 'employee_123' maxLength: 512 minLength: 1 - pattern: '^[^\u0000]+$' + pattern: '^(?!\s)(?![\s\S]*\s$)[^\u0000]+$' type: 'string' required: - 'user' @@ -11712,7 +11778,7 @@ components: example: 'employee_123' maxLength: 512 minLength: 1 - pattern: '^[^\u0000]+$' + pattern: '^(?!\s)(?![\s\S]*\s$)[^\u0000]+$' type: 'string' required: - 'user' @@ -11993,6 +12059,10 @@ components: example: {} properties: {} type: 'object' + Filter: + anyOf: + - $ref: '#/components/schemas/ScalarFilter' + - $ref: '#/components/schemas/SetFilter' FinishReason: enum: - 'stop' @@ -14263,7 +14333,7 @@ components: example: 1 type: 'integer' output_compression: - description: 'Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.' + description: 'Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format "jpeg" or "webp").' example: 100 type: 'integer' output_format: @@ -14316,7 +14386,7 @@ components: maxLength: 256 type: 'string' size: - description: 'Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400.' + description: 'Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`.' example: '2K' type: 'string' stream: @@ -22861,6 +22931,33 @@ components: required: - 'type' type: 'object' + Operator: + properties: + name: + description: 'Operator identifier used in filter definitions' + enum: + - 'eq' + - 'neq' + - 'in' + - 'not_in' + - 'gt' + - 'gte' + - 'lt' + - 'lte' + example: 'eq' + type: 'string' + x-speakeasy-unknown-values: allow + value_type: + description: 'Whether the operator expects a single value or an array' + enum: + - 'scalar' + - 'array' + type: 'string' + x-speakeasy-unknown-values: allow + required: + - 'name' + - 'value_type' + type: 'object' ORAnthropicBashToolResult: description: 'Output of an `openrouter:bash` call executed in the OpenRouter sandbox (`engine: ''openrouter''`)' example: @@ -28936,6 +29033,37 @@ components: example: 'direct' type: 'string' x-speakeasy-unknown-values: allow + ScalarFilter: + properties: + field: + description: 'Dimension to filter on. Use the /meta endpoint for available dimensions.' + example: 'model' + type: 'string' + operator: + $ref: '#/components/schemas/ScalarFilterOperator' + value: + anyOf: + - type: 'string' + - format: 'double' + type: 'number' + description: 'Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.' + required: + - 'field' + - 'operator' + - 'value' + type: 'object' + ScalarFilterOperator: + description: 'Comparison operator taking a scalar filter value.' + enum: + - 'eq' + - 'neq' + - 'gt' + - 'gte' + - 'lt' + - 'lte' + example: 'eq' + type: 'string' + x-speakeasy-unknown-values: allow ScimGroup: example: created_at: '2025-08-24T10:30:00.000Z' @@ -29561,6 +29689,38 @@ components: - 'data' - 'meta' type: 'object' + SetFilter: + properties: + field: + description: 'Dimension to filter on. Use the /meta endpoint for available dimensions.' + example: 'model' + type: 'string' + include_unset: + description: 'Include rows where the dimension has no value. Applies only to dimensions that have an unset bucket.' + type: 'boolean' + operator: + $ref: '#/components/schemas/SetFilterOperator' + value: + items: + anyOf: + - type: 'string' + - format: 'double' + type: 'number' + description: 'Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.' + type: 'array' + required: + - 'field' + - 'operator' + - 'value' + type: 'object' + SetFilterOperator: + description: 'Set-membership operator taking an array filter value.' + enum: + - 'in' + - 'not_in' + example: 'in' + type: 'string' + x-speakeasy-unknown-values: allow ShellCallItem: description: 'A shell command execution call (newer variant)' example: @@ -33828,8 +33988,8 @@ components: minItems: 1 type: 'array' value: - description: 'Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.' - maxLength: 65536 + description: 'Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned.' + maxLength: 985721 minLength: 1 type: 'string' required: @@ -35289,32 +35449,7 @@ paths: type: 'array' operators: items: - properties: - name: - description: 'Operator identifier used in filter definitions' - enum: - - 'eq' - - 'neq' - - 'in' - - 'not_in' - - 'gt' - - 'gte' - - 'lt' - - 'lte' - example: 'eq' - type: 'string' - x-speakeasy-unknown-values: allow - value_type: - description: 'Whether the operator expects a single value or an array' - enum: - - 'scalar' - - 'array' - type: 'string' - x-speakeasy-unknown-values: allow - required: - - 'name' - - 'value_type' - type: 'object' + $ref: '#/components/schemas/Operator' type: 'array' required: - 'metrics' @@ -35394,6 +35529,7 @@ paths: items: description: 'Classifier dimension name (snake_case identifier). Each name becomes its own column key in the response; providing two names cross-groups results by both dimensions. With no names, the response uses `clf_dimension_name`/`clf_dimension_value` columns (one row per dimension/value pair).' example: 'department' + pattern: '^[a-zA-Z_][a-zA-Z0-9_]{0,63}$' type: 'string' maxItems: 2 type: 'array' @@ -35413,33 +35549,7 @@ paths: type: 'string' filters: items: - properties: - field: - description: 'Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type").' - example: 'department' - type: 'string' - operator: - description: 'Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings.' - example: 'eq' - type: 'string' - value: - anyOf: - - type: 'string' - - format: 'double' - type: 'number' - - items: - anyOf: - - type: 'string' - - format: 'double' - type: 'number' - type: 'array' - description: 'Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.' - example: 'Engineering' - required: - - 'field' - - 'operator' - - 'value' - type: 'object' + $ref: '#/components/schemas/ClassifierFiltersFilter' maxItems: 10 minItems: 1 type: 'array' @@ -35456,35 +35566,7 @@ paths: type: 'array' filters: items: - properties: - field: - description: 'Dimension to filter on. Use the /meta endpoint for available dimensions.' - example: 'model' - type: 'string' - include_unset: - description: 'Include rows where the dimension has no value. Applies only to the `in` and `not_in` operators and dimensions that have an unset bucket.' - type: 'boolean' - operator: - description: 'Filter operator' - example: 'eq' - type: 'string' - value: - anyOf: - - type: 'string' - - format: 'double' - type: 'number' - - items: - anyOf: - - type: 'string' - - format: 'double' - type: 'number' - type: 'array' - description: 'Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.' - required: - - 'field' - - 'operator' - - 'value' - type: 'object' + $ref: '#/components/schemas/Filter' maxItems: 20 type: 'array' granularity: @@ -36043,7 +36125,9 @@ paths: keyterms[]: description: 'Domain terms, names, or phrases to bias recognition toward; repeat the part once per term (keyterms=... is also accepted). Only supported by some providers; 400 when the selected model cannot use keyterms.' items: + maxLength: 100 type: 'string' + maxItems: 1000 type: 'array' language: description: 'The language of the input audio (ISO-639-1).' @@ -36068,9 +36152,12 @@ paths: source_url: description: 'Publicly reachable http(s) URL of the audio file, downloaded by the provider directly (no size limit on our side). The format is derived from the URL path extension. Only supported by some providers; exactly one of file or source_url is required.' format: 'uri' + maxLength: 8000 type: 'string' temperature: description: 'The sampling temperature.' + maximum: 1 + minimum: 0 type: 'number' timestamp_granularities[]: description: 'Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array.' @@ -39909,7 +39996,7 @@ paths: example: 'employee_123' maxLength: 512 minLength: 1 - pattern: '^[^\u0000]+$' + pattern: '^(?!\s)(?![\s\S]*\s$)[^\u0000]+$' type: 'string' - description: 'Include deactivated registrations.' in: 'query' @@ -40097,7 +40184,7 @@ paths: example: 'employee_123' maxLength: 512 minLength: 1 - pattern: '^[^\u0000]+$' + pattern: '^(?!\s)(?![\s\S]*\s$)[^\u0000]+$' type: 'string' responses: '204': @@ -40160,7 +40247,7 @@ paths: example: 'employee_123' maxLength: 512 minLength: 1 - pattern: '^[^\u0000]+$' + pattern: '^(?!\s)(?![\s\S]*\s$)[^\u0000]+$' type: 'string' responses: '200': @@ -40243,7 +40330,7 @@ paths: example: 'employee_123' maxLength: 512 minLength: 1 - pattern: '^[^\u0000]+$' + pattern: '^(?!\s)(?![\s\S]*\s$)[^\u0000]+$' type: 'string' requestBody: content: @@ -52453,14 +52540,13 @@ paths: example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' format: 'uuid' type: 'string' - - description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + - description: 'Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.' in: 'path' name: 'name' required: true schema: - description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + description: 'Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.' example: 'github_token' - maxLength: 255 minLength: 1 pattern: '^(?!.*__)[a-z]([a-z0-9_]*[a-z0-9])?$' type: 'string' @@ -52789,7 +52875,7 @@ paths: message: 'Request body too large' schema: $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - The JSON body exceeds 425000 bytes.' + description: 'Payload Too Large - The JSON body exceeds 1309643 bytes.' '429': content: application/json: @@ -53015,7 +53101,7 @@ paths: message: 'Request body too large' schema: $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - The JSON body exceeds 425000 bytes.' + description: 'Payload Too Large - The JSON body exceeds 1309643 bytes.' '429': content: application/json: @@ -53317,14 +53403,13 @@ paths: description: 'Deletes a secret from the workspace of the authenticated API key. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key''s active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. An intern''s own API key is confined to that intern: it can always read the intern''s secrets and effective secrets, writes to them follow the rules above, and every other intern and every workspace route answers 404. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.' operationId: 'deleteVaultSecret' parameters: - - description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + - description: 'Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.' in: 'path' name: 'name' required: true schema: - description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + description: 'Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.' example: 'github_token' - maxLength: 255 minLength: 1 pattern: '^(?!.*__)[a-z]([a-z0-9_]*[a-z0-9])?$' type: 'string' @@ -53644,7 +53729,7 @@ paths: message: 'Request body too large' schema: $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - The JSON body exceeds 425000 bytes.' + description: 'Payload Too Large - The JSON body exceeds 1309643 bytes.' '429': content: application/json: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index c6f408324..e10d8e020 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:4195674d477f915085b147e820939116117bb3cd2aca4b4907100cd3742d6a4f - sourceBlobDigest: sha256:99c4030ee3cf77a2d1a6de79ada9ed0a4ee0790c2478011e30c45b067446ee51 + sourceRevisionDigest: sha256:e68f6e81a66c91c18611abd72e741995f83228a5e69c34acdc1f570ed66ef012 + sourceBlobDigest: sha256:95a532f816db55bae4bb6529bb8239de9e69b235023a5a0a7da4d138433477dc tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:4195674d477f915085b147e820939116117bb3cd2aca4b4907100cd3742d6a4f - sourceBlobDigest: sha256:99c4030ee3cf77a2d1a6de79ada9ed0a4ee0790c2478011e30c45b067446ee51 + sourceRevisionDigest: sha256:e68f6e81a66c91c18611abd72e741995f83228a5e69c34acdc1f570ed66ef012 + sourceBlobDigest: sha256:95a532f816db55bae4bb6529bb8239de9e69b235023a5a0a7da4d138433477dc codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:749e9f581dcf51ae7d60d5a189cd3ee840b774fc17213a568add9217a687d5e3 + codeSamplesRevisionDigest: sha256:83249b88a852f8f22434d3cff10a3509e964f9a2e17cf03cb80d14f7c497ff4c workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 02f14e76f..c62c8a656 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3729,4 +3729,14 @@ Based on: ### Generated - [python v1.3.96] . ### Releases -- [PyPI v1.3.96] https://pypi.org/project/openrouter/1.3.96 - . \ No newline at end of file +- [PyPI v1.3.96] https://pypi.org/project/openrouter/1.3.96 - . + +## 2026-10-30 00:00:50 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.97] . +### Releases +- [PyPI v1.3.97] https://pypi.org/project/openrouter/1.3.97 - . \ No newline at end of file diff --git a/docs/components/classifierfiltersfilter.mdx b/docs/components/classifierfiltersfilter.mdx new file mode 100644 index 000000000..1b7f00e8a --- /dev/null +++ b/docs/components/classifierfiltersfilter.mdx @@ -0,0 +1,18 @@ +--- +title: "ClassifierFiltersFilter" +--- + +## Supported Types + +### `components.ClassifierScalarFilter` + +```python +value: components.ClassifierScalarFilter = /* values here */ +``` + +### `components.ClassifierSetFilter` + +```python +value: components.ClassifierSetFilter = /* values here */ +``` + diff --git a/docs/components/classifierscalarfilter.mdx b/docs/components/classifierscalarfilter.mdx new file mode 100644 index 000000000..a7c6a7473 --- /dev/null +++ b/docs/components/classifierscalarfilter.mdx @@ -0,0 +1,11 @@ +--- +title: "ClassifierScalarFilter" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `field` | *str* | ✔️ | Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type"). | department | +| `operator` | [components.ClassifierScalarFilterOperator](../components/classifierscalarfilteroperator.mdx) | ✔️ | Equality operator taking a scalar filter value. Ordered comparisons are not available because classification values are strings. | eq | +| `value` | [components.ClassifierScalarFilterValue](../components/classifierscalarfiltervalue.mdx) | ✔️ | Scalar (string or number) filter value. | Engineering | \ No newline at end of file diff --git a/docs/components/classifierscalarfilteroperator.mdx b/docs/components/classifierscalarfilteroperator.mdx new file mode 100644 index 000000000..6b34924a4 --- /dev/null +++ b/docs/components/classifierscalarfilteroperator.mdx @@ -0,0 +1,22 @@ +--- +title: "ClassifierScalarFilterOperator" +--- + +Equality operator taking a scalar filter value. Ordered comparisons are not available because classification values are strings. + +## Example Usage + +```python +from openrouter.components import ClassifierScalarFilterOperator + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ClassifierScalarFilterOperator = "eq" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"eq"` +- `"neq"` diff --git a/docs/operations/valueclassifierfilters.mdx b/docs/components/classifierscalarfiltervalue.mdx similarity index 65% rename from docs/operations/valueclassifierfilters.mdx rename to docs/components/classifierscalarfiltervalue.mdx index 9280541b8..01cc4ee5a 100644 --- a/docs/operations/valueclassifierfilters.mdx +++ b/docs/components/classifierscalarfiltervalue.mdx @@ -1,7 +1,10 @@ --- -title: "ValueClassifierFilters" +title: "ClassifierScalarFilterValue" --- +Scalar (string or number) filter value. + + ## Supported Types ### `str` diff --git a/docs/components/classifiersetfilter.mdx b/docs/components/classifiersetfilter.mdx new file mode 100644 index 000000000..b821ac799 --- /dev/null +++ b/docs/components/classifiersetfilter.mdx @@ -0,0 +1,11 @@ +--- +title: "ClassifierSetFilter" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `field` | *str* | ✔️ | Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type"). | department | +| `operator` | [components.ClassifierSetFilterOperator](../components/classifiersetfilteroperator.mdx) | ✔️ | Set-membership operator taking an array filter value. | in | +| `value` | List[[components.ClassifierSetFilterValue](../components/classifiersetfiltervalue.mdx)] | ✔️ | Array of scalar filter values. | [
"Engineering",
"Support"
] | \ No newline at end of file diff --git a/docs/components/classifiersetfilteroperator.mdx b/docs/components/classifiersetfilteroperator.mdx new file mode 100644 index 000000000..b1b28a9a5 --- /dev/null +++ b/docs/components/classifiersetfilteroperator.mdx @@ -0,0 +1,22 @@ +--- +title: "ClassifierSetFilterOperator" +--- + +Set-membership operator taking an array filter value. + +## Example Usage + +```python +from openrouter.components import ClassifierSetFilterOperator + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ClassifierSetFilterOperator = "in" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"in"` +- `"not_in"` diff --git a/docs/operations/value2.mdx b/docs/components/classifiersetfiltervalue.mdx similarity index 81% rename from docs/operations/value2.mdx rename to docs/components/classifiersetfiltervalue.mdx index f72dd54a6..bbaebfede 100644 --- a/docs/operations/value2.mdx +++ b/docs/components/classifiersetfiltervalue.mdx @@ -1,5 +1,5 @@ --- -title: "Value2" +title: "ClassifierSetFilterValue" --- ## Supported Types diff --git a/docs/components/filter_.mdx b/docs/components/filter_.mdx new file mode 100644 index 000000000..35621a505 --- /dev/null +++ b/docs/components/filter_.mdx @@ -0,0 +1,18 @@ +--- +title: "Filter" +--- + +## Supported Types + +### `components.ScalarFilter` + +```python +value: components.ScalarFilter = /* values here */ +``` + +### `components.SetFilter` + +```python +value: components.SetFilter = /* values here */ +``` + diff --git a/docs/components/imagegenerationrequest.mdx b/docs/components/imagegenerationrequest.mdx index 18d32fa5c..dd4b81c76 100644 --- a/docs/components/imagegenerationrequest.mdx +++ b/docs/components/imagegenerationrequest.mdx @@ -7,22 +7,22 @@ Image generation request input ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../components/imagegenerationrequestaspectratio.mdx) | ➖ | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 | -| `background` | [Optional[components.ImageGenerationRequestBackground]](../components/imagegenerationrequestbackground.mdx) | ➖ | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto | -| `input_references` | List[[components.ContentPartImage](../components/contentpartimage.mdx)] | ➖ | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | | -| `model` | *str* | ✔️ | The image generation model to use | bytedance-seed/seedream-4.5 | -| `n` | *Optional[int]* | ➖ | Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. | 1 | -| `output_compression` | *Optional[int]* | ➖ | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 | -| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../components/imagegenerationrequestoutputformat.mdx) | ➖ | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png | -| `prompt` | *str* | ✔️ | Text description of the desired image | a red panda astronaut floating in space, studio lighting | -| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../components/imagegenerationproviderpreferences.mdx) | ➖ | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} | -| `quality` | [Optional[components.ImageGenerationRequestQuality]](../components/imagegenerationrequestquality.mdx) | ➖ | Rendering quality. Providers without a quality knob ignore this. | high | -| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../components/imagegenerationrequestresolution.mdx) | ➖ | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | -| `seed` | *Optional[int]* | ➖ | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | -| `session_id` | *Optional[str]* | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 | -| `size` | *Optional[str]* | ➖ | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. | 2K | -| `stream` | *Optional[bool]* | ➖ | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | -| `trace` | [Optional[components.TraceConfig]](../components/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | -| `user` | *Optional[str]* | ➖ | A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. | end-user-abc123 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../components/imagegenerationrequestaspectratio.mdx) | ➖ | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 | +| `background` | [Optional[components.ImageGenerationRequestBackground]](../components/imagegenerationrequestbackground.mdx) | ➖ | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto | +| `input_references` | List[[components.ContentPartImage](../components/contentpartimage.mdx)] | ➖ | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | | +| `model` | *str* | ✔️ | The image generation model to use | bytedance-seed/seedream-4.5 | +| `n` | *Optional[int]* | ➖ | Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. | 1 | +| `output_compression` | *Optional[int]* | ➖ | Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format "jpeg" or "webp"). | 100 | +| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../components/imagegenerationrequestoutputformat.mdx) | ➖ | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png | +| `prompt` | *str* | ✔️ | Text description of the desired image | a red panda astronaut floating in space, studio lighting | +| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../components/imagegenerationproviderpreferences.mdx) | ➖ | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} | +| `quality` | [Optional[components.ImageGenerationRequestQuality]](../components/imagegenerationrequestquality.mdx) | ➖ | Rendering quality. Providers without a quality knob ignore this. | high | +| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../components/imagegenerationrequestresolution.mdx) | ➖ | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | +| `seed` | *Optional[int]* | ➖ | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | +| `session_id` | *Optional[str]* | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 | +| `size` | *Optional[str]* | ➖ | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. | 2K | +| `stream` | *Optional[bool]* | ➖ | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | +| `trace` | [Optional[components.TraceConfig]](../components/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `user` | *Optional[str]* | ➖ | A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. | end-user-abc123 | \ No newline at end of file diff --git a/docs/components/operator.mdx b/docs/components/operator.mdx index b4df5fb47..c420c9094 100644 --- a/docs/components/operator.mdx +++ b/docs/components/operator.mdx @@ -2,30 +2,9 @@ title: "Operator" --- -## Example Usage +## Fields -```python -from openrouter.components import Operator - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: Operator = "equals" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"equals"` -- `"not_equals"` -- `"contains"` -- `"not_contains"` -- `"regex"` -- `"starts_with"` -- `"ends_with"` -- `"gt"` -- `"lt"` -- `"gte"` -- `"lte"` -- `"exists"` -- `"not_exists"` +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `name` | [components.OperatorName](../components/operatorname.mdx) | ✔️ | Operator identifier used in filter definitions | eq | +| `value_type` | [components.ValueType](../components/valuetype.mdx) | ✔️ | Whether the operator expects a single value or an array | | \ No newline at end of file diff --git a/docs/components/operatorenum.mdx b/docs/components/operatorenum.mdx new file mode 100644 index 000000000..29cd51850 --- /dev/null +++ b/docs/components/operatorenum.mdx @@ -0,0 +1,31 @@ +--- +title: "OperatorEnum" +--- + +## Example Usage + +```python +from openrouter.components import OperatorEnum + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: OperatorEnum = "equals" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"equals"` +- `"not_equals"` +- `"contains"` +- `"not_contains"` +- `"regex"` +- `"starts_with"` +- `"ends_with"` +- `"gt"` +- `"lt"` +- `"gte"` +- `"lte"` +- `"exists"` +- `"not_exists"` diff --git a/docs/operations/operatorname.mdx b/docs/components/operatorname.mdx similarity index 88% rename from docs/operations/operatorname.mdx rename to docs/components/operatorname.mdx index 8acee5400..1cc22734e 100644 --- a/docs/operations/operatorname.mdx +++ b/docs/components/operatorname.mdx @@ -7,7 +7,7 @@ Operator identifier used in filter definitions ## Example Usage ```python -from openrouter.operations import OperatorName +from openrouter.components import OperatorName # Open enum: unrecognized values are captured as UnrecognizedStr value: OperatorName = "eq" diff --git a/docs/components/rule.mdx b/docs/components/rule.mdx index 508f3a7f5..12534180c 100644 --- a/docs/components/rule.mdx +++ b/docs/components/rule.mdx @@ -7,5 +7,5 @@ title: "Rule" | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | | `field` | [components.FieldT](../components/fieldt.mdx) | ✔️ | N/A | -| `operator` | [components.Operator](../components/operator.mdx) | ✔️ | N/A | +| `operator` | [components.OperatorEnum](../components/operatorenum.mdx) | ✔️ | N/A | | `value` | [Optional[components.ObservabilityFilterRuleGroupValue]](../components/observabilityfilterrulegroupvalue.mdx) | ➖ | N/A | \ No newline at end of file diff --git a/docs/operations/filter_.mdx b/docs/components/scalarfilter.mdx similarity index 67% rename from docs/operations/filter_.mdx rename to docs/components/scalarfilter.mdx index 1472b37b7..9eea77dc8 100644 --- a/docs/operations/filter_.mdx +++ b/docs/components/scalarfilter.mdx @@ -1,12 +1,11 @@ --- -title: "Filter" +title: "ScalarFilter" --- ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `field` | *str* | ✔️ | Dimension to filter on. Use the /meta endpoint for available dimensions. | model | -| `include_unset` | *Optional[bool]* | ➖ | Include rows where the dimension has no value. Applies only to the `in` and `not_in` operators and dimensions that have an unset bucket. | | -| `operator` | *str* | ✔️ | Filter operator | eq | -| `value` | [operations.Value1](../operations/value1.mdx) | ✔️ | Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `field` | *str* | ✔️ | Dimension to filter on. Use the /meta endpoint for available dimensions. | model | +| `operator` | [components.ScalarFilterOperator](../components/scalarfilteroperator.mdx) | ✔️ | Comparison operator taking a scalar filter value. | eq | +| `value` | [components.ScalarFilterValue](../components/scalarfiltervalue.mdx) | ✔️ | Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. | | \ No newline at end of file diff --git a/docs/components/scalarfilteroperator.mdx b/docs/components/scalarfilteroperator.mdx new file mode 100644 index 000000000..84711d6b2 --- /dev/null +++ b/docs/components/scalarfilteroperator.mdx @@ -0,0 +1,26 @@ +--- +title: "ScalarFilterOperator" +--- + +Comparison operator taking a scalar filter value. + +## Example Usage + +```python +from openrouter.components import ScalarFilterOperator + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ScalarFilterOperator = "eq" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"eq"` +- `"neq"` +- `"gt"` +- `"gte"` +- `"lt"` +- `"lte"` diff --git a/docs/components/scalarfiltervalue.mdx b/docs/components/scalarfiltervalue.mdx new file mode 100644 index 000000000..2990666b8 --- /dev/null +++ b/docs/components/scalarfiltervalue.mdx @@ -0,0 +1,21 @@ +--- +title: "ScalarFilterValue" +--- + +Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/components/setfilter.mdx b/docs/components/setfilter.mdx new file mode 100644 index 000000000..0514c9cf1 --- /dev/null +++ b/docs/components/setfilter.mdx @@ -0,0 +1,12 @@ +--- +title: "SetFilter" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `field` | *str* | ✔️ | Dimension to filter on. Use the /meta endpoint for available dimensions. | model | +| `include_unset` | *Optional[bool]* | ➖ | Include rows where the dimension has no value. Applies only to dimensions that have an unset bucket. | | +| `operator` | [components.SetFilterOperator](../components/setfilteroperator.mdx) | ✔️ | Set-membership operator taking an array filter value. | in | +| `value` | List[[components.SetFilterValue](../components/setfiltervalue.mdx)] | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/components/setfilteroperator.mdx b/docs/components/setfilteroperator.mdx new file mode 100644 index 000000000..2d5068bff --- /dev/null +++ b/docs/components/setfilteroperator.mdx @@ -0,0 +1,22 @@ +--- +title: "SetFilterOperator" +--- + +Set-membership operator taking an array filter value. + +## Example Usage + +```python +from openrouter.components import SetFilterOperator + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: SetFilterOperator = "in" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"in"` +- `"not_in"` diff --git a/docs/components/setfiltervalue.mdx b/docs/components/setfiltervalue.mdx new file mode 100644 index 000000000..65e77725e --- /dev/null +++ b/docs/components/setfiltervalue.mdx @@ -0,0 +1,21 @@ +--- +title: "SetFilterValue" +--- + +Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/operations/valuetype.mdx b/docs/components/valuetype.mdx similarity index 87% rename from docs/operations/valuetype.mdx rename to docs/components/valuetype.mdx index 87a439af5..a6a99bc12 100644 --- a/docs/operations/valuetype.mdx +++ b/docs/components/valuetype.mdx @@ -7,7 +7,7 @@ Whether the operator expects a single value or an array ## Example Usage ```python -from openrouter.operations import ValueType +from openrouter.components import ValueType # Open enum: unrecognized values are captured as UnrecognizedStr value: ValueType = "scalar" diff --git a/docs/components/vaultsecretwriterequest.mdx b/docs/components/vaultsecretwriterequest.mdx index 997936057..8571f4803 100644 --- a/docs/components/vaultsecretwriterequest.mdx +++ b/docs/components/vaultsecretwriterequest.mdx @@ -10,4 +10,4 @@ Secret value and the exact hostnames it may be released to. | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `hosts` | List[*str*] | ✔️ | Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. | -| `value` | *str* | ✔️ | Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. | \ No newline at end of file +| `value` | *str* | ✔️ | Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned. | \ No newline at end of file diff --git a/docs/operations/classifierfilters.mdx b/docs/operations/classifierfilters.mdx index f7fc5d6ae..91ffad701 100644 --- a/docs/operations/classifierfilters.mdx +++ b/docs/operations/classifierfilters.mdx @@ -10,4 +10,4 @@ Filter results to generations with specific classifier tag values. Can be combin | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `classifier_id` | *str* | ✔️ | UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified. | 550e8400-e29b-41d4-a716-446655440000 | -| `filters` | List[[operations.ClassifierFiltersFilter](../operations/classifierfiltersfilter.mdx)] | ✔️ | N/A | | \ No newline at end of file +| `filters` | List[[components.ClassifierFiltersFilter](../components/classifierfiltersfilter.mdx)] | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/operations/classifierfiltersfilter.mdx b/docs/operations/classifierfiltersfilter.mdx deleted file mode 100644 index 91b515f29..000000000 --- a/docs/operations/classifierfiltersfilter.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "ClassifierFiltersFilter" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `field` | *str* | ✔️ | Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type"). | department | -| `operator` | *str* | ✔️ | Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings. | eq | -| `value` | [operations.ClassifierFiltersValue](../operations/classifierfiltersvalue.mdx) | ✔️ | Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in. | Engineering | \ No newline at end of file diff --git a/docs/operations/classifierfiltersvalue.mdx b/docs/operations/classifierfiltersvalue.mdx deleted file mode 100644 index 47e7dc4e5..000000000 --- a/docs/operations/classifierfiltersvalue.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "ClassifierFiltersValue" ---- - -Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in. - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `float` - -```python -value: float = /* values here */ -``` - -### `List[operations.ValueClassifierFilters]` - -```python -value: List[operations.ValueClassifierFilters] = /* values here */ -``` - diff --git a/docs/operations/deleteinternvaultsecretrequest.mdx b/docs/operations/deleteinternvaultsecretrequest.mdx index a564cf90a..2f3ca02c9 100644 --- a/docs/operations/deleteinternvaultsecretrequest.mdx +++ b/docs/operations/deleteinternvaultsecretrequest.mdx @@ -10,4 +10,4 @@ title: "DeleteInternVaultSecretRequest" | `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `intern_id` | *str* | ✔️ | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `name` | *str* | ✔️ | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | \ No newline at end of file +| `name` | *str* | ✔️ | Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format. | github_token | \ No newline at end of file diff --git a/docs/operations/deletevaultsecretrequest.mdx b/docs/operations/deletevaultsecretrequest.mdx index 08b8f8f6e..c378b120f 100644 --- a/docs/operations/deletevaultsecretrequest.mdx +++ b/docs/operations/deletevaultsecretrequest.mdx @@ -9,4 +9,4 @@ title: "DeleteVaultSecretRequest" | `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `name` | *str* | ✔️ | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | \ No newline at end of file +| `name` | *str* | ✔️ | Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format. | github_token | \ No newline at end of file diff --git a/docs/operations/getanalyticsmetadata.mdx b/docs/operations/getanalyticsmetadata.mdx index 35590a7d4..1cef92eb6 100644 --- a/docs/operations/getanalyticsmetadata.mdx +++ b/docs/operations/getanalyticsmetadata.mdx @@ -9,4 +9,4 @@ title: "GetAnalyticsMetaData" | `dimensions` | List[[operations.Dimension](../operations/dimension.mdx)] | ✔️ | N/A | | `granularities` | List[[operations.Granularity](../operations/granularity.mdx)] | ✔️ | N/A | | `metrics` | List[[operations.Metric](../operations/metric.mdx)] | ✔️ | N/A | -| `operators` | List[[operations.Operator](../operations/operator.mdx)] | ✔️ | N/A | \ No newline at end of file +| `operators` | List[[components.Operator](../components/operator.mdx)] | ✔️ | N/A | \ No newline at end of file diff --git a/docs/operations/granularity.mdx b/docs/operations/granularity.mdx index d7d423072..0ad551f76 100644 --- a/docs/operations/granularity.mdx +++ b/docs/operations/granularity.mdx @@ -4,7 +4,7 @@ title: "Granularity" ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `display_label` | *str* | ✔️ | Human-readable label | Day | -| `name` | [operations.GranularityName](../operations/granularityname.mdx) | ✔️ | Granularity identifier | day | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `display_label` | *str* | ✔️ | Human-readable label | Day | +| `name` | [operations.Name](../operations/name.mdx) | ✔️ | Granularity identifier | day | \ No newline at end of file diff --git a/docs/operations/granularityname.mdx b/docs/operations/name.mdx similarity index 71% rename from docs/operations/granularityname.mdx rename to docs/operations/name.mdx index 9d6dfd531..6cbc2d707 100644 --- a/docs/operations/granularityname.mdx +++ b/docs/operations/name.mdx @@ -1,5 +1,5 @@ --- -title: "GranularityName" +title: "Name" --- Granularity identifier @@ -7,10 +7,10 @@ Granularity identifier ## Example Usage ```python -from openrouter.operations import GranularityName +from openrouter.operations import Name # Open enum: unrecognized values are captured as UnrecognizedStr -value: GranularityName = "minute" +value: Name = "minute" ``` diff --git a/docs/operations/operator.mdx b/docs/operations/operator.mdx deleted file mode 100644 index 72095eea8..000000000 --- a/docs/operations/operator.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Operator" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `name` | [operations.OperatorName](../operations/operatorname.mdx) | ✔️ | Operator identifier used in filter definitions | eq | -| `value_type` | [operations.ValueType](../operations/valuetype.mdx) | ✔️ | Whether the operator expects a single value or an array | | \ No newline at end of file diff --git a/docs/operations/queryanalyticsrequestbody.mdx b/docs/operations/queryanalyticsrequestbody.mdx index 71359d67e..09d27e7e5 100644 --- a/docs/operations/queryanalyticsrequestbody.mdx +++ b/docs/operations/queryanalyticsrequestbody.mdx @@ -9,7 +9,7 @@ title: "QueryAnalyticsRequestBody" | `classifier_dimensions` | [Optional[operations.ClassifierDimensions]](../operations/classifierdimensions.mdx) | ➖ | Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace. | | | `classifier_filters` | [Optional[operations.ClassifierFilters]](../operations/classifierfilters.mdx) | ➖ | Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions. | | | `dimensions` | List[*str*] | ➖ | N/A | | -| `filters` | List[[operations.Filter](../operations/filter_.mdx)] | ➖ | N/A | | +| `filters` | List[[components.Filter](../components/filter_.mdx)] | ➖ | N/A | | | `granularity` | *Optional[str]* | ➖ | Time granularity | day | | `group_limit` | *Optional[int]* | ➖ | Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified. | 100 | | `limit` | *Optional[int]* | ➖ | Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations. | | diff --git a/docs/operations/value1.mdx b/docs/operations/value1.mdx deleted file mode 100644 index 329fc8cb9..000000000 --- a/docs/operations/value1.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Value1" ---- - -Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `float` - -```python -value: float = /* values here */ -``` - -### `List[operations.Value2]` - -```python -value: List[operations.Value2] = /* values here */ -``` - diff --git a/docs/sdks/analytics/README.mdx b/docs/sdks/analytics/README.mdx index 45489cdc2..2cfd14c40 100644 --- a/docs/sdks/analytics/README.mdx +++ b/docs/sdks/analytics/README.mdx @@ -151,7 +151,7 @@ with OpenRouter( | `classifier_dimensions` | [Optional[operations.ClassifierDimensions]](../../operations/classifierdimensions.mdx) | ➖ | Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace. | | | `classifier_filters` | [Optional[operations.ClassifierFilters]](../../operations/classifierfilters.mdx) | ➖ | Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions. | | | `dimensions` | List[*str*] | ➖ | N/A | | -| `filters` | List[[operations.Filter](../../operations/filter_.mdx)] | ➖ | N/A | | +| `filters` | List[[components.Filter](../../components/filter_.mdx)] | ➖ | N/A | | | `granularity` | *Optional[str]* | ➖ | Time granularity | day | | `group_limit` | *Optional[int]* | ➖ | Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified. | 100 | | `limit` | *Optional[int]* | ➖ | Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations. | | diff --git a/docs/sdks/images/README.mdx b/docs/sdks/images/README.mdx index faf1c8edd..fa46dc09c 100644 --- a/docs/sdks/images/README.mdx +++ b/docs/sdks/images/README.mdx @@ -42,29 +42,29 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `model` | *str* | ✔️ | The image generation model to use | bytedance-seed/seedream-4.5 | -| `prompt` | *str* | ✔️ | Text description of the desired image | a red panda astronaut floating in space, studio lighting | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../../components/imagegenerationrequestaspectratio.mdx) | ➖ | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 | -| `background` | [Optional[components.ImageGenerationRequestBackground]](../../components/imagegenerationrequestbackground.mdx) | ➖ | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto | -| `input_references` | List[[components.ContentPartImage](../../components/contentpartimage.mdx)] | ➖ | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | | -| `n` | *Optional[int]* | ➖ | Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. | 1 | -| `output_compression` | *Optional[int]* | ➖ | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 | -| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../../components/imagegenerationrequestoutputformat.mdx) | ➖ | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png | -| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../../components/imagegenerationproviderpreferences.mdx) | ➖ | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} | -| `quality` | [Optional[components.ImageGenerationRequestQuality]](../../components/imagegenerationrequestquality.mdx) | ➖ | Rendering quality. Providers without a quality knob ignore this. | high | -| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../../components/imagegenerationrequestresolution.mdx) | ➖ | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | -| `seed` | *Optional[int]* | ➖ | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | -| `session_id` | *Optional[str]* | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 | -| `size` | *Optional[str]* | ➖ | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. | 2K | -| `stream` | *Optional[bool]* | ➖ | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | -| `trace` | [Optional[components.TraceConfig]](../../components/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | -| `user` | *Optional[str]* | ➖ | A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. | end-user-abc123 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `model` | *str* | ✔️ | The image generation model to use | bytedance-seed/seedream-4.5 | +| `prompt` | *str* | ✔️ | Text description of the desired image | a red panda astronaut floating in space, studio lighting | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../../components/imagegenerationrequestaspectratio.mdx) | ➖ | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 | +| `background` | [Optional[components.ImageGenerationRequestBackground]](../../components/imagegenerationrequestbackground.mdx) | ➖ | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto | +| `input_references` | List[[components.ContentPartImage](../../components/contentpartimage.mdx)] | ➖ | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | | +| `n` | *Optional[int]* | ➖ | Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. | 1 | +| `output_compression` | *Optional[int]* | ➖ | Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format "jpeg" or "webp"). | 100 | +| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../../components/imagegenerationrequestoutputformat.mdx) | ➖ | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png | +| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../../components/imagegenerationproviderpreferences.mdx) | ➖ | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} | +| `quality` | [Optional[components.ImageGenerationRequestQuality]](../../components/imagegenerationrequestquality.mdx) | ➖ | Rendering quality. Providers without a quality knob ignore this. | high | +| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../../components/imagegenerationrequestresolution.mdx) | ➖ | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | +| `seed` | *Optional[int]* | ➖ | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | +| `session_id` | *Optional[str]* | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 | +| `size` | *Optional[str]* | ➖ | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. | 2K | +| `stream` | *Optional[bool]* | ➖ | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | +| `trace` | [Optional[components.TraceConfig]](../../components/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `user` | *Optional[str]* | ➖ | A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. | end-user-abc123 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/vault/README.mdx b/docs/sdks/vault/README.mdx index 4b397ebbe..63da02745 100644 --- a/docs/sdks/vault/README.mdx +++ b/docs/sdks/vault/README.mdx @@ -217,7 +217,7 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `intern_id` | *str* | ✔️ | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `name` | *str* | ✔️ | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | +| `name` | *str* | ✔️ | Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format. | github_token | | `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | @@ -626,7 +626,7 @@ with OpenRouter( | `intern_id` | *str* | ✔️ | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | | `name` | *str* | ✔️ | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | | `hosts` | List[*str*] | ✔️ | Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. | | -| `value` | *str* | ✔️ | Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. | | +| `value` | *str* | ✔️ | Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned. | | | `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | @@ -1128,7 +1128,7 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | ✔️ | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | +| `name` | *str* | ✔️ | Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format. | github_token | | `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | @@ -1514,7 +1514,7 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *str* | ✔️ | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | | `hosts` | List[*str*] | ✔️ | Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. | | -| `value` | *str* | ✔️ | Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. | | +| `value` | *str* | ✔️ | Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned. | | | `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | diff --git a/pyproject.toml b/pyproject.toml index af8e076cf..8b292d5ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.96" +version = "1.3.97" 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 035c1db1f..7efe45123 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.96" +__version__: str = "1.3.97" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.96 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.97 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/analytics.py b/src/openrouter/analytics.py index 9587309db..0e567f3a3 100644 --- a/src/openrouter/analytics.py +++ b/src/openrouter/analytics.py @@ -540,7 +540,7 @@ def query_analytics( ] = None, dimensions: Optional[Iterable[str]] = None, filters: Optional[ - Union[Iterable[operations.Filter], Iterable[operations.FilterTypedDict]] + Union[Iterable[components.Filter], Iterable[components.FilterTypedDict]] ] = None, granularity: Optional[str] = None, group_limit: Optional[int] = None, @@ -605,7 +605,7 @@ def query_analytics( ), dimensions=utils.unmarshal(dimensions, Optional[List[str]]), filters=utils.get_pydantic_model( - filters, Optional[List[operations.Filter]] + filters, Optional[List[components.Filter]] ), granularity=granularity, group_limit=group_limit, @@ -737,7 +737,7 @@ async def query_analytics_async( ] = None, dimensions: Optional[Iterable[str]] = None, filters: Optional[ - Union[Iterable[operations.Filter], Iterable[operations.FilterTypedDict]] + Union[Iterable[components.Filter], Iterable[components.FilterTypedDict]] ] = None, granularity: Optional[str] = None, group_limit: Optional[int] = None, @@ -802,7 +802,7 @@ async def query_analytics_async( ), dimensions=utils.unmarshal(dimensions, Optional[List[str]]), filters=utils.get_pydantic_model( - filters, Optional[List[operations.Filter]] + filters, Optional[List[components.Filter]] ), granularity=granularity, group_limit=group_limit, diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 7ddf8fc90..5dc456606 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -1275,6 +1275,24 @@ ChatWebSearchShorthandType, ChatWebSearchShorthandTypedDict, ) + from .classifierfiltersfilter import ( + ClassifierFiltersFilter, + ClassifierFiltersFilterTypedDict, + ) + from .classifierscalarfilter import ( + ClassifierScalarFilter, + ClassifierScalarFilterTypedDict, + ClassifierScalarFilterValue, + ClassifierScalarFilterValueTypedDict, + ) + from .classifierscalarfilteroperator import ClassifierScalarFilterOperator + from .classifiersetfilter import ( + ClassifierSetFilter, + ClassifierSetFilterTypedDict, + ClassifierSetFilterValue, + ClassifierSetFilterValueTypedDict, + ) + from .classifiersetfilteroperator import ClassifierSetFilterOperator from .clientclosedrequestresponseerrordata import ( ClientClosedRequestResponseErrorData, ClientClosedRequestResponseErrorDataTypedDict, @@ -1836,6 +1854,7 @@ FilesServerToolConfig, FilesServerToolConfigTypedDict, ) + from .filter_ import Filter, FilterTypedDict from .finishreason import FinishReason from .forbiddenresponseerrordata import ( ForbiddenResponseErrorData, @@ -2758,7 +2777,7 @@ ObservabilityFilterRuleGroupTypedDict, ObservabilityFilterRuleGroupValue, ObservabilityFilterRuleGroupValueTypedDict, - Operator, + OperatorEnum, Rule, RuleTypedDict, ) @@ -3028,6 +3047,7 @@ OpenRouterWebSearchServerToolType, OpenRouterWebSearchServerToolTypedDict, ) + from .operator import Operator, OperatorName, OperatorTypedDict, ValueType from .oranthropicbashtoolresult import ( ORAnthropicBashToolResult, ORAnthropicBashToolResultFile, @@ -3774,6 +3794,13 @@ from .routerattempt import RouterAttempt, RouterAttemptTypedDict from .routerparams import RouterParams, RouterParamsTypedDict from .routingstrategy import RoutingStrategy + from .scalarfilter import ( + ScalarFilter, + ScalarFilterTypedDict, + ScalarFilterValue, + ScalarFilterValueTypedDict, + ) + from .scalarfilteroperator import ScalarFilterOperator from .scimgroup import ScimGroup, ScimGroupTypedDict from .scimgroupmapping import ( ScimGroupMapping, @@ -3849,6 +3876,13 @@ SessionCostMetaVersion, ) from .sessioncostresponse import SessionCostResponse, SessionCostResponseTypedDict + from .setfilter import ( + SetFilter, + SetFilterTypedDict, + SetFilterValue, + SetFilterValueTypedDict, + ) + from .setfilteroperator import SetFilterOperator from .shellcallitem import ( ShellCallItem, ShellCallItemAction, @@ -5347,6 +5381,18 @@ "ChoiceTypedDict", "Citation", "CitationTypedDict", + "ClassifierFiltersFilter", + "ClassifierFiltersFilterTypedDict", + "ClassifierScalarFilter", + "ClassifierScalarFilterOperator", + "ClassifierScalarFilterTypedDict", + "ClassifierScalarFilterValue", + "ClassifierScalarFilterValueTypedDict", + "ClassifierSetFilter", + "ClassifierSetFilterOperator", + "ClassifierSetFilterTypedDict", + "ClassifierSetFilterValue", + "ClassifierSetFilterValueTypedDict", "ClearToolInputs", "ClearToolInputsTypedDict", "ClientClosedRequestResponseErrorData", @@ -5767,6 +5813,8 @@ "FilesServerToolConfigTypedDict", "FilesServerToolType", "FilesServerToolTypedDict", + "Filter", + "FilterTypedDict", "Filters", "FiltersType", "FiltersTypedDict", @@ -6613,6 +6661,9 @@ "Operation", "OperationTypedDict", "Operator", + "OperatorEnum", + "OperatorName", + "OperatorTypedDict", "OrganizationSettings", "OrganizationSettingsTypedDict", "Outcome", @@ -7171,6 +7222,11 @@ "STTWord", "STTWordType", "STTWordTypedDict", + "ScalarFilter", + "ScalarFilterOperator", + "ScalarFilterTypedDict", + "ScalarFilterValue", + "ScalarFilterValueTypedDict", "ScimGroup", "ScimGroupMapping", "ScimGroupMappingRole", @@ -7228,6 +7284,11 @@ "SessionCostMetaVersion", "SessionCostResponse", "SessionCostResponseTypedDict", + "SetFilter", + "SetFilterOperator", + "SetFilterTypedDict", + "SetFilterValue", + "SetFilterValueTypedDict", "ShadowedBy", "ShellCallItem", "ShellCallItemAction", @@ -7677,6 +7738,7 @@ "ValidatePrivateEndpointRequest", "ValidatePrivateEndpointRequestTypedDict", "Validation", + "ValueType", "Variables", "VariablesTypedDict", "VaultEffectiveSecret", @@ -8708,6 +8770,18 @@ "ChatWebSearchShorthand": ".chatwebsearchshorthand", "ChatWebSearchShorthandType": ".chatwebsearchshorthand", "ChatWebSearchShorthandTypedDict": ".chatwebsearchshorthand", + "ClassifierFiltersFilter": ".classifierfiltersfilter", + "ClassifierFiltersFilterTypedDict": ".classifierfiltersfilter", + "ClassifierScalarFilter": ".classifierscalarfilter", + "ClassifierScalarFilterTypedDict": ".classifierscalarfilter", + "ClassifierScalarFilterValue": ".classifierscalarfilter", + "ClassifierScalarFilterValueTypedDict": ".classifierscalarfilter", + "ClassifierScalarFilterOperator": ".classifierscalarfilteroperator", + "ClassifierSetFilter": ".classifiersetfilter", + "ClassifierSetFilterTypedDict": ".classifiersetfilter", + "ClassifierSetFilterValue": ".classifiersetfilter", + "ClassifierSetFilterValueTypedDict": ".classifiersetfilter", + "ClassifierSetFilterOperator": ".classifiersetfilteroperator", "ClientClosedRequestResponseErrorData": ".clientclosedrequestresponseerrordata", "ClientClosedRequestResponseErrorDataTypedDict": ".clientclosedrequestresponseerrordata", "CodeInterpreterCallCodeDeltaEvent": ".codeinterpretercallcodedeltaevent", @@ -9103,6 +9177,8 @@ "FilesServerToolTypedDict": ".filesservertool", "FilesServerToolConfig": ".filesservertoolconfig", "FilesServerToolConfigTypedDict": ".filesservertoolconfig", + "Filter": ".filter_", + "FilterTypedDict": ".filter_", "FinishReason": ".finishreason", "ForbiddenResponseErrorData": ".forbiddenresponseerrordata", "ForbiddenResponseErrorDataTypedDict": ".forbiddenresponseerrordata", @@ -9820,7 +9896,7 @@ "ObservabilityFilterRuleGroupTypedDict": ".observabilityfilterrulegroup", "ObservabilityFilterRuleGroupValue": ".observabilityfilterrulegroup", "ObservabilityFilterRuleGroupValueTypedDict": ".observabilityfilterrulegroup", - "Operator": ".observabilityfilterrulegroup", + "OperatorEnum": ".observabilityfilterrulegroup", "Rule": ".observabilityfilterrulegroup", "RuleTypedDict": ".observabilityfilterrulegroup", "ObservabilityFilterRulesConfig": ".observabilityfilterrulesconfig", @@ -10020,6 +10096,10 @@ "OpenRouterWebSearchServerTool": ".openrouterwebsearchservertool", "OpenRouterWebSearchServerToolType": ".openrouterwebsearchservertool", "OpenRouterWebSearchServerToolTypedDict": ".openrouterwebsearchservertool", + "Operator": ".operator", + "OperatorName": ".operator", + "OperatorTypedDict": ".operator", + "ValueType": ".operator", "ORAnthropicBashToolResult": ".oranthropicbashtoolresult", "ORAnthropicBashToolResultFile": ".oranthropicbashtoolresult", "ORAnthropicBashToolResultFileTypedDict": ".oranthropicbashtoolresult", @@ -10566,6 +10646,11 @@ "RouterParams": ".routerparams", "RouterParamsTypedDict": ".routerparams", "RoutingStrategy": ".routingstrategy", + "ScalarFilter": ".scalarfilter", + "ScalarFilterTypedDict": ".scalarfilter", + "ScalarFilterValue": ".scalarfilter", + "ScalarFilterValueTypedDict": ".scalarfilter", + "ScalarFilterOperator": ".scalarfilteroperator", "ScimGroup": ".scimgroup", "ScimGroupTypedDict": ".scimgroup", "ScimGroupMapping": ".scimgroupmapping", @@ -10623,6 +10708,11 @@ "SessionCostMetaVersion": ".sessioncostmeta", "SessionCostResponse": ".sessioncostresponse", "SessionCostResponseTypedDict": ".sessioncostresponse", + "SetFilter": ".setfilter", + "SetFilterTypedDict": ".setfilter", + "SetFilterValue": ".setfilter", + "SetFilterValueTypedDict": ".setfilter", + "SetFilterOperator": ".setfilteroperator", "ShellCallItem": ".shellcallitem", "ShellCallItemAction": ".shellcallitem", "ShellCallItemActionTypedDict": ".shellcallitem", diff --git a/src/openrouter/components/classifierfiltersfilter.py b/src/openrouter/components/classifierfiltersfilter.py new file mode 100644 index 000000000..aa59c71ba --- /dev/null +++ b/src/openrouter/components/classifierfiltersfilter.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .classifierscalarfilter import ( + ClassifierScalarFilter, + ClassifierScalarFilterTypedDict, +) +from .classifiersetfilter import ClassifierSetFilter, ClassifierSetFilterTypedDict +from typing import Union +from typing_extensions import TypeAliasType + + +ClassifierFiltersFilterTypedDict = TypeAliasType( + "ClassifierFiltersFilterTypedDict", + Union[ClassifierScalarFilterTypedDict, ClassifierSetFilterTypedDict], +) + + +ClassifierFiltersFilter = TypeAliasType( + "ClassifierFiltersFilter", Union[ClassifierScalarFilter, ClassifierSetFilter] +) diff --git a/src/openrouter/components/classifierscalarfilter.py b/src/openrouter/components/classifierscalarfilter.py new file mode 100644 index 000000000..093a1972e --- /dev/null +++ b/src/openrouter/components/classifierscalarfilter.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .classifierscalarfilteroperator import ClassifierScalarFilterOperator +from openrouter.types import BaseModel +from typing import Union +from typing_extensions import TypeAliasType, TypedDict + + +ClassifierScalarFilterValueTypedDict = TypeAliasType( + "ClassifierScalarFilterValueTypedDict", Union[str, float] +) +r"""Scalar (string or number) filter value.""" + + +ClassifierScalarFilterValue = TypeAliasType( + "ClassifierScalarFilterValue", Union[str, float] +) +r"""Scalar (string or number) filter value.""" + + +class ClassifierScalarFilterTypedDict(TypedDict): + field: str + r"""Classifier dimension name to filter on (snake_case identifier, e.g. \"department\", \"work_type\").""" + operator: ClassifierScalarFilterOperator + r"""Equality operator taking a scalar filter value. Ordered comparisons are not available because classification values are strings.""" + value: ClassifierScalarFilterValueTypedDict + r"""Scalar (string or number) filter value.""" + + +class ClassifierScalarFilter(BaseModel): + field: str + r"""Classifier dimension name to filter on (snake_case identifier, e.g. \"department\", \"work_type\").""" + + operator: ClassifierScalarFilterOperator + r"""Equality operator taking a scalar filter value. Ordered comparisons are not available because classification values are strings.""" + + value: ClassifierScalarFilterValue + r"""Scalar (string or number) filter value.""" diff --git a/src/openrouter/components/classifierscalarfilteroperator.py b/src/openrouter/components/classifierscalarfilteroperator.py new file mode 100644 index 000000000..d832f6ac8 --- /dev/null +++ b/src/openrouter/components/classifierscalarfilteroperator.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 + + +ClassifierScalarFilterOperator = Union[ + Literal[ + "eq", + "neq", + ], + UnrecognizedStr, +] +r"""Equality operator taking a scalar filter value. Ordered comparisons are not available because classification values are strings.""" diff --git a/src/openrouter/components/classifiersetfilter.py b/src/openrouter/components/classifiersetfilter.py new file mode 100644 index 000000000..5d181bb4d --- /dev/null +++ b/src/openrouter/components/classifiersetfilter.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .classifiersetfilteroperator import ClassifierSetFilterOperator +from openrouter.types import BaseModel +from typing import List, Union +from typing_extensions import TypeAliasType, TypedDict + + +ClassifierSetFilterValueTypedDict = TypeAliasType( + "ClassifierSetFilterValueTypedDict", Union[str, float] +) + + +ClassifierSetFilterValue = TypeAliasType("ClassifierSetFilterValue", Union[str, float]) + + +class ClassifierSetFilterTypedDict(TypedDict): + field: str + r"""Classifier dimension name to filter on (snake_case identifier, e.g. \"department\", \"work_type\").""" + operator: ClassifierSetFilterOperator + r"""Set-membership operator taking an array filter value.""" + value: List[ClassifierSetFilterValueTypedDict] + r"""Array of scalar filter values.""" + + +class ClassifierSetFilter(BaseModel): + field: str + r"""Classifier dimension name to filter on (snake_case identifier, e.g. \"department\", \"work_type\").""" + + operator: ClassifierSetFilterOperator + r"""Set-membership operator taking an array filter value.""" + + value: List[ClassifierSetFilterValue] + r"""Array of scalar filter values.""" diff --git a/src/openrouter/components/classifiersetfilteroperator.py b/src/openrouter/components/classifiersetfilteroperator.py new file mode 100644 index 000000000..449a67a20 --- /dev/null +++ b/src/openrouter/components/classifiersetfilteroperator.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 + + +ClassifierSetFilterOperator = Union[ + Literal[ + "in", + "not_in", + ], + UnrecognizedStr, +] +r"""Set-membership operator taking an array filter value.""" diff --git a/src/openrouter/components/filter_.py b/src/openrouter/components/filter_.py new file mode 100644 index 000000000..407533538 --- /dev/null +++ b/src/openrouter/components/filter_.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .scalarfilter import ScalarFilter, ScalarFilterTypedDict +from .setfilter import SetFilter, SetFilterTypedDict +from typing import Union +from typing_extensions import TypeAliasType + + +FilterTypedDict = TypeAliasType( + "FilterTypedDict", Union[ScalarFilterTypedDict, SetFilterTypedDict] +) + + +Filter = TypeAliasType("Filter", Union[ScalarFilter, SetFilter]) diff --git a/src/openrouter/components/imagegenerationrequest.py b/src/openrouter/components/imagegenerationrequest.py index a3aad180f..10ece11aa 100644 --- a/src/openrouter/components/imagegenerationrequest.py +++ b/src/openrouter/components/imagegenerationrequest.py @@ -114,7 +114,7 @@ class ImageGenerationRequestTypedDict(TypedDict): n: NotRequired[int] r"""Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.""" output_compression: NotRequired[int] - r"""Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.""" + r"""Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").""" output_format: NotRequired[ImageGenerationRequestOutputFormat] r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.""" provider: NotRequired[ImageGenerationProviderPreferencesTypedDict] @@ -128,7 +128,7 @@ class ImageGenerationRequestTypedDict(TypedDict): session_id: NotRequired[str] r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.""" size: NotRequired[str] - r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400.""" + r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`.""" stream: NotRequired[bool] r"""If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.""" trace: NotRequired[TraceConfigTypedDict] @@ -159,7 +159,7 @@ class ImageGenerationRequest(BaseModel): r"""Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.""" output_compression: Optional[int] = None - r"""Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.""" + r"""Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").""" output_format: Optional[ImageGenerationRequestOutputFormat] = None r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.""" @@ -180,7 +180,7 @@ class ImageGenerationRequest(BaseModel): r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.""" size: Optional[str] = None - r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400.""" + r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`.""" stream: Optional[bool] = None r"""If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.""" diff --git a/src/openrouter/components/observabilityfilterrulegroup.py b/src/openrouter/components/observabilityfilterrulegroup.py index 576d6a303..011991892 100644 --- a/src/openrouter/components/observabilityfilterrulegroup.py +++ b/src/openrouter/components/observabilityfilterrulegroup.py @@ -35,7 +35,7 @@ ] -Operator = Union[ +OperatorEnum = Union[ Literal[ "equals", "not_equals", @@ -67,14 +67,14 @@ class RuleTypedDict(TypedDict): field: FieldT - operator: Operator + operator: OperatorEnum value: NotRequired[ObservabilityFilterRuleGroupValueTypedDict] class Rule(BaseModel): field: FieldT - operator: Operator + operator: OperatorEnum value: Optional[ObservabilityFilterRuleGroupValue] = None diff --git a/src/openrouter/components/operator.py b/src/openrouter/components/operator.py new file mode 100644 index 000000000..d5a4e7dd5 --- /dev/null +++ b/src/openrouter/components/operator.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UnrecognizedStr +from typing import Literal, Union +from typing_extensions import TypedDict + + +OperatorName = Union[ + Literal[ + "eq", + "neq", + "in", + "not_in", + "gt", + "gte", + "lt", + "lte", + ], + UnrecognizedStr, +] +r"""Operator identifier used in filter definitions""" + + +ValueType = Union[ + Literal[ + "scalar", + "array", + ], + UnrecognizedStr, +] +r"""Whether the operator expects a single value or an array""" + + +class OperatorTypedDict(TypedDict): + name: OperatorName + r"""Operator identifier used in filter definitions""" + value_type: ValueType + r"""Whether the operator expects a single value or an array""" + + +class Operator(BaseModel): + name: OperatorName + r"""Operator identifier used in filter definitions""" + + value_type: ValueType + r"""Whether the operator expects a single value or an array""" diff --git a/src/openrouter/components/scalarfilter.py b/src/openrouter/components/scalarfilter.py new file mode 100644 index 000000000..e2491d6c2 --- /dev/null +++ b/src/openrouter/components/scalarfilter.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .scalarfilteroperator import ScalarFilterOperator +from openrouter.types import BaseModel +from typing import Union +from typing_extensions import TypeAliasType, TypedDict + + +ScalarFilterValueTypedDict = TypeAliasType( + "ScalarFilterValueTypedDict", Union[str, float] +) +r"""Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" + + +ScalarFilterValue = TypeAliasType("ScalarFilterValue", Union[str, float]) +r"""Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" + + +class ScalarFilterTypedDict(TypedDict): + field: str + r"""Dimension to filter on. Use the /meta endpoint for available dimensions.""" + operator: ScalarFilterOperator + r"""Comparison operator taking a scalar filter value.""" + value: ScalarFilterValueTypedDict + r"""Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" + + +class ScalarFilter(BaseModel): + field: str + r"""Dimension to filter on. Use the /meta endpoint for available dimensions.""" + + operator: ScalarFilterOperator + r"""Comparison operator taking a scalar filter value.""" + + value: ScalarFilterValue + r"""Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" diff --git a/src/openrouter/components/scalarfilteroperator.py b/src/openrouter/components/scalarfilteroperator.py new file mode 100644 index 000000000..e0b02c320 --- /dev/null +++ b/src/openrouter/components/scalarfilteroperator.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +ScalarFilterOperator = Union[ + Literal[ + "eq", + "neq", + "gt", + "gte", + "lt", + "lte", + ], + UnrecognizedStr, +] +r"""Comparison operator taking a scalar filter value.""" diff --git a/src/openrouter/components/setfilter.py b/src/openrouter/components/setfilter.py new file mode 100644 index 000000000..34228f6b0 --- /dev/null +++ b/src/openrouter/components/setfilter.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .setfilteroperator import SetFilterOperator +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +SetFilterValueTypedDict = TypeAliasType("SetFilterValueTypedDict", Union[str, float]) +r"""Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" + + +SetFilterValue = TypeAliasType("SetFilterValue", Union[str, float]) +r"""Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" + + +class SetFilterTypedDict(TypedDict): + field: str + r"""Dimension to filter on. Use the /meta endpoint for available dimensions.""" + operator: SetFilterOperator + r"""Set-membership operator taking an array filter value.""" + value: List[SetFilterValueTypedDict] + include_unset: NotRequired[bool] + r"""Include rows where the dimension has no value. Applies only to dimensions that have an unset bucket.""" + + +class SetFilter(BaseModel): + field: str + r"""Dimension to filter on. Use the /meta endpoint for available dimensions.""" + + operator: SetFilterOperator + r"""Set-membership operator taking an array filter value.""" + + value: List[SetFilterValue] + + include_unset: Optional[bool] = None + r"""Include rows where the dimension has no value. Applies only to dimensions that have an unset bucket.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["include_unset"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/setfilteroperator.py b/src/openrouter/components/setfilteroperator.py new file mode 100644 index 000000000..d3a253483 --- /dev/null +++ b/src/openrouter/components/setfilteroperator.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 + + +SetFilterOperator = Union[ + Literal[ + "in", + "not_in", + ], + UnrecognizedStr, +] +r"""Set-membership operator taking an array filter value.""" diff --git a/src/openrouter/components/vaultsecretwriterequest.py b/src/openrouter/components/vaultsecretwriterequest.py index b4a3db2fc..70de1bfb3 100644 --- a/src/openrouter/components/vaultsecretwriterequest.py +++ b/src/openrouter/components/vaultsecretwriterequest.py @@ -12,7 +12,7 @@ class VaultSecretWriteRequestTypedDict(TypedDict): hosts: List[str] r"""Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname.""" value: str - r"""Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.""" + r"""Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned.""" class VaultSecretWriteRequest(BaseModel): @@ -22,4 +22,4 @@ class VaultSecretWriteRequest(BaseModel): r"""Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname.""" value: str - r"""Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.""" + r"""Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned.""" diff --git a/src/openrouter/images.py b/src/openrouter/images.py index 50643a126..c21152bd7 100644 --- a/src/openrouter/images.py +++ b/src/openrouter/images.py @@ -70,14 +70,14 @@ def generate( :param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). :param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. :param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. - :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + :param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\"). :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. :param user: A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. @@ -145,14 +145,14 @@ def generate( :param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). :param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. :param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. - :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + :param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\"). :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. :param user: A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. @@ -223,14 +223,14 @@ def generate( :param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). :param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. :param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. - :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + :param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\"). :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. :param user: A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. @@ -300,14 +300,14 @@ def generate( :param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). :param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. :param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. - :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + :param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\"). :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. :param user: A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. @@ -585,14 +585,14 @@ async def generate_async( :param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). :param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. :param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. - :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + :param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\"). :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. :param user: A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. @@ -660,14 +660,14 @@ async def generate_async( :param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). :param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. :param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. - :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + :param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\"). :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. :param user: A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. @@ -738,14 +738,14 @@ async def generate_async( :param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). :param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. :param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. - :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + :param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\"). :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. :param user: A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. @@ -815,14 +815,14 @@ async def generate_async( :param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). :param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. :param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. - :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + :param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\"). :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. :param user: A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 35c06702f..fa711f814 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -430,14 +430,10 @@ GetAnalyticsMetaResponse, GetAnalyticsMetaResponseTypedDict, Granularity, - GranularityName, GranularityTypedDict, Metric, MetricTypedDict, - Operator, - OperatorName, - OperatorTypedDict, - ValueType, + Name, ) from .getapprankings import ( GetAppRankingsCategory, @@ -984,14 +980,8 @@ ClassifierDimensions, ClassifierDimensionsTypedDict, ClassifierFilters, - ClassifierFiltersFilter, - ClassifierFiltersFilterTypedDict, ClassifierFiltersTypedDict, - ClassifierFiltersValue, - ClassifierFiltersValueTypedDict, Direction, - Filter, - FilterTypedDict, Metadata, MetadataTypedDict, OrderBy, @@ -1010,12 +1000,6 @@ QueryAnalyticsResponseTypedDict, TimeRange, TimeRangeTypedDict, - Value1, - Value1TypedDict, - Value2, - Value2TypedDict, - ValueClassifierFilters, - ValueClassifierFiltersTypedDict, ) from .sendchatcompletionrequest import ( SendChatCompletionRequestGlobals, @@ -1186,11 +1170,7 @@ "ClassifierDimensions", "ClassifierDimensionsTypedDict", "ClassifierFilters", - "ClassifierFiltersFilter", - "ClassifierFiltersFilterTypedDict", "ClassifierFiltersTypedDict", - "ClassifierFiltersValue", - "ClassifierFiltersValueTypedDict", "Content", "ContentImageURL", "ContentImageURLTypedDict", @@ -1455,8 +1435,6 @@ "ExchangeAuthCodeForAPIKeyResponseTypedDict", "External", "ExternalTypedDict", - "Filter", - "FilterTypedDict", "GetAnalyticsMetaData", "GetAnalyticsMetaDataTypedDict", "GetAnalyticsMetaGlobals", @@ -1617,7 +1595,6 @@ "GetWorkspaceRequest", "GetWorkspaceRequestTypedDict", "Granularity", - "GranularityName", "GranularityTypedDict", "GroupBy", "Headquarters", @@ -1857,11 +1834,9 @@ "Metric", "MetricTypedDict", "Modality", + "Name", "Object", "ObjectEmbedding", - "Operator", - "OperatorName", - "OperatorTypedDict", "Order", "OrderBy", "OrderByTypedDict", @@ -1996,13 +1971,6 @@ "ValidatePrivateEndpointGlobalsTypedDict", "ValidatePrivateEndpointRequest", "ValidatePrivateEndpointRequestTypedDict", - "Value1", - "Value1TypedDict", - "Value2", - "Value2TypedDict", - "ValueClassifierFilters", - "ValueClassifierFiltersTypedDict", - "ValueType", "Window", "Zdr", ] @@ -2326,14 +2294,10 @@ "GetAnalyticsMetaResponse": ".getanalyticsmeta", "GetAnalyticsMetaResponseTypedDict": ".getanalyticsmeta", "Granularity": ".getanalyticsmeta", - "GranularityName": ".getanalyticsmeta", "GranularityTypedDict": ".getanalyticsmeta", "Metric": ".getanalyticsmeta", "MetricTypedDict": ".getanalyticsmeta", - "Operator": ".getanalyticsmeta", - "OperatorName": ".getanalyticsmeta", - "OperatorTypedDict": ".getanalyticsmeta", - "ValueType": ".getanalyticsmeta", + "Name": ".getanalyticsmeta", "GetAppRankingsCategory": ".getapprankings", "GetAppRankingsGlobals": ".getapprankings", "GetAppRankingsGlobalsTypedDict": ".getapprankings", @@ -2738,14 +2702,8 @@ "ClassifierDimensions": ".queryanalytics", "ClassifierDimensionsTypedDict": ".queryanalytics", "ClassifierFilters": ".queryanalytics", - "ClassifierFiltersFilter": ".queryanalytics", - "ClassifierFiltersFilterTypedDict": ".queryanalytics", "ClassifierFiltersTypedDict": ".queryanalytics", - "ClassifierFiltersValue": ".queryanalytics", - "ClassifierFiltersValueTypedDict": ".queryanalytics", "Direction": ".queryanalytics", - "Filter": ".queryanalytics", - "FilterTypedDict": ".queryanalytics", "Metadata": ".queryanalytics", "MetadataTypedDict": ".queryanalytics", "OrderBy": ".queryanalytics", @@ -2764,12 +2722,6 @@ "QueryAnalyticsResponseTypedDict": ".queryanalytics", "TimeRange": ".queryanalytics", "TimeRangeTypedDict": ".queryanalytics", - "Value1": ".queryanalytics", - "Value1TypedDict": ".queryanalytics", - "Value2": ".queryanalytics", - "Value2TypedDict": ".queryanalytics", - "ValueClassifierFilters": ".queryanalytics", - "ValueClassifierFiltersTypedDict": ".queryanalytics", "SendChatCompletionRequestGlobals": ".sendchatcompletionrequest", "SendChatCompletionRequestGlobalsTypedDict": ".sendchatcompletionrequest", "SendChatCompletionRequestRequest": ".sendchatcompletionrequest", diff --git a/src/openrouter/operations/deleteinternvaultsecret.py b/src/openrouter/operations/deleteinternvaultsecret.py index 40dffe39c..445c7df3d 100644 --- a/src/openrouter/operations/deleteinternvaultsecret.py +++ b/src/openrouter/operations/deleteinternvaultsecret.py @@ -77,7 +77,7 @@ class DeleteInternVaultSecretRequestTypedDict(TypedDict): intern_id: str r"""UUID of an intern in the workspace selected by the API key.""" name: str - r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + r"""Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.""" http_referer: NotRequired[str] r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -104,7 +104,7 @@ class DeleteInternVaultSecretRequest(BaseModel): name: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + r"""Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.""" http_referer: Annotated[ Optional[str], diff --git a/src/openrouter/operations/deletevaultsecret.py b/src/openrouter/operations/deletevaultsecret.py index 8db5088e3..94d21d87d 100644 --- a/src/openrouter/operations/deletevaultsecret.py +++ b/src/openrouter/operations/deletevaultsecret.py @@ -75,7 +75,7 @@ def serialize_model(self, handler): class DeleteVaultSecretRequestTypedDict(TypedDict): name: str - r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + r"""Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.""" http_referer: NotRequired[str] r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -95,7 +95,7 @@ class DeleteVaultSecretRequest(BaseModel): name: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + r"""Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.""" http_referer: Annotated[ Optional[str], diff --git a/src/openrouter/operations/getanalyticsmeta.py b/src/openrouter/operations/getanalyticsmeta.py index dc728a09f..d4b717427 100644 --- a/src/openrouter/operations/getanalyticsmeta.py +++ b/src/openrouter/operations/getanalyticsmeta.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from openrouter.components import operator as components_operator from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr from openrouter.utils import FieldMetadata, HeaderMetadata import pydantic @@ -152,7 +153,7 @@ class Dimension(BaseModel): r"""Dimension identifier used in query requests""" -GranularityName = Union[ +Name = Union[ Literal[ "minute", "hour", @@ -168,7 +169,7 @@ class Dimension(BaseModel): class GranularityTypedDict(TypedDict): display_label: str r"""Human-readable label""" - name: GranularityName + name: Name r"""Granularity identifier""" @@ -176,7 +177,7 @@ class Granularity(BaseModel): display_label: str r"""Human-readable label""" - name: GranularityName + name: Name r"""Granularity identifier""" @@ -218,52 +219,11 @@ class Metric(BaseModel): r"""Metric identifier used in query requests""" -OperatorName = Union[ - Literal[ - "eq", - "neq", - "in", - "not_in", - "gt", - "gte", - "lt", - "lte", - ], - UnrecognizedStr, -] -r"""Operator identifier used in filter definitions""" - - -ValueType = Union[ - Literal[ - "scalar", - "array", - ], - UnrecognizedStr, -] -r"""Whether the operator expects a single value or an array""" - - -class OperatorTypedDict(TypedDict): - name: OperatorName - r"""Operator identifier used in filter definitions""" - value_type: ValueType - r"""Whether the operator expects a single value or an array""" - - -class Operator(BaseModel): - name: OperatorName - r"""Operator identifier used in filter definitions""" - - value_type: ValueType - r"""Whether the operator expects a single value or an array""" - - class GetAnalyticsMetaDataTypedDict(TypedDict): dimensions: List[DimensionTypedDict] granularities: List[GranularityTypedDict] metrics: List[MetricTypedDict] - operators: List[OperatorTypedDict] + operators: List[components_operator.OperatorTypedDict] class GetAnalyticsMetaData(BaseModel): @@ -273,7 +233,7 @@ class GetAnalyticsMetaData(BaseModel): metrics: List[Metric] - operators: List[Operator] + operators: List[components_operator.Operator] class GetAnalyticsMetaResponseTypedDict(TypedDict): diff --git a/src/openrouter/operations/queryanalytics.py b/src/openrouter/operations/queryanalytics.py index 8eb73dfdc..ffee19233 100644 --- a/src/openrouter/operations/queryanalytics.py +++ b/src/openrouter/operations/queryanalytics.py @@ -2,12 +2,16 @@ from __future__ import annotations from datetime import datetime +from openrouter.components import ( + classifierfiltersfilter as components_classifierfiltersfilter, + filter_ as components_filter_, +) from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr from openrouter.utils import FieldMetadata, HeaderMetadata, RequestMetadata import pydantic from pydantic import model_serializer from typing import List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict class QueryAnalyticsGlobalsTypedDict(TypedDict): @@ -112,53 +116,12 @@ def serialize_model(self, handler): return m -ValueClassifierFiltersTypedDict = TypeAliasType( - "ValueClassifierFiltersTypedDict", Union[str, float] -) - - -ValueClassifierFilters = TypeAliasType("ValueClassifierFilters", Union[str, float]) - - -ClassifierFiltersValueTypedDict = TypeAliasType( - "ClassifierFiltersValueTypedDict", - Union[str, float, List[ValueClassifierFiltersTypedDict]], -) -r"""Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.""" - - -ClassifierFiltersValue = TypeAliasType( - "ClassifierFiltersValue", Union[str, float, List[ValueClassifierFilters]] -) -r"""Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.""" - - -class ClassifierFiltersFilterTypedDict(TypedDict): - field: str - r"""Classifier dimension name to filter on (snake_case identifier, e.g. \"department\", \"work_type\").""" - operator: str - r"""Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings.""" - value: ClassifierFiltersValueTypedDict - r"""Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.""" - - -class ClassifierFiltersFilter(BaseModel): - field: str - r"""Classifier dimension name to filter on (snake_case identifier, e.g. \"department\", \"work_type\").""" - - operator: str - r"""Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings.""" - - value: ClassifierFiltersValue - r"""Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.""" - - class ClassifierFiltersTypedDict(TypedDict): r"""Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.""" classifier_id: str r"""UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.""" - filters: List[ClassifierFiltersFilterTypedDict] + filters: List[components_classifierfiltersfilter.ClassifierFiltersFilterTypedDict] class ClassifierFilters(BaseModel): @@ -167,64 +130,7 @@ class ClassifierFilters(BaseModel): classifier_id: str r"""UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.""" - filters: List[ClassifierFiltersFilter] - - -Value2TypedDict = TypeAliasType("Value2TypedDict", Union[str, float]) - - -Value2 = TypeAliasType("Value2", Union[str, float]) - - -Value1TypedDict = TypeAliasType( - "Value1TypedDict", Union[str, float, List[Value2TypedDict]] -) -r"""Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" - - -Value1 = TypeAliasType("Value1", Union[str, float, List[Value2]]) -r"""Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" - - -class FilterTypedDict(TypedDict): - field: str - r"""Dimension to filter on. Use the /meta endpoint for available dimensions.""" - operator: str - r"""Filter operator""" - value: Value1TypedDict - r"""Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" - include_unset: NotRequired[bool] - r"""Include rows where the dimension has no value. Applies only to the `in` and `not_in` operators and dimensions that have an unset bucket.""" - - -class Filter(BaseModel): - field: str - r"""Dimension to filter on. Use the /meta endpoint for available dimensions.""" - - operator: str - r"""Filter operator""" - - value: Value1 - r"""Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.""" - - include_unset: Optional[bool] = None - r"""Include rows where the dimension has no value. Applies only to the `in` and `not_in` operators and dimensions that have an unset bucket.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["include_unset"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m + filters: List[components_classifierfiltersfilter.ClassifierFiltersFilter] Direction = Union[ @@ -271,7 +177,7 @@ class QueryAnalyticsRequestBodyTypedDict(TypedDict): classifier_filters: NotRequired[ClassifierFiltersTypedDict] r"""Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.""" dimensions: NotRequired[List[str]] - filters: NotRequired[List[FilterTypedDict]] + filters: NotRequired[List[components_filter_.FilterTypedDict]] granularity: NotRequired[str] r"""Time granularity""" group_limit: NotRequired[int] @@ -293,7 +199,7 @@ class QueryAnalyticsRequestBody(BaseModel): dimensions: Optional[List[str]] = None - filters: Optional[List[Filter]] = None + filters: Optional[List[components_filter_.Filter]] = None granularity: Optional[str] = None r"""Time granularity""" diff --git a/src/openrouter/vault.py b/src/openrouter/vault.py index 5883820d1..301f5a486 100644 --- a/src/openrouter/vault.py +++ b/src/openrouter/vault.py @@ -1060,7 +1060,7 @@ def delete_intern_vault_secret( If set, this operation will use `api_key` from the global security. :param intern_id: UUID of an intern in the workspace selected by the API key. - :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param name: Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -1234,7 +1234,7 @@ async def delete_intern_vault_secret_async( If set, this operation will use `api_key` from the global security. :param intern_id: UUID of an intern in the workspace selected by the API key. - :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param name: Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -1412,7 +1412,7 @@ def store_intern_vault_secret( :param intern_id: UUID of an intern in the workspace selected by the API key. :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. :param hosts: Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. - :param value: Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. + :param value: Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -1606,7 +1606,7 @@ async def store_intern_vault_secret_async( :param intern_id: UUID of an intern in the workspace selected by the API key. :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. :param hosts: Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. - :param value: Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. + :param value: Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -2508,7 +2508,7 @@ def delete_vault_secret( If set, this operation will use `api_key` from the global security. - :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param name: Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -2679,7 +2679,7 @@ async def delete_vault_secret_async( If set, this operation will use `api_key` from the global security. - :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param name: Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -2854,7 +2854,7 @@ def store_vault_secret( :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. :param hosts: Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. - :param value: Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. + :param value: Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -3045,7 +3045,7 @@ async def store_vault_secret_async( :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. :param hosts: Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. - :param value: Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. + :param value: Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. diff --git a/uv.lock b/uv.lock index 58e3ebc0a..4ae6a0b0c 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.96" +version = "1.3.97" source = { editable = "." } dependencies = [ { name = "httpcore" }, From 51a13f50d062dc91adf697dd8a2fc1c3c3f2e88e Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 00:02:50 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow