From d32d5281647392d9cfa60c3b99954b0fcf384a23 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 24 Jun 2026 00:50:00 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `open_router.beta.responses.send()`: * `request` **Changed** * `response` **Changed** **Breaking** :warning: * `open_router.tts.create_speech()`: * `request.provider.options.tenstorrent` **Added** * `open_router.chat.send()`: `response` **Changed** * `open_router.images.list_models()`: **Added** * `open_router.images.list_model_endpoints()`: **Added** * `open_router.datasets.get_benchmarks_artificial_analysis()`: **Deleted** **Breaking** :warning: * `open_router.datasets.get_benchmarks_design_arena()`: **Deleted** **Breaking** :warning: * `open_router.classifications.get_task_classifications()`: **Added** * `open_router.benchmarks.get_benchmarks()`: **Added** * `open_router.images.generate()`: **Added** * `open_router.stt.create_transcription()`: * `request.provider.options.tenstorrent` **Added** * `open_router.byok.list()`: `request.provider` **Changed** * `open_router.embeddings.generate()`: `response.usage` **Changed** * `open_router.embeddings.list_models()`: `response.data.[].reasoning` **Added** * `open_router.models.get()`: `response.data.reasoning` **Added** * `open_router.models.list()`: `response.data.[].reasoning` **Added** * `open_router.models.list_for_user()`: `response.data.[].reasoning` **Added** * `open_router.presets.create_presets_responses()`: `request` **Changed** * `open_router.video_generation.generate()`: * `request.provider.options.tenstorrent` **Added** --- .speakeasy/gen.lock | 1070 ++++-- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 2890 ++++++++++++----- .speakeasy/workflow.lock | 12 +- RELEASES.md | 12 +- docs/components/completiontokensdetails.md | 13 - docs/components/error.md | 11 - docs/components/model.md | 1 + docs/components/prompttokensdetails.md | 13 - docs/components/providername.md | 1 + docs/sdks/responses/README.md | 1 + pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/benchmarks.py | 303 ++ src/openrouter/classifications.py | 315 ++ src/openrouter/components/__init__.py | 594 +++- src/openrouter/components/advisorreasoning.py | 1 + .../anthropicadvisormessageusageiteration.py | 82 + .../anthropiccompactionusageiteration.py | 79 + .../anthropiciterationcachecreation.py | 17 + .../anthropicmessageusageiteration.py | 83 + src/openrouter/components/anthropicspeed.py | 14 + .../anthropicunknownusageiteration.py | 76 + .../components/anthropicusageiteration.py | 43 + src/openrouter/components/apierrortype.py | 40 + src/openrouter/components/benchmarksaameta.py | 53 - .../components/benchmarksaaresponse.py | 19 - src/openrouter/components/benchmarksdameta.py | 118 - .../components/benchmarksdaresponse.py | 19 - .../components/booleancapability.py | 21 + src/openrouter/components/byokproviderslug.py | 1 + .../components/capabilitydescriptor.py | 30 + src/openrouter/components/chatrequest.py | 2 + src/openrouter/components/chatstreamchunk.py | 37 +- src/openrouter/components/chatusage.py | 89 +- src/openrouter/components/debugevent.py | 65 + src/openrouter/components/enumcapability.py | 24 + .../components/fusionservertoolconfig.py | 10 + src/openrouter/components/imageendpoint.py | 81 + .../components/imagegencompletedevent.py | 40 + .../components/imagegenerationrequest.py | 593 ++++ .../components/imagegenerationresponse.py | 41 + .../components/imagegenerationservertool.py | 25 +- .../components/imagegenerationusage.py | 331 ++ .../components/imagegenpartialimageevent.py | 34 + .../components/imagegenstreamerrorevent.py | 95 + .../components/imagemodelarchitecture.py | 29 + .../components/imagemodelendpointsresponse.py | 24 + .../components/imagemodellistitem.py | 56 + .../components/imagemodelslistresponse.py | 19 + .../components/imageoutputmodality.py | 20 + .../components/imagepricingentry.py | 51 + .../components/imagestreamingresponse.py | 48 + src/openrouter/components/messagesrequest.py | 8 +- src/openrouter/components/model.py | 7 + src/openrouter/components/modelreasoning.py | 107 + .../observabilityarizedestination.py | 2 + .../components/openresponsesresult.py | 9 + src/openrouter/components/providername.py | 1 + src/openrouter/components/provideroptions.py | 3 + src/openrouter/components/providerresponse.py | 1 + src/openrouter/components/rangecapability.py | 27 + src/openrouter/components/reasoningeffort.py | 1 + src/openrouter/components/responsesrequest.py | 7 + src/openrouter/components/streamevents.py | 31 +- .../components/subagentreasoning.py | 1 + .../components/taskclassificationitem.py | 55 + .../taskclassificationmacrocategory.py | 30 + .../components/taskclassificationmodel.py | 25 + .../components/taskclassificationresponse.py | 47 + ...kpricing.py => unifiedbenchmarkpricing.py} | 4 +- ...ksaaitem.py => unifiedbenchmarksaaitem.py} | 33 +- ...ksdaitem.py => unifiedbenchmarksdaitem.py} | 27 +- .../components/unifiedbenchmarksmeta.py | 95 + .../components/unifiedbenchmarksresponse.py | 43 + .../components/videogenerationrequest.py | 25 +- src/openrouter/datasets.py | 536 --- src/openrouter/images.py | 1319 ++++++++ src/openrouter/operations/__init__.py | 119 +- src/openrouter/operations/createembeddings.py | 88 + src/openrouter/operations/createimages.py | 150 + src/openrouter/operations/getbenchmarks.py | 178 + ...signarena.py => gettaskclassifications.py} | 59 +- src/openrouter/operations/listbyokkeys.py | 1 + .../operations/listimagemodelendpoints.py | 114 + ...tificialanalysis.py => listimagemodels.py} | 18 +- src/openrouter/presets.py | 28 +- src/openrouter/responses.py | 30 + src/openrouter/sdk.py | 12 + src/openrouter/video_generation.py | 8 +- uv.lock | 2 +- 91 files changed, 8781 insertions(+), 2124 deletions(-) delete mode 100644 docs/components/completiontokensdetails.md delete mode 100644 docs/components/error.md delete mode 100644 docs/components/prompttokensdetails.md create mode 100644 src/openrouter/benchmarks.py create mode 100644 src/openrouter/classifications.py create mode 100644 src/openrouter/components/anthropicadvisormessageusageiteration.py create mode 100644 src/openrouter/components/anthropiccompactionusageiteration.py create mode 100644 src/openrouter/components/anthropiciterationcachecreation.py create mode 100644 src/openrouter/components/anthropicmessageusageiteration.py create mode 100644 src/openrouter/components/anthropicspeed.py create mode 100644 src/openrouter/components/anthropicunknownusageiteration.py create mode 100644 src/openrouter/components/anthropicusageiteration.py create mode 100644 src/openrouter/components/apierrortype.py delete mode 100644 src/openrouter/components/benchmarksaameta.py delete mode 100644 src/openrouter/components/benchmarksaaresponse.py delete mode 100644 src/openrouter/components/benchmarksdameta.py delete mode 100644 src/openrouter/components/benchmarksdaresponse.py create mode 100644 src/openrouter/components/booleancapability.py create mode 100644 src/openrouter/components/capabilitydescriptor.py create mode 100644 src/openrouter/components/debugevent.py create mode 100644 src/openrouter/components/enumcapability.py create mode 100644 src/openrouter/components/imageendpoint.py create mode 100644 src/openrouter/components/imagegencompletedevent.py create mode 100644 src/openrouter/components/imagegenerationrequest.py create mode 100644 src/openrouter/components/imagegenerationresponse.py create mode 100644 src/openrouter/components/imagegenerationusage.py create mode 100644 src/openrouter/components/imagegenpartialimageevent.py create mode 100644 src/openrouter/components/imagegenstreamerrorevent.py create mode 100644 src/openrouter/components/imagemodelarchitecture.py create mode 100644 src/openrouter/components/imagemodelendpointsresponse.py create mode 100644 src/openrouter/components/imagemodellistitem.py create mode 100644 src/openrouter/components/imagemodelslistresponse.py create mode 100644 src/openrouter/components/imageoutputmodality.py create mode 100644 src/openrouter/components/imagepricingentry.py create mode 100644 src/openrouter/components/imagestreamingresponse.py create mode 100644 src/openrouter/components/modelreasoning.py create mode 100644 src/openrouter/components/rangecapability.py create mode 100644 src/openrouter/components/taskclassificationitem.py create mode 100644 src/openrouter/components/taskclassificationmacrocategory.py create mode 100644 src/openrouter/components/taskclassificationmodel.py create mode 100644 src/openrouter/components/taskclassificationresponse.py rename src/openrouter/components/{benchmarkpricing.py => unifiedbenchmarkpricing.py} (87%) rename src/openrouter/components/{benchmarksaaitem.py => unifiedbenchmarksaaitem.py} (78%) rename src/openrouter/components/{benchmarksdaitem.py => unifiedbenchmarksdaitem.py} (83%) create mode 100644 src/openrouter/components/unifiedbenchmarksmeta.py create mode 100644 src/openrouter/components/unifiedbenchmarksresponse.py create mode 100644 src/openrouter/images.py create mode 100644 src/openrouter/operations/createimages.py create mode 100644 src/openrouter/operations/getbenchmarks.py rename src/openrouter/operations/{getbenchmarksdesignarena.py => gettaskclassifications.py} (64%) create mode 100644 src/openrouter/operations/listimagemodelendpoints.py rename src/openrouter/operations/{getbenchmarksartificialanalysis.py => listimagemodels.py} (84%) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 4249b4b3..666b9cdc 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: 8dd32184dc771115ba5e79b3c70e7f6f + docChecksum: 1fa8e5b0e17f8a8011b4a14b08e8b27a docVersion: 1.0.0 speakeasyVersion: 1.680.0 generationVersion: 2.788.4 - releaseVersion: 0.10.0 - configChecksum: 00a97c5bcdbddf7e591c0a1d7a45e98e + releaseVersion: 0.10.1 + configChecksum: b1687c127d87a1ac114b35dd9b492f3c repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: b6cb6701-b1ae-453f-beb8-2064f09433f4 - pristine_commit_hash: ed0a00c99b7b3b76ed1de023bc8174696435c2cd - pristine_tree_hash: a5b3d8dc9253bb236d709d9f365f5766595d820b + generation_id: 4fb9c904-e778-406b-bf97-2a66744bc9f2 + pristine_commit_hash: 596a3ce4e96d3bcec5ec3b054718ddab5931d568 + pristine_tree_hash: c26fb96a6f3c9c16b22938044f87bdd6589b082a features: python: acceptHeaders: 3.0.0 @@ -118,8 +118,8 @@ trackedFiles: pristine_git_object: 123091224cbc4d87e2e01748e013618f2d142632 docs/components/advisorreasoningeffort.md: id: 8b65bf21bf5d - last_write_checksum: sha1:ffd01ce6c48ad3d25fb92083622f94c855ed2dea - pristine_git_object: 70c97a14813005cfafcc7e2d132921d3e95fb7bc + last_write_checksum: sha1:ae1a31169657770ac54bd15b8b9ba99dec447546 + pristine_git_object: 8828292d4f0692af00fefc00ae0a702cb151d2f1 docs/components/advisorservertoolconfig.md: id: 9a630ec9486f last_write_checksum: sha1:b01e3db43dd70ddca3a7bb093b99f5b14c669835 @@ -152,6 +152,14 @@ trackedFiles: id: 11b3c6c877d0 last_write_checksum: sha1:4d8fae9c0de452c9ee796eeab63d242e4feb8497 pristine_git_object: 4840df7f7005389811fae7c8868ad8d6c1efcd18 + docs/components/anthropicadvisormessageusageiteration.md: + id: 33186ccd38ac + last_write_checksum: sha1:85b1ab8c5a0caba0d812a49020e86c3e4e4e9a08 + pristine_git_object: fb1fb2c3c092a43a6f03f4b264d71641bd0e7446 + docs/components/anthropicadvisormessageusageiterationtype.md: + id: f57e902db2d1 + last_write_checksum: sha1:dddea52debf78713faf29d2538ebb770389ec3e5 + pristine_git_object: c91caf36632b4be80f9ee056c70353060066eb7a docs/components/anthropicallowedcallers.md: id: 11ad7b23165a last_write_checksum: sha1:25cf3f22c4aec1a2dad1c12dd83d5ac9681386c5 @@ -228,6 +236,14 @@ trackedFiles: id: 9a62f0c12dea last_write_checksum: sha1:d6f2b7a37400b47dc5fe09582e4a1c386efd5f64 pristine_git_object: 1d4dc34466805c06bef9a5ea0d4b3e2658d8fbca + docs/components/anthropiccompactionusageiteration.md: + id: 0fdb4605a989 + last_write_checksum: sha1:56320c5757e6070820d812140e08b55844c0c387 + pristine_git_object: 12fda13cd239b66019e9d6ecba71731b99241816 + docs/components/anthropiccompactionusageiterationtype.md: + id: 05adaf701f26 + last_write_checksum: sha1:73792e3e037989d145d95059d9926d9cca0b09fa + pristine_git_object: 8b38e51d69691041d5c05c3fd3f6b7e0d400fce9 docs/components/anthropicdocumentblockparam.md: id: 0c8300a9f979 last_write_checksum: sha1:96771cf30db36eb18111c9600fda87cb6e446ec2 @@ -288,6 +304,18 @@ trackedFiles: id: c1ed4899ff43 last_write_checksum: sha1:c30ae212332ee1793cfdf928f5529f02f57fba08 pristine_git_object: 07b76dbfef3ae2fa73a2c8a347aaec4a2c2db250 + docs/components/anthropiciterationcachecreation.md: + id: 3a99c1a33f1b + last_write_checksum: sha1:c6fd763c2cebfbba0a36f8f6200ff6974f702e4b + pristine_git_object: 55371b59cf7faa5425c4207b1adb658830bbd7d8 + docs/components/anthropicmessageusageiteration.md: + id: 161b60719de5 + last_write_checksum: sha1:6620e05e3214198239b7dc56b085630726d6b21b + pristine_git_object: 3cb3b43e9fbd0f5cab636b5b48b0c80dedae1839 + docs/components/anthropicmessageusageiterationtype.md: + id: 3d6e1d90edab + last_write_checksum: sha1:9f6d1c4cf939adcd22b792d57ab41cde2c1b18a9 + pristine_git_object: 7ba4b3470290a6518ddc33a5675daf4a486871b3 docs/components/anthropicplaintextsource.md: id: 889fb950c676 last_write_checksum: sha1:d8887a9e5aed15b708e69d8073fa6a5563afca5b @@ -312,6 +340,10 @@ trackedFiles: id: 727f596d14b6 last_write_checksum: sha1:8aac220d2c56349083d624947756e5d459df3b50 pristine_git_object: 89be471a605fb0c9061d62cd853fa70cea52d88f + docs/components/anthropicspeed.md: + id: 3391bd502330 + last_write_checksum: sha1:40c366feb39d4306823c71e112b2c9fb40adca9e + pristine_git_object: b523006e867a12653a8e462cd2158e4ff6a5a33f docs/components/anthropictextblockparam.md: id: 5dc491a109ed last_write_checksum: sha1:53c890398ec305cb94ef47dc91ede516284903c0 @@ -348,6 +380,10 @@ trackedFiles: id: 45a733d909af last_write_checksum: sha1:474ee631bb8dcae59c70180e496431be478cae5f pristine_git_object: 675f7fd5e9133893bf44dc86bcd92d1f6dfaad61 + docs/components/anthropicunknownusageiteration.md: + id: 7cd2d2aa995f + last_write_checksum: sha1:47e54d3e8225cc69c125c2ab45d0377d8407c36a + pristine_git_object: 2f341aed854466929fc7e8c909b771fb276447b0 docs/components/anthropicurlimagesource.md: id: 8ff15dedbdfe last_write_checksum: sha1:bab99b78bdc564a6d16910aec71cfc8a15fe5a91 @@ -364,6 +400,10 @@ trackedFiles: id: 2fbeab80f950 last_write_checksum: sha1:8db23a874bd09d9757276589bd1b4d2ab77180e4 pristine_git_object: 3757423de0c85933d0aadd6bb331862c69b6fbde + docs/components/anthropicusageiteration.md: + id: 9d04ae0634ed + last_write_checksum: sha1:4fcbd0ad911126d09cb0d1c2deb31274f0cfc437 + pristine_git_object: 0bf1cc48ee7ff861dcd371c0e73aea1cadb50942 docs/components/anthropicwebsearchresultblockparam.md: id: 719c1c8395a3 last_write_checksum: sha1:21e1935215988acd172e194ff764e3b4c7680733 @@ -380,6 +420,10 @@ trackedFiles: id: 9f4ae9375a85 last_write_checksum: sha1:383159e247a79336120befe7f34d876dc2e93b24 pristine_git_object: 21c0a2b3ee378c2301f8f82385193e3f6bfc0f01 + docs/components/apierrortype.md: + id: 036063e21392 + last_write_checksum: sha1:860373546a5bd66c47bb4f976e92cc512727b51a + pristine_git_object: 10664241eafdb8ba666faebf62e4285f452450e7 docs/components/apitype.md: id: "0e0508573603" last_write_checksum: sha1:36f315a2ffdb3a935abab8832ca98d89e2945a14 @@ -488,10 +532,6 @@ trackedFiles: id: 40a5f2f0b4f3 last_write_checksum: sha1:1edafecb76992fb1ef8201d9686a011a805431f2 pristine_git_object: 335e0104f7f12774a22886876bde455234e7ea9b - docs/components/aspectratio.md: - id: fc8c3ccdb468 - last_write_checksum: sha1:573dc4ea5cdec788353f87f49ab48434367d7a56 - pristine_git_object: 10febe4b549ef241d21e8ec471c5867c4c670f9e docs/components/audiourl.md: id: 1ad9b13da86b last_write_checksum: sha1:9614979c76c9624def8aeecc503aa736c99240a0 @@ -504,10 +544,6 @@ trackedFiles: id: a871b7b2af66 last_write_checksum: sha1:f9df41065f2d4eaf35a8d24a54a3824d17e12284 pristine_git_object: 350b1e9c7a237364a36740e7737db408de1fba50 - docs/components/background.md: - id: d5d845f5b5f5 - last_write_checksum: sha1:9221c224fd1b8e9c50e5eda1ed6fe78c47221f96 - pristine_git_object: 62f0f52d26cf2e28ae868efa254c7dd41a37537b docs/components/badgatewayresponseerrordata.md: id: f01b062274e6 last_write_checksum: sha1:7dc1fd7cde5f6810da4b468ecbfa6c5a68d402c6 @@ -596,58 +632,18 @@ trackedFiles: id: e6ed8eddbb24 last_write_checksum: sha1:4b8db8f915f099b89698c93a9dd86fdde32f0d29 pristine_git_object: 39e37fdadaf320fbd499c345f02b0f248331fa98 - docs/components/benchmarkpricing.md: - id: 1773696fd2fb - last_write_checksum: sha1:335d20d71d0225a7b8b3ef222f2433571966fe03 - pristine_git_object: 335c8e92b6ef64040c2d5d774f8bba265bf98f83 - docs/components/benchmarksaaitem.md: - id: a51a6ebb2653 - last_write_checksum: sha1:5f32825973fbdb3a88d6ae603d9f342befa17ab8 - pristine_git_object: 1800438874a9224105018148d4fb38ec29aed892 - docs/components/benchmarksaameta.md: - id: 66665e5cc0cb - last_write_checksum: sha1:4015be7186e032526ac628e4e57420410ea86bc7 - pristine_git_object: 92f3db8c60f8ef464075623dc24a6e20c74d1750 - docs/components/benchmarksaametasource.md: - id: 2aac90c13609 - last_write_checksum: sha1:218130854d26c4067c6ced560ec4c1393e144174 - pristine_git_object: 9917ffc03124110df323fa88d5a5026145797eb1 - docs/components/benchmarksaametasourceurl.md: - id: 5775371c2220 - last_write_checksum: sha1:bfd9917a494e65d372cd3900f5178e37af0580ed - pristine_git_object: 79522841c570e593e332ce71c07eb81b23abc230 - docs/components/benchmarksaametaversion.md: - id: 7ff3469b31de - last_write_checksum: sha1:e26c09306146670ea424451b18297b96258d29c2 - pristine_git_object: 9649dd143a7a7d927563c2e5d66d899d4bd4a23d - docs/components/benchmarksaaresponse.md: - id: 6a2090513e37 - last_write_checksum: sha1:139fd98981f96576c7ef677d15536be622e5b8fe - pristine_git_object: a170b12c3bd7816ed14a2bcf823ad518bb5b10ff - docs/components/benchmarksdaitem.md: - id: a921b9b462b2 - last_write_checksum: sha1:51b045b1525937e43d122e7e944e305393957000 - pristine_git_object: 6ef28c047743208fd9694ff3f5fb6797ed2bec39 - docs/components/benchmarksdameta.md: - id: 396a3643066d - last_write_checksum: sha1:33c7867659944bd15b83c41170aa6a2cf6b18726 - pristine_git_object: 71b87b1e04918ab51469ac90868385b723147734 - docs/components/benchmarksdametasource.md: - id: 2846adb831b8 - last_write_checksum: sha1:c6a9d05b62027e40294664cd4d60eb54eb638ec4 - pristine_git_object: 5c7aa0e34088aba458f90c5ef441b84b6cc3201e - docs/components/benchmarksdametasourceurl.md: - id: 6991d2000ec5 - last_write_checksum: sha1:10a1e0d6a64580aa4443b35ebd44497fd6720c15 - pristine_git_object: 0460bd8b38e93aaf2dfee47a96b9e46ef2e3b0d0 - docs/components/benchmarksdametaversion.md: - id: da86e114b298 - last_write_checksum: sha1:e36c13df0304f6803bae21d80dc888d29c281634 - pristine_git_object: 8997ff2bb56ee569f15d0d1932b95f00c2674ebc - docs/components/benchmarksdaresponse.md: - id: f052f6690836 - last_write_checksum: sha1:d49ff5d719b552043a32a0cde7c36578bb5f1a8f - pristine_git_object: d296d588dcc07434b82d1fc1bb60a88486406ded + docs/components/billable.md: + id: e56cdac5d413 + last_write_checksum: sha1:98491069a5b43aebf322444078f4484e619feb1d + pristine_git_object: 37795867a108149fc17bf3eef278a974b555b979 + docs/components/booleancapability.md: + id: 41eaf33722f3 + last_write_checksum: sha1:cd411f5fcbd4d577fa2fce0e25585f23c36d4d40 + pristine_git_object: fdb413c61dcecb4b3a9a746774ca51dbb46907c5 + docs/components/booleancapabilitytype.md: + id: ecb8a3396553 + last_write_checksum: sha1:51460435490021c79f8cbea257d7321e15b7b743 + pristine_git_object: 7b69b91002c3e38e6751e581211d9fa17e209ff2 docs/components/bulkaddworkspacemembersrequest.md: id: 12cbe93243c4 last_write_checksum: sha1:5bc0f5067f2fdd1a05409b18ec723b8b2acb4026 @@ -706,12 +702,16 @@ trackedFiles: pristine_git_object: b4b8d797251e82804d823c25a93aa5116e292d5f docs/components/byokproviderslug.md: id: 73e588243967 - last_write_checksum: sha1:3ea3bc70d14aaab8fbcc9b3377ff978932cbb2ab - pristine_git_object: d7c097216061b05072bb004982b66df48f6b4e28 + last_write_checksum: sha1:0f894b39e84d59f1b4cb07a93d409237a8b169f0 + pristine_git_object: 45e6a397f9484c67081b0c931e40773c9416ae5e docs/components/caching.md: id: 87fa8b1ac535 last_write_checksum: sha1:cd5e0704dcc4beb29c8e173b7d73365c27b1cb8e pristine_git_object: 4108245a8918a4015e5bd610fd87e8e5f4741ce8 + docs/components/capabilitydescriptor.md: + id: b50896c38c8d + last_write_checksum: sha1:08c9bd8d8829a298de0f531b0c1c4d8e0e0f6199 + pristine_git_object: 5d58663d481701b702e326aa62e86f93295c2f78 docs/components/chatassistantimages.md: id: f1f776b0c4ae last_write_checksum: sha1:05697e4bc0690cabd72965d01519102c149f6363 @@ -906,8 +906,8 @@ trackedFiles: pristine_git_object: 6c832606b0e983d2efd7cc6e3bec98d70e7fc603 docs/components/chatrequesteffort.md: id: 244b6cbbd2e1 - last_write_checksum: sha1:232d283adecdffb3fd73e052f4913320c9d0b997 - pristine_git_object: ed30f437a84f7ae8508545aefa44198935377768 + last_write_checksum: sha1:f9ce1e4a1c3f705b673808b35750af7b71b158ca + pristine_git_object: 26c09f0c5ae097d1373b8e5c721a4606765d5c99 docs/components/chatrequestplugin.md: id: 24a908f99472 last_write_checksum: sha1:0d96c14c2f1675e1bc3cdea7b70a82385a5bc117 @@ -918,16 +918,16 @@ trackedFiles: pristine_git_object: baa1fb1a1f855f0ea648d44b8cb4c52185efe77d docs/components/chatrequestreasoningeffort.md: id: d91e84590d64 - last_write_checksum: sha1:e05ffa6a13566055170ad3490b2114c7f8215c70 - pristine_git_object: ab2eb8e2084efaee1528e74f2de35166d9bbf05e + last_write_checksum: sha1:b72a0292fdffaf77b2531a155ca00d6d46405746 + pristine_git_object: 475f655086e1ec97e9b7aadc35ea4977da9e32dd docs/components/chatrequestservicetier.md: id: deaf591bec38 last_write_checksum: sha1:8fa53b0f868c99934b83719b7c0b6b44b1f960eb pristine_git_object: 13ae40be5e3c883f88789c3b5b74a3b2da4c85c2 docs/components/chatresult.md: id: 212b0f66efd0 - last_write_checksum: sha1:0a94cfb0c88a0dbf0f0abc5d83ac6fc6c48051b4 - pristine_git_object: cc04eadd2f48efd93533a3ddae52ad39e91f5dee + last_write_checksum: sha1:f40df693ad2d2d8e156aacb218af394f675bfb89 + pristine_git_object: 41f82f9576591d048a504f29ca19b148ccca02bc docs/components/chatresultobject.md: id: 668504931d18 last_write_checksum: sha1:6d550246aa007a5be94a9788ae4cfdfb75006980 @@ -950,8 +950,16 @@ trackedFiles: pristine_git_object: 690d74b67239bf7f423039652aea3741c831137e docs/components/chatstreamchunk.md: id: 404d264ea22c - last_write_checksum: sha1:1353c09378850a9810c39cf3198f0fd5e049f610 - pristine_git_object: 3c64aec72fb2eb9f0cf6eae975dd9c8bb183c6e6 + last_write_checksum: sha1:a5e9c58b21127bf93139cfb1b0a1276b141daaa7 + pristine_git_object: deabe169649ad00df0ca40ba1d018bce72cd8c5e + docs/components/chatstreamchunkerror.md: + id: 5a682faf2e52 + last_write_checksum: sha1:11c574387ad732a510f5dbdb23228b9756ab2809 + pristine_git_object: e8fe9aa61113231613df47d0cdf54c2fedc15134 + docs/components/chatstreamchunkmetadata.md: + id: acc0cb830ced + last_write_checksum: sha1:b8cdf1dd8825c832a9162d42d6c776394cb09212 + pristine_git_object: d1ac1cb7d60159e5f2438f0aca87623b232533be docs/components/chatstreamchunkobject.md: id: 5393918d9606 last_write_checksum: sha1:0765d94b3d01c811155dce29c20c2ae4bd4abd0e @@ -1050,8 +1058,16 @@ trackedFiles: pristine_git_object: 7eb1791a9153498d5ffffc6b67d3668df59000c2 docs/components/chatusage.md: id: 72cd0c41ec64 - last_write_checksum: sha1:9a6a709e2ea8f36c1f55afc3ae364917ab787e5e - pristine_git_object: 536fc52c1d3dec20dc3dd38e65714da08779e4d3 + last_write_checksum: sha1:144cb3e4e6a71d58327acf0ff8498eed396ade84 + pristine_git_object: 1d06874f274e6752279eeff823c9a05b8ee97735 + docs/components/chatusagecompletiontokensdetails.md: + id: fd8b3b9b7ae5 + last_write_checksum: sha1:16c853c63f5304e52cbf897cb4f67e9d35d3b97b + pristine_git_object: e3ccb3e879887bc2406c08c4321435c986a04309 + docs/components/chatusageprompttokensdetails.md: + id: c8b56480e08a + last_write_checksum: sha1:28bbd1adcb38e0e57cc2b20e5ed0f26269e39675 + pristine_git_object: 14e30cda6c43cb27d0316b8d1450c63943115467 docs/components/chatusermessage.md: id: 4ab205b0030b last_write_checksum: sha1:4c87fbc12f54bb5b58526949e3f8ea9c161f8cdf @@ -1108,10 +1124,6 @@ trackedFiles: id: 1033dd974aab last_write_checksum: sha1:ba3f1ccb85f1193a2523c96199a7e15a4923e5ef pristine_git_object: 3616c45038b37d4adc7f0d643f7159853915586d - docs/components/completiontokensdetails.md: - id: 6b7b08e269a0 - last_write_checksum: sha1:1731f180f3ed8e9fb0a52137853b0d587f8f703c - pristine_git_object: 79c357c837cdd905fc6e73470401f1477f3539b7 docs/components/compoundfilter.md: id: 6c881867d341 last_write_checksum: sha1:0afec796142bbf1dd29d5ae73e6926bfc46c7ab6 @@ -1448,6 +1460,22 @@ trackedFiles: id: 8d84fb41685d last_write_checksum: sha1:fcfbe6740c505b263b90f7de5281d4f506922b05 pristine_git_object: 870296bd3335da46ecdf4ec1722a3d47037a09c9 + docs/components/debug.md: + id: 26a3872bbe78 + last_write_checksum: sha1:49855ba9878e3a8cab4e48176c1638475824b111 + pristine_git_object: 57d0211ffc7883793b06207fd2909f05117f42e1 + docs/components/debugevent.md: + id: fc88265fcb2e + last_write_checksum: sha1:5797649b9dec8e67a019a339786d29067bc6c1d0 + pristine_git_object: 190177ccf64727feae565ad9930ca71cf0c5bc1f + docs/components/debugeventtype.md: + id: 8e17e2235c87 + last_write_checksum: sha1:981773f91d37ee4d920a01c457995b4fe2085f69 + pristine_git_object: c70c1ce547e7a377caca25eac9e55d5cac10c165 + docs/components/defaulteffort.md: + id: 08dabde07c1d + last_write_checksum: sha1:0a1d4ee947c22010f9bb2cb66a52a0bbb2011e00 + pristine_git_object: 871219eaf7153f1027be70d26b1f667444a6fb17 docs/components/defaultparameters.md: id: a84477afcaec last_write_checksum: sha1:a20e8b576e341dbcdb91884b8fc83cf4316ab106 @@ -1556,10 +1584,6 @@ trackedFiles: id: 099ed6a1de82 last_write_checksum: sha1:41580565bc483b2ca1cdb981e15d324f8060f504 pristine_git_object: 8463c0cdd55e1d75e23e3d7362f0dbfeca1985c0 - docs/components/elobounds.md: - id: a274cbd2e74e - last_write_checksum: sha1:516698f2d4c018cb0e999981d34f4d4d782a2382 - pristine_git_object: 101203ebc6a380cabc8c7767c3d9a775bbf16dda docs/components/endpointinfo.md: id: 98e0e75e1121 last_write_checksum: sha1:5563b32279aeafa2725d1547df1d0f517e53789d @@ -1572,14 +1596,18 @@ trackedFiles: id: 8643237270dc last_write_checksum: sha1:945606bc29cd884375a5c9404786df5e726e67a0 pristine_git_object: dd8900571dc033720f7ae045e3ea0592d4588c4c + docs/components/enumcapability.md: + id: 03f3a8a22c9d + last_write_checksum: sha1:3e87b13cadc0c69789c6a5f9e0d5163501615711 + pristine_git_object: ab110208b2603a762628911c9952a34dce75a38a + docs/components/enumcapabilitytype.md: + id: eb85df42d2a1 + last_write_checksum: sha1:c86722cdb14ed7a6de6574259b4a44fbcfb3f104 + pristine_git_object: 4c3f22bb88bfc6e30be791285a94861ae272c39c docs/components/environment.md: id: 29e78fad01ee last_write_checksum: sha1:532d3cc7bb12231a96be78b25f9b5b06e1db3218 pristine_git_object: e58da65457bd71885289a77f054ae63189dc77d9 - docs/components/error.md: - id: 786c3bb44e8d - last_write_checksum: sha1:5ed43ad1b7a3ad8ed0d2198be4edb3a469c4910c - pristine_git_object: a64dcf8737b1b8fd7dd8d3be0d9ca92f3febb59d docs/components/errorcode.md: id: 8444c861d257 last_write_checksum: sha1:8afa60d8ed19ab173c806f80bbe6fee0f40daf5a @@ -1592,6 +1620,10 @@ trackedFiles: id: c66a1a2560ef last_write_checksum: sha1:75e5cd528e6faeee349e685da1810190643ae17d pristine_git_object: b3410e67c37edd66f60b0f2364e0d858abe3bd88 + docs/components/event.md: + id: 4bd48e5ca177 + last_write_checksum: sha1:943311c8ce583f0b6395a3a71b3c2c8d3ca1d533 + pristine_git_object: 951557e29494624a811928ce287ea536a39d14c2 docs/components/failedmodel.md: id: 352428b99ca5 last_write_checksum: sha1:92ead534bbde5d3029a41bcdae5d381d85ece301 @@ -1890,12 +1922,12 @@ trackedFiles: pristine_git_object: 6e9d365f8f2f48bd6e425c4bc196d5572b5c9828 docs/components/fusionservertoolconfig.md: id: bc9b9f7ae08b - last_write_checksum: sha1:49f4e5047fad8c20098c6500d17ee3d883f41c56 - pristine_git_object: b243b885cd9572d61cb63f2364f924a0751b19fa + last_write_checksum: sha1:6868fa48d73ab5cf7c839b160d271c9d0d80ed23 + pristine_git_object: e0056de3776d8d0e790220f36e19e8ccf2679329 docs/components/fusionservertoolconfigeffort.md: id: 897b52512b1c - last_write_checksum: sha1:3d2f3e019eee3c6bf4aedba909f7a92740d21225 - pristine_git_object: c7578213d3c65bdf579321a08c84d8f4c1de59a6 + last_write_checksum: sha1:2bb8798736eeb5504615ae93293601042af679cd + pristine_git_object: 3e3f9ac35f973801cf9cc5be1ac29e9916074377 docs/components/fusionservertoolconfigreasoning.md: id: 349d14075b51 last_write_checksum: sha1:9c650a736d7b96f193e6d24da5e82b7aa24ba39e @@ -1976,6 +2008,10 @@ trackedFiles: id: 0b156eedfb3c last_write_checksum: sha1:09e8882a3b53c99f85610eaddf2cb8ab788527d4 pristine_git_object: ae78526d566a4cc55996515044cebeb36166f7fe + docs/components/imageendpoint.md: + id: 128d4f4eda2b + last_write_checksum: sha1:775911a83810fc45a4107c5c1cf6e2677ec23788 + pristine_git_object: d062f647fd27433d0a106eafc0ea17553a468fd8 docs/components/imagegencallcompletedevent.md: id: c26bc1b3854e last_write_checksum: sha1:487f2664906ce2bf995e5f33739ea14944d4a20b @@ -2008,10 +2044,62 @@ trackedFiles: id: c007465f6177 last_write_checksum: sha1:c14e2e12eb49cf4445fdda2e2f400a8ea849d058 pristine_git_object: 841d9210013aa9eac24702237c16d0aca12a985f + docs/components/imagegencompletedevent.md: + id: 43f5718fe2c2 + last_write_checksum: sha1:650b4752a08040461390f10b30ceda0b5df1f0bb + pristine_git_object: 33b0307acdb1bf725cd89c5adb39eb3e110ff876 + docs/components/imagegencompletedeventtype.md: + id: 84e07b20590e + last_write_checksum: sha1:2c301f011ef720a3d8c561c8823bcfb982934d16 + pristine_git_object: a55fc00acede523cca610d646093deddf558b168 + docs/components/imagegenerationrequest.md: + id: e9d8e330fcaa + last_write_checksum: sha1:dddd107f6e4742d210cf232c0f790ab89a767883 + pristine_git_object: 554e79c04d916e93d56da8434958640791e87fea + docs/components/imagegenerationrequestaspectratio.md: + id: 4362d9221e46 + last_write_checksum: sha1:42f4b0d20c677cb8eeed1da4be0ba99b3949a092 + pristine_git_object: 5fd5856c0c84516b9cafb31efc69c9dffde3cd6d + docs/components/imagegenerationrequestbackground.md: + id: c71873b68e38 + last_write_checksum: sha1:d19360cc58475f3df142bbdf4e0cc05b2e402f8d + pristine_git_object: e6a05256245f0e61a844854a79e3df7b614660e7 + docs/components/imagegenerationrequestoptions.md: + id: c0b61720c268 + last_write_checksum: sha1:1e984261ddd2e150afc4005ac29aafb39faddb0e + pristine_git_object: 4bae12bf3f648957e9b5280515df2719bcaea2c2 + docs/components/imagegenerationrequestoutputformat.md: + id: e2b7dc215866 + last_write_checksum: sha1:4b9a9b87036845d3ac7d1750f9f23ed0a89d9151 + pristine_git_object: 6120e0a8081f9a2ed9a0c3606f7fe3d45d4e6f81 + docs/components/imagegenerationrequestprovider.md: + id: 2718a263ac9d + last_write_checksum: sha1:cd79a69707ee0a6040570128b20dc122f9561c37 + pristine_git_object: b61121191366b1bc3021939e983e136588a2ecf8 + docs/components/imagegenerationrequestquality.md: + id: 1c832458c677 + last_write_checksum: sha1:cb4331f66f1295a6b046c4575e443b9ca84d6939 + pristine_git_object: 4e7aef948aa95a900e52687840862e48882de964 + docs/components/imagegenerationrequestresolution.md: + id: d1e0d8c6d7ca + last_write_checksum: sha1:3459b30c68397ab41b467b9c933df24b8922c917 + pristine_git_object: 6da119988a6c4ed655b1ba1698a8e77dc6a3014a + docs/components/imagegenerationresponse.md: + id: ad79bc29b985 + last_write_checksum: sha1:adb46b786be5d9b720945c8cb714fd661a86d629 + pristine_git_object: a921a4c4cd5f75c926ba03263469315a14537160 + docs/components/imagegenerationresponsedata.md: + id: 6a33b08924d8 + last_write_checksum: sha1:ddb47b0ec0e5854effe56ca1989b8206e0d7b56a + pristine_git_object: c80a572552036e143d3b8827a84011d5f62083e9 docs/components/imagegenerationservertool.md: id: 0ddff7f46134 - last_write_checksum: sha1:b46e044c36e1518d95bb94572e43311da69a5b6d - pristine_git_object: e38b5c19b6356f255783dfacea66b45418679e21 + last_write_checksum: sha1:02ee9876107578bd27eb9ba811439416b9e76a63 + pristine_git_object: f8fc06e67da93583c9faf5a5e6e5042064c5c2c3 + docs/components/imagegenerationservertoolbackground.md: + id: e9f2d4d3c83a + last_write_checksum: sha1:4c13d167e30bd2452b0945864c06a4d29eed747f + pristine_git_object: 0e17cf5b4827e7a189c3b3ca6d11f778a870b648 docs/components/imagegenerationservertoolconfig.md: id: 4086d42eed1b last_write_checksum: sha1:4be4af2bb484ca26d779f052da6a645dcb4d912c @@ -2028,6 +2116,14 @@ trackedFiles: id: 420c811d4561 last_write_checksum: sha1:6b8ce48b3e662ea3bfd8a9be737e43cd1b051e39 pristine_git_object: 30c86424343ade04282d92095ea92ebf6635ac81 + docs/components/imagegenerationservertooloutputformat.md: + id: d7955b88c967 + last_write_checksum: sha1:2478be8f2137bfc7e30dbe5a6a85b57afa2755f9 + pristine_git_object: a020209bb1b86f2ad5d8820bcdf792c2e6a6e56c + docs/components/imagegenerationservertoolquality.md: + id: b8b7bc3e3b90 + last_write_checksum: sha1:63f903c60036f9c9a3edbcd830bd57c55328ceeb + pristine_git_object: 75a4cf8af255afbdad2a25e9291e3afaf880d235 docs/components/imagegenerationservertooltype.md: id: 5d4b6d6b41ce last_write_checksum: sha1:125bdc6395723e8fcdd82be5d88e04916b8641fd @@ -2036,6 +2132,70 @@ trackedFiles: id: 20f9a63cfff4 last_write_checksum: sha1:999c6f63846a5521309becac23012ed04d18f9eb pristine_git_object: 22e0541cab57771537bd791307029b628e7151ec + docs/components/imagegenerationusage.md: + id: cc38c041200d + last_write_checksum: sha1:9987bcb7e94ecd6bbe04bcfd6c12313ccbb7ec81 + pristine_git_object: 3e69647aa497f0b7d030d6cde11782c1b0d20a38 + docs/components/imagegenerationusagecompletiontokensdetails.md: + id: 6a9505656f3e + last_write_checksum: sha1:3a8ab71ac995be890cd743b4414d964340423719 + pristine_git_object: b11137adab9011a40f4a5df6f340af6137b283a0 + docs/components/imagegenerationusageprompttokensdetails.md: + id: b3e9b815a8d9 + last_write_checksum: sha1:86c40da9dcd83869181810175843195be4dc264c + pristine_git_object: bc851c33c247b050c60d463c1c8331be6510e7fa + docs/components/imagegenpartialimageevent.md: + id: 7cb3bb2545b0 + last_write_checksum: sha1:cc556150e26bd4466e955c0e71e9b21273f396b0 + pristine_git_object: 4ae2746c47459dab9adb9bfa949a4bb8b4fc58c7 + docs/components/imagegenpartialimageeventtype.md: + id: 96f18837a787 + last_write_checksum: sha1:4ec9ffdbd40cafee34f51514e57c2fbc02348970 + pristine_git_object: 874960df1e1e77d552ec0c400f4802ef2492ead3 + docs/components/imagegenstreamerrorevent.md: + id: 7f87611c8219 + last_write_checksum: sha1:b80d7feb4f647b58d24637f811717a9f2cb4da49 + pristine_git_object: 25fa3a5e9bc19b2c7f034b0097434e48e4d6a21e + docs/components/imagegenstreamerroreventerror.md: + id: f563003ebf93 + last_write_checksum: sha1:738e09a08778523ee61551fc92dba743e5188512 + pristine_git_object: 05a27840bf348b3b6faa675330c8374272e83089 + docs/components/imagegenstreamerroreventtype.md: + id: 0960d2a494df + last_write_checksum: sha1:029b8554dac0fe80200b521707d848102b887a12 + pristine_git_object: 0d7e98938d1d3955a470eb109413d03b2319da40 + docs/components/imagemodelarchitecture.md: + id: 664721f94572 + last_write_checksum: sha1:b4755ec3785f84b9292c004bb4502eedbac95416 + pristine_git_object: 4c9d858d399c4b690e0ae62268bb93868b204fc3 + docs/components/imagemodelendpointsresponse.md: + id: 29ef44f50783 + last_write_checksum: sha1:bff6a52c9ef77f4ba2287d7682287e796cb059fd + pristine_git_object: c10719481269bc587d7116bb9d0e7edad72a657c + docs/components/imagemodellistitem.md: + id: 32a773c24ad0 + last_write_checksum: sha1:57ba7d06ca6f0a4aeb770bf0057dce5914e19672 + pristine_git_object: 0402259ab80680643074eda229d5d06b7b0cdcd6 + docs/components/imagemodelslistresponse.md: + id: aebec95b3fdb + last_write_checksum: sha1:f45a3bde3fb4753553bd652ea13b39b385b3c1d3 + pristine_git_object: 02cf2f7805c226f04a7137b6a7a5d2172cbcdfdc + docs/components/imageoutputmodality.md: + id: c88658d6160a + last_write_checksum: sha1:6f11a36268e2b1910e5d3f62244a71638b6a4345 + pristine_git_object: 0cd471e8af6f05e30fe6ada9ea442f38e710630e + docs/components/imagepricingentry.md: + id: ffea76db0419 + last_write_checksum: sha1:8ac8f6a3131bf6ef1804ebacca11103bba4905d2 + pristine_git_object: 638fcc2a0bed2741bdbaf8472cf6e127dbe21028 + docs/components/imagestreamingresponse.md: + id: b50cb74438a9 + last_write_checksum: sha1:0bd7f6e18c2e7f51db16b38982320bf915ef23df + pristine_git_object: fc57cc2c190c12caa1ca878c9545d00a67c72ca7 + docs/components/imagestreamingresponsedata.md: + id: c072b0eb2c02 + last_write_checksum: sha1:a3e05c53987d0149bdf23251f29f1b433008b818 + pristine_git_object: 78dab52333e65bcadb03fe4d69d176f3259e4561 docs/components/incompletedetails.md: id: 4ce388faaac0 last_write_checksum: sha1:3aad9a98e1bb15a540b9f8307a1c9524432e7959 @@ -2482,8 +2642,12 @@ trackedFiles: pristine_git_object: 6a8883bfc55e71980d691e2b9bda395dc40397e0 docs/components/messagesrequest.md: id: e479a7035a9d - last_write_checksum: sha1:7f34c120832595fda47c0a0740558fd1778775de - pristine_git_object: ef9fe199bf4fe157d4e0a141e0a68fb072e94163 + last_write_checksum: sha1:55da58866bcd40c949c5669195633a2064fc1da9 + pristine_git_object: d4322feeca1f49bedfa491fc3401173acdf31cc8 + docs/components/messagesrequestmetadata.md: + id: 6bbb17fb8289 + last_write_checksum: sha1:59573dcf98c6a520e39df65af105d9550ad91855 + pristine_git_object: debe3767143e4e0d9902d566f07edc0a88f72a74 docs/components/messagesrequestplugin.md: id: 6c74af3351ff last_write_checksum: sha1:ae5c77653f405c1074121821ac97ff6a78c2f76f @@ -2496,10 +2660,6 @@ trackedFiles: id: e51d7bd17081 last_write_checksum: sha1:8e080cbf5102f73960172e0c1c63a3aa020d6259 pristine_git_object: 98cf674943ef36b59b9430c7a299666570390075 - docs/components/metadata.md: - id: b3d2643730d7 - last_write_checksum: sha1:299d28071b0bc538aca3b9d4e5ed94d82b6db010 - pristine_git_object: 2e1c7ac6f37ad4ef941717ea77b3e750800b5007 docs/components/metadatalevel.md: id: 9f671abd00b9 last_write_checksum: sha1:6238f82ab3af2fe7bf4a1e3945d5612e59afcde3 @@ -2522,8 +2682,8 @@ trackedFiles: pristine_git_object: d5bbdc95f658be46eebf13f0ba8b9ae3716f72e2 docs/components/model.md: id: 673ad57400cd - last_write_checksum: sha1:517cbce221606bacb2cab7b97e53d316d09a5f17 - pristine_git_object: 8ce3d9d7c9ddc7c270da3a39df079148aa7ff207 + last_write_checksum: sha1:ea20bf9ca8f49a181142f516f1b36758cf5ceac6 + pristine_git_object: edb000fc276b3eec0dbe0bb1e82c4f5d7a72e8c9 docs/components/modelarchitecture.md: id: 79816051e6e8 last_write_checksum: sha1:158b04c79b7a32a2d95e3d3fda8fa6da0ab91cd9 @@ -2548,10 +2708,14 @@ trackedFiles: id: 74607e6a173d last_write_checksum: sha1:445ec227b130763e2509d1a181dd5e3e6d71420a pristine_git_object: 317190772f743d2aba63c4dad770827b46688f6a + docs/components/modelreasoning.md: + id: 47976b46e5b9 + last_write_checksum: sha1:07deec55fe155257ef07086b6dc2fbc7e012e031 + pristine_git_object: 306c0aeb39047768e6c79975996240584a97525b docs/components/modelresponse.md: id: 9d48c3f335b1 - last_write_checksum: sha1:5d8890c41a9f448341037e9915dd6e93df9140cb - pristine_git_object: 2a7433dc87413943d14220ffdfda8b25e59bc9c0 + last_write_checksum: sha1:442bb6c4d21debbceb5a48a9563b07704983123f + pristine_git_object: 2ad6e9dc16fa06d03318e98bc540c7aca0d497ed docs/components/modelscountresponse.md: id: abdad0c1a02a last_write_checksum: sha1:50ae205604eddcbdced268b8cd3e1ac06f0dd7c0 @@ -2618,8 +2782,8 @@ trackedFiles: pristine_git_object: 04544acc47732ace2cf93c40a24734e72ab7fbc8 docs/components/observabilityarizedestinationconfig.md: id: dc1d535079ea - last_write_checksum: sha1:abb1dd20f7c854e5ef212d78da381740ae160a5d - pristine_git_object: a62521fecc1f3c34092879f92859f4020684936d + last_write_checksum: sha1:1288b88f495552b356e2f4ddf71440866c6b4d74 + pristine_git_object: 3e51f13a5a9751ae689488b368edcd4eb47fa408 docs/components/observabilityarizedestinationtype.md: id: 8e8a0fa37466 last_write_checksum: sha1:ac6b0d3b0f878616a9cfd4c82d3bf5f992176f65 @@ -3002,8 +3166,8 @@ trackedFiles: pristine_git_object: e88886f738fef9ad22e5efc74e3e0ea2cd8ceeb3 docs/components/openresponsesresult.md: id: 9795b7de3f92 - last_write_checksum: sha1:e76ebc50bf983fda5b31b5c87b306c5abd5b43ae - pristine_git_object: c4ef91fa969c5ac26e6de263b88b7d816edab692 + last_write_checksum: sha1:90beaa7103cc4f9a333285c90e186ba412fa037d + pristine_git_object: f41bfcc4855b54c33cd0d4c47eb25b91f6d8fedd docs/components/openresponsesresultobject.md: id: a8c7f7bc0b24 last_write_checksum: sha1:3df49df80dda49ea4cb53f913931fd4754769b66 @@ -3036,10 +3200,6 @@ trackedFiles: id: 63449f6362da last_write_checksum: sha1:11b3d7ad51195be1e48a90e2861633551b9992d5 pristine_git_object: ffa82a743b58e9352a9dfad57f7a4a94c629944c - docs/components/options.md: - id: d57f3108a48d - last_write_checksum: sha1:5aa4060133c8174e65d08d837c209fc2f250afd1 - pristine_git_object: bf8723976c27b0315ba0abce902ee5c053f9cbae docs/components/order.md: id: 16e6ae6962e7 last_write_checksum: sha1:a060705e562a2f3fc024c4fd8aa80604535b0bc1 @@ -3160,10 +3320,6 @@ trackedFiles: id: 706d9134f7f4 last_write_checksum: sha1:2a870670b74028e5d40aac474e3cb64527a740f8 pristine_git_object: 52d2d39bfacfe9086893c241a4bc4e22f7d13ddc - docs/components/outputformat.md: - id: 6699f32fe6fa - last_write_checksum: sha1:f02204f21f3fb218890b08c23458c4db9d27b634 - pristine_git_object: 7f5c5453ac49de51f495c9bc9ab491a02025e92b docs/components/outputfunctioncallitem.md: id: a0b3dcf93469 last_write_checksum: sha1:30c6f678351da68f90cc92d45d6c477ab0aee6a4 @@ -3600,18 +3756,14 @@ trackedFiles: id: 285ea7802dcd last_write_checksum: sha1:0fff83f064f6699f5a86c5068423c646a9fca69e pristine_git_object: 02d5dcdfc5bec22a67a803487f4758df68ba098e - docs/components/prompttokensdetails.md: - id: 58d2af57c508 - last_write_checksum: sha1:900904dec588ecd97ed17fc0d99896082494f729 - pristine_git_object: ecc924e0faf698d142621fce07381ec15ce6d725 docs/components/providername.md: id: fe24a77d9911 - last_write_checksum: sha1:dbadb7842e1e2db16bae5e0fdf3090bf44f9f4f8 - pristine_git_object: e27624b1a7745588aaea78a70b6b9cbb75aa6c18 + last_write_checksum: sha1:06dad591e67434bce4b9ddf1ac3cadd44678e95f + pristine_git_object: 90bcbf9b725b064575447fa83febe416f6bebbef docs/components/provideroptions.md: id: 48594a6d2d81 - last_write_checksum: sha1:31490a802ccda3b318ec379332a8049a2c0b1fae - pristine_git_object: ec5a70a055cce6b4781a87b4760bcf50c7f62291 + last_write_checksum: sha1:56df25efaae2625a23b7bd9d5455320ecd773eed + pristine_git_object: c0305a2c0a548da4a8db1157c1b447828a5e28fa docs/components/provideroverloadedresponseerrordata.md: id: c2a8cc4ec6df last_write_checksum: sha1:1d206d00dc0d91b5ceec470579c6ce345cc23d29 @@ -3626,8 +3778,8 @@ trackedFiles: pristine_git_object: 09beea2aedab445e726f20fb9a9d3ed5ebb4df25 docs/components/providerresponseprovidername.md: id: 800bab487911 - last_write_checksum: sha1:facbea7a411cb7600fceae161d4270ac3597778d - pristine_git_object: e0443626dcb65a09857b084e2e93ad319d96cede + last_write_checksum: sha1:0e064fe30e46a48f9622b0ca45ce4b7758cb33bf + pristine_git_object: 941f122feb2b067bc89823a563f28411314856de docs/components/providersort.md: id: 290449b1880f last_write_checksum: sha1:f15d65e5c226a222c3bfc0b9f55dd9ca0443d415 @@ -3648,14 +3800,18 @@ trackedFiles: id: 9d43651da8ad last_write_checksum: sha1:c066038e95bcbaec6cb1eeb3b5657102c37ee5a7 pristine_git_object: b96d4af729e9e69d041122e88b11e82cd2db8878 - docs/components/quality.md: - id: dd4dd0d7b023 - last_write_checksum: sha1:6191307209f88c4d94d43a9f9b2e200a2b16cc66 - pristine_git_object: a09a4498e9247a867f25cb54f1898572125f48af docs/components/quantization.md: id: 0d17b4a78828 last_write_checksum: sha1:992ee3fdd0f4e09c9f6e6426c413841fe34a86a5 pristine_git_object: 7a0574a89d4c7836115ac16571dd32b7d9290914 + docs/components/rangecapability.md: + id: 790774ea2733 + last_write_checksum: sha1:120397200e2eea9f5f06e4d77329af171e0fd67d + pristine_git_object: 869b0a3d3c2bdc63a7e617281c1ac343d85b489e + docs/components/rangecapabilitytype.md: + id: d1afd4e509b0 + last_write_checksum: sha1:b591fbd5fa30109a985f7f91b136e52e3b1677ff + pristine_git_object: 2bb5777d79c16416dd0d7ab0539a28f37e77d8cf docs/components/ranker.md: id: 5a14b8d09a01 last_write_checksum: sha1:56664aff547bdcede5fb21eec2731a58d393c949 @@ -3734,8 +3890,8 @@ trackedFiles: pristine_git_object: 31d997aa9e0721cacdebfeb79ce3428d5ec79bf0 docs/components/reasoningeffort.md: id: ea6dba24a061 - last_write_checksum: sha1:1a34f59ecfdc631ed846c0e33951b52d2a86beae - pristine_git_object: 9fb0ddf227e42c634f5c435a2749db2e7effbf45 + last_write_checksum: sha1:53d8315d1f29bca1071672fbe583cad08f1cec81 + pristine_git_object: 225df68e53d3632bcd740e4f821d4f14233be403 docs/components/reasoningformat.md: id: c0483881ee4e last_write_checksum: sha1:45038411b97c73c37fa000694770b06d13b0eb4b @@ -3860,10 +4016,6 @@ trackedFiles: id: b03f377616f1 last_write_checksum: sha1:1e7d12b699c50af0d04cce4cb73efe48cf32f49a pristine_git_object: 0bb2e7cd4a22f1d0e52d75180639dd9125c0b542 - docs/components/resolution.md: - id: 84d737f84bee - last_write_checksum: sha1:606fd74ebc92be927228afd7adefa80e64c47a52 - pristine_git_object: 596502b2f94707deb347c53015c764525c9ba3b9 docs/components/response.md: id: 2b40822178c9 last_write_checksum: sha1:385337549929814b68441066e56ed7daa6183344 @@ -3906,8 +4058,8 @@ trackedFiles: pristine_git_object: e21193bbab68ee5dfdb0a113e26ba70f82bcab55 docs/components/responsesrequest.md: id: cb5cd99790f3 - last_write_checksum: sha1:80469fec7c75dcdf77ae2ad4f5bf40cdfedd4397 - pristine_git_object: 22201e800d4d5cb9759f21c1cd10d72580a93ad2 + last_write_checksum: sha1:ab9017177687f0f272ff43fa0238172d526878ad + pristine_git_object: 9ea0e1056bd1e0adce85cf9c39af993c1aae5e59 docs/components/responsesrequestplugin.md: id: 20da7be12bb9 last_write_checksum: sha1:0bb97c99ec4b7fd13321427b9aff9a2d8bb6d288 @@ -3964,6 +4116,14 @@ trackedFiles: id: beee40001fda last_write_checksum: sha1:45b7b8881a6560a468153662d61b99605a492edf pristine_git_object: 2e0839d06f821dd97780dc22f202dedf23e4efe1 + docs/components/servertooluse.md: + id: e304ebc583f7 + last_write_checksum: sha1:99e277666646ff89adce836927c58d9021fa6677 + pristine_git_object: 2532d4cd15c0a21efce64ce42719d6b24aa0a063 + docs/components/servertoolusedetails.md: + id: b14e315828c5 + last_write_checksum: sha1:2e4e747062c990a502a208c1c90382305e428fe7 + pristine_git_object: fb12e181963bb9eada3294d7a605b076f695ab58 docs/components/serviceunavailableresponseerrordata.md: id: 6d65ecfd7ad3 last_write_checksum: sha1:c0e9357b45a58f3da2d3520b502cec7dae5f3446 @@ -4118,8 +4278,8 @@ trackedFiles: pristine_git_object: 0b3d0bcfd7082915b45ef9a4a8e74422857dd665 docs/components/streamevents.md: id: bdfd7bf6c2b0 - last_write_checksum: sha1:8f15c1a958bc657678852f48a6504c8cc82445a3 - pristine_git_object: ab79016604959e59d30008817272722fe9c3cec1 + last_write_checksum: sha1:bc6b66905697ce2589ab6ea247b1e834d6e0bc68 + pristine_git_object: 639fb4cd758757c7978a545c0373526a2fef01df docs/components/streameventsresponsecompleted.md: id: 072f9ee89867 last_write_checksum: sha1:9f33add33825fc28ad93f36c26638728fc66712b @@ -4198,8 +4358,8 @@ trackedFiles: pristine_git_object: 3e49330ffc6e7ae403873cfe3e8297ad188bcafa docs/components/subagentreasoningeffort.md: id: 068a2b1e59c4 - last_write_checksum: sha1:6b27ed5774615473f501ec7bf18c1524c99e4002 - pristine_git_object: fe29f80f29f7137d07401b4d25def11360a70a32 + last_write_checksum: sha1:6dbeef8db7e15799fd0f87d4965ba5613a388396 + pristine_git_object: 57b95be94ff3162b0601124a9d6d9b49f49eecaf docs/components/subagentservertoolconfig.md: id: 07f1740a203f last_write_checksum: sha1:3175e6b1db4977f98195f30c6e2391092bc017ff @@ -4240,6 +4400,26 @@ trackedFiles: id: bedfcbf92d70 last_write_checksum: sha1:c7add9b6d8e40f8303dc9575c51f21c333ad8883 pristine_git_object: 097d7e4af92079998b9d9a1c0f0b0d55e63324e3 + docs/components/taskclassificationitem.md: + id: 86b268b60a54 + last_write_checksum: sha1:7f07577fdff0a45be7f186d4cebff4227be4c928 + pristine_git_object: e03f5457debc455787309feea466d7cffd97ce31 + docs/components/taskclassificationmacrocategory.md: + id: 98a4c75f676e + last_write_checksum: sha1:63c894b788adec15f2df8e0e8dbdf97dc5b94c24 + pristine_git_object: cdfd3111becda570309e4a471c522fa7b02d07f6 + docs/components/taskclassificationmodel.md: + id: d4b9a4653049 + last_write_checksum: sha1:3ee634a155a1b53602eb617e3afffc09dc18cb68 + pristine_git_object: 741953d15da9a7bcfcbc85ae7bd6ae954d88b96d + docs/components/taskclassificationresponse.md: + id: 2d2564e94621 + last_write_checksum: sha1:49ed0f9b59669a390346d22fa5c18e8d09964e07 + pristine_git_object: 285c5cbcef93a7aed10565461c2f6ee71367686d + docs/components/taskclassificationresponsedata.md: + id: 8aa33a036184 + last_write_checksum: sha1:1304391a25af40ebc87b37a62653d4775cfa24bd + pristine_git_object: f674f29f1d324be9237f9d90897c998a78cbe439 docs/components/textdeltaevent.md: id: 339fe3591c0d last_write_checksum: sha1:97aed7ba0e23221806738f4ed7819f8aec0db957 @@ -4276,6 +4456,10 @@ trackedFiles: id: 28a220a73365 last_write_checksum: sha1:784cb7e75b383ed2c288716830d701f2563feba8 pristine_git_object: f8c28844eae476d93d80f9bb89812df998fe7988 + docs/components/timings.md: + id: 458f7a6290a7 + last_write_checksum: sha1:2fb6a4822a5d3046868380d5d1e4a1a6fd096ce4 + pristine_git_object: dd5a0d0fbd9e962afc1b88cd96cf9f563c356ca3 docs/components/tokenizer.md: id: f1ad3417d8d1 last_write_checksum: sha1:4223f630f7d880b9288fb654f67817560fb2dbd8 @@ -4524,10 +4708,54 @@ trackedFiles: id: 79b657be05c4 last_write_checksum: sha1:69e58ae8931fc723bbb4aa1212e50b97a83db709 pristine_git_object: 1db2a3a9378d0eeb5de39f1d6621e69bbb7e0953 + docs/components/unifiedbenchmarkpricing.md: + id: 2c0b1127a84f + last_write_checksum: sha1:536d10a0997b62e031564acc91dd3d1dede8ae6b + pristine_git_object: 02271ae5d1e6836b02869391fbc7a08df47aaa31 + docs/components/unifiedbenchmarksaaitem.md: + id: aa98383cedbb + last_write_checksum: sha1:0c5a943891afc1617252650b539aacda66219cb3 + pristine_git_object: 12ee0f9d6c843cabbeea35693eef407c7727e818 + docs/components/unifiedbenchmarksaaitemsource.md: + id: a055d68005b2 + last_write_checksum: sha1:a2d31b611ef768ef91be865e6ad137219baa49c0 + pristine_git_object: 9c7155b69b81eb5b72455656962cd477716a5527 + docs/components/unifiedbenchmarksdaitem.md: + id: 97ff97a53af6 + last_write_checksum: sha1:7e75867184c7835316e3dba6c41f99915d8f66fe + pristine_git_object: 3b882c36e525b3f547b77796a644d7a533d3e275 + docs/components/unifiedbenchmarksdaitemsource.md: + id: e45e347cc983 + last_write_checksum: sha1:7d8c239a56a8fcabf6c8633fd174c88d21bd612c + pristine_git_object: 5690f32ab463b163e96353931423c22499ac17ab + docs/components/unifiedbenchmarksmeta.md: + id: eda2de5d8d6b + last_write_checksum: sha1:defd88dbce795b757a855c25953109f91791ea61 + pristine_git_object: aced020dcc3fcc5c659bca9070063417ec3496d9 + docs/components/unifiedbenchmarksmetasource.md: + id: 093d733c42fd + last_write_checksum: sha1:e820ca0846602261b47e18ccca1005042ded4024 + pristine_git_object: bf52e964cd5ad79dde98693f436788f1e7c1a764 + docs/components/unifiedbenchmarksmetaversion.md: + id: 883a12af05e5 + last_write_checksum: sha1:df710f97d758bb6403da1438fd81221a03142e64 + pristine_git_object: fa7abb7a34e41e9bba65d7e902d1bffbd431a7ba + docs/components/unifiedbenchmarksresponse.md: + id: 711086447b69 + last_write_checksum: sha1:6278d07a5e342097572f380e22c0af1c88070a05 + pristine_git_object: 1fa09b414027fbf850446167276ccc554f5446f0 + docs/components/unifiedbenchmarksresponsedata.md: + id: df6d6262fae1 + last_write_checksum: sha1:42427d4695c2a5c5c66233b358442cd62e55e2e0 + pristine_git_object: 58d4d7d8c3b5943e09024f28b0444097ea6f8bbb docs/components/uniqueinsight.md: id: 8f721a7538ef last_write_checksum: sha1:d1955a3237b8047e074df6a6cf0e158beeac10c0 pristine_git_object: 3395cb6ae241647ad498206ba1672bc3e4a1f7fc + docs/components/unit.md: + id: 0b0f1341f4ee + last_write_checksum: sha1:b9ff7dec614b495c5512b9228d018dda7d78fdc9 + pristine_git_object: 42e2fb33a744ffbb03cbae27c94401c51f0d83c0 docs/components/unprocessableentityresponseerrordata.md: id: 6a36f0c9d959 last_write_checksum: sha1:b7adc7ae81b79cb1436c8f85b45283fe52320d81 @@ -4602,12 +4830,24 @@ trackedFiles: pristine_git_object: cf10c9e56352e1ef074e794b915639774a0de872 docs/components/videogenerationrequest.md: id: cacead3ac9fe - last_write_checksum: sha1:c87d8d7a7ce900738b6a536f863a34cf36854506 - pristine_git_object: 3a2a2df8edd75d87dade8b35c075759ff91a5415 + last_write_checksum: sha1:5f2a97129c791a736378af0331c8800da3e555d0 + pristine_git_object: 8306cca5a6a8740243cd1bc49409bfd4b8e58891 + docs/components/videogenerationrequestaspectratio.md: + id: 8183ceeab79d + last_write_checksum: sha1:8aad3355b02e6578e57dc64355c6e51fcb44f763 + pristine_git_object: 16659f24b21051064e5fc6addbda9ebe73650a01 + docs/components/videogenerationrequestoptions.md: + id: 6d200b026e3d + last_write_checksum: sha1:66b6975423581c0492a04f687a318750146b10bd + pristine_git_object: 6f4ba6efc4e3b8b4da0a54540a4fa5d5208e32e7 docs/components/videogenerationrequestprovider.md: id: e2a64e74f555 - last_write_checksum: sha1:e27ed0509f52bc14e831d19fe4205ed37f5f65a8 - pristine_git_object: 28a704024a917c0aaff8c53f2a8c9e20c7ee52b4 + last_write_checksum: sha1:f0461ead71e8c146e9ba4fcfd1cdf3383828f125 + pristine_git_object: b7e2128738d513fcbcadf9ffaec2e655c4e26419 + docs/components/videogenerationrequestresolution.md: + id: 96bb24160b25 + last_write_checksum: sha1:c5180c8900165f2c87fe36de22f6d5e695371dfd + pristine_git_object: 1af61111d11241b9c536e60ed23ffdcf4a375d33 docs/components/videogenerationresponse.md: id: adbbd66af4bd last_write_checksum: sha1:52c73fc2047792e3194f316e3182a96f8c7b85f2 @@ -4846,8 +5086,8 @@ trackedFiles: pristine_git_object: 69dd549ec7f5f885101d08dd502e25748183aebf docs/operations/arena.md: id: a9de99ef2b33 - last_write_checksum: sha1:72964c86d5b8a31c3144454e0ca717b111a5c4f4 - pristine_git_object: bb57edab7f915ebccc0af37e46c11b7b23f9dfd9 + last_write_checksum: sha1:e512fec90170ea812bad81c221a6537e2ef92f15 + pristine_git_object: 1714dac53f131a38cd5cb11e270e5500b0740280 docs/operations/bulkaddworkspacemembersglobals.md: id: 6cff183f93a1 last_write_checksum: sha1:39941ebc9a51b0189aed03680e2168e25b7c9692 @@ -4908,6 +5148,10 @@ trackedFiles: id: 01cceb61d42f last_write_checksum: sha1:7e1d73bd30584d55f4b116737c15d7c73cdf6a3a pristine_git_object: 522f4978a3c4e1d1c0d197b541fc57e745b7d4e7 + docs/operations/costdetails.md: + id: 777b240173de + last_write_checksum: sha1:b2748fc0cf305791446f5f217947d82bd74a8350 + pristine_git_object: 58a1aa8485130f8b49c633dfef0439b83a5f239c docs/operations/createaudiospeechglobals.md: id: c67d64f11ad7 last_write_checksum: sha1:a0026b1caf2268dd4a79177fa2bb630eca1498b4 @@ -4982,8 +5226,8 @@ trackedFiles: pristine_git_object: 1ff75cb8fa59d2b7b756ea07e9f5849995b62435 docs/operations/createembeddingsusage.md: id: 2dc99973f6c7 - last_write_checksum: sha1:b01ba733f5d1369b21a54b9f3bfb0e4059504b6f - pristine_git_object: 007fb235eef4ebb9b3dda14352e9a252004de4c2 + last_write_checksum: sha1:292de8b3a80697b56a961d2eb7f97d54dd29c4ae + pristine_git_object: 639fb7e305ff27786b6ea858b425e36aaaf20252 docs/operations/createguardrailglobals.md: id: 34f5b2a17330 last_write_checksum: sha1:a43fb357b9c08974befd14a79da7623e72bc3245 @@ -4992,6 +5236,18 @@ trackedFiles: id: 2d8932b329b3 last_write_checksum: sha1:e03ea14af1abe30c5dc38323a824a91fa817bc2d pristine_git_object: 74958a262f7d16b3cd8166b0a80a832d44b3df03 + docs/operations/createimagesglobals.md: + id: a5e3bc55fcda + last_write_checksum: sha1:46b4241b2368ab79160dd347eae68445df55d0cd + pristine_git_object: 5b67f3639d1cf0a543f9f9930d1cae61b423c4e0 + docs/operations/createimagesrequest.md: + id: cdafaa0c3856 + last_write_checksum: sha1:17f63228061ce2f31c6631edb2536255ffb129b9 + pristine_git_object: 26a6d04520f3711a61a53f121c89e2f4cbd693cc + docs/operations/createimagesresponse.md: + id: 42e21d45bf02 + last_write_checksum: sha1:1d13ca55ce05a64da61acdfe71d878d91df777f4 + pristine_git_object: 58bc07e6d75f13d766e336b9f868a8486d52d187 docs/operations/createkeysdata.md: id: 903a6d611ab2 last_write_checksum: sha1:78eb64a7cc6deeb3959adeb0ca705826f5f47005 @@ -5272,22 +5528,14 @@ trackedFiles: id: f6276c91ff17 last_write_checksum: sha1:9c80418c5384e63542ea16aa336c3bfe54c23b64 pristine_git_object: f0d402fbc8b66cc075706e056fd152e41e141c3f - docs/operations/getbenchmarksartificialanalysisglobals.md: - id: fc980e69438e - last_write_checksum: sha1:4b7871db540cc8d255518b0fb51845738a2b7d09 - pristine_git_object: 8925cb558b063d232a4eab418279d6fe69443023 - docs/operations/getbenchmarksartificialanalysisrequest.md: - id: 998a53047e6f - last_write_checksum: sha1:c4e6ee2f48087e0198b49e16c286f7034b043034 - pristine_git_object: bca988aaed6a6fee2fa08342305a1070c2d41c95 - docs/operations/getbenchmarksdesignarenaglobals.md: - id: 4e2f927bea8b - last_write_checksum: sha1:76d2ff4919b87f05d3672f5b660033d2c9e689a2 - pristine_git_object: d6c6cad08146378c7794aa8af56234a01cf0df71 - docs/operations/getbenchmarksdesignarenarequest.md: - id: aea9fe0d448c - last_write_checksum: sha1:433d65b3a6d7fe0b3e4a824a8ca9f9a36593a6be - pristine_git_object: 73202a7094b97faf481947434a8253f72eb872b6 + docs/operations/getbenchmarksglobals.md: + id: 18c553c31212 + last_write_checksum: sha1:99f5c115ff5fd28f04cb80fe4dfa280f12c7c68b + pristine_git_object: 215e03e822bc8d9945711a5b08bdb1790617dd3b + docs/operations/getbenchmarksrequest.md: + id: 0a40a540bba0 + last_write_checksum: sha1:8102900af82a582c56bb903d521fddf4bc7bea8e + pristine_git_object: 3bf4626faebe849aa85814be508bc820c74a0868 docs/operations/getbyokkeyglobals.md: id: 82a8cd8db21c last_write_checksum: sha1:4490949622267f537def903fa3efe64142925739 @@ -5424,6 +5672,14 @@ trackedFiles: id: 4418b400973a last_write_checksum: sha1:9941d12ab4bf460c95756d511f9339a17383e113 pristine_git_object: 59be90b2aebcf81f507dbea4cea1496beb9c5454 + docs/operations/gettaskclassificationsglobals.md: + id: eaf1910aeda8 + last_write_checksum: sha1:3902ca1f10b2247b71a868dc5a2789fba1328983 + pristine_git_object: c0f672452f4e7e1bdc24388e61a01c3f8a763b1d + docs/operations/gettaskclassificationsrequest.md: + id: 5d0a91bd9531 + last_write_checksum: sha1:45c9c66b1fc95916b7c7c0924cea6120c372a308 + pristine_git_object: 3970eeeea4f1689144161d9d5b0dc79f9a50af01 docs/operations/getuseractivityglobals.md: id: 39aded6fc0f1 last_write_checksum: sha1:53ccc45e0783444aa97f4e051b6ac6edc3acc588 @@ -5580,6 +5836,22 @@ trackedFiles: id: 0e85f301aa5c last_write_checksum: sha1:69b2d4440e668dc9e76ebad86d5f70227276a31c pristine_git_object: c2e3510e7d805915eb9f493ac6cb092ec1a9d9dc + docs/operations/listimagemodelendpointsglobals.md: + id: 24c447cf0391 + last_write_checksum: sha1:bc2e0cbf57b211cb37f3d0ec5e22a4e4ad8de12f + pristine_git_object: 8ac861e3954206f311e935cb0f555c430bd48f65 + docs/operations/listimagemodelendpointsrequest.md: + id: 4e63ace27269 + last_write_checksum: sha1:d8362d4de0204a7ee118c106e6150a89bb28c039 + pristine_git_object: 27647dcaee248f17d21e6f1d6658eab1a7bbbe1a + docs/operations/listimagemodelsglobals.md: + id: d44612742724 + last_write_checksum: sha1:4016d7f2b457583473315913e4056de5c9b0bf3b + pristine_git_object: c3edbe39ee3c886c9a45d511442aa6f6a8cf4801 + docs/operations/listimagemodelsrequest.md: + id: 3b796f3db657 + last_write_checksum: sha1:9a49a00fc5847eca4f41a90b552ba1622982c1e7 + pristine_git_object: 2732ff2195c83246c0cd67cf88f2c5e528354936 docs/operations/listkeyassignmentsglobals.md: id: eb16fba53032 last_write_checksum: sha1:823375a0dc84574748befda39821c790b469a6b4 @@ -5774,8 +6046,8 @@ trackedFiles: pristine_git_object: 56c454715dfb32bf210dfe8031e7145fd4c2c83b docs/operations/provider.md: id: 9d89f101fabf - last_write_checksum: sha1:8b0c3c9d88e5fca583ecf2acfb331616ee4c546a - pristine_git_object: 12dc1b15d6b22dc26ace4c59f6114856f2e2361d + last_write_checksum: sha1:7c02e6315e8e3b77f30d330a8b034278f6c528e1 + pristine_git_object: be1e3f484899068953ef247253fcc1a93a404501 docs/operations/queryanalyticsdata1.md: id: f5ead5b95530 last_write_checksum: sha1:a55813c57010d0613c1e70ee1a9232fdcf98775c @@ -5828,10 +6100,18 @@ trackedFiles: id: 354b29241c52 last_write_checksum: sha1:baf6f1195eeabcb4742fec427127f2c33ffd9b3c pristine_git_object: c4ba8c79c6ba3021472583b922c3ef01c4115bf4 + docs/operations/source.md: + id: 8d5b4a7ef752 + last_write_checksum: sha1:7ecc37abdbb6b9ac5e6bc3bac1254d4b5b4a6f2a + pristine_git_object: 244d7c7eae58985137b5615d4b4a0a9c552f1a00 docs/operations/subcategory.md: id: "169243175101" last_write_checksum: sha1:ddf3195ab7768df3095efa4cc86ea7b5ca3504f3 pristine_git_object: 912cc5d754a041cfdddbad5c704505a3f7da1cec + docs/operations/tasktype.md: + id: f741399fcc2a + last_write_checksum: sha1:e3b9c5b4a2b103ee4c7f60e7c8eb25b8a351c970 + pristine_git_object: f978421391efaf8d7b0b449cbcba9b82a93d182a docs/operations/timerange.md: id: a5ee8c05a917 last_write_checksum: sha1:00b61805899422b836494a24088ec33674316714 @@ -5936,6 +6216,10 @@ trackedFiles: id: 20b3a19cf0bf last_write_checksum: sha1:3ee651ec1a0b12ed21c222f856ed351e99ce36b5 pristine_git_object: 9b4d37e44d3b989fe6b9bc47c9e35a9e09cdc5cb + docs/operations/window.md: + id: cae9b0c9da39 + last_write_checksum: sha1:236895b24731096eb1e95b8d4f88fb4ee485ee4b + pristine_git_object: 7b3ba482648c212d9ebb3dd3285fdd86958ef051 docs/operations/zdr.md: id: 7b519776696a last_write_checksum: sha1:9c7ea16d0ca7b4105190e93e583f145fb9c8b8f4 @@ -5948,6 +6232,10 @@ trackedFiles: id: e2bd25998427 last_write_checksum: sha1:82bec11fedf21eed760739e1adb08fec06239279 pristine_git_object: 6e72f51df9e9811cee424032f7dba0887e15afec + docs/sdks/benchmarks/README.md: + id: 61c16262af9b + last_write_checksum: sha1:e3030fe550fa8bb1d3379692f9633b5f8e98be99 + pristine_git_object: 7a4db0f13ee00f246b5f13887a023fc70a3b74df docs/sdks/betaanalytics/README.md: id: e037af84b386 last_write_checksum: sha1:78a1ed27ae55ac9b6e6926e2587adeda0de65aa3 @@ -5960,14 +6248,18 @@ trackedFiles: id: 393193527c2c last_write_checksum: sha1:0b40d973610ed193d6faafc7f4f0bfad06c78225 pristine_git_object: 08b736f0782487ac73f87d4f008079ebc00eab48 + docs/sdks/classifications/README.md: + id: ba3b1f5de071 + last_write_checksum: sha1:9bfc60644eccb737e3a3c64fe7c4bcb80bd63e61 + pristine_git_object: 85a0d0b4329b9e3954b27187389dbf5e8e77ea06 docs/sdks/credits/README.md: id: 81608135c0ff last_write_checksum: sha1:abca02bc25760be47f80100a7cce6bb711202aef pristine_git_object: 1837ff59343eb87482e8750c1fb5d2b5f89aae6a docs/sdks/datasets/README.md: id: deb5d90f4faf - last_write_checksum: sha1:a3585d8d399421584c3f65610c59fe5dfbf897ab - pristine_git_object: f097289cff8c229c70c4f9e3e934f28372f69167 + last_write_checksum: sha1:c09c0c118def84591a90132f77b67f40ae9e3d1e + pristine_git_object: afcf796dfd4d793bbfe7bcd3bdd81e5fe908de94 docs/sdks/embeddings/README.md: id: 15b5b04486c1 last_write_checksum: sha1:c2ed15521af31873f56e7813292aa30c5adf94e4 @@ -5988,6 +6280,10 @@ trackedFiles: id: f72b38a5a2a7 last_write_checksum: sha1:e90c6c713afcfa087edfcb6367397b9109ac3af9 pristine_git_object: 427dac57b47fbb136a16eb1ab7732c1ff61d7c2e + docs/sdks/images/README.md: + id: cc752c3524d0 + last_write_checksum: sha1:5a7a17ae16ed1070ff54f29bf479699454c91f00 + pristine_git_object: 65f916be2b82bb2a8f62757aa39b95c6f226dbd1 docs/sdks/models/README.md: id: b35bdf4bc7ed last_write_checksum: sha1:76c1efecbc8a679a233ea1a80bdb01ead5b65ce1 @@ -6006,8 +6302,8 @@ trackedFiles: pristine_git_object: 867781001d3d7c6e755bcd3024268d831d154732 docs/sdks/presets/README.md: id: ead9668ae1dd - last_write_checksum: sha1:340a33451b0f832a07ed068df7ce71707e80484d - pristine_git_object: f31181e6253ccc15aaf6edf21fb489e49a0ec9ce + last_write_checksum: sha1:dd895ffd401b378c4d6de8cfff3bcf55af781364 + pristine_git_object: acd8279d19eacab7957c440ed14834e8573539fc docs/sdks/providers/README.md: id: b02aa45c0093 last_write_checksum: sha1:576c938477d66de01f39db88b50caea41a6812d3 @@ -6018,8 +6314,8 @@ trackedFiles: pristine_git_object: a558abc06eb1e3251ae6a7993245f8e6e0ef3b2a docs/sdks/responses/README.md: id: e717bad14f63 - last_write_checksum: sha1:5aacb6cdf4577af559b61207fba01dcc4dd9fdc8 - pristine_git_object: b1c9d9fe27407f44f07c074db989fd4201dceaef + last_write_checksum: sha1:2fa7c76ae6c364248526d04871db0c16291bf60e + pristine_git_object: c9601f17bbd48441521f947aa7e312d2689f6b0b docs/sdks/stt/README.md: id: 0806154492f9 last_write_checksum: sha1:a8b75526dac340b813f687081fab11165dec3d11 @@ -6030,8 +6326,8 @@ trackedFiles: pristine_git_object: 1543931c82477df894cca5b2a2e32838bc66bf5d docs/sdks/videogeneration/README.md: id: b6dbf7b0729c - last_write_checksum: sha1:caee1abd23bfb62bc9cb2e280efa51c98cfe38ef - pristine_git_object: ec02618703a38431fb34c15919848501ace2c91f + last_write_checksum: sha1:186dc73b0d741c97bb92c441ae7c99809e43449f + pristine_git_object: 393bdc66fbf85057da5811936439c48ad03a2322 docs/sdks/workspaces/README.md: id: 1f5b051a6380 last_write_checksum: sha1:e315405c5619ae4b47119d01951118cb658cba46 @@ -6042,8 +6338,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:ccf5925a473a1eb527cec02639f862b79b601251 - pristine_git_object: 396bd51f9c1428f03560f3e7988edc99edc698e8 + last_write_checksum: sha1:8223abd8e7463dfa2b2c1097670bb28b2ec73e68 + pristine_git_object: b98c0280ffbb42638747b1064375fa36f467223c scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -6070,8 +6366,8 @@ trackedFiles: pristine_git_object: 07ace03229fd3267623c8f48665d2c3a67c3565d src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:017dc1ec43588b31eee23532d74d4421993dd874 - pristine_git_object: be619e3be1aa8d27deef5752ecc9ff09ccd4cd9f + last_write_checksum: sha1:856bdf17b7de36f6e1abd0b56f55bbc6093e4c68 + pristine_git_object: ade61995259031f3789ff71f0cfd1d6ae4b39395 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:6d47d1ab3da9cb4ac9f0a2bfe442f1a82a614f35 @@ -6084,6 +6380,10 @@ trackedFiles: id: c5733c5a1e12 last_write_checksum: sha1:71f242fd9955e5a17a8d055e2210cc2708bb94fc pristine_git_object: fcffdcc6eaa61a4b79f7f1f76458eeb27e8f896d + src/openrouter/benchmarks.py: + id: 178d2ad8d706 + last_write_checksum: sha1:1a4280d54c5db249e7089d03c304f57c51765b04 + pristine_git_object: d29a685964300932a574e77d64558f7a34e97796 src/openrouter/beta.py: id: fffdf54fd8f5 last_write_checksum: sha1:7999d9294e23e166c6b27236262f1fb40139a4d1 @@ -6100,10 +6400,14 @@ trackedFiles: id: 723fdce15c1d last_write_checksum: sha1:045ca733908a82e099a0c2a76c6c498025827391 pristine_git_object: a1894915bd32aee65f019885634eb7908970a046 + src/openrouter/classifications.py: + id: 4f2efc24b95b + last_write_checksum: sha1:9a80e34828aaa3aa2bb2ecca3b665d4cb454d68e + pristine_git_object: 2654cbc562cc83940a6713b68f3967cb3f9dcfbe src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:56e0c315ac8fe611bf70b465a91341acbbe34534 - pristine_git_object: 2c07302c12f51cdf053e306906ac30862e925246 + last_write_checksum: sha1:e38f46d4bf8292139d85d59c2b2cb5f450367e39 + pristine_git_object: 27e2fff5aafa475227a34c3dd5242e4e54b9e762 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:1b6b66672fb80dccdc39843a98bdef6d7d804364 @@ -6122,8 +6426,8 @@ trackedFiles: pristine_git_object: e21d2d2322aad32dabda485132c4046d2ec6de89 src/openrouter/components/advisorreasoning.py: id: d5af5c19fc73 - last_write_checksum: sha1:ee69d03c9da3a6b9b42c3e6525d21d9c1910cfa1 - pristine_git_object: 7376346542022324ca4d8475237e78346ee607dc + last_write_checksum: sha1:db9d67036b51e37b98ea76b383528af3d48f6ca6 + pristine_git_object: a2ab43864d385b5554fc911cc9ee9ebe9893c10f src/openrouter/components/advisorservertool_openrouter.py: id: 4442cd9ad387 last_write_checksum: sha1:c1825628e0bbba268e5addad89e7abe6e45b2926 @@ -6136,6 +6440,10 @@ trackedFiles: id: dc032c9ad744 last_write_checksum: sha1:8e5d49d2b57114df7f4559b611d40769e65f9f78 pristine_git_object: 597a5e01e843b06758f9c49b32d5d18d473dd106 + src/openrouter/components/anthropicadvisormessageusageiteration.py: + id: 121ee5a5d831 + last_write_checksum: sha1:dc0947f15ab23a783f4146c03b046351836300c7 + pristine_git_object: 86b0175b497b07f6deb5f31edf994183c891d1e3 src/openrouter/components/anthropicallowedcallers.py: id: b51c080db25a last_write_checksum: sha1:250ea2824392b7c385c4375a029a256f3d10afb4 @@ -6176,6 +6484,10 @@ trackedFiles: id: 1a120a6f2e0a last_write_checksum: sha1:997517abf99c9f97c4c76936f92a95f40eb0cf7f pristine_git_object: e64d16928a4efa5c07e431a317ec573963fe9310 + src/openrouter/components/anthropiccompactionusageiteration.py: + id: fdfc1ef0420f + last_write_checksum: sha1:a30d2b6892509f226083dfd421f0b633ecc614da + pristine_git_object: 5b00555a9e606281c749d7d147ae58ca0868e396 src/openrouter/components/anthropicdocumentblockparam.py: id: 2c3093530540 last_write_checksum: sha1:db21d071f7ea9b0597a83da88697c1bc11d72981 @@ -6200,6 +6512,14 @@ trackedFiles: id: e48f71196f16 last_write_checksum: sha1:92fb29d4e239e0cb361dde42a1e61a8486233a34 pristine_git_object: 8ff4915a203908a5ae986f28357b7211590912d2 + src/openrouter/components/anthropiciterationcachecreation.py: + id: d8eff6dbf240 + last_write_checksum: sha1:54740194c3948b6066d700b47f54f9b42912ae15 + pristine_git_object: 9447771803562a9dc7c9509c87c63ad65a914757 + src/openrouter/components/anthropicmessageusageiteration.py: + id: d94b609d7d8e + last_write_checksum: sha1:64cce42227c30259261e6c0e9958a17e2afddbde + pristine_git_object: 0c76c28951383fc04cc9a95224811a0692d058fb src/openrouter/components/anthropicplaintextsource.py: id: ed38ef79c74b last_write_checksum: sha1:b6584da4f7255412f12de31e02c522fb84d4cfd0 @@ -6208,6 +6528,10 @@ trackedFiles: id: bccb7c6b3128 last_write_checksum: sha1:2917cf9fe9a10f160359e7f43ecdcaf7bf172ebe pristine_git_object: f953ecdcfaf801ee1f89d23b3463642adbd85221 + src/openrouter/components/anthropicspeed.py: + id: 7e39c29f3d89 + last_write_checksum: sha1:19e37bf7ec082d89258f44674405811cc8a010ad + pristine_git_object: 4f9c2bc739541b12c381e3d6265184af879cc1ff src/openrouter/components/anthropictextblockparam.py: id: f387daeeb940 last_write_checksum: sha1:315ad4fb2c0cede75e5b8dfe3d8dcd4842a03322 @@ -6228,6 +6552,10 @@ trackedFiles: id: f38744b90fdc last_write_checksum: sha1:6c367ebe08a45ad6f45ae9877e2852e917079c8e pristine_git_object: 97aca7f4209ba9ad038b97e35b9b8b8cd0e6e168 + src/openrouter/components/anthropicunknownusageiteration.py: + id: e0c582be1ffd + last_write_checksum: sha1:7c50a515d361fdd0008f1c04a4babdcfe15c1b55 + pristine_git_object: 5bbd2e0feacf932a927422a0ea9667493d9904cf src/openrouter/components/anthropicurlimagesource.py: id: 291b4d476bb8 last_write_checksum: sha1:e6a8b32f053bfbe3debb8940b03135d1e8a00eb5 @@ -6236,6 +6564,10 @@ trackedFiles: id: 1f1d455d7db3 last_write_checksum: sha1:37d89d625d5d7443993ac2c054b6cf37554eed15 pristine_git_object: c0a140bcee011f2f86eb22eadc03281f8f59b894 + src/openrouter/components/anthropicusageiteration.py: + id: 5e4d6928bcab + last_write_checksum: sha1:bdc2b877ec6d51b9480bd58fb4f2ae0308060ecb + pristine_git_object: a984e7a5e0de4d93e4a65582d97b8eb9c3b1a1ab src/openrouter/components/anthropicwebsearchresultblockparam.py: id: 7a85be31694c last_write_checksum: sha1:a87c04e8e05b3424f44a8ed55225b1bcb05b40b2 @@ -6244,6 +6576,10 @@ trackedFiles: id: 11ce6e19f6e8 last_write_checksum: sha1:43e5b88a03a2c16cb48e58bc33090ff8934e47c6 pristine_git_object: 888de6cb6bf49187c71e5b0fd2474cdc05f27e9f + src/openrouter/components/apierrortype.py: + id: 04798f000cd5 + last_write_checksum: sha1:c504f52290f8fa4f49d73cbd2c8b4aa8b695e612 + pristine_git_object: cb48803e55aa039bcfa8232328dd2874db8d73e3 src/openrouter/components/applypatchcallitem.py: id: 532887f6dcc3 last_write_checksum: sha1:fd5ee933b7c7ab2160bc5dc95e967a67700201d4 @@ -6340,34 +6676,10 @@ trackedFiles: id: 5533c01ab156 last_write_checksum: sha1:0d74bf725e24809c704e0c293d72ea96a897446b pristine_git_object: 0e610680e018be53b3e62759ad61e9f7c416640b - src/openrouter/components/benchmarkpricing.py: - id: a7c56383dbe6 - last_write_checksum: sha1:2af31e20dfde609e7d5c1b791e02b55a483d92c6 - pristine_git_object: 3524f786e3f73c7436e061800ecd403d92854621 - src/openrouter/components/benchmarksaaitem.py: - id: a90a5423d2ab - last_write_checksum: sha1:7b10783085a9bb672306573cf73a8a77f5d65973 - pristine_git_object: 2855ffe10969511370a40e492b4956196a075864 - src/openrouter/components/benchmarksaameta.py: - id: 67ea1de84da3 - last_write_checksum: sha1:def05fd7d2546eeb56f2e908c1032aa2a9f8af1e - pristine_git_object: 9d751f4abb5b2d88625ecf05a447f9368b03999e - src/openrouter/components/benchmarksaaresponse.py: - id: b0b47f818fb0 - last_write_checksum: sha1:9fff98aec7bdcf688bb46673949f2badf0c21c33 - pristine_git_object: 787ae1ca313f84e1f958d01fbde16a7addfe30c3 - src/openrouter/components/benchmarksdaitem.py: - id: 575945def054 - last_write_checksum: sha1:7cd6079757b7be8f6e3add94eb05d68cf7c73bc4 - pristine_git_object: 7713e2e8acdc2a75742873408b2238c163acba91 - src/openrouter/components/benchmarksdameta.py: - id: dd1d01a44665 - last_write_checksum: sha1:e8e640d403468fe3be115da58a843eb37cc2e292 - pristine_git_object: 0ca3550d2febc93be4ef3f4df531ef4e2dca6358 - src/openrouter/components/benchmarksdaresponse.py: - id: 9e8cefb8d1e1 - last_write_checksum: sha1:694c9e050fec812c95cf37eeb53b9e3920773106 - pristine_git_object: 7588fc5242eb12d83c24453d8dad455d6ee7e1aa + src/openrouter/components/booleancapability.py: + id: 6009fd660c03 + last_write_checksum: sha1:2615f4f9eecdf753ece20adc9897553404c71cc1 + pristine_git_object: 75d5ed893814b2af7bd59a0f4729ecbcd701bf6b src/openrouter/components/bulkaddworkspacemembersrequest.py: id: c042d4bce938 last_write_checksum: sha1:dd5b69cce65985231a77351be04aadeecc85c46c @@ -6422,8 +6734,12 @@ trackedFiles: pristine_git_object: 033a6f367e4da3d56835bb0d593042f24bfa0930 src/openrouter/components/byokproviderslug.py: id: 6738a8516caf - last_write_checksum: sha1:6ccf194550ae1f9844b3f2ef38523abeee676cf1 - pristine_git_object: 1786f6d4d76b38ecfdbcc3281845b424119b8450 + last_write_checksum: sha1:4963c072be088036df589c34f7e3c988b9692bb4 + pristine_git_object: ddb35a6e9bd87c9954686678825ec02743e50cbd + src/openrouter/components/capabilitydescriptor.py: + id: 368790a86f10 + last_write_checksum: sha1:13a2fe668fd9d3fdb2d6941cf7a14b49f8168066 + pristine_git_object: 3b40c65b1bd2d08a6d01c3ec69023bd64a72907d src/openrouter/components/chatassistantimages.py: id: 993f9dcd8575 last_write_checksum: sha1:0b6be31bb9c8b3bc8f2098af5b2bd12b62a710bb @@ -6522,8 +6838,8 @@ trackedFiles: pristine_git_object: 8bbde153b53887e426989fd5b0486b6dc1122810 src/openrouter/components/chatrequest.py: id: 5e39eaefa9cf - last_write_checksum: sha1:65012c617dd06019eb4bf62d04c434ebfb23adcc - pristine_git_object: f90c290577966b6fc85afaf1634b2413b02661b6 + last_write_checksum: sha1:eb9f865918863ceb12508060f3bc8605f3a9a87a + pristine_git_object: f60f367c641cb92d48bbc2873bba0704800165d9 src/openrouter/components/chatresult.py: id: 9062fe2935fe last_write_checksum: sha1:b44dc25412b1206cc188d9516191a273d0f3e4dc @@ -6542,8 +6858,8 @@ trackedFiles: pristine_git_object: 9166d93e4c351c7465ba67e2e7f4708038d6ef2b src/openrouter/components/chatstreamchunk.py: id: 16cdd8d4a3d1 - last_write_checksum: sha1:fe5022e99730741f13a46946596fe8221c9ae8e8 - pristine_git_object: 52c37761f777435f6d75e03242f8b9069f08a84f + last_write_checksum: sha1:c3efdb1447546f143f33c51b8971fe0677828f70 + pristine_git_object: 1f00ab137cb7ede250f76d8bd0d1d50397c31927 src/openrouter/components/chatstreamdelta.py: id: 7484252729d4 last_write_checksum: sha1:2e1a6408c51e6519337e01c394f4ce7695edf573 @@ -6586,8 +6902,8 @@ trackedFiles: pristine_git_object: 2ccba8386486b7a730816a9829b01754935a2e96 src/openrouter/components/chatusage.py: id: f224a054bf45 - last_write_checksum: sha1:947079d2163225a49e423151de25dc6132df5bf6 - pristine_git_object: 3a7357d8a6f725ba18b1f15215a197f11e917659 + last_write_checksum: sha1:b97beddfd0229cf3d993948cbad3bd45ca76d7fc + pristine_git_object: 8eb123a284d3fe9604c0f97ec225da377b0fbd88 src/openrouter/components/chatusermessage.py: id: 7777191e729a last_write_checksum: sha1:1ecc9101c05178427d73e455de4d679ac8d78015 @@ -6764,6 +7080,10 @@ trackedFiles: id: 96ac233137bf last_write_checksum: sha1:0e20ce9fd09b64922e63b1bf37395bb80ea3e440 pristine_git_object: 3eaaa33c3856a99254c617bcfe98693f31db1234 + src/openrouter/components/debugevent.py: + id: 5ecad6212326 + last_write_checksum: sha1:437a5547042617c66b1e59e25388d77729dd28c4 + pristine_git_object: e163680e5e5e254a73a0646e4b562cd0b46065d0 src/openrouter/components/defaultparameters.py: id: 548f4f885c22 last_write_checksum: sha1:ed72fc048f61ec663361ab2206cd140c35971a0e @@ -6808,6 +7128,10 @@ trackedFiles: id: e935c578fce8 last_write_checksum: sha1:8a9c8184852faf1e3ca9a478e48df41ccac6fc33 pristine_git_object: ed5f8af0c599b1e55bb1939bc1d2aff0aeef610d + src/openrouter/components/enumcapability.py: + id: 1eddd72a17a5 + last_write_checksum: sha1:09e366c414f84edb166eeb8e9091e278c15136d6 + pristine_git_object: 468dba815ec1bb9a06cbf8983c8f13f2c585db59 src/openrouter/components/errorevent.py: id: 8e87043bec43 last_write_checksum: sha1:ca2fd0001394a54cbaaf07abb827184f58e1de9e @@ -6930,8 +7254,8 @@ trackedFiles: pristine_git_object: 5729ea0c31a0ce7283a77316282ea77c91f13ae3 src/openrouter/components/fusionservertoolconfig.py: id: 0d1d229c531f - last_write_checksum: sha1:9f013aa6431316312a04ad960d3ef26d0a341356 - pristine_git_object: 4eae6cf00e69b060b3a99ef75ccc7a3762de37d0 + last_write_checksum: sha1:0aaf2b744bbade347bf6e14a68fa7d1351ea6236 + pristine_git_object: a9631f6d4047651498a05e7171290408a098d21d src/openrouter/components/generationcontentdata.py: id: 0140215b5b46 last_write_checksum: sha1:09e15ae2acc4f44084e2206ea51e6a06f4c5ee11 @@ -6980,6 +7304,10 @@ trackedFiles: id: 674f6eca2929 last_write_checksum: sha1:8eaffb70806c74b1111b377b0024375f3c80ef44 pristine_git_object: d24d5e2bf337e19bb80a1aa24b8b27c93d67f1b1 + src/openrouter/components/imageendpoint.py: + id: 6466b0bedef0 + last_write_checksum: sha1:b619627cc7e24b774b1786f763b2d5c8db766e1d + pristine_git_object: 8d392046999ddf1f251215f892b6bb3371ed1e9a src/openrouter/components/imagegencallcompletedevent.py: id: cbf654faeb3e last_write_checksum: sha1:8fb3e34408dd8b167afc6aad641de9cc2483c9f1 @@ -6996,10 +7324,22 @@ trackedFiles: id: 8d83770569d5 last_write_checksum: sha1:c56b462d54b40d74e37bda390528b127565b33fd pristine_git_object: 5f17d77c25a82ad2bf7b1211d05ee665b6fee35a + src/openrouter/components/imagegencompletedevent.py: + id: 7a791a02cb5b + last_write_checksum: sha1:2e5822401bac22b5936ed4787b3d648eed60e725 + pristine_git_object: e5907de80032821f54ab0829729f137497b6f289 + src/openrouter/components/imagegenerationrequest.py: + id: f8291a7be9a0 + last_write_checksum: sha1:dbe4672bfdc46ea9aa4fa000ce81a765d2421bbe + pristine_git_object: a7bdd3ff3db844ad3bbfbba03084b5c37a376727 + src/openrouter/components/imagegenerationresponse.py: + id: 53354cd0cbfc + last_write_checksum: sha1:e1c531b4a761668151800f450b82dfab0da00f77 + pristine_git_object: deb67493a8ace61abf039d5d6d46b33e37a7c66c src/openrouter/components/imagegenerationservertool.py: id: 9c95bc975f2e - last_write_checksum: sha1:5b6cf7e4c433056713467e1fbb680e644a1f47bc - pristine_git_object: 1bb3764815a286c4774d5b0a6b841c1606d57fa0 + last_write_checksum: sha1:b7e0d9db78b0b7662cd34a31e593842cea5ef990 + pristine_git_object: dfcb122b1ce68cc165b0b86b603b658670320eff src/openrouter/components/imagegenerationservertool_openrouter.py: id: b7499cf15b3a last_write_checksum: sha1:2a253a105b37e5e1b6b3b9345cdaf64ebe65f703 @@ -7016,6 +7356,46 @@ trackedFiles: id: f257690edb46 last_write_checksum: sha1:8ae33e94dc42144f3269a65834ed7d59aeab3c69 pristine_git_object: eb59bfd0d4b89dde72504f8aa57533c689474ced + src/openrouter/components/imagegenerationusage.py: + id: f51151e8dbfa + last_write_checksum: sha1:94b36c85779166c24486c3f8cb59dd5b5e96f227 + pristine_git_object: ddc1c84536c4579a40f3c58482dc0ad3dc74b5bc + src/openrouter/components/imagegenpartialimageevent.py: + id: f88cea0c67fc + last_write_checksum: sha1:2ee76cbb50b60ebe624bdfe0769a7bbdce047cd0 + pristine_git_object: ad454de88a0dd65f464fb25a982d3c4060d17994 + src/openrouter/components/imagegenstreamerrorevent.py: + id: 15c890eb8a08 + last_write_checksum: sha1:3472a96f7a2855a043011f43d5a72eb51ebd5458 + pristine_git_object: 9396413a957395a3fb784b80a443f12cf35948cf + src/openrouter/components/imagemodelarchitecture.py: + id: 5f3e50733fe9 + last_write_checksum: sha1:207defb8e73dde6e8f0f431ddd1c26c00671cd8b + pristine_git_object: 5e93aaa1401ef96452bda0ff80d520b190968d86 + src/openrouter/components/imagemodelendpointsresponse.py: + id: f3d538d38ec2 + last_write_checksum: sha1:e10cae58b2bb98ab1a0df6fc162f402ac1561d3c + pristine_git_object: d97d1ee622f150b70dbaeda2db870711c97c1e4d + src/openrouter/components/imagemodellistitem.py: + id: 0e8365caa96c + last_write_checksum: sha1:28308827116fa3810cbd776bed12d0a300848ed6 + pristine_git_object: f2bb3e2929198956accdf1e98fc8c947838b2399 + src/openrouter/components/imagemodelslistresponse.py: + id: 9616976ca854 + last_write_checksum: sha1:22cfac5912511e7cfbf4a60dc5e2bb835f5a11bd + pristine_git_object: d36ed6324c9a9a973b1564fc08dcd7e30e9db25a + src/openrouter/components/imageoutputmodality.py: + id: 56bf82622455 + last_write_checksum: sha1:fdd714b24893d1cc9a488a8927f6659188427438 + pristine_git_object: 9c5a7a430aa6103cc10052b1d6c278181071180c + src/openrouter/components/imagepricingentry.py: + id: 58bd958fe130 + last_write_checksum: sha1:62645aeb8bd8ea04844616e6f21e7c863585a2fd + pristine_git_object: 8a8700461f2731e8ca7e1b62d6c41d5afc24d015 + src/openrouter/components/imagestreamingresponse.py: + id: 7de5604ae99c + last_write_checksum: sha1:5ac700ab9ab34476b5831d438747e2ca89d0b9c5 + pristine_git_object: 74c8f0665e48d0442fd6c67e86bce01b3c948c6e src/openrouter/components/incompletedetails.py: id: 1984e5246b23 last_write_checksum: sha1:494eaf7185deb1ef3b12d4e81711a8aec012445f @@ -7170,16 +7550,16 @@ trackedFiles: pristine_git_object: a5410bd961e2ce450b97e6a5702a336731b2e0ab src/openrouter/components/messagesrequest.py: id: 72b1f339024d - last_write_checksum: sha1:a03c557fca983279521c04f710310f09195a5d6f - pristine_git_object: 2f93bcfcd69ae20ca260631e4d218db6f5b5ee8f + last_write_checksum: sha1:da2e9563eb32013861d1c138ee3ed341cf77091c + pristine_git_object: 2ccd8d8f6441a0401323ea5bb80203cced06f12d src/openrouter/components/metadatalevel.py: id: 0eede47eef62 last_write_checksum: sha1:b4e7e6fc4e9016b65008e9ebbfcc6f018fe89ced pristine_git_object: 1257b38d2001f34078cd1b052c20264e81a95e57 src/openrouter/components/model.py: id: cef3adaa772b - last_write_checksum: sha1:53eb4a044a7bf546225416bb08597df46a3b60a2 - pristine_git_object: 637b3fbe54ddcc454750d8de702045ee690c3333 + last_write_checksum: sha1:53f544fe39ae08cde33f99c5d0bb4b6cc1555301 + pristine_git_object: c0345109fb1717ea27010605984c27e1137426fd src/openrouter/components/modelarchitecture.py: id: b37ac27e512b last_write_checksum: sha1:e1dd41aa140b2ca2c3bbf15abf74e034d42b0166 @@ -7196,6 +7576,10 @@ trackedFiles: id: b8759a1a4787 last_write_checksum: sha1:69b2c991666848f4790e5136c67553733cc68a54 pristine_git_object: c197cb2c527296adff2c3cfd9e49bcbc48087ce7 + src/openrouter/components/modelreasoning.py: + id: 58bb3f2d75e0 + last_write_checksum: sha1:d7decd330533b566bda99e6b4b5e120970cf61f1 + pristine_git_object: fa73b90a1b4b140d6b9ceb9ac284142c4d95e4d7 src/openrouter/components/modelresponse.py: id: 023136e6dedf last_write_checksum: sha1:af84587984cbe6341f59f176b08df43096ac48c6 @@ -7222,8 +7606,8 @@ trackedFiles: pristine_git_object: 5b8ca0ce252ca2fc909770c5c338793b05877a91 src/openrouter/components/observabilityarizedestination.py: id: 8926882c1d18 - last_write_checksum: sha1:85184a10e7e8e135038392296e6e4bf6695a66e9 - pristine_git_object: 142a548baf77b7e25fb0088cabb3a94fcc2bf34f + last_write_checksum: sha1:d9dfd8b65cbb889188c000cf4dfee81f18a0e1ba + pristine_git_object: fdcc98dd16e3e38d4e3d2bea91139ee62ac41570 src/openrouter/components/observabilitybraintrustdestination.py: id: 432de20d1c77 last_write_checksum: sha1:1ba768fc9387674e430704553c6f8e202f3396ac @@ -7346,8 +7730,8 @@ trackedFiles: pristine_git_object: 08d990d8cc07b7928158fc55784cd9d613f4c58b src/openrouter/components/openresponsesresult.py: id: 78f7e33b19e6 - last_write_checksum: sha1:20511d969d1679022d2bf3fd92584c613c2d5b63 - pristine_git_object: 60eaf9f1e8860d8b064a58f9cb4dd2c27fcd061d + last_write_checksum: sha1:ab91e0c198cfeddefbf5b1b5b33e7bb9b08b948c + pristine_git_object: d53fb70ebbd7108d300c78b82ef884289ca6dc7a src/openrouter/components/openroutermetadata.py: id: 87062f38be59 last_write_checksum: sha1:5f69423c82ec021b04be5d518f2b75acf671dba8 @@ -7582,12 +7966,12 @@ trackedFiles: pristine_git_object: 170ae25c582bb8decd74e1c69bfa8353bd44e86d src/openrouter/components/providername.py: id: fcc722fa2fce - last_write_checksum: sha1:8348b476c4ca50dc94c4c8cc1e7a4f94a2efd1d0 - pristine_git_object: bcf5ebc091a731af5570f084e29fe69370bba382 + last_write_checksum: sha1:d47a96e7fd206554f941a005507b3daa6c5a3011 + pristine_git_object: 2f73920830e553e1544c32547c09856706a3a7c0 src/openrouter/components/provideroptions.py: id: 73dde6c8f359 - last_write_checksum: sha1:932d0c6f35d0be43dcdbc3a2b42f544494340f39 - pristine_git_object: f5675d66d54191aecc0bb1a4bf09eec72ded9e17 + last_write_checksum: sha1:4a354444c351be20adb8195e27acf15cb6954044 + pristine_git_object: dfda74d7fa939dd0745a898744304b7cfa60f48e src/openrouter/components/provideroverloadedresponseerrordata.py: id: 5b693682570e last_write_checksum: sha1:41a977452d58b52cb9d4b3a85f4b7970529352d5 @@ -7598,8 +7982,8 @@ trackedFiles: pristine_git_object: 5145815e6196470f3f5f24893afdc4415d27c53e src/openrouter/components/providerresponse.py: id: ad3887be54c5 - last_write_checksum: sha1:12dcb549ec2efb3c44296c77f16a4ce511197cac - pristine_git_object: be63eef02944fffd54074f2e9cef6b43070f7a36 + last_write_checksum: sha1:cadffd9042f4c5196ca31a4abf523f034537a1bc + pristine_git_object: 3ce78d7713f8082800e9633c3d5ed1a001a92e1d src/openrouter/components/providersort.py: id: 348e382bf494 last_write_checksum: sha1:57551507f95cd2e16ef995e1c13f859fd0726152 @@ -7620,6 +8004,10 @@ trackedFiles: id: bde317b3d703 last_write_checksum: sha1:96b042899bfb818f20d282be76ad37fc948a599d pristine_git_object: dfcecafdc6d2a3a3dbc7beec2f07e1258415b2b4 + src/openrouter/components/rangecapability.py: + id: ac3aad570488 + last_write_checksum: sha1:9eaed841f5e178925a070ebcbe6f18b4178dbaab + pristine_git_object: 76fabc08d96646862e7a1618d39d84934a25b5e4 src/openrouter/components/rankingsdailyitem.py: id: 9aab72b1d643 last_write_checksum: sha1:c753fd7363f424f144710ceb18456f882d7b6e6e @@ -7662,8 +8050,8 @@ trackedFiles: pristine_git_object: 29c0fc9a1ff14d26fc99a70bac491ce3b4240384 src/openrouter/components/reasoningeffort.py: id: cadb8da93572 - last_write_checksum: sha1:a4d9c3c61ccfc2842592ca33d310b15b60bf9a10 - pristine_git_object: 3cf5b2e32d9b73277c73db6141e841f416fba384 + last_write_checksum: sha1:f0cac6530b869890e30631e9d42eedae0f2a5be8 + pristine_git_object: fe3562c76fc28d2f8cacd49a12c0a0500b069147 src/openrouter/components/reasoningformat.py: id: 99d79e5500b6 last_write_checksum: sha1:bfb111196309079ff8dcb09ab406d08a3a809e67 @@ -7730,8 +8118,8 @@ trackedFiles: pristine_git_object: d3c77624292ba0985104a6125e462c305a633d84 src/openrouter/components/responsesrequest.py: id: 8c850080ec5d - last_write_checksum: sha1:f3943c6484819e73eafb9baaa6ee56bfe2fb0ae7 - pristine_git_object: 8f4b2a3e17f49d7059cd5427e65d76a41f3a380b + last_write_checksum: sha1:20d13187b1c6e2530e2bcdaa7c3f551e99065121 + pristine_git_object: 683fab4a6f2fba854b0d920a787307f4977e94a1 src/openrouter/components/responsesstreamingresponse.py: id: 142379f3bd90 last_write_checksum: sha1:a48d6f3610f5d15248ef4d25a0d88a0a4a1a9db7 @@ -7834,8 +8222,8 @@ trackedFiles: pristine_git_object: ffb7a43e64bfef2809683fe60a5d17744ea345c3 src/openrouter/components/streamevents.py: id: 331636234c76 - last_write_checksum: sha1:482d71c2b91da416ea0754f4cfc613465160208c - pristine_git_object: b1e1e147f0333345f7a25fecebb41b31e51127f6 + last_write_checksum: sha1:cddb5b06cdaf9ad42dbb49ffa918b8cd19b36749 + pristine_git_object: 0761a9610b5a27a071785b4e8d849410aaf64623 src/openrouter/components/streameventsresponsecompleted.py: id: fd244f61371c last_write_checksum: sha1:011e0930c7994f64dbee78c0a4c2fa5d7167d8ab @@ -7886,8 +8274,8 @@ trackedFiles: pristine_git_object: 8e1417b1cf116bf26060143dcab214d2623bddcf src/openrouter/components/subagentreasoning.py: id: 2715ebf26eb3 - last_write_checksum: sha1:40e3041f4cf9ac8b4371e6351686cbf537d17da1 - pristine_git_object: 1eb4e862985164f2e48b53dd0119d42bf8bed25e + last_write_checksum: sha1:ce0a8989c3e42612edf46770a0039aca05b949de + pristine_git_object: d2d508152e2a4339602d010776894f76210b3abf src/openrouter/components/subagentservertool_openrouter.py: id: f08524c6985a last_write_checksum: sha1:771b71aae9989727ea3564615f06da7f08431705 @@ -7896,6 +8284,22 @@ trackedFiles: id: a8425c790cb6 last_write_checksum: sha1:a885325a7612357dbb9454400433cc485e6ca420 pristine_git_object: 27bb1e45236dcdda4d14d5c09bac867d86cf1ace + src/openrouter/components/taskclassificationitem.py: + id: 86d4bab5ebf3 + last_write_checksum: sha1:16176fda0ccd16b0be59bb5c4b74db78eae02f36 + pristine_git_object: ec4567edd049c0edd7946134aa26b1653129c89d + src/openrouter/components/taskclassificationmacrocategory.py: + id: 37807f6ecfc4 + last_write_checksum: sha1:34e755800c3bbdcb74c6977b067bb722213e70d4 + pristine_git_object: c9def1e6701ed933e7d313037ab66019f17f2cb6 + src/openrouter/components/taskclassificationmodel.py: + id: 32ca0a493e58 + last_write_checksum: sha1:7806a10203f15938876607b5f6d4c2891c64c3e0 + pristine_git_object: 72f490abd847da4a077b93d2303ce2466efeac31 + src/openrouter/components/taskclassificationresponse.py: + id: 36078ab9920b + last_write_checksum: sha1:e2f286eed954ce1fa244428a8b50ea38a8e23c95 + pristine_git_object: b88e852e18069aa6e8f6dbb21c16b00534ce6394 src/openrouter/components/textdeltaevent.py: id: 6d1d416a373d last_write_checksum: sha1:9a024e07b3f2d65d5f88e01f0e2035efd956f3fc @@ -7936,6 +8340,26 @@ trackedFiles: id: 7d9755fc8395 last_write_checksum: sha1:d614e72cc67bf6c4da7f57cf0f4367de726ec06d pristine_git_object: 0fc3c7c3991891ae00ae2f624df78d21e0ae05a8 + src/openrouter/components/unifiedbenchmarkpricing.py: + id: b08adf1a31d0 + last_write_checksum: sha1:e8d1cb425c61a7094f50a73e59cec6d64dc34204 + pristine_git_object: bad387cea54fcab00e8a7fe54780dd97a29d72c3 + src/openrouter/components/unifiedbenchmarksaaitem.py: + id: cc8382ac1af5 + last_write_checksum: sha1:39fc6f0409234ec30e6bbdba2736e278abda8756 + pristine_git_object: a01518d4c996f16bd740489684b20a9682db0f0e + src/openrouter/components/unifiedbenchmarksdaitem.py: + id: 946501943ce2 + last_write_checksum: sha1:22bbe61dd833db3da96796ebfdcd3141dd0ed126 + pristine_git_object: 0bb8159d555e263bd875bd42e1cf0e552c3573b5 + src/openrouter/components/unifiedbenchmarksmeta.py: + id: ca02b44f633a + last_write_checksum: sha1:fdf3983fad9a3c119c88a1fe5e3d314787dcf248 + pristine_git_object: 6106104d5249ae04075f1905f330b5aeaaaeb02c + src/openrouter/components/unifiedbenchmarksresponse.py: + id: 4f7bbccaba03 + last_write_checksum: sha1:f0775bb4427be9ad7c01942e5048a103647a78eb + pristine_git_object: 8f064226057a3d4d331cee102713813a208452cc src/openrouter/components/unprocessableentityresponseerrordata.py: id: e8ca4a51f994 last_write_checksum: sha1:d9ff0dea491e12d5ccb28607eb65f00fe8d694aa @@ -7990,8 +8414,8 @@ trackedFiles: pristine_git_object: b140a02148be319bb2aeb0287bdd6e031ad6a3a4 src/openrouter/components/videogenerationrequest.py: id: 70e3c9ff288c - last_write_checksum: sha1:b933805b55daa65d78997fe85a11e18e56aa924a - pristine_git_object: ae3bd049ac980f82a4b0b501e24b4f1fd8238bc4 + last_write_checksum: sha1:6c0044fd54e16b8876c30d45f564f5ba3a6f3637 + pristine_git_object: 036db7d9ef8bf05d995d65cd7fb620c04657f83a src/openrouter/components/videogenerationresponse.py: id: 541f1321b072 last_write_checksum: sha1:051ace67776106616ec4c8e55cf2df9a99855d0f @@ -8106,8 +8530,8 @@ trackedFiles: pristine_git_object: 0a376fb8ee2df0be8546458e0008a2fbc0fd492a src/openrouter/datasets.py: id: 2378f80d1d6a - last_write_checksum: sha1:16857b6d0c5e815cfacb6db6eef804dd37493a38 - pristine_git_object: c80a941f2da9bc4c71561fb804ca4e64dfb7c31b + last_write_checksum: sha1:057b0dde4e051f2cf5cd9fd5b82bbe45eb8fafc5 + pristine_git_object: c483912549b3243f73b300bcea343914e66ef211 src/openrouter/embeddings.py: id: 0374ace39067 last_write_checksum: sha1:8622e7717ef639f2ee452d295c4b2c957a2fe13f @@ -8212,6 +8636,10 @@ trackedFiles: id: e9311185443d last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 pristine_git_object: 89560b566073785535643e694c112bedbd3db13d + src/openrouter/images.py: + id: c4d7adf63ae0 + last_write_checksum: sha1:1bfa3a9cf3bd0eb942d50d77e96bfe456ee9e688 + pristine_git_object: 87b2682c7449ab1be4f24ed44143769772e51b72 src/openrouter/models/__init__.py: id: ed73b93abb3f last_write_checksum: sha1:fd931d5c2d58b5f9189cc897e038d6d78e362dab @@ -8238,8 +8666,8 @@ trackedFiles: pristine_git_object: 37ee42a638f5fce69fc7db1e6b86efb51f381582 src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:5b56b8c29c9360d44a121cdb78811b323c2f5093 - pristine_git_object: 8b12f08941bfd82eabf06beb651eaced69f48158 + last_write_checksum: sha1:3c7911bf0b16974fea948f5f28471866c933f4d4 + pristine_git_object: 8bc044fca36a2e72d87795ebafe99c9f43e38312 src/openrouter/operations/bulkaddworkspacemembers.py: id: e0ed56117619 last_write_checksum: sha1:2b9c73dd8a24d6c479d50118a309e4e0969ca7ea @@ -8282,12 +8710,16 @@ trackedFiles: pristine_git_object: 523d24efa869d63a145167b94e811671b84c5cfb src/openrouter/operations/createembeddings.py: id: fe1160a960e9 - last_write_checksum: sha1:5307ac65b8a4c3eec3de9158c2a3d10554212e8b - pristine_git_object: 4cc4c5c044fa87a8ae21dd7aa0f83d09f4d00f09 + last_write_checksum: sha1:55a231d6e9a2f2a76c3fbc1f8af893e393e08bc3 + pristine_git_object: 6459cab7e1a597f5a1b24f690d845b4ee8809236 src/openrouter/operations/createguardrail.py: id: 52ed4b2f5903 last_write_checksum: sha1:119141c01d19df6b6d090b67f80145e3bf4d4d60 pristine_git_object: 75b9661b38be99f2a067eda4051592111301bed1 + src/openrouter/operations/createimages.py: + id: ef9b8b32ed45 + last_write_checksum: sha1:d88655f88d52b99844fd4bdd2a07554543f3ce65 + pristine_git_object: dcc89c263d4ade2a6cee42a3d42c343546cf313f src/openrouter/operations/createkeys.py: id: 64ad31fdaa6c last_write_checksum: sha1:41931fecbca34b228d5fe6230810eb6bf9271250 @@ -8368,14 +8800,10 @@ trackedFiles: id: 5ffd23dafcc1 last_write_checksum: sha1:c9011252cc7862d8c35b4ff2f3c82003c98953de pristine_git_object: d19ef64ed4dcc19027c95ba19c9b37ed301ebb72 - src/openrouter/operations/getbenchmarksartificialanalysis.py: - id: c967fd553338 - last_write_checksum: sha1:75aed29dbc8f9d41ba0eb3dabd077a2747018eb9 - pristine_git_object: 707ed91247e14983a8fdc1241b83c9512db9144f - src/openrouter/operations/getbenchmarksdesignarena.py: - id: b05492401be4 - last_write_checksum: sha1:fa36e7a28e19c67d8b72060ce85fa6c83e3b7ca9 - pristine_git_object: 2ac2aed2e814ba1a8dc6ad49d05ae582a42f149d + src/openrouter/operations/getbenchmarks.py: + id: 5fb88644491e + last_write_checksum: sha1:03d0020dcfe87f6f0d8e9a36f6374ec4bba3f8eb + pristine_git_object: 480c2f31a1714ecdc1e83b34fb2a1fca0be5aa99 src/openrouter/operations/getbyokkey.py: id: d141452bd88a last_write_checksum: sha1:16c33afc84cd0d3a68e977e739a59d14dfd3bd44 @@ -8428,6 +8856,10 @@ trackedFiles: id: 61dd0325de08 last_write_checksum: sha1:4a96c332bdd9d5e9bf86b7bed29e65f387ea52b6 pristine_git_object: 2e3cf71acfb8771108bc32503a5b87860e5f2d91 + src/openrouter/operations/gettaskclassifications.py: + id: ba6156d68acf + last_write_checksum: sha1:2806a5eaf999c66cc50e57fa258b7c6ef06bd340 + pristine_git_object: 793d2ca73527fee34611019499c0b5f51b361758 src/openrouter/operations/getuseractivity.py: id: 560a0e01c2c3 last_write_checksum: sha1:88c8f4fe8019dc79934cf6b566111bf34d4adb08 @@ -8446,8 +8878,8 @@ trackedFiles: pristine_git_object: bf9965a274d7249abb169adb43c8358b1ee73105 src/openrouter/operations/listbyokkeys.py: id: b6dd42b3e05f - last_write_checksum: sha1:d9b6a80b2120649eef650acbfcddd0cf49901e88 - pristine_git_object: 4b17f290d17f8de1bc81b39f71a4344100aae782 + last_write_checksum: sha1:dd8b78e9b387130fbe2128f6b6531341916cd306 + pristine_git_object: f450f0da77871f1ff4f889ef56de3971e7825a0b src/openrouter/operations/listembeddingsmodels.py: id: bf749a1f23d6 last_write_checksum: sha1:654a4e7e7b486f1d321eeb11ef7a7fa928e501a6 @@ -8480,6 +8912,14 @@ trackedFiles: id: c99a9e7be93c last_write_checksum: sha1:f82932a120516264880ec2defa377bb03a56071f pristine_git_object: f91db9e67fe3a10b2fffd681a517a65eee4df8c8 + src/openrouter/operations/listimagemodelendpoints.py: + id: 40fd868ead3f + last_write_checksum: sha1:a59e2ecd4a27fe12141b7dd34befcae00c1d6206 + pristine_git_object: 15c606cc2a3a7a5c6825124c9ea09c7f9a9c31ad + src/openrouter/operations/listimagemodels.py: + id: ad2131e4aa6c + last_write_checksum: sha1:aefb1c9ab70ad8d1e53e2bd636807c12f4c5744c + pristine_git_object: e5c89ce75ede0c49f529ffced4a041b1d05d48f0 src/openrouter/operations/listkeyassignments.py: id: e26c11d1bd3c last_write_checksum: sha1:2c4e9b2dac5566beb3b4f1331686ec45c174e021 @@ -8574,8 +9014,8 @@ trackedFiles: pristine_git_object: ad2e7f86b6138cf2b2137345155e2b3a5784fb46 src/openrouter/presets.py: id: bd0c40379dcd - last_write_checksum: sha1:e8ce79b2a8f66c69a5b4ae926cc57d7751044f3b - pristine_git_object: ae12a80da2520719fd06717796b8b8cc4a7d9354 + last_write_checksum: sha1:9072880166c0921a928c3898a91de6fab8d5bcd1 + pristine_git_object: 4ab1b9cdeb1929ce264f5d6d19c63f9f7231d6a6 src/openrouter/providers.py: id: debc4c48f149 last_write_checksum: sha1:f39f155f26e6f5e4fb5b7e0f577a8c49536f6bb3 @@ -8590,12 +9030,12 @@ trackedFiles: pristine_git_object: 96401a2fe86fefe574e073952ca235e71953fbec src/openrouter/responses.py: id: f2108fb635e1 - last_write_checksum: sha1:e21e99418d831ca2f606406cc2736b39ecf02bd0 - pristine_git_object: 944aff9aa812fff9b702d8735a37ea279d915a1d + last_write_checksum: sha1:2d50009bcadc43406cab3a16fb72feca6c54ec82 + pristine_git_object: e80404c46cf9516ca4ad7bdb1760a810d5a3850e src/openrouter/sdk.py: id: ee9846c4c9c5 - last_write_checksum: sha1:b2d1f64ba5783c98dc31e15e23966d83abaa2d9d - pristine_git_object: abc46c8355ba5cd0fee2e8e1536ac90eda7aa1b4 + last_write_checksum: sha1:d64c6bd75bb3ff1b610ab0fc5fee0b79fad100e5 + pristine_git_object: 8fe36b2268f2f87ce9e0cf5e140002564fe69e65 src/openrouter/sdkconfiguration.py: id: 55773bb98d7c last_write_checksum: sha1:c01826125c31a8b8bc99d9d679782c8758fae001 @@ -8686,8 +9126,8 @@ trackedFiles: pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 src/openrouter/video_generation.py: id: d0a90c1b8efe - last_write_checksum: sha1:1d2b872c5f939b1758603eede3584cce3d5a97f6 - pristine_git_object: 30f265d1bebd524ab6db41e4529d64d8df561d44 + last_write_checksum: sha1:d752e915a80df1f48a7ca35e901b50175fe3682b + pristine_git_object: cdd7182ff939a02a0bbcd135c06a3b34d50e7076 src/openrouter/workspaces.py: id: cd6c533b1802 last_write_checksum: sha1:2d9fc04510d5e28f57f23eacd7a5814495b127e7 @@ -10042,5 +10482,81 @@ examples: application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getBenchmarks: + speakeasy-default-get-benchmarks: + responses: + "200": + application/json: {"data": [{"agentic_index": 58.3, "coding_index": 65.8, "display_name": "GPT-4o", "intelligence_index": 71.2, "model_permaslug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "source": "artificial-analysis"}], "meta": {"as_of": "2026-06-03T12:00:00Z", "citation": null, "model_count": 1, "source": null, "source_url": null, "task_type": null, "version": "v1"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getTaskClassifications: + speakeasy-default-get-task-classifications: + parameters: + query: + window: "7d" + responses: + "200": + application/json: {"data": {"as_of": "2026-06-17", "classifications": [{"category_token_share": 0.48, "category_usage_share": 0.51, "display_name": "Code Generation", "macro_category": "code", "models": [{"id": "openai/gpt-4.1-mini", "tag_token_share": 0.75, "tag_usage_share": 0.55}], "tag": "code:general_impl", "token_share": 0.31, "usage_share": 0.23}], "macro_categories": [{"key": "code", "label": "Code", "token_share": 0.52, "usage_share": 0.45}], "window_days": 7}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createImages: + speakeasy-default-create-images: + requestBody: + application/json: {"model": "bytedance-seed/seedream-4.5", "prompt": "a red panda astronaut floating in space, studio lighting"} + responses: + "200": + application/json: {"created": 1748372400, "data": [{"b64_json": ""}]} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "402": + application/json: {"error": {"code": 402, "message": "Insufficient credits. Add more using https://openrouter.ai/credits"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "524": + application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} + "529": + application/json: {"error": {"code": 529, "message": "Provider returned error"}} + listImageModels: + speakeasy-default-list-image-models: + responses: + "200": + application/json: {"data": [{"architecture": {"input_modalities": ["text"], "output_modalities": ["image"]}, "created": 1692901234, "description": "A text-to-image model.", "endpoints": "/api/v1/images/models/bytedance-seed/seedream-4.5/endpoints", "id": "bytedance-seed/seedream-4.5", "name": "Seedream 4.5", "supported_parameters": {"resolution": {"type": "enum", "values": ["1K", "2K", "4K"]}}, "supports_streaming": false}]} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listImageModelEndpoints: + speakeasy-default-list-image-model-endpoints: + parameters: + path: + author: "bytedance-seed" + slug: "seedream-4.5" + responses: + "200": + application/json: {"endpoints": [{"allowed_passthrough_parameters": [], "pricing": [{"billable": "output_image", "cost_usd": 0.05, "unit": "image"}], "provider_name": "Bytedance", "provider_slug": "bytedance", "provider_tag": "bytedance", "supported_parameters": {"resolution": {"type": "enum", "values": ["1K", "2K", "4K"]}}, "supports_streaming": false}], "id": "bytedance-seed/seedream-4.5"} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `open_router.presets.create_presets_responses()`: `request` **Changed** **Breaking** :warning:\n* `open_router.presets.create_presets_chat_completions()`: `request` **Changed** **Breaking** :warning:\n* `open_router.chat.send()`: `request` **Changed** **Breaking** :warning:\n* `open_router.workspaces.set_budget()`: **Added**\n* `open_router.o_auth.create_auth_code()`: \n * `request.workspace_id` **Added**\n * `error.status[403]` **Added**\n* `open_router.files.download()`: **Added**\n* `open_router.models.get()`: **Added**\n* `open_router.workspaces.list_budgets()`: **Added**\n* `open_router.workspaces.delete_budget()`: **Added**\n* `open_router.datasets.get_benchmarks_artificial_analysis()`: **Added**\n* `open_router.beta.analytics.query_analytics()`: `response.data.warnings` **Added**\n* `open_router.files.delete()`: **Added**\n* `open_router.files.retrieve()`: **Added**\n* `open_router.files.upload()`: **Added**\n* `open_router.embeddings.list_models()`: `response.data.[].benchmarks` **Added**\n* `open_router.models.list()`: \n * `request` **Changed**\n * `response.data.[].benchmarks` **Added**\n* `open_router.models.list_for_user()`: `response.data.[].benchmarks` **Added**\n* `open_router.files.list()`: **Added**\n* `open_router.presets.create_presets_messages()`: `request` **Changed**\n* `open_router.datasets.get_benchmarks_design_arena()`: **Added**\n" +releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request` **Changed**\n * `response` **Changed** **Breaking** :warning:\n* `open_router.tts.create_speech()`: \n * `request.provider.options.tenstorrent` **Added**\n* `open_router.chat.send()`: `response` **Changed**\n* `open_router.images.list_models()`: **Added**\n* `open_router.images.list_model_endpoints()`: **Added**\n* `open_router.datasets.get_benchmarks_artificial_analysis()`: **Deleted** **Breaking** :warning:\n* `open_router.datasets.get_benchmarks_design_arena()`: **Deleted** **Breaking** :warning:\n* `open_router.classifications.get_task_classifications()`: **Added**\n* `open_router.benchmarks.get_benchmarks()`: **Added**\n* `open_router.images.generate()`: **Added**\n* `open_router.stt.create_transcription()`: \n * `request.provider.options.tenstorrent` **Added**\n* `open_router.byok.list()`: `request.provider` **Changed**\n* `open_router.embeddings.generate()`: `response.usage` **Changed**\n* `open_router.embeddings.list_models()`: `response.data.[].reasoning` **Added**\n* `open_router.models.get()`: `response.data.reasoning` **Added**\n* `open_router.models.list()`: `response.data.[].reasoning` **Added**\n* `open_router.models.list_for_user()`: `response.data.[].reasoning` **Added**\n* `open_router.presets.create_presets_responses()`: `request` **Changed**\n* `open_router.video_generation.generate()`: \n * `request.provider.options.tenstorrent` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 652ef6cc..dec9772a 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true python: - version: 0.10.0 + version: 0.10.1 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 0efe6ba9..50d99d70 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -175,6 +175,7 @@ components: effort: description: Reasoning effort level for the advisor call. enum: + - max - xhigh - high - medium @@ -2202,6 +2203,39 @@ components: required: - type type: object + ApiErrorType: + description: Canonical OpenRouter error type, stable across all API formats + enum: + - context_length_exceeded + - max_tokens_exceeded + - token_limit_exceeded + - string_too_long + - authentication + - permission_denied + - payment_required + - rate_limit_exceeded + - provider_overloaded + - provider_unavailable + - invalid_request + - invalid_prompt + - not_found + - precondition_failed + - payload_too_large + - unprocessable + - content_policy_violation + - refusal + - invalid_image + - image_too_large + - image_too_small + - unsupported_image_format + - image_not_found + - image_download_failed + - server + - timeout + - unmapped + example: rate_limit_exceeded + type: string + x-speakeasy-unknown-values: allow ApplyPatchCallItem: description: >- A tool call emitted by the model requesting a V4A patch operation. The client applies the patch and echoes an `apply_patch_call_output` on the next turn. @@ -3642,353 +3676,22 @@ components: oneOf: - $ref: '#/components/schemas/ContainerAutoEnvironment' - $ref: '#/components/schemas/ContainerReferenceEnvironment' - BenchmarkPricing: - description: OpenRouter pricing per token for this model. Null if pricing is unavailable. - example: - completion: '0.000015' - prompt: '0.000003' - nullable: true - properties: - completion: - description: Cost per output token (USD, decimal string). - example: '0.000015' - type: string - prompt: - description: Cost per input token (USD, decimal string). - example: '0.000003' - type: string - required: - - prompt - - completion - type: object - BenchmarksAAItem: - example: - aa_name: GPT-4o - agentic_index: 58.3 - coding_index: 65.8 - intelligence_index: 71.2 - model_permaslug: openai/gpt-4o - pricing: - completion: '0.00001' - prompt: '0.0000025' - properties: - aa_name: - description: Model name as listed on Artificial Analysis. - example: GPT-4o - type: string - agentic_index: - description: Artificial Analysis Agentic Index composite score. Higher is better. - example: 58.3 - format: double - nullable: true - type: number - coding_index: - description: Artificial Analysis Coding Index composite score. Higher is better. - example: 65.8 - format: double - nullable: true - type: number - intelligence_index: - description: Artificial Analysis Intelligence Index composite score. Higher is better. - example: 71.2 - format: double - nullable: true - type: number - model_permaslug: - description: Stable OpenRouter model identifier. - example: openai/gpt-4o - type: string - pricing: - $ref: '#/components/schemas/BenchmarkPricing' - required: - - model_permaslug - - aa_name - - intelligence_index - - coding_index - - agentic_index - - pricing - type: object - BenchmarksAAMeta: - example: - as_of: '2026-06-03T12:00:00Z' - citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - model_count: 50 - source: artificial-analysis - source_url: https://artificialanalysis.ai - version: v1 - properties: - as_of: - description: ISO-8601 timestamp of when this data was last updated. - example: '2026-06-03T12:00:00Z' - type: string - citation: - description: Required attribution when republishing this data. - example: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - type: string - model_count: - description: Number of unique models in the response. - type: integer - source: - description: Data source identifier. - enum: - - artificial-analysis - type: string - source_url: - description: URL of the upstream data source. - enum: - - https://artificialanalysis.ai - type: string - version: - description: Dataset version. - enum: - - v1 - type: string - required: - - as_of - - version - - source - - source_url - - citation - - model_count - type: object - BenchmarksAAResponse: - example: - data: - - aa_name: GPT-4o - agentic_index: 58.3 - coding_index: 65.8 - intelligence_index: 71.2 - model_permaslug: openai/gpt-4o - pricing: - completion: '0.00001' - prompt: '0.0000025' - meta: - as_of: '2026-06-03T12:00:00Z' - citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - model_count: 1 - source: artificial-analysis - source_url: https://artificialanalysis.ai - version: v1 - properties: - data: - items: - $ref: '#/components/schemas/BenchmarksAAItem' - type: array - meta: - $ref: '#/components/schemas/BenchmarksAAMeta' - required: - - data - - meta - type: object - BenchmarksDAItem: - example: - arena: models - avg_generation_time_ms: 3200 - category: codecategories - display_name: Claude Sonnet 4 - elo: 1423 - model_permaslug: anthropic/claude-sonnet-4 - pricing: - completion: '0.000015' - prompt: '0.000003' - tournament_stats: - first_place: 12 - fourth_place: 2 - second_place: 8 - third_place: 5 - total: 27 - win_rate: 72 - properties: - arena: - description: Arena this ranking belongs to. - example: models - type: string - avg_generation_time_ms: - description: Average generation time in milliseconds. - example: 3200 - format: double - nullable: true - type: number - category: - description: Category within the arena. - example: codecategories - type: string - display_name: - description: Human-readable model name from Design Arena. - example: Claude Sonnet 4 - type: string - elo: - description: ELO rating from head-to-head arena battles. - example: 1423 - format: double - type: number - model_permaslug: - description: >- - Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models. - example: anthropic/claude-sonnet-4 - type: string - pricing: - $ref: '#/components/schemas/BenchmarkPricing' - tournament_stats: - description: Placement distribution from tournament matches. - properties: - first_place: - nullable: true - type: integer - fourth_place: - nullable: true - type: integer - second_place: - nullable: true - type: integer - third_place: - nullable: true - type: integer - total: - nullable: true - type: integer - required: - - first_place - - second_place - - third_place - - fourth_place - - total - type: object - win_rate: - description: Win rate as a percentage (0–100). - example: 72 - format: double - type: number - required: - - model_permaslug - - display_name - - arena - - category - - elo - - win_rate - - avg_generation_time_ms - - tournament_stats - - pricing - type: object - BenchmarksDAMeta: + BigNumberUnion: + description: Price per million prompt tokens + example: 1000 + type: string + BooleanCapability: + description: A supported-or-not flag. Present means the parameter is accepted. example: - arena: models - as_of: '2026-06-03T12:00:00Z' - category: null - citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - elo_bounds: - max: 1600 - min: 900 - model_count: 50 - source: design-arena - source_url: https://www.designarena.ai - version: v1 + type: boolean properties: - arena: - description: The arena filter applied. - type: string - as_of: - description: ISO-8601 timestamp of when this data was generated. - example: '2026-06-03T12:00:00Z' - type: string - category: - description: The category filter applied, or null if showing all. - nullable: true - type: string - citation: - description: Required attribution when republishing this data. - example: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - type: string - elo_bounds: - description: ELO range across all returned models for normalization. - properties: - max: - description: Maximum ELO in the result set. - format: double - type: number - min: - description: Minimum ELO in the result set. - format: double - type: number - required: - - min - - max - type: object - model_count: - description: Number of unique models in the response. - type: integer - source: - description: Data source identifier. - enum: - - design-arena - type: string - source_url: - description: URL of the upstream data source. - enum: - - https://www.designarena.ai - type: string - version: - description: Dataset version. + type: enum: - - v1 + - boolean type: string required: - - as_of - - version - - source - - source_url - - citation - - model_count - - arena - - category - - elo_bounds - type: object - BenchmarksDAResponse: - example: - data: - - arena: models - avg_generation_time_ms: 3200 - category: codecategories - display_name: Claude Sonnet 4 - elo: 1423 - model_permaslug: anthropic/claude-sonnet-4 - pricing: - completion: '0.000015' - prompt: '0.000003' - tournament_stats: - first_place: 12 - fourth_place: 2 - second_place: 8 - third_place: 5 - total: 27 - win_rate: 72 - meta: - arena: models - as_of: '2026-06-03T12:00:00Z' - category: null - citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - elo_bounds: - max: 1600 - min: 900 - model_count: 1 - source: design-arena - source_url: https://www.designarena.ai - version: v1 - properties: - data: - items: - $ref: '#/components/schemas/BenchmarksDAItem' - type: array - meta: - $ref: '#/components/schemas/BenchmarksDAMeta' - required: - - data - - meta + - type type: object - BigNumberUnion: - description: Price per million prompt tokens - example: 1000 - type: string BulkAddWorkspaceMembersRequest: example: user_ids: @@ -4348,6 +4051,7 @@ components: - stepfun - streamlake - switchpoint + - tenstorrent - together - upstage - venice @@ -4359,6 +4063,25 @@ components: example: openai type: string x-speakeasy-unknown-values: allow + CapabilityDescriptor: + description: A typed descriptor for one supported request parameter. + discriminator: + mapping: + boolean: '#/components/schemas/BooleanCapability' + enum: '#/components/schemas/EnumCapability' + range: '#/components/schemas/RangeCapability' + x-speakeasy-unknown-values: allow + propertyName: type + example: + type: enum + values: + - 1K + - 2K + - 4K + oneOf: + - $ref: '#/components/schemas/EnumCapability' + - $ref: '#/components/schemas/RangeCapability' + - $ref: '#/components/schemas/BooleanCapability' ChatAssistantImages: description: Generated images from image generation models example: @@ -5085,6 +4808,7 @@ components: effort: description: Constrains effort on reasoning for reasoning models enum: + - max - xhigh - high - medium @@ -5103,6 +4827,7 @@ components: description: >- Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. enum: + - max - xhigh - high - medium @@ -5377,6 +5102,8 @@ components: example: code: 429 message: Rate limit exceeded + metadata: + error_type: rate_limit_exceeded properties: code: description: Error code @@ -5387,6 +5114,17 @@ components: description: Error message example: Rate limit exceeded type: string + metadata: + description: Structured error metadata + properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' + provider_code: + description: Upstream provider-specific error code, when available + type: string + required: + - error_type + type: object required: - message - code @@ -5735,6 +5473,9 @@ components: prompt_tokens: 10 prompt_tokens_details: cached_tokens: 2 + server_tool_use_details: + tool_calls_executed: 2 + tool_calls_requested: 2 total_tokens: 25 properties: completion_tokens: @@ -5791,6 +5532,25 @@ components: description: Video input tokens type: integer type: object + server_tool_use_details: + description: Usage for server-side tool execution (e.g., web search) + nullable: true + properties: + tool_calls_executed: + description: Number of OpenRouter server tool calls that executed and produced a result + nullable: true + type: integer + tool_calls_requested: + description: >- + Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. + nullable: true + type: integer + web_search_requests: + description: >- + Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. + nullable: true + type: integer + type: object total_tokens: description: Total number of tokens type: integer @@ -7204,6 +6964,54 @@ components: example: America/New_York type: string type: object + DebugEvent: + description: >- + Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones. + example: + debug: + echo_upstream_body: + messages: [] + model: anthropic/claude-sonnet-4 + sequence_number: 1 + type: response.debug + properties: + debug: + properties: + echo_upstream_body: + additionalProperties: + nullable: true + type: object + timings: + properties: + epoch_ms: + type: integer + event: + enum: + - adapter_request + - upstream_headers_received + - first_token_received + - upstream_body_ended + type: string + x-speakeasy-unknown-values: allow + start_ms: + type: integer + required: + - start_ms + - event + - epoch_ms + type: object + type: object + sequence_number: + type: integer + type: + enum: + - response.debug + type: string + required: + - type + - debug + - sequence_number + type: object DefaultParameters: additionalProperties: false description: Default parameters for this model @@ -7457,6 +7265,27 @@ components: example: 0 type: integer x-speakeasy-unknown-values: allow + EnumCapability: + description: A parameter that accepts one of a discrete set of string values. + example: + type: enum + values: + - 1K + - 2K + - 4K + properties: + type: + enum: + - enum + type: string + values: + items: + type: string + type: array + required: + - type + - values + type: object ErrorEvent: allOf: - $ref: '#/components/schemas/BaseErrorEvent' @@ -8455,6 +8284,8 @@ components: maxItems: 8 minItems: 1 type: array + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' max_completion_tokens: description: >- Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies. @@ -8479,6 +8310,7 @@ components: effort: description: Reasoning effort level for panelist and judge inner calls. enum: + - max - xhigh - high - medium @@ -9299,6 +9131,73 @@ components: aspect_ratio: '16:9' quality: high type: object + ImageEndpoint: + description: An endpoint that serves a given image model. + example: + allowed_passthrough_parameters: [] + pricing: + - billable: output_image + cost_usd: 0.05 + unit: image + provider_name: Bytedance + provider_slug: bytedance + provider_tag: bytedance + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + seed: + type: boolean + supports_streaming: false + properties: + allowed_passthrough_parameters: + description: Provider-specific options accepted under provider.options[provider_slug]. + example: [] + items: + type: string + type: array + pricing: + description: Billable pricing lines for this endpoint. + example: + - billable: output_image + cost_usd: 0.05 + unit: image + items: + $ref: '#/components/schemas/ImagePricingEntry' + type: array + provider_name: + description: Provider display name + example: Bytedance + type: string + provider_slug: + description: Provider slug + example: bytedance + type: string + provider_tag: + description: Provider tag for request-side selection + example: bytedance + nullable: true + type: string + supported_parameters: + allOf: + - $ref: '#/components/schemas/SupportedParameters' + - description: The definitive set of parameters this endpoint accepts for this model. + supports_streaming: + description: 'Whether this endpoint supports native SSE streaming (`stream: true` in the request).' + example: false + type: boolean + required: + - provider_name + - provider_slug + - provider_tag + - supported_parameters + - allowed_passthrough_parameters + - supports_streaming + - pricing + type: object ImageGenCallCompletedEvent: allOf: - $ref: '#/components/schemas/OpenAIResponsesImageGenCallCompleted' @@ -9345,6 +9244,192 @@ components: partial_image_index: 0 sequence_number: 3 type: response.image_generation_call.partial_image + ImageGenCompletedEvent: + description: Emitted when generation completes and the final image is available + example: + b64_json: + created: 1748372400 + type: image_generation.completed + usage: + completion_tokens: 4175 + cost: 0.04 + prompt_tokens: 0 + total_tokens: 4175 + properties: + b64_json: + description: Base64-encoded final image data + type: string + created: + description: Unix timestamp (seconds) when the image was generated + type: integer + type: + description: The event type + enum: + - image_generation.completed + type: string + usage: + $ref: '#/components/schemas/ImageGenerationUsage' + required: + - type + - b64_json + - created + type: object + ImageGenerationRequest: + description: Image generation request input + example: + model: bytedance-seed/seedream-4.5 + prompt: a red panda astronaut floating in space, studio lighting + properties: + aspect_ratio: + description: Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + enum: + - '1:1' + - '1:2' + - '1:4' + - '1:8' + - '2:1' + - '2:3' + - '3:2' + - '3:4' + - '4:1' + - '4:3' + - '4:5' + - '5:4' + - '8:1' + - '9:16' + - '16:9' + - '9:19.5' + - 19.5:9 + - '9:20' + - '20:9' + - '9:21' + - '21:9' + - auto + example: '16:9' + type: string + x-speakeasy-unknown-values: allow + background: + description: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). + enum: + - auto + - transparent + - opaque + example: auto + type: string + x-speakeasy-unknown-values: allow + input_references: + description: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. + items: + $ref: '#/components/schemas/ContentPartImage' + maxItems: 16 + type: array + model: + description: The image generation model to use + example: bytedance-seed/seedream-4.5 + type: string + 'n': + description: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. + 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. + example: 100 + type: integer + output_format: + description: Encoding of the returned image bytes. + enum: + - png + - jpeg + - webp + example: png + type: string + x-speakeasy-unknown-values: allow + prompt: + description: Text description of the desired image + example: a red panda astronaut floating in space, studio lighting + minLength: 1 + type: string + provider: + description: Provider-specific passthrough configuration + properties: + options: + allOf: + - $ref: '#/components/schemas/ProviderOptions' + - example: + black-forest-labs: + guidance: 3 + steps: 40 + type: object + quality: + description: Rendering quality. Providers without a quality knob ignore this. + enum: + - auto + - low + - medium + - high + example: high + type: string + x-speakeasy-unknown-values: allow + resolution: + description: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + enum: + - '512' + - 1K + - 2K + - 4K + example: 2K + type: string + x-speakeasy-unknown-values: allow + seed: + description: >- + 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. + type: integer + 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. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + example: 2K + type: string + stream: + description: >- + 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. + type: boolean + required: + - model + - prompt + type: object + ImageGenerationResponse: + description: Image generation response + example: + created: 1748372400 + data: + - b64_json: + usage: + completion_tokens: 4175 + cost: 0.04 + prompt_tokens: 0 + total_tokens: 4175 + properties: + created: + description: Unix timestamp (seconds) when the image was generated + example: 1748372400 + type: integer + data: + description: Generated images + items: + properties: + b64_json: + description: Base64-encoded image bytes + type: string + required: + - b64_json + type: object + type: array + usage: + $ref: '#/components/schemas/ImageGenerationUsage' + required: + - created + - data + type: object ImageGenerationServerTool: description: Image generation tool configuration example: @@ -9467,6 +9552,382 @@ components: example: completed type: string x-speakeasy-unknown-values: allow + ImageGenerationUsage: + description: Token and cost usage for the image generation request, when available + example: + completion_tokens: 4175 + cost: 0.04 + prompt_tokens: 0 + total_tokens: 4175 + properties: + completion_tokens: + description: The tokens generated + type: integer + completion_tokens_details: + nullable: true + properties: + audio_tokens: + description: Tokens generated by the model for audio output. + nullable: true + type: integer + image_tokens: + description: Tokens generated by the model for image output. + nullable: true + type: integer + reasoning_tokens: + description: Tokens generated by the model for reasoning. + nullable: true + type: integer + type: object + cost: + description: Cost of the completion + format: double + nullable: true + type: number + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + description: Whether a request was made using a Bring Your Own Key configuration + type: boolean + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + nullable: true + type: array + prompt_tokens: + description: Including images, input audio, and tools if any + type: integer + prompt_tokens_details: + description: Breakdown of tokens used in the prompt. + nullable: true + properties: + audio_tokens: + description: Tokens used for input audio. + nullable: true + type: integer + cache_write_tokens: + description: Tokens written to cache. Only returned for models with explicit caching and cache write pricing. + nullable: true + type: integer + cached_tokens: + description: Tokens cached by the endpoint. + nullable: true + type: integer + file_tokens: + description: Tokens used for input files/documents. + nullable: true + type: integer + video_tokens: + description: Tokens used for input video. + nullable: true + type: integer + type: object + server_tool_use: + description: Usage for server-side tool execution (e.g., web search) + nullable: true + properties: + tool_calls_executed: + description: Number of OpenRouter server tool calls that executed and produced a result. + nullable: true + type: integer + tool_calls_requested: + description: >- + Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. + nullable: true + type: integer + web_search_requests: + description: >- + Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. + nullable: true + type: integer + type: object + service_tier: + description: The service tier used by the upstream provider for this request + nullable: true + type: string + speed: + $ref: '#/components/schemas/AnthropicSpeed' + total_tokens: + description: Sum of the above two fields + type: integer + required: + - prompt_tokens + - completion_tokens + - total_tokens + type: object + ImageGenPartialImageEvent: + description: Emitted when a partial image becomes available during streaming generation + example: + b64_json: + partial_image_index: 0 + type: image_generation.partial_image + properties: + b64_json: + description: Base64-encoded partial image data + type: string + partial_image_index: + description: 0-based index indicating which partial image this is in the sequence + type: integer + type: + description: The event type + enum: + - image_generation.partial_image + type: string + required: + - type + - partial_image_index + - b64_json + type: object + ImageGenStreamErrorEvent: + description: Emitted when streaming generation fails after the SSE response starts + example: + error: + code: upstream_error + message: The upstream provider returned an error + param: null + type: provider_error + type: error + properties: + error: + description: Provider error details + properties: + code: + description: Provider error code, when supplied + nullable: true + type: string + message: + description: Provider error message + type: string + param: + description: Request parameter associated with the error, when supplied + nullable: true + type: string + type: + description: Provider error type, when supplied + nullable: true + type: string + required: + - message + type: object + type: + description: The event type + enum: + - error + type: string + required: + - type + - error + type: object + ImageModelArchitecture: + example: + input_modalities: + - text + - image + output_modalities: + - image + properties: + input_modalities: + description: Supported input modalities + items: + $ref: '#/components/schemas/InputModality' + type: array + output_modalities: + description: Supported output modalities + items: + $ref: '#/components/schemas/ImageOutputModality' + type: array + required: + - input_modalities + - output_modalities + type: object + ImageModelEndpointsResponse: + description: The full per-endpoint records for an image model. + example: + endpoints: + - allowed_passthrough_parameters: [] + pricing: + - billable: output_image + cost_usd: 0.05 + unit: image + provider_name: Bytedance + provider_slug: bytedance + provider_tag: bytedance + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + supports_streaming: false + id: bytedance-seed/seedream-4.5 + properties: + endpoints: + items: + $ref: '#/components/schemas/ImageEndpoint' + type: array + id: + description: Model slug + example: bytedance-seed/seedream-4.5 + type: string + required: + - id + - endpoints + type: object + ImageModelListItem: + description: A single image model in the discovery listing. + example: + architecture: + input_modalities: + - text + - image + output_modalities: + - image + created: 1692901234 + description: A text-to-image model. + endpoints: /api/v1/images/models/bytedance-seed/seedream-4.5/endpoints + id: bytedance-seed/seedream-4.5 + name: Seedream 4.5 + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + seed: + type: boolean + supports_streaming: false + properties: + architecture: + $ref: '#/components/schemas/ImageModelArchitecture' + created: + description: Unix timestamp (seconds) of when the model was created + example: 1692901234 + type: integer + description: + example: A text-to-image model. + type: string + endpoints: + description: Relative URL to the full per-endpoint records for this model + example: /api/v1/images/models/bytedance-seed/seedream-4.5/endpoints + type: string + id: + description: Model slug + example: bytedance-seed/seedream-4.5 + type: string + name: + description: Display name + example: Seedream 4.5 + type: string + supported_parameters: + $ref: '#/components/schemas/SupportedParameters' + supports_streaming: + description: >- + Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints. + example: false + type: boolean + required: + - id + - name + - description + - created + - architecture + - supported_parameters + - supports_streaming + - endpoints + type: object + ImageModelsListResponse: + description: List of image generation models. + example: + data: + - architecture: + input_modalities: + - text + output_modalities: + - image + created: 1692901234 + description: A text-to-image model. + endpoints: /api/v1/images/models/bytedance-seed/seedream-4.5/endpoints + id: bytedance-seed/seedream-4.5 + name: Seedream 4.5 + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + supports_streaming: false + properties: + data: + items: + $ref: '#/components/schemas/ImageModelListItem' + type: array + required: + - data + type: object + ImageOutputModality: + enum: + - text + - image + - embeddings + - audio + - video + - rerank + - speech + - transcription + example: image + type: string + x-speakeasy-unknown-values: allow + ImagePricingEntry: + description: One billable pricing line for an image provider. + example: + billable: output_image + cost_usd: 0.05 + unit: image + properties: + billable: + enum: + - output_image + - input_image + - input_font + - input_reference + - input_text + type: string + x-speakeasy-unknown-values: allow + cost_usd: + format: double + type: number + unit: + enum: + - image + - megapixel + - token + type: string + x-speakeasy-unknown-values: allow + variant: + type: string + required: + - billable + - unit + - cost_usd + type: object + ImageStreamingResponse: + example: + data: + b64_json: + partial_image_index: 0 + type: image_generation.partial_image + properties: + data: + anyOf: + - $ref: '#/components/schemas/ImageGenPartialImageEvent' + - $ref: '#/components/schemas/ImageGenCompletedEvent' + - $ref: '#/components/schemas/ImageGenStreamErrorEvent' + required: + - data + type: object IncompleteDetails: example: reason: max_output_tokens @@ -11011,9 +11472,12 @@ components: type: object MessagesErrorDetail: example: + error_type: invalid_request message: Invalid request parameters type: invalid_request_error properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' message: type: string type: @@ -11026,12 +11490,15 @@ components: description: Error event in the stream example: error: + error_type: provider_overloaded message: Overloaded type: overloaded_error type: error properties: error: properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' message: type: string type: @@ -11040,6 +11507,8 @@ components: - type - message type: object + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' type: enum: - error @@ -11990,6 +12459,7 @@ components: - Stealth - StreamLake - Switchpoint + - Tenstorrent - Together - Upstage - Venice @@ -12151,6 +12621,15 @@ components: image: '0' prompt: '0.00003' request: '0' + reasoning: + default_effort: medium + default_enabled: true + mandatory: false + supported_efforts: + - high + - medium + - low + - minimal supported_parameters: - temperature - top_p @@ -12213,6 +12692,8 @@ components: $ref: '#/components/schemas/PerRequestLimits' pricing: $ref: '#/components/schemas/PublicPricing' + reasoning: + $ref: '#/components/schemas/ModelReasoning' supported_parameters: description: List of supported parameters for this model items: @@ -12377,6 +12858,43 @@ components: description: Model to use for completion example: openai/gpt-4 type: string + ModelReasoning: + description: Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. + example: + default_effort: medium + default_enabled: true + mandatory: false + supported_efforts: + - high + - medium + - low + - minimal + properties: + default_effort: + allOf: + - $ref: '#/components/schemas/ReasoningEffort' + - description: >- + Default reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `"none"`, prefer omitting effort unless the user explicitly disables reasoning. + default_enabled: + description: Default reasoning enabled state when the client does not set `reasoning.enabled`. + type: boolean + mandatory: + description: When true, reasoning cannot be disabled and effort "none" is rejected. + type: boolean + supported_efforts: + description: >- + Allowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted. + items: + $ref: '#/components/schemas/ReasoningEffort' + nullable: true + type: array + supports_max_tokens: + description: >- + Present and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise. + type: boolean + required: + - mandatory + type: object ModelResponse: description: Single model response example: @@ -12624,6 +13142,7 @@ components: description: Custom HTTP headers to include in requests to this destination. type: object modelId: + description: The name of the tracing project in Arize AX minLength: 1 type: string spaceKey: @@ -15041,6 +15560,8 @@ components: allOf: - $ref: '#/components/schemas/BaseResponsesResult' - properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' openrouter_metadata: $ref: '#/components/schemas/OpenRouterMetadata' output: @@ -17310,6 +17831,7 @@ components: - Stealth - StreamLake - Switchpoint + - Tenstorrent - Together - Upstage - Venice @@ -17749,6 +18271,10 @@ components: additionalProperties: nullable: true type: object + tenstorrent: + additionalProperties: + nullable: true + type: object together: additionalProperties: nullable: true @@ -18098,6 +18624,7 @@ components: - Stealth - StreamLake - Switchpoint + - Tenstorrent - Together - Upstage - Venice @@ -18411,6 +18938,26 @@ components: example: fp16 type: string x-speakeasy-unknown-values: allow + RangeCapability: + description: A parameter that accepts any value within an inclusive numeric range. + example: + max: 100 + min: 0 + type: range + properties: + max: + type: number + min: + type: number + type: + enum: + - range + type: string + required: + - type + - min + - max + type: object RankingsDailyItem: example: date: '2026-05-11' @@ -18626,6 +19173,7 @@ components: type: response.reasoning_text.done ReasoningEffort: enum: + - max - xhigh - high - medium @@ -18991,6 +19539,8 @@ components: type: boolean cache_control: $ref: '#/components/schemas/AnthropicCacheControlDirective' + debug: + $ref: '#/components/schemas/ChatDebugOptions' frequency_penalty: format: double nullable: true @@ -19692,6 +20242,7 @@ components: response.created: '#/components/schemas/OpenResponsesCreatedEvent' response.custom_tool_call_input.delta: '#/components/schemas/CustomToolCallInputDeltaEvent' response.custom_tool_call_input.done: '#/components/schemas/CustomToolCallInputDoneEvent' + response.debug: '#/components/schemas/DebugEvent' response.failed: '#/components/schemas/StreamEventsResponseFailed' response.function_call_arguments.delta: '#/components/schemas/FunctionCallArgsDeltaEvent' response.function_call_arguments.done: '#/components/schemas/FunctionCallArgsDoneEvent' @@ -19791,6 +20342,7 @@ components: - $ref: '#/components/schemas/FusionCallAnalysisInProgressEvent' - $ref: '#/components/schemas/FusionCallAnalysisCompletedEvent' - $ref: '#/components/schemas/FusionCallCompletedEvent' + - $ref: '#/components/schemas/DebugEvent' StreamEventsResponseCompleted: allOf: - $ref: '#/components/schemas/CompletedEvent' @@ -20078,6 +20630,7 @@ components: effort: description: Reasoning effort level for the subagent call. enum: + - max - xhigh - high - medium @@ -20148,6 +20701,205 @@ components: $ref: '#/components/schemas/SubagentNestedTool' type: array type: object + SupportedParameters: + additionalProperties: + $ref: '#/components/schemas/CapabilityDescriptor' + description: >- + Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL. + example: + output_compression: + max: 100 + min: 0 + type: range + resolution: + type: enum + values: + - 1K + - 2K + - 4K + seed: + type: boolean + type: object + TaskClassificationItem: + example: + category_token_share: 0.48 + category_usage_share: 0.51 + display_name: Code Generation + macro_category: code + models: + - id: openai/gpt-4.1-mini + tag_token_share: 0.75 + tag_usage_share: 0.55 + - id: anthropic/claude-sonnet-4 + tag_token_share: 0.12 + tag_usage_share: 0.2 + tag: code:general_impl + token_share: 0.31 + usage_share: 0.23 + properties: + category_token_share: + description: >- + Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`. + example: 0.48 + format: double + type: number + category_usage_share: + description: >- + Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`. + example: 0.51 + format: double + type: number + display_name: + description: Human-readable label for the classification. + example: Code Generation + type: string + macro_category: + description: 'Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`.' + example: code + type: string + models: + description: >- + Top models for this classification by request volume, sorted descending. Each entry reports the model's share of this classification's requests and tokens. + items: + $ref: '#/components/schemas/TaskClassificationModel' + type: array + tag: + description: Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`). + example: code:general_impl + type: string + token_share: + description: >- + Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator. + example: 0.31 + format: double + type: number + usage_share: + description: >- + Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator. + example: 0.23 + format: double + type: number + required: + - tag + - display_name + - macro_category + - usage_share + - token_share + - category_usage_share + - category_token_share + - models + type: object + TaskClassificationMacroCategory: + example: + key: code + label: Code + token_share: 0.52 + usage_share: 0.45 + properties: + key: + description: Macro-category identifier. + example: code + type: string + label: + description: Human-readable label for the macro-category. + example: Code + type: string + token_share: + description: Combined token share of all classifications in this macro-category (0–1). + example: 0.52 + format: double + type: number + usage_share: + description: Combined usage share of all classifications in this macro-category (0–1). + example: 0.45 + format: double + type: number + required: + - key + - label + - usage_share + - token_share + type: object + TaskClassificationModel: + example: + id: openai/gpt-4.1-mini + tag_token_share: 0.75 + tag_usage_share: 0.55 + properties: + id: + description: Model identifier (permaslug). + example: openai/gpt-4.1-mini + type: string + tag_token_share: + description: >- + Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded). + example: 0.75 + format: double + type: number + tag_usage_share: + description: >- + Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded). + example: 0.55 + format: double + type: number + required: + - id + - tag_usage_share + - tag_token_share + type: object + TaskClassificationResponse: + example: + data: + as_of: '2026-06-17' + classifications: + - category_token_share: 0.48 + category_usage_share: 0.51 + display_name: Code Generation + macro_category: code + models: + - id: openai/gpt-4.1-mini + tag_token_share: 0.75 + tag_usage_share: 0.55 + tag: code:general_impl + token_share: 0.31 + usage_share: 0.23 + macro_categories: + - key: code + label: Code + token_share: 0.52 + usage_share: 0.45 + window_days: 7 + properties: + data: + properties: + as_of: + description: >- + UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that date. + example: '2026-06-17' + type: string + classifications: + description: Per-task classification market-share data, sorted by usage_share descending. + items: + $ref: '#/components/schemas/TaskClassificationItem' + type: array + macro_categories: + description: Aggregate market-share data per macro-category (code, data, agent, general). + items: + $ref: '#/components/schemas/TaskClassificationMacroCategory' + type: array + window_days: + description: Number of trailing days covered by this snapshot. + example: 7 + type: integer + required: + - window_days + - as_of + - classifications + - macro_categories + type: object + required: + - data + type: object TextConfig: description: Text output configuration including format and verbosity example: @@ -20394,6 +21146,269 @@ components: - code - message type: object + UnifiedBenchmarkPricing: + description: OpenRouter pricing per token for this model. Null if pricing is unavailable. + example: + completion: '0.000015' + prompt: '0.000003' + nullable: true + properties: + completion: + description: Cost per output token (USD, decimal string). + example: '0.000015' + type: string + prompt: + description: Cost per input token (USD, decimal string). + example: '0.000003' + type: string + required: + - prompt + - completion + type: object + UnifiedBenchmarksAAItem: + example: + agentic_index: 58.3 + coding_index: 65.8 + display_name: GPT-4o + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: artificial-analysis + properties: + agentic_index: + description: Artificial Analysis Agentic Index composite score. Higher is better. + example: 58.3 + format: double + nullable: true + type: number + coding_index: + description: Artificial Analysis Coding Index composite score. Higher is better. + example: 65.8 + format: double + nullable: true + type: number + display_name: + description: Model name as listed on Artificial Analysis. + example: GPT-4o + type: string + intelligence_index: + description: Artificial Analysis Intelligence Index composite score. Higher is better. + example: 71.2 + format: double + nullable: true + type: number + model_permaslug: + description: Stable OpenRouter model identifier. + example: openai/gpt-4o + type: string + pricing: + $ref: '#/components/schemas/UnifiedBenchmarkPricing' + source: + description: Benchmark source discriminator. + enum: + - artificial-analysis + type: string + required: + - source + - model_permaslug + - display_name + - intelligence_index + - coding_index + - agentic_index + - pricing + type: object + UnifiedBenchmarksDAItem: + example: + arena: models + avg_generation_time_ms: 3200 + category: codecategories + display_name: Claude Sonnet 4 + elo: 1423 + model_permaslug: anthropic/claude-sonnet-4 + pricing: + completion: '0.000015' + prompt: '0.000003' + source: design-arena + tournament_stats: + first_place: 12 + fourth_place: 2 + second_place: 8 + third_place: 5 + total: 27 + win_rate: 72 + properties: + arena: + description: Arena this ranking belongs to. + example: models + type: string + avg_generation_time_ms: + description: Average generation time in milliseconds. + example: 3200 + format: double + nullable: true + type: number + category: + description: Category within the arena. + example: codecategories + type: string + display_name: + description: Human-readable model name from Design Arena. + example: Claude Sonnet 4 + type: string + elo: + description: ELO rating from head-to-head arena battles. + example: 1423 + format: double + type: number + model_permaslug: + description: Stable OpenRouter model identifier when mapped; otherwise the upstream Design Arena model id. + example: anthropic/claude-sonnet-4 + type: string + pricing: + $ref: '#/components/schemas/UnifiedBenchmarkPricing' + source: + description: Benchmark source discriminator. + enum: + - design-arena + type: string + tournament_stats: + description: Placement distribution from tournament matches. + properties: + first_place: + nullable: true + type: integer + fourth_place: + nullable: true + type: integer + second_place: + nullable: true + type: integer + third_place: + nullable: true + type: integer + total: + nullable: true + type: integer + required: + - first_place + - second_place + - third_place + - fourth_place + - total + type: object + win_rate: + description: Win rate as a percentage (0–100). + example: 72 + format: double + type: number + required: + - source + - model_permaslug + - display_name + - arena + - category + - elo + - win_rate + - avg_generation_time_ms + - tournament_stats + - pricing + type: object + UnifiedBenchmarksMeta: + example: + as_of: '2026-06-03T12:00:00Z' + citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + model_count: 50 + source: artificial-analysis + source_url: https://artificialanalysis.ai + task_type: null + version: v1 + properties: + as_of: + description: ISO-8601 timestamp of when this data was last updated. + example: '2026-06-03T12:00:00Z' + type: string + citation: + description: >- + Required attribution when republishing this data, or null when results span multiple sources (attribute each item individually by its `source` discriminator). + example: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + nullable: true + type: string + model_count: + description: Number of unique models in the response. + type: integer + source: + description: The source filter applied, or null when all sources are returned. + enum: + - artificial-analysis + - design-arena + - null + example: artificial-analysis + nullable: true + type: string + x-speakeasy-unknown-values: allow + source_url: + description: URL of the upstream data source, or null when results span multiple sources. + example: https://artificialanalysis.ai + nullable: true + type: string + task_type: + description: The task_type filter applied, or null if showing all. + nullable: true + type: string + version: + description: Dataset version. + enum: + - v1 + type: string + required: + - as_of + - version + - source + - source_url + - citation + - model_count + - task_type + type: object + UnifiedBenchmarksResponse: + example: + data: + - agentic_index: 58.3 + coding_index: 65.8 + display_name: GPT-4o + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: artificial-analysis + meta: + as_of: '2026-06-03T12:00:00Z' + citation: null + model_count: 1 + source: null + source_url: null + task_type: null + version: v1 + properties: + data: + items: + discriminator: + mapping: + artificial-analysis: '#/components/schemas/UnifiedBenchmarksAAItem' + design-arena: '#/components/schemas/UnifiedBenchmarksDAItem' + propertyName: source + oneOf: + - $ref: '#/components/schemas/UnifiedBenchmarksAAItem' + - $ref: '#/components/schemas/UnifiedBenchmarksDAItem' + type: array + meta: + $ref: '#/components/schemas/UnifiedBenchmarksMeta' + required: + - data + - meta + type: object UnprocessableEntityResponse: description: Unprocessable Entity - Semantic validation failure example: @@ -22978,6 +23993,146 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" + /benchmarks: + get: + description: >- + Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + operationId: getBenchmarks + parameters: + - description: >- + Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. + in: query + name: source + required: false + schema: + description: >- + Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. + enum: + - artificial-analysis + - design-arena + example: artificial-analysis + type: string + x-speakeasy-unknown-values: allow + - description: >- + Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + in: query + name: task_type + required: false + schema: + description: >- + Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + enum: + - coding + - intelligence + - agentic + example: coding + type: string + x-speakeasy-unknown-values: allow + - description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' + in: query + name: arena + required: false + schema: + description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' + enum: + - models + - builders + - agents + example: models + type: string + x-speakeasy-unknown-values: allow + - description: >- + Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + in: query + name: category + required: false + schema: + description: >- + Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + example: codecategories + type: string + - description: Maximum number of items to return. When omitted, all matching results are returned. + in: query + name: max_results + required: false + schema: + description: Maximum number of items to return. When omitted, all matching results are returned. + example: 50 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - agentic_index: 58.3 + coding_index: 65.8 + display_name: GPT-4o + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: artificial-analysis + meta: + as_of: '2026-06-03T12:00:00Z' + citation: null + model_count: 1 + source: null + source_url: null + task_type: null + version: v1 + schema: + $ref: '#/components/schemas/UnifiedBenchmarksResponse' + description: Benchmark results filtered by the specified source and optional task type. + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List Benchmarks + tags: + - Benchmarks + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /byok: get: description: >- @@ -23095,6 +24250,7 @@ paths: - stepfun - streamlake - switchpoint + - tenstorrent - together - upstage - venice @@ -23721,6 +24877,116 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" + /classifications/task: + get: + description: |- + Returns the market-share breakdown of OpenRouter traffic by task classification + (e.g. code generation, web search, summarization) over a trailing time window. + + Each classification reports its share of classified sampled requests (`usage_share`) + and classified sampled token volume (`token_share`) as fractions between 0 and 1. + The unclassified `other` bucket is excluded. Absolute volumes are not exposed + because the underlying data is sampled. + + Each classification also includes a `models` array listing the top models by + request volume within that classification, with their within-tag usage and token shares. + + Classifications are grouped into macro-categories (Code, Data, Agent, General) + with aggregate shares provided for each. + + Authenticate with any valid OpenRouter API key (same key used for inference). + Rate-limited to 30 requests/minute per key and 500 requests/day per account. + + When republishing or quoting this data, cite as: + "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}." + operationId: getTaskClassifications + parameters: + - description: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. + in: query + name: window + required: false + schema: + default: 7d + description: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. + enum: + - 7d + example: 7d + type: string + responses: + '200': + content: + application/json: + example: + data: + as_of: '2026-06-17' + classifications: + - category_token_share: 0.48 + category_usage_share: 0.51 + display_name: Code Generation + macro_category: code + models: + - id: openai/gpt-4.1-mini + tag_token_share: 0.75 + tag_usage_share: 0.55 + tag: code:general_impl + token_share: 0.31 + usage_share: 0.23 + macro_categories: + - key: code + label: Code + token_share: 0.52 + usage_share: 0.45 + window_days: 7 + schema: + $ref: '#/components/schemas/TaskClassificationResponse' + description: Task classification market-share data for the requested trailing window. + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Task classification market share + tags: + - Classifications + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /credits: get: description: >- @@ -24049,219 +25315,6 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /datasets/benchmarks/artificial-analysis: - get: - description: >- - Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - operationId: getBenchmarksArtificialAnalysis - parameters: - - description: Max results to return (1–100, default 50). - in: query - name: max_results - required: false - schema: - default: 50 - description: Max results to return (1–100, default 50). - example: 20 - maximum: 100 - minimum: 1 - type: integer - responses: - '200': - content: - application/json: - example: - data: - - aa_name: GPT-4o - agentic_index: 58.3 - coding_index: 65.8 - intelligence_index: 71.2 - model_permaslug: openai/gpt-4o - pricing: - completion: '0.00001' - prompt: '0.0000025' - meta: - as_of: '2026-06-03T12:00:00Z' - citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - model_count: 1 - source: artificial-analysis - source_url: https://artificialanalysis.ai - version: v1 - schema: - $ref: '#/components/schemas/BenchmarksAAResponse' - description: Artificial Analysis composite index scores with pricing and attribution metadata. - '400': - content: - application/json: - example: - error: - code: 400 - message: Invalid request parameters - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input - '401': - content: - application/json: - example: - error: - code: 401 - message: Missing Authentication header - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '429': - content: - application/json: - example: - error: - code: 429 - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Artificial Analysis Benchmark Indices - tags: - - Datasets - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /datasets/benchmarks/design-arena: - get: - description: >- - Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - operationId: getBenchmarksDesignArena - parameters: - - description: Arena to query. Defaults to `models`. - in: query - name: arena - required: false - schema: - default: models - description: Arena to query. Defaults to `models`. - enum: - - models - - builders - - agents - example: models - type: string - x-speakeasy-unknown-values: allow - - description: >- - Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - in: query - name: category - required: false - schema: - description: >- - Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - example: codecategories - type: string - - description: 'Max results to return: per category when no category filter is applied (1–100, default 50).' - in: query - name: max_results - required: false - schema: - default: 50 - description: 'Max results to return: per category when no category filter is applied (1–100, default 50).' - example: 20 - maximum: 100 - minimum: 1 - type: integer - responses: - '200': - content: - application/json: - example: - data: - - arena: models - avg_generation_time_ms: 3200 - category: codecategories - display_name: Claude Sonnet 4 - elo: 1423 - model_permaslug: anthropic/claude-sonnet-4 - pricing: - completion: '0.000015' - prompt: '0.000003' - tournament_stats: - first_place: 12 - fourth_place: 2 - second_place: 8 - third_place: 5 - total: 27 - win_rate: 72 - meta: - arena: models - as_of: '2026-06-03T12:00:00Z' - category: null - citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - elo_bounds: - max: 1600 - min: 900 - model_count: 1 - source: design-arena - source_url: https://www.designarena.ai - version: v1 - schema: - $ref: '#/components/schemas/BenchmarksDAResponse' - description: Design Arena ELO rankings with pricing and attribution metadata. - '400': - content: - application/json: - example: - error: - code: 400 - message: Invalid request parameters - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input - '401': - content: - application/json: - example: - error: - code: 401 - message: Missing Authentication header - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '429': - content: - application/json: - example: - error: - code: 429 - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Design Arena Benchmark Rankings - tags: - - Datasets - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" /datasets/rankings-daily: get: description: |- @@ -24569,6 +25622,31 @@ paths: example: 0.0001 format: double type: number + cost_details: + description: Breakdown of upstream inference costs + example: + upstream_inference_completions_cost: 0.0004 + upstream_inference_cost: null + upstream_inference_prompt_cost: 0.0008 + nullable: true + properties: + upstream_inference_completions_cost: + format: double + type: number + upstream_inference_cost: + format: double + nullable: true + type: number + upstream_inference_prompt_cost: + format: double + type: number + required: + - upstream_inference_prompt_cost + - upstream_inference_completions_cost + type: object + is_byok: + description: Whether a request was made using a Bring Your Own Key configuration + type: boolean prompt_tokens: description: Number of tokens in the input example: 8 @@ -26368,16 +27446,338 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '404': - content: - application/json: - example: - error: - code: 404 - message: Resource not found - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List member assignments for a guardrail + tags: + - Guardrails + x-speakeasy-name-override: listGuardrailMemberAssignments + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + post: + description: >- + Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: bulkAssignMembersToGuardrail + parameters: + - description: The unique identifier of the guardrail + in: path + name: id + required: true + schema: + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + requestBody: + content: + application/json: + example: + member_user_ids: + - user_abc123 + - user_def456 + schema: + $ref: '#/components/schemas/BulkAssignMembersRequest' + required: true + responses: + '200': + content: + application/json: + example: + assigned_count: 2 + schema: + $ref: '#/components/schemas/BulkAssignMembersResponse' + description: Assignment result + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Bulk assign members to a guardrail + tags: + - Guardrails + x-speakeasy-name-override: bulkAssignMembers + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /guardrails/{id}/assignments/members/remove: + post: + description: >- + Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: bulkUnassignMembersFromGuardrail + parameters: + - description: The unique identifier of the guardrail + in: path + name: id + required: true + schema: + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + requestBody: + content: + application/json: + example: + member_user_ids: + - user_abc123 + - user_def456 + schema: + $ref: '#/components/schemas/BulkUnassignMembersRequest' + required: true + responses: + '200': + content: + application/json: + example: + unassigned_count: 2 + schema: + $ref: '#/components/schemas/BulkUnassignMembersResponse' + description: Unassignment result + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Bulk unassign members from a guardrail + tags: + - Guardrails + x-speakeasy-name-override: bulkUnassignMembers + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /guardrails/assignments/keys: + get: + description: >- + List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listKeyAssignments + parameters: + - description: Number of records to skip for pagination + in: query + name: offset + required: false + schema: + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: false + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + key_label: prod-key + key_name: Production Key + total_count: 1 + schema: + $ref: '#/components/schemas/ListKeyAssignmentsResponse' + description: List of key assignments + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List all key assignments + tags: + - Guardrails + x-speakeasy-name-override: listKeyAssignments + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /guardrails/assignments/members: + get: + description: >- + List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listMemberAssignments + parameters: + - description: Number of records to skip for pagination + in: query + name: offset + required: false + schema: + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: false + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + organization_id: org_xyz789 + user_id: user_abc123 + total_count: 1 + schema: + $ref: '#/components/schemas/ListMemberAssignmentsResponse' + description: List of member assignments + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials '500': content: application/json: @@ -26388,10 +27788,10 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List member assignments for a guardrail + summary: List all member assignments tags: - Guardrails - x-speakeasy-name-override: listGuardrailMemberAssignments + x-speakeasy-name-override: listMemberAssignments x-speakeasy-pagination: inputs: - in: parameters @@ -26403,39 +27803,48 @@ paths: outputs: results: $.data type: offsetLimit + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /images: post: - description: >- - Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: bulkAssignMembersToGuardrail - parameters: - - description: The unique identifier of the guardrail - in: path - name: id - required: true - schema: - description: The unique identifier of the guardrail - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string + description: Generates an image from a text prompt via the image generation router + operationId: createImages requestBody: content: application/json: example: - member_user_ids: - - user_abc123 - - user_def456 + model: bytedance-seed/seedream-4.5 + prompt: a red panda astronaut floating in space, studio lighting schema: - $ref: '#/components/schemas/BulkAssignMembersRequest' + $ref: '#/components/schemas/ImageGenerationRequest' required: true responses: '200': content: application/json: example: - assigned_count: 2 + created: 1748372400 + data: + - b64_json: + usage: + completion_tokens: 4175 + cost: 0.04 + prompt_tokens: 0 + total_tokens: 4175 schema: - $ref: '#/components/schemas/BulkAssignMembersResponse' - description: Assignment result + $ref: '#/components/schemas/ImageGenerationResponse' + text/event-stream: + example: + data: + b64_json: + partial_image_index: 0 + type: image_generation.partial_image + schema: + $ref: '#/components/schemas/ImageStreamingResponse' + x-speakeasy-sse-sentinel: '[DONE]' + description: Image generation response '400': content: application/json: @@ -26456,6 +27865,26 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials + '402': + content: + application/json: + example: + error: + code: 402 + message: Insufficient credits. Add more using https://openrouter.ai/credits + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: Payment Required - Insufficient credits or quota to complete request + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions '404': content: application/json: @@ -26466,159 +27895,96 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist - '500': + '429': content: application/json: example: error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Bulk assign members to a guardrail - tags: - - Guardrails - x-speakeasy-name-override: bulkAssignMembers - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /guardrails/{id}/assignments/members/remove: - post: - description: >- - Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: bulkUnassignMembersFromGuardrail - parameters: - - description: The unique identifier of the guardrail - in: path - name: id - required: true - schema: - description: The unique identifier of the guardrail - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string - requestBody: - content: - application/json: - example: - member_user_ids: - - user_abc123 - - user_def456 - schema: - $ref: '#/components/schemas/BulkUnassignMembersRequest' - required: true - responses: - '200': - content: - application/json: - example: - unassigned_count: 2 + code: 429 + message: Rate limit exceeded schema: - $ref: '#/components/schemas/BulkUnassignMembersResponse' - description: Unassignment result - '400': + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': content: application/json: example: error: - code: 400 - message: Invalid request parameters + code: 500 + message: Internal Server Error schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input - '401': + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + '502': content: application/json: example: error: - code: 401 - message: Missing Authentication header + code: 502 + message: Provider returned error schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '404': + $ref: '#/components/schemas/BadGatewayResponse' + description: Bad Gateway - Provider/upstream API failure + '524': content: application/json: example: error: - code: 404 - message: Resource not found + code: 524 + message: Request timed out. Please try again later. schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist - '500': + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: Infrastructure Timeout - Provider request timed out at edge network + '529': content: application/json: example: error: - code: 500 - message: Internal Server Error + code: 529 + message: Provider returned error schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Bulk unassign members from a guardrail + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: Provider Overloaded - Provider is temporarily overloaded + summary: Generate an image tags: - - Guardrails - x-speakeasy-name-override: bulkUnassignMembers + - Images + x-speakeasy-name-override: generate parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /guardrails/assignments/keys: + /images/models: get: description: >- - List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: listKeyAssignments - parameters: - - description: Number of records to skip for pagination - in: query - name: offset - required: false - schema: - description: Number of records to skip for pagination - example: 0 - minimum: 0 - nullable: false - type: integer - - description: Maximum number of records to return (max 100) - in: query - name: limit - required: false - schema: - description: Maximum number of records to return (max 100) - example: 50 - maximum: 100 - minimum: 1 - type: integer + Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records. + operationId: listImageModels responses: '200': content: application/json: example: data: - - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 - key_label: prod-key - key_name: Production Key - total_count: 1 - schema: - $ref: '#/components/schemas/ListKeyAssignmentsResponse' - description: List of key assignments - '401': - content: - application/json: - example: - error: - code: 401 - message: Missing Authentication header - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials + - architecture: + input_modalities: + - text + output_modalities: + - image + created: 1692901234 + description: A text-to-image model. + endpoints: /api/v1/images/models/bytedance-seed/seedream-4.5/endpoints + id: bytedance-seed/seedream-4.5 + name: Seedream 4.5 + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + supports_streaming: false + schema: + $ref: '#/components/schemas/ImageModelsListResponse' + description: List of image generation models '500': content: application/json: @@ -26629,77 +27995,72 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List all key assignments + summary: List image generation models tags: - - Guardrails - x-speakeasy-name-override: listKeyAssignments - x-speakeasy-pagination: - inputs: - - in: parameters - name: offset - type: offset - - in: parameters - name: limit - type: limit - outputs: - results: $.data - type: offsetLimit + - Images + x-speakeasy-name-override: listModels parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /guardrails/assignments/members: + /images/models/{author}/{slug}/endpoints: get: description: >- - List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: listMemberAssignments + Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist. + operationId: listImageModelEndpoints parameters: - - description: Number of records to skip for pagination - in: query - name: offset - required: false + - description: Model author/organization + in: path + name: author + required: true schema: - description: Number of records to skip for pagination - example: 0 - minimum: 0 - nullable: false - type: integer - - description: Maximum number of records to return (max 100) - in: query - name: limit - required: false + description: Model author/organization + example: bytedance-seed + type: string + - description: Model slug + in: path + name: slug + required: true schema: - description: Maximum number of records to return (max 100) - example: 50 - maximum: 100 - minimum: 1 - type: integer + description: Model slug + example: seedream-4.5 + type: string responses: '200': content: application/json: example: - data: - - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - organization_id: org_xyz789 - user_id: user_abc123 - total_count: 1 - schema: - $ref: '#/components/schemas/ListMemberAssignmentsResponse' - description: List of member assignments - '401': + endpoints: + - allowed_passthrough_parameters: [] + pricing: + - billable: output_image + cost_usd: 0.05 + unit: image + provider_name: Bytedance + provider_slug: bytedance + provider_tag: bytedance + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + supports_streaming: false + id: bytedance-seed/seedream-4.5 + schema: + $ref: '#/components/schemas/ImageModelEndpointsResponse' + description: The full per-endpoint records for an image model + '404': content: application/json: example: error: - code: 401 - message: Missing Authentication header + code: 404 + message: Resource not found schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist '500': content: application/json: @@ -26710,21 +28071,10 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List all member assignments + summary: List endpoints for an image model tags: - - Guardrails - x-speakeasy-name-override: listMemberAssignments - x-speakeasy-pagination: - inputs: - - in: parameters - name: offset - type: offset - - in: parameters - name: limit - type: limit - outputs: - results: $.data - type: offsetLimit + - Images + x-speakeasy-name-override: listModelEndpoints parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" @@ -28725,7 +30075,7 @@ paths: id: openai/gpt-4 knowledge_cutoff: null links: - details: /api/v1/models/openai/gpt-5.4/endpoints + details: /api/v1/models/openai/gpt-4/endpoints name: GPT-4 per_request_limits: null pricing: @@ -32681,8 +34031,12 @@ tags: name: Anthropic Messages - description: BYOK endpoints name: BYOK + - description: Benchmarks endpoints + name: Benchmarks - description: Chat completion endpoints name: Chat + - description: Task classification market-share endpoints + name: Classifications - description: Credit management endpoints name: Credits - description: Datasets endpoints @@ -32697,6 +34051,8 @@ tags: name: Generations - description: Guardrails endpoints name: Guardrails + - description: Images endpoints + name: Images - description: Model information endpoints name: Models - description: OAuth authentication endpoints diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 8c161448..0fab45b7 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,20 +2,20 @@ speakeasyVersion: 1.680.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:716ece4a1211eac2ee0e7e5836c7b484cff9bb002bd4e676d9ecad8317ee7941 - sourceBlobDigest: sha256:12d3dc8e7150ab2c4c5e3d613b01cb5e4dcce52b329eea89ca1fdc656d6fe045 + sourceRevisionDigest: sha256:d25511f000fb087e613908484a869356d3288aab6ad76a9116c4aa8aea97c8e2 + sourceBlobDigest: sha256:8e4c160ace01ceb9d04d4fc322ec093377dd9d3eb132a91d570e8ded33e9a4a4 tags: - latest - - speakeasy-sdk-regen-1781312282 + - speakeasy-sdk-regen-1782223810 - 1.0.0 targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:716ece4a1211eac2ee0e7e5836c7b484cff9bb002bd4e676d9ecad8317ee7941 - sourceBlobDigest: sha256:12d3dc8e7150ab2c4c5e3d613b01cb5e4dcce52b329eea89ca1fdc656d6fe045 + sourceRevisionDigest: sha256:d25511f000fb087e613908484a869356d3288aab6ad76a9116c4aa8aea97c8e2 + sourceBlobDigest: sha256:8e4c160ace01ceb9d04d4fc322ec093377dd9d3eb132a91d570e8ded33e9a4a4 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:e7d6f4de48a7c63cf15f3a8378f952277cd4c59373c28c61909497853fa769e2 + codeSamplesRevisionDigest: sha256:9d3c04388203f2bb53c98d355f28eb347c4e35f4c325b8dcd55302f3b4ad621a workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.680.0 diff --git a/RELEASES.md b/RELEASES.md index 3c7e1bf4..d650292e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -28,4 +28,14 @@ Based on: ### Generated - [python v0.10.0] . ### Releases -- [PyPI v0.10.0] https://pypi.org/project/openrouter/0.10.0 - . \ No newline at end of file +- [PyPI v0.10.0] https://pypi.org/project/openrouter/0.10.0 - . + +## 2026-06-24 00:47:54 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.10.1] . +### Releases +- [PyPI v0.10.1] https://pypi.org/project/openrouter/0.10.1 - . \ No newline at end of file diff --git a/docs/components/completiontokensdetails.md b/docs/components/completiontokensdetails.md deleted file mode 100644 index 79c357c8..00000000 --- a/docs/components/completiontokensdetails.md +++ /dev/null @@ -1,13 +0,0 @@ -# CompletionTokensDetails - -Detailed completion token usage - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | -| `accepted_prediction_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Accepted prediction tokens | -| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for audio output | -| `reasoning_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for reasoning | -| `rejected_prediction_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Rejected prediction tokens | \ No newline at end of file diff --git a/docs/components/error.md b/docs/components/error.md deleted file mode 100644 index a64dcf87..00000000 --- a/docs/components/error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -Error information - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| `code` | *int* | :heavy_check_mark: | Error code | 429 | -| `message` | *str* | :heavy_check_mark: | Error message | Rate limit exceeded | \ No newline at end of file diff --git a/docs/components/model.md b/docs/components/model.md index 8ce3d9d7..edb000fc 100644 --- a/docs/components/model.md +++ b/docs/components/model.md @@ -22,6 +22,7 @@ Information about an AI model available on OpenRouter | `name` | *str* | :heavy_check_mark: | Display name of the model | GPT-4 | | `per_request_limits` | [Nullable[components.PerRequestLimits]](../components/perrequestlimits.md) | :heavy_check_mark: | Per-request token limits | {
"completion_tokens": 1000,
"prompt_tokens": 1000
} | | `pricing` | [components.PublicPricing](../components/publicpricing.md) | :heavy_check_mark: | Pricing information for the model | {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
} | +| `reasoning` | [Optional[components.ModelReasoning]](../components/modelreasoning.md) | :heavy_minus_sign: | Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. | {
"default_effort": "medium",
"default_enabled": true,
"mandatory": false,
"supported_efforts": [
"high",
"medium",
"low",
"minimal"
]
} | | `supported_parameters` | List[[components.Parameter](../components/parameter.md)] | :heavy_check_mark: | List of supported parameters for this model | | | `supported_voices` | List[*str*] | :heavy_check_mark: | List of supported voice identifiers for TTS models. Null for non-TTS models. | | | `top_provider` | [components.TopProviderInfo](../components/topproviderinfo.md) | :heavy_check_mark: | Information about the top provider for this model | {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
} | \ No newline at end of file diff --git a/docs/components/prompttokensdetails.md b/docs/components/prompttokensdetails.md deleted file mode 100644 index ecc924e0..00000000 --- a/docs/components/prompttokensdetails.md +++ /dev/null @@ -1,13 +0,0 @@ -# PromptTokensDetails - -Detailed prompt token usage - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `audio_tokens` | *Optional[int]* | :heavy_minus_sign: | Audio input tokens | -| `cache_write_tokens` | *Optional[int]* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | -| `cached_tokens` | *Optional[int]* | :heavy_minus_sign: | Cached prompt tokens | -| `video_tokens` | *Optional[int]* | :heavy_minus_sign: | Video input tokens | \ No newline at end of file diff --git a/docs/components/providername.md b/docs/components/providername.md index e27624b1..90bcbf9b 100644 --- a/docs/components/providername.md +++ b/docs/components/providername.md @@ -82,6 +82,7 @@ | `STEALTH` | Stealth | | `STREAM_LAKE` | StreamLake | | `SWITCHPOINT` | Switchpoint | +| `TENSTORRENT` | Tenstorrent | | `TOGETHER` | Together | | `UPSTAGE` | Upstage | | `VENICE` | Venice | diff --git a/docs/sdks/responses/README.md b/docs/sdks/responses/README.md index b1c9d9fe..c9601f17 100644 --- a/docs/sdks/responses/README.md +++ b/docs/sdks/responses/README.md @@ -46,6 +46,7 @@ with OpenRouter( | `x_open_router_metadata` | [Optional[components.MetadataLevel]](../../components/metadatalevel.md) | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. | enabled | | `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | | `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `debug` | [Optional[components.ChatDebugOptions]](../../components/chatdebugoptions.md) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | {
"echo_upstream_body": true
} | | `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | | `image_config` | Dict[str, [components.ImageConfig](../../components/imageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | {
"aspect_ratio": "16:9",
"quality": "high"
} | | `include` | List[[components.ResponseIncludesEnum](../../components/responseincludesenum.md)] | :heavy_minus_sign: | N/A | | diff --git a/pyproject.toml b/pyproject.toml index 396bd51f..b98c0280 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "0.10.0" +version = "0.10.1" 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 be619e3b..ade61995 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "0.10.0" +__version__: str = "0.10.1" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.788.4" -__user_agent__: str = "speakeasy-sdk/python 0.10.0 2.788.4 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 0.10.1 2.788.4 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/benchmarks.py b/src/openrouter/benchmarks.py new file mode 100644 index 00000000..d29a6859 --- /dev/null +++ b/src/openrouter/benchmarks.py @@ -0,0 +1,303 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from openrouter import components, errors, operations, utils +from openrouter._hooks import HookContext +from openrouter.types import OptionalNullable, UNSET +from openrouter.utils import get_security_from_env +from openrouter.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional + + +class Benchmarks(BaseSDK): + r"""Benchmarks endpoints""" + + def get_benchmarks( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + source: Optional[operations.Source] = None, + task_type: Optional[operations.TaskType] = None, + arena: Optional[operations.Arena] = None, + category: Optional[str] = None, + max_results: Optional[int] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.UnifiedBenchmarksResponse: + r"""List Benchmarks + + Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param source: Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. + :param task_type: Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + :param arena: Design Arena only: arena to query. Defaults to `models` when source is `design-arena`. + :param category: Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + :param max_results: Maximum number of items to return. When omitted, all matching results are returned. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.GetBenchmarksRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + source=source, + task_type=task_type, + arena=arena, + category=category, + max_results=max_results, + ) + + req = self._build_request( + method="GET", + path="/benchmarks", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.GetBenchmarksGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getBenchmarks", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "429", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.UnifiedBenchmarksResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def get_benchmarks_async( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + source: Optional[operations.Source] = None, + task_type: Optional[operations.TaskType] = None, + arena: Optional[operations.Arena] = None, + category: Optional[str] = None, + max_results: Optional[int] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.UnifiedBenchmarksResponse: + r"""List Benchmarks + + Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param source: Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. + :param task_type: Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + :param arena: Design Arena only: arena to query. Defaults to `models` when source is `design-arena`. + :param category: Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + :param max_results: Maximum number of items to return. When omitted, all matching results are returned. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.GetBenchmarksRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + source=source, + task_type=task_type, + arena=arena, + category=category, + max_results=max_results, + ) + + req = self._build_request_async( + method="GET", + path="/benchmarks", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.GetBenchmarksGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getBenchmarks", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "429", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.UnifiedBenchmarksResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) diff --git a/src/openrouter/classifications.py b/src/openrouter/classifications.py new file mode 100644 index 00000000..2654cbc5 --- /dev/null +++ b/src/openrouter/classifications.py @@ -0,0 +1,315 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from openrouter import components, errors, operations, utils +from openrouter._hooks import HookContext +from openrouter.types import OptionalNullable, UNSET +from openrouter.utils import get_security_from_env +from openrouter.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional + + +class Classifications(BaseSDK): + r"""Task classification market-share endpoints""" + + def get_task_classifications( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + window: Optional[operations.Window] = "7d", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.TaskClassificationResponse: + r"""Task classification market share + + Returns the market-share breakdown of OpenRouter traffic by task classification + (e.g. code generation, web search, summarization) over a trailing time window. + + Each classification reports its share of classified sampled requests (`usage_share`) + and classified sampled token volume (`token_share`) as fractions between 0 and 1. + The unclassified `other` bucket is excluded. Absolute volumes are not exposed + because the underlying data is sampled. + + Each classification also includes a `models` array listing the top models by + request volume within that classification, with their within-tag usage and token shares. + + Classifications are grouped into macro-categories (Code, Data, Agent, General) + with aggregate shares provided for each. + + Authenticate with any valid OpenRouter API key (same key used for inference). + Rate-limited to 30 requests/minute per key and 500 requests/day per account. + + When republishing or quoting this data, cite as: + \"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}.\" + + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param window: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.GetTaskClassificationsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + window=window, + ) + + req = self._build_request( + method="GET", + path="/classifications/task", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.GetTaskClassificationsGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getTaskClassifications", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "429", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.TaskClassificationResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def get_task_classifications_async( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + window: Optional[operations.Window] = "7d", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.TaskClassificationResponse: + r"""Task classification market share + + Returns the market-share breakdown of OpenRouter traffic by task classification + (e.g. code generation, web search, summarization) over a trailing time window. + + Each classification reports its share of classified sampled requests (`usage_share`) + and classified sampled token volume (`token_share`) as fractions between 0 and 1. + The unclassified `other` bucket is excluded. Absolute volumes are not exposed + because the underlying data is sampled. + + Each classification also includes a `models` array listing the top models by + request volume within that classification, with their within-tag usage and token shares. + + Classifications are grouped into macro-categories (Code, Data, Agent, General) + with aggregate shares provided for each. + + Authenticate with any valid OpenRouter API key (same key used for inference). + Rate-limited to 30 requests/minute per key and 500 requests/day per account. + + When republishing or quoting this data, cite as: + \"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}.\" + + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param window: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.GetTaskClassificationsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + window=window, + ) + + req = self._build_request_async( + method="GET", + path="/classifications/task", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.GetTaskClassificationsGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getTaskClassifications", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "429", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.TaskClassificationResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 2c07302c..27e2fff5 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -29,6 +29,11 @@ AnnotationAddedEventType, AnnotationAddedEventTypedDict, ) + from .anthropicadvisormessageusageiteration import ( + AnthropicAdvisorMessageUsageIteration, + AnthropicAdvisorMessageUsageIterationType, + AnthropicAdvisorMessageUsageIterationTypedDict, + ) from .anthropicallowedcallers import AnthropicAllowedCallers from .anthropicbase64imagesource import ( AnthropicBase64ImageSource, @@ -72,6 +77,11 @@ AnthropicCitationWebSearchResultLocationType, AnthropicCitationWebSearchResultLocationTypedDict, ) + from .anthropiccompactionusageiteration import ( + AnthropicCompactionUsageIteration, + AnthropicCompactionUsageIterationType, + AnthropicCompactionUsageIterationTypedDict, + ) from .anthropicdocumentblockparam import ( AnthropicDocumentBlockParam, AnthropicDocumentBlockParamCitations, @@ -111,6 +121,15 @@ AnthropicInputTokensTriggerType, AnthropicInputTokensTriggerTypedDict, ) + from .anthropiciterationcachecreation import ( + AnthropicIterationCacheCreation, + AnthropicIterationCacheCreationTypedDict, + ) + from .anthropicmessageusageiteration import ( + AnthropicMessageUsageIteration, + AnthropicMessageUsageIterationType, + AnthropicMessageUsageIterationTypedDict, + ) from .anthropicplaintextsource import ( AnthropicPlainTextSource, AnthropicPlainTextSourceMediaType, @@ -124,6 +143,7 @@ AnthropicSearchResultBlockParamType, AnthropicSearchResultBlockParamTypedDict, ) + from .anthropicspeed import AnthropicSpeed from .anthropictextblockparam import ( AnthropicTextBlockParam, AnthropicTextBlockParamType, @@ -147,6 +167,10 @@ AnthropicToolUsesTriggerType, AnthropicToolUsesTriggerTypedDict, ) + from .anthropicunknownusageiteration import ( + AnthropicUnknownUsageIteration, + AnthropicUnknownUsageIterationTypedDict, + ) from .anthropicurlimagesource import ( AnthropicURLImageSource, AnthropicURLImageSourceType, @@ -157,6 +181,10 @@ AnthropicURLPdfSourceType, AnthropicURLPdfSourceTypedDict, ) + from .anthropicusageiteration import ( + AnthropicUsageIteration, + AnthropicUsageIterationTypedDict, + ) from .anthropicwebsearchresultblockparam import ( AnthropicWebSearchResultBlockParam, AnthropicWebSearchResultBlockParamType, @@ -167,6 +195,7 @@ AnthropicWebSearchToolUserLocationType, AnthropicWebSearchToolUserLocationTypedDict, ) + from .apierrortype import APIErrorType from .applypatchcallitem import ( ApplyPatchCallItem, ApplyPatchCallItemType, @@ -276,37 +305,10 @@ BashServerToolEnvironment, BashServerToolEnvironmentTypedDict, ) - from .benchmarkpricing import BenchmarkPricing, BenchmarkPricingTypedDict - from .benchmarksaaitem import BenchmarksAAItem, BenchmarksAAItemTypedDict - from .benchmarksaameta import ( - BenchmarksAAMeta, - BenchmarksAAMetaSource, - BenchmarksAAMetaSourceURL, - BenchmarksAAMetaTypedDict, - BenchmarksAAMetaVersion, - ) - from .benchmarksaaresponse import ( - BenchmarksAAResponse, - BenchmarksAAResponseTypedDict, - ) - from .benchmarksdaitem import ( - BenchmarksDAItem, - BenchmarksDAItemTypedDict, - TournamentStats, - TournamentStatsTypedDict, - ) - from .benchmarksdameta import ( - BenchmarksDAMeta, - BenchmarksDAMetaSource, - BenchmarksDAMetaSourceURL, - BenchmarksDAMetaTypedDict, - BenchmarksDAMetaVersion, - EloBounds, - EloBoundsTypedDict, - ) - from .benchmarksdaresponse import ( - BenchmarksDAResponse, - BenchmarksDAResponseTypedDict, + from .booleancapability import ( + BooleanCapability, + BooleanCapabilityType, + BooleanCapabilityTypedDict, ) from .bulkaddworkspacemembersrequest import ( BulkAddWorkspaceMembersRequest, @@ -358,6 +360,10 @@ ) from .byokkey import BYOKKey, BYOKKeyTypedDict from .byokproviderslug import BYOKProviderSlug + from .capabilitydescriptor import ( + CapabilityDescriptor, + CapabilityDescriptorTypedDict, + ) from .chatassistantimages import ( ChatAssistantImages, ChatAssistantImagesImageURL, @@ -495,10 +501,12 @@ from .chatstreamchoice import ChatStreamChoice, ChatStreamChoiceTypedDict from .chatstreamchunk import ( ChatStreamChunk, + ChatStreamChunkError, + ChatStreamChunkErrorTypedDict, + ChatStreamChunkMetadata, + ChatStreamChunkMetadataTypedDict, ChatStreamChunkObject, ChatStreamChunkTypedDict, - Error, - ErrorTypedDict, ) from .chatstreamdelta import ( ChatStreamDelta, @@ -554,11 +562,13 @@ ) from .chatusage import ( ChatUsage, + ChatUsageCompletionTokensDetails, + ChatUsageCompletionTokensDetailsTypedDict, + ChatUsagePromptTokensDetails, + ChatUsagePromptTokensDetailsTypedDict, ChatUsageTypedDict, - CompletionTokensDetails, - CompletionTokensDetailsTypedDict, - PromptTokensDetails, - PromptTokensDetailsTypedDict, + ServerToolUseDetails, + ServerToolUseDetailsTypedDict, ) from .chatusermessage import ( ChatUserMessage, @@ -776,6 +786,16 @@ DatetimeServerToolConfig, DatetimeServerToolConfigTypedDict, ) + from .debugevent import ( + Debug, + DebugEvent, + DebugEventType, + DebugEventTypedDict, + DebugTypedDict, + Event, + Timings, + TimingsTypedDict, + ) from .defaultparameters import DefaultParameters, DefaultParametersTypedDict from .deletebyokkeyresponse import ( DeleteBYOKKeyResponse, @@ -827,6 +847,11 @@ from .endpointinfo import EndpointInfo, EndpointInfoTypedDict from .endpointsmetadata import EndpointsMetadata, EndpointsMetadataTypedDict from .endpointstatus import EndpointStatus + from .enumcapability import ( + EnumCapability, + EnumCapabilityType, + EnumCapabilityTypedDict, + ) from .errorevent import ErrorEvent, ErrorEventType, ErrorEventTypedDict from .filecitation import FileCitation, FileCitationType, FileCitationTypedDict from .filedeleteresponse import ( @@ -1040,6 +1065,7 @@ from .guardrail import Guardrail, GuardrailTypedDict from .guardrailinterval import GuardrailInterval from .imageconfig import ImageConfig, ImageConfigTypedDict + from .imageendpoint import ImageEndpoint, ImageEndpointTypedDict from .imagegencallcompletedevent import ( ImageGenCallCompletedEvent, ImageGenCallCompletedEventType, @@ -1060,9 +1086,35 @@ ImageGenCallPartialImageEventType, ImageGenCallPartialImageEventTypedDict, ) + from .imagegencompletedevent import ( + ImageGenCompletedEvent, + ImageGenCompletedEventType, + ImageGenCompletedEventTypedDict, + ) + from .imagegenerationrequest import ( + ImageGenerationRequest, + ImageGenerationRequestAspectRatio, + ImageGenerationRequestBackground, + ImageGenerationRequestOptions, + ImageGenerationRequestOptionsTypedDict, + ImageGenerationRequestOutputFormat, + ImageGenerationRequestProvider, + ImageGenerationRequestProviderTypedDict, + ImageGenerationRequestQuality, + ImageGenerationRequestResolution, + ImageGenerationRequestTypedDict, + ) + from .imagegenerationresponse import ( + ImageGenerationResponse, + ImageGenerationResponseData, + ImageGenerationResponseDataTypedDict, + ImageGenerationResponseTypedDict, + ) from .imagegenerationservertool import ( - Background, ImageGenerationServerTool, + ImageGenerationServerToolBackground, + ImageGenerationServerToolOutputFormat, + ImageGenerationServerToolQuality, ImageGenerationServerToolType, ImageGenerationServerToolTypedDict, InputFidelity, @@ -1070,8 +1122,6 @@ InputImageMaskTypedDict, ModelEnum, Moderation, - OutputFormat, - Quality, Size, ) from .imagegenerationservertool_openrouter import ( @@ -1088,6 +1138,54 @@ ImageGenerationServerToolConfigUnionTypedDict, ) from .imagegenerationstatus import ImageGenerationStatus + from .imagegenerationusage import ( + ImageGenerationUsage, + ImageGenerationUsageCompletionTokensDetails, + ImageGenerationUsageCompletionTokensDetailsTypedDict, + ImageGenerationUsagePromptTokensDetails, + ImageGenerationUsagePromptTokensDetailsTypedDict, + ImageGenerationUsageTypedDict, + ServerToolUse, + ServerToolUseTypedDict, + ) + from .imagegenpartialimageevent import ( + ImageGenPartialImageEvent, + ImageGenPartialImageEventType, + ImageGenPartialImageEventTypedDict, + ) + from .imagegenstreamerrorevent import ( + ImageGenStreamErrorEvent, + ImageGenStreamErrorEventError, + ImageGenStreamErrorEventErrorTypedDict, + ImageGenStreamErrorEventType, + ImageGenStreamErrorEventTypedDict, + ) + from .imagemodelarchitecture import ( + ImageModelArchitecture, + ImageModelArchitectureTypedDict, + ) + from .imagemodelendpointsresponse import ( + ImageModelEndpointsResponse, + ImageModelEndpointsResponseTypedDict, + ) + from .imagemodellistitem import ImageModelListItem, ImageModelListItemTypedDict + from .imagemodelslistresponse import ( + ImageModelsListResponse, + ImageModelsListResponseTypedDict, + ) + from .imageoutputmodality import ImageOutputModality + from .imagepricingentry import ( + Billable, + ImagePricingEntry, + ImagePricingEntryTypedDict, + Unit, + ) + from .imagestreamingresponse import ( + ImageStreamingResponse, + ImageStreamingResponseData, + ImageStreamingResponseDataTypedDict, + ImageStreamingResponseTypedDict, + ) from .incompletedetails import IncompleteDetails, IncompleteDetailsTypedDict, Reason from .inputaudio import ( FormatEnum, @@ -1357,6 +1455,8 @@ KeepType, KeepTypedDict, MessagesRequest, + MessagesRequestMetadata, + MessagesRequestMetadataTypedDict, MessagesRequestPlugin, MessagesRequestPluginTypedDict, MessagesRequestTool, @@ -1364,8 +1464,6 @@ MessagesRequestToolUnion, MessagesRequestToolUnionTypedDict, MessagesRequestTypedDict, - Metadata, - MetadataTypedDict, NameAdvisor, NameBash, NameStrReplaceEditor, @@ -1436,6 +1534,7 @@ from .modelbenchmarks import ModelBenchmarks, ModelBenchmarksTypedDict from .modelgroup import ModelGroup from .modellinks import ModelLinks, ModelLinksTypedDict + from .modelreasoning import DefaultEffort, ModelReasoning, ModelReasoningTypedDict from .modelresponse import ModelResponse, ModelResponseTypedDict from .modelscountresponse import ( ModelsCountResponse, @@ -2036,6 +2135,11 @@ ) from .publicpricing import PublicPricing, PublicPricingTypedDict from .quantization import Quantization + from .rangecapability import ( + RangeCapability, + RangeCapabilityType, + RangeCapabilityTypedDict, + ) from .rankingsdailyitem import RankingsDailyItem, RankingsDailyItemTypedDict from .rankingsdailymeta import ( RankingsDailyMeta, @@ -2316,6 +2420,24 @@ SubagentServerToolConfig, SubagentServerToolConfigTypedDict, ) + from .taskclassificationitem import ( + TaskClassificationItem, + TaskClassificationItemTypedDict, + ) + from .taskclassificationmacrocategory import ( + TaskClassificationMacroCategory, + TaskClassificationMacroCategoryTypedDict, + ) + from .taskclassificationmodel import ( + TaskClassificationModel, + TaskClassificationModelTypedDict, + ) + from .taskclassificationresponse import ( + TaskClassificationResponse, + TaskClassificationResponseData, + TaskClassificationResponseDataTypedDict, + TaskClassificationResponseTypedDict, + ) from .textdeltaevent import ( TextDeltaEvent, TextDeltaEventType, @@ -2348,6 +2470,34 @@ UnauthorizedResponseErrorData, UnauthorizedResponseErrorDataTypedDict, ) + from .unifiedbenchmarkpricing import ( + UnifiedBenchmarkPricing, + UnifiedBenchmarkPricingTypedDict, + ) + from .unifiedbenchmarksaaitem import ( + UnifiedBenchmarksAAItem, + UnifiedBenchmarksAAItemSource, + UnifiedBenchmarksAAItemTypedDict, + ) + from .unifiedbenchmarksdaitem import ( + TournamentStats, + TournamentStatsTypedDict, + UnifiedBenchmarksDAItem, + UnifiedBenchmarksDAItemSource, + UnifiedBenchmarksDAItemTypedDict, + ) + from .unifiedbenchmarksmeta import ( + UnifiedBenchmarksMeta, + UnifiedBenchmarksMetaSource, + UnifiedBenchmarksMetaTypedDict, + UnifiedBenchmarksMetaVersion, + ) + from .unifiedbenchmarksresponse import ( + UnifiedBenchmarksResponse, + UnifiedBenchmarksResponseData, + UnifiedBenchmarksResponseDataTypedDict, + UnifiedBenchmarksResponseTypedDict, + ) from .unprocessableentityresponseerrordata import ( UnprocessableEntityResponseErrorData, UnprocessableEntityResponseErrorDataTypedDict, @@ -2404,13 +2554,13 @@ UsageTypedDict, ) from .videogenerationrequest import ( - AspectRatio, - Options, - OptionsTypedDict, - Resolution, VideoGenerationRequest, + VideoGenerationRequestAspectRatio, + VideoGenerationRequestOptions, + VideoGenerationRequestOptionsTypedDict, VideoGenerationRequestProvider, VideoGenerationRequestProviderTypedDict, + VideoGenerationRequestResolution, VideoGenerationRequestTypedDict, ) from .videogenerationresponse import ( @@ -2525,6 +2675,7 @@ __all__ = [ "AABenchmarkEntry", "AABenchmarkEntryTypedDict", + "APIErrorType", "APIType", "Action", "ActionEnum", @@ -2557,6 +2708,9 @@ "AnnotationAddedEvent", "AnnotationAddedEventType", "AnnotationAddedEventTypedDict", + "AnthropicAdvisorMessageUsageIteration", + "AnthropicAdvisorMessageUsageIterationType", + "AnthropicAdvisorMessageUsageIterationTypedDict", "AnthropicAllowedCallers", "AnthropicBase64ImageSource", "AnthropicBase64ImageSourceType", @@ -2584,6 +2738,9 @@ "AnthropicCitationWebSearchResultLocation", "AnthropicCitationWebSearchResultLocationType", "AnthropicCitationWebSearchResultLocationTypedDict", + "AnthropicCompactionUsageIteration", + "AnthropicCompactionUsageIterationType", + "AnthropicCompactionUsageIterationTypedDict", "AnthropicDocumentBlockParam", "AnthropicDocumentBlockParamCitations", "AnthropicDocumentBlockParamCitationsTypedDict", @@ -2609,6 +2766,11 @@ "AnthropicInputTokensTrigger", "AnthropicInputTokensTriggerType", "AnthropicInputTokensTriggerTypedDict", + "AnthropicIterationCacheCreation", + "AnthropicIterationCacheCreationTypedDict", + "AnthropicMessageUsageIteration", + "AnthropicMessageUsageIterationType", + "AnthropicMessageUsageIterationTypedDict", "AnthropicPlainTextSource", "AnthropicPlainTextSourceMediaType", "AnthropicPlainTextSourceType", @@ -2618,6 +2780,7 @@ "AnthropicSearchResultBlockParamCitationsTypedDict", "AnthropicSearchResultBlockParamType", "AnthropicSearchResultBlockParamTypedDict", + "AnthropicSpeed", "AnthropicTextBlockParam", "AnthropicTextBlockParamType", "AnthropicTextBlockParamTypedDict", @@ -2637,6 +2800,10 @@ "AnthropicURLPdfSource", "AnthropicURLPdfSourceType", "AnthropicURLPdfSourceTypedDict", + "AnthropicUnknownUsageIteration", + "AnthropicUnknownUsageIterationTypedDict", + "AnthropicUsageIteration", + "AnthropicUsageIterationTypedDict", "AnthropicWebSearchResultBlockParam", "AnthropicWebSearchResultBlockParamType", "AnthropicWebSearchResultBlockParamTypedDict", @@ -2683,7 +2850,6 @@ "ApplyPatchUpdateFileOperationTypedDict", "Architecture", "ArchitectureTypedDict", - "AspectRatio", "AudioURL", "AudioURLTypedDict", "AutoRouterPlugin", @@ -2692,7 +2858,6 @@ "BYOKKey", "BYOKKeyTypedDict", "BYOKProviderSlug", - "Background", "BadGatewayResponseErrorData", "BadGatewayResponseErrorDataTypedDict", "BadRequestResponseErrorData", @@ -2728,26 +2893,10 @@ "BashServerToolEnvironmentTypedDict", "BashServerToolType", "BashServerToolTypedDict", - "BenchmarkPricing", - "BenchmarkPricingTypedDict", - "BenchmarksAAItem", - "BenchmarksAAItemTypedDict", - "BenchmarksAAMeta", - "BenchmarksAAMetaSource", - "BenchmarksAAMetaSourceURL", - "BenchmarksAAMetaTypedDict", - "BenchmarksAAMetaVersion", - "BenchmarksAAResponse", - "BenchmarksAAResponseTypedDict", - "BenchmarksDAItem", - "BenchmarksDAItemTypedDict", - "BenchmarksDAMeta", - "BenchmarksDAMetaSource", - "BenchmarksDAMetaSourceURL", - "BenchmarksDAMetaTypedDict", - "BenchmarksDAMetaVersion", - "BenchmarksDAResponse", - "BenchmarksDAResponseTypedDict", + "Billable", + "BooleanCapability", + "BooleanCapabilityType", + "BooleanCapabilityTypedDict", "BulkAddWorkspaceMembersRequest", "BulkAddWorkspaceMembersRequestTypedDict", "BulkAddWorkspaceMembersResponse", @@ -2775,6 +2924,8 @@ "By", "Caching", "CachingTypedDict", + "CapabilityDescriptor", + "CapabilityDescriptorTypedDict", "ChatAssistantImages", "ChatAssistantImagesImageURL", "ChatAssistantImagesImageURLTypedDict", @@ -2872,6 +3023,10 @@ "ChatStreamChoice", "ChatStreamChoiceTypedDict", "ChatStreamChunk", + "ChatStreamChunkError", + "ChatStreamChunkErrorTypedDict", + "ChatStreamChunkMetadata", + "ChatStreamChunkMetadataTypedDict", "ChatStreamChunkObject", "ChatStreamChunkTypedDict", "ChatStreamDelta", @@ -2913,6 +3068,10 @@ "ChatToolMessageRole", "ChatToolMessageTypedDict", "ChatUsage", + "ChatUsageCompletionTokensDetails", + "ChatUsageCompletionTokensDetailsTypedDict", + "ChatUsagePromptTokensDetails", + "ChatUsagePromptTokensDetailsTypedDict", "ChatUsageTypedDict", "ChatUserMessage", "ChatUserMessageContent", @@ -2936,8 +3095,6 @@ "CompactionItem", "CompactionItemType", "CompactionItemTypedDict", - "CompletionTokensDetails", - "CompletionTokensDetailsTypedDict", "CompoundFilter", "CompoundFilterType", "CompoundFilterTypedDict", @@ -3076,6 +3233,12 @@ "DatetimeServerToolConfigTypedDict", "DatetimeServerToolType", "DatetimeServerToolTypedDict", + "Debug", + "DebugEvent", + "DebugEventType", + "DebugEventTypedDict", + "DebugTypedDict", + "DefaultEffort", "DefaultParameters", "DefaultParametersTypedDict", "DeleteBYOKKeyResponse", @@ -3120,20 +3283,20 @@ "EditCompact20260112TypedDict", "EditTypeInputTokens", "EditTypedDict", - "EloBounds", - "EloBoundsTypedDict", "EndpointInfo", "EndpointInfoTypedDict", "EndpointStatus", "EndpointsMetadata", "EndpointsMetadataTypedDict", + "EnumCapability", + "EnumCapabilityType", + "EnumCapabilityTypedDict", "Environment", - "Error", "ErrorCode", "ErrorEvent", "ErrorEventType", "ErrorEventTypedDict", - "ErrorTypedDict", + "Event", "FailedModel", "FailedModelTypedDict", "FieldT", @@ -3291,6 +3454,8 @@ "IgnoreTypedDict", "ImageConfig", "ImageConfigTypedDict", + "ImageEndpoint", + "ImageEndpointTypedDict", "ImageGenCallCompletedEvent", "ImageGenCallCompletedEventType", "ImageGenCallCompletedEventTypedDict", @@ -3303,7 +3468,34 @@ "ImageGenCallPartialImageEvent", "ImageGenCallPartialImageEventType", "ImageGenCallPartialImageEventTypedDict", + "ImageGenCompletedEvent", + "ImageGenCompletedEventType", + "ImageGenCompletedEventTypedDict", + "ImageGenPartialImageEvent", + "ImageGenPartialImageEventType", + "ImageGenPartialImageEventTypedDict", + "ImageGenStreamErrorEvent", + "ImageGenStreamErrorEventError", + "ImageGenStreamErrorEventErrorTypedDict", + "ImageGenStreamErrorEventType", + "ImageGenStreamErrorEventTypedDict", + "ImageGenerationRequest", + "ImageGenerationRequestAspectRatio", + "ImageGenerationRequestBackground", + "ImageGenerationRequestOptions", + "ImageGenerationRequestOptionsTypedDict", + "ImageGenerationRequestOutputFormat", + "ImageGenerationRequestProvider", + "ImageGenerationRequestProviderTypedDict", + "ImageGenerationRequestQuality", + "ImageGenerationRequestResolution", + "ImageGenerationRequestTypedDict", + "ImageGenerationResponse", + "ImageGenerationResponseData", + "ImageGenerationResponseDataTypedDict", + "ImageGenerationResponseTypedDict", "ImageGenerationServerTool", + "ImageGenerationServerToolBackground", "ImageGenerationServerToolConfig", "ImageGenerationServerToolConfigTypedDict", "ImageGenerationServerToolConfigUnion", @@ -3311,9 +3503,32 @@ "ImageGenerationServerToolOpenRouter", "ImageGenerationServerToolOpenRouterType", "ImageGenerationServerToolOpenRouterTypedDict", + "ImageGenerationServerToolOutputFormat", + "ImageGenerationServerToolQuality", "ImageGenerationServerToolType", "ImageGenerationServerToolTypedDict", "ImageGenerationStatus", + "ImageGenerationUsage", + "ImageGenerationUsageCompletionTokensDetails", + "ImageGenerationUsageCompletionTokensDetailsTypedDict", + "ImageGenerationUsagePromptTokensDetails", + "ImageGenerationUsagePromptTokensDetailsTypedDict", + "ImageGenerationUsageTypedDict", + "ImageModelArchitecture", + "ImageModelArchitectureTypedDict", + "ImageModelEndpointsResponse", + "ImageModelEndpointsResponseTypedDict", + "ImageModelListItem", + "ImageModelListItemTypedDict", + "ImageModelsListResponse", + "ImageModelsListResponseTypedDict", + "ImageOutputModality", + "ImagePricingEntry", + "ImagePricingEntryTypedDict", + "ImageStreamingResponse", + "ImageStreamingResponseData", + "ImageStreamingResponseDataTypedDict", + "ImageStreamingResponseTypedDict", "IncompleteDetails", "IncompleteDetailsTypedDict", "Input1", @@ -3492,6 +3707,8 @@ "MessagesOutputConfigTypeJSONSchema", "MessagesOutputConfigTypedDict", "MessagesRequest", + "MessagesRequestMetadata", + "MessagesRequestMetadataTypedDict", "MessagesRequestPlugin", "MessagesRequestPluginTypedDict", "MessagesRequestTool", @@ -3499,9 +3716,7 @@ "MessagesRequestToolUnion", "MessagesRequestToolUnionTypedDict", "MessagesRequestTypedDict", - "Metadata", "MetadataLevel", - "MetadataTypedDict", "Method", "Modality", "Mode", @@ -3518,6 +3733,8 @@ "ModelGroup", "ModelLinks", "ModelLinksTypedDict", + "ModelReasoning", + "ModelReasoningTypedDict", "ModelResponse", "ModelResponseTypedDict", "ModelTypedDict", @@ -3711,8 +3928,6 @@ "OpenRouterWebSearchServerToolType", "OpenRouterWebSearchServerToolTypedDict", "Operator", - "Options", - "OptionsTypedDict", "Order", "OrderTypedDict", "Outcome", @@ -3760,7 +3975,6 @@ "OutputFileSearchServerToolItem", "OutputFileSearchServerToolItemType", "OutputFileSearchServerToolItemTypedDict", - "OutputFormat", "OutputFunctionCallItem", "OutputFunctionCallItemStatusCompleted", "OutputFunctionCallItemStatusInProgress", @@ -3927,8 +4141,6 @@ "Pricing", "PricingTypedDict", "PromptInjectionScanScope", - "PromptTokensDetails", - "PromptTokensDetailsTypedDict", "ProviderName", "ProviderOptions", "ProviderOptionsTypedDict", @@ -3947,8 +4159,10 @@ "PublicEndpointTypedDict", "PublicPricing", "PublicPricingTypedDict", - "Quality", "Quantization", + "RangeCapability", + "RangeCapabilityType", + "RangeCapabilityTypedDict", "Ranker", "RankingOptions", "RankingOptionsTypedDict", @@ -4024,7 +4238,6 @@ "RequireApprovalUnion", "RequireApprovalUnionTypedDict", "ResetInterval", - "Resolution", "Response", "ResponseFormat", "ResponseFormatEnum", @@ -4076,6 +4289,10 @@ "SearchQualityLevel", "Security", "SecurityTypedDict", + "ServerToolUse", + "ServerToolUseDetails", + "ServerToolUseDetailsTypedDict", + "ServerToolUseTypedDict", "ServiceUnavailableResponseErrorData", "ServiceUnavailableResponseErrorDataTypedDict", "ShellCallItem", @@ -4176,6 +4393,16 @@ "SystemTypedDict", "TaskBudget", "TaskBudgetTypedDict", + "TaskClassificationItem", + "TaskClassificationItemTypedDict", + "TaskClassificationMacroCategory", + "TaskClassificationMacroCategoryTypedDict", + "TaskClassificationModel", + "TaskClassificationModelTypedDict", + "TaskClassificationResponse", + "TaskClassificationResponseData", + "TaskClassificationResponseDataTypedDict", + "TaskClassificationResponseTypedDict", "TextDeltaEvent", "TextDeltaEventType", "TextDeltaEventTypedDict", @@ -4192,6 +4419,8 @@ "ThinkingEnabled", "ThinkingEnabledTypedDict", "ThinkingTypedDict", + "Timings", + "TimingsTypedDict", "Tokenizer", "TooManyRequestsResponseErrorData", "TooManyRequestsResponseErrorDataTypedDict", @@ -4277,8 +4506,25 @@ "URLCitationTypedDict", "UnauthorizedResponseErrorData", "UnauthorizedResponseErrorDataTypedDict", + "UnifiedBenchmarkPricing", + "UnifiedBenchmarkPricingTypedDict", + "UnifiedBenchmarksAAItem", + "UnifiedBenchmarksAAItemSource", + "UnifiedBenchmarksAAItemTypedDict", + "UnifiedBenchmarksDAItem", + "UnifiedBenchmarksDAItemSource", + "UnifiedBenchmarksDAItemTypedDict", + "UnifiedBenchmarksMeta", + "UnifiedBenchmarksMetaSource", + "UnifiedBenchmarksMetaTypedDict", + "UnifiedBenchmarksMetaVersion", + "UnifiedBenchmarksResponse", + "UnifiedBenchmarksResponseData", + "UnifiedBenchmarksResponseDataTypedDict", + "UnifiedBenchmarksResponseTypedDict", "UniqueInsight", "UniqueInsightTypedDict", + "Unit", "UnprocessableEntityResponseErrorData", "UnprocessableEntityResponseErrorDataTypedDict", "UpdateBYOKKeyRequest", @@ -4311,8 +4557,12 @@ "VariablesTypedDict", "Verbosity", "VideoGenerationRequest", + "VideoGenerationRequestAspectRatio", + "VideoGenerationRequestOptions", + "VideoGenerationRequestOptionsTypedDict", "VideoGenerationRequestProvider", "VideoGenerationRequestProviderTypedDict", + "VideoGenerationRequestResolution", "VideoGenerationRequestTypedDict", "VideoGenerationResponse", "VideoGenerationResponseStatus", @@ -4401,6 +4651,9 @@ "AnnotationAddedEvent": ".annotationaddedevent", "AnnotationAddedEventType": ".annotationaddedevent", "AnnotationAddedEventTypedDict": ".annotationaddedevent", + "AnthropicAdvisorMessageUsageIteration": ".anthropicadvisormessageusageiteration", + "AnthropicAdvisorMessageUsageIterationType": ".anthropicadvisormessageusageiteration", + "AnthropicAdvisorMessageUsageIterationTypedDict": ".anthropicadvisormessageusageiteration", "AnthropicAllowedCallers": ".anthropicallowedcallers", "AnthropicBase64ImageSource": ".anthropicbase64imagesource", "AnthropicBase64ImageSourceType": ".anthropicbase64imagesource", @@ -4428,6 +4681,9 @@ "AnthropicCitationWebSearchResultLocation": ".anthropiccitationwebsearchresultlocation", "AnthropicCitationWebSearchResultLocationType": ".anthropiccitationwebsearchresultlocation", "AnthropicCitationWebSearchResultLocationTypedDict": ".anthropiccitationwebsearchresultlocation", + "AnthropicCompactionUsageIteration": ".anthropiccompactionusageiteration", + "AnthropicCompactionUsageIterationType": ".anthropiccompactionusageiteration", + "AnthropicCompactionUsageIterationTypedDict": ".anthropiccompactionusageiteration", "AnthropicDocumentBlockParam": ".anthropicdocumentblockparam", "AnthropicDocumentBlockParamCitations": ".anthropicdocumentblockparam", "AnthropicDocumentBlockParamCitationsTypedDict": ".anthropicdocumentblockparam", @@ -4457,6 +4713,11 @@ "AnthropicInputTokensTrigger": ".anthropicinputtokenstrigger", "AnthropicInputTokensTriggerType": ".anthropicinputtokenstrigger", "AnthropicInputTokensTriggerTypedDict": ".anthropicinputtokenstrigger", + "AnthropicIterationCacheCreation": ".anthropiciterationcachecreation", + "AnthropicIterationCacheCreationTypedDict": ".anthropiciterationcachecreation", + "AnthropicMessageUsageIteration": ".anthropicmessageusageiteration", + "AnthropicMessageUsageIterationType": ".anthropicmessageusageiteration", + "AnthropicMessageUsageIterationTypedDict": ".anthropicmessageusageiteration", "AnthropicPlainTextSource": ".anthropicplaintextsource", "AnthropicPlainTextSourceMediaType": ".anthropicplaintextsource", "AnthropicPlainTextSourceType": ".anthropicplaintextsource", @@ -4466,6 +4727,7 @@ "AnthropicSearchResultBlockParamCitationsTypedDict": ".anthropicsearchresultblockparam", "AnthropicSearchResultBlockParamType": ".anthropicsearchresultblockparam", "AnthropicSearchResultBlockParamTypedDict": ".anthropicsearchresultblockparam", + "AnthropicSpeed": ".anthropicspeed", "AnthropicTextBlockParam": ".anthropictextblockparam", "AnthropicTextBlockParamType": ".anthropictextblockparam", "AnthropicTextBlockParamTypedDict": ".anthropictextblockparam", @@ -4481,18 +4743,23 @@ "AnthropicToolUsesTrigger": ".anthropictoolusestrigger", "AnthropicToolUsesTriggerType": ".anthropictoolusestrigger", "AnthropicToolUsesTriggerTypedDict": ".anthropictoolusestrigger", + "AnthropicUnknownUsageIteration": ".anthropicunknownusageiteration", + "AnthropicUnknownUsageIterationTypedDict": ".anthropicunknownusageiteration", "AnthropicURLImageSource": ".anthropicurlimagesource", "AnthropicURLImageSourceType": ".anthropicurlimagesource", "AnthropicURLImageSourceTypedDict": ".anthropicurlimagesource", "AnthropicURLPdfSource": ".anthropicurlpdfsource", "AnthropicURLPdfSourceType": ".anthropicurlpdfsource", "AnthropicURLPdfSourceTypedDict": ".anthropicurlpdfsource", + "AnthropicUsageIteration": ".anthropicusageiteration", + "AnthropicUsageIterationTypedDict": ".anthropicusageiteration", "AnthropicWebSearchResultBlockParam": ".anthropicwebsearchresultblockparam", "AnthropicWebSearchResultBlockParamType": ".anthropicwebsearchresultblockparam", "AnthropicWebSearchResultBlockParamTypedDict": ".anthropicwebsearchresultblockparam", "AnthropicWebSearchToolUserLocation": ".anthropicwebsearchtooluserlocation", "AnthropicWebSearchToolUserLocationType": ".anthropicwebsearchtooluserlocation", "AnthropicWebSearchToolUserLocationTypedDict": ".anthropicwebsearchtooluserlocation", + "APIErrorType": ".apierrortype", "ApplyPatchCallItem": ".applypatchcallitem", "ApplyPatchCallItemType": ".applypatchcallitem", "ApplyPatchCallItemTypedDict": ".applypatchcallitem", @@ -4569,30 +4836,9 @@ "BashServerToolEngine": ".bashservertoolengine", "BashServerToolEnvironment": ".bashservertoolenvironment", "BashServerToolEnvironmentTypedDict": ".bashservertoolenvironment", - "BenchmarkPricing": ".benchmarkpricing", - "BenchmarkPricingTypedDict": ".benchmarkpricing", - "BenchmarksAAItem": ".benchmarksaaitem", - "BenchmarksAAItemTypedDict": ".benchmarksaaitem", - "BenchmarksAAMeta": ".benchmarksaameta", - "BenchmarksAAMetaSource": ".benchmarksaameta", - "BenchmarksAAMetaSourceURL": ".benchmarksaameta", - "BenchmarksAAMetaTypedDict": ".benchmarksaameta", - "BenchmarksAAMetaVersion": ".benchmarksaameta", - "BenchmarksAAResponse": ".benchmarksaaresponse", - "BenchmarksAAResponseTypedDict": ".benchmarksaaresponse", - "BenchmarksDAItem": ".benchmarksdaitem", - "BenchmarksDAItemTypedDict": ".benchmarksdaitem", - "TournamentStats": ".benchmarksdaitem", - "TournamentStatsTypedDict": ".benchmarksdaitem", - "BenchmarksDAMeta": ".benchmarksdameta", - "BenchmarksDAMetaSource": ".benchmarksdameta", - "BenchmarksDAMetaSourceURL": ".benchmarksdameta", - "BenchmarksDAMetaTypedDict": ".benchmarksdameta", - "BenchmarksDAMetaVersion": ".benchmarksdameta", - "EloBounds": ".benchmarksdameta", - "EloBoundsTypedDict": ".benchmarksdameta", - "BenchmarksDAResponse": ".benchmarksdaresponse", - "BenchmarksDAResponseTypedDict": ".benchmarksdaresponse", + "BooleanCapability": ".booleancapability", + "BooleanCapabilityType": ".booleancapability", + "BooleanCapabilityTypedDict": ".booleancapability", "BulkAddWorkspaceMembersRequest": ".bulkaddworkspacemembersrequest", "BulkAddWorkspaceMembersRequestTypedDict": ".bulkaddworkspacemembersrequest", "BulkAddWorkspaceMembersResponse": ".bulkaddworkspacemembersresponse", @@ -4620,6 +4866,8 @@ "BYOKKey": ".byokkey", "BYOKKeyTypedDict": ".byokkey", "BYOKProviderSlug": ".byokproviderslug", + "CapabilityDescriptor": ".capabilitydescriptor", + "CapabilityDescriptorTypedDict": ".capabilitydescriptor", "ChatAssistantImages": ".chatassistantimages", "ChatAssistantImagesImageURL": ".chatassistantimages", "ChatAssistantImagesImageURLTypedDict": ".chatassistantimages", @@ -4724,10 +4972,12 @@ "ChatStreamChoice": ".chatstreamchoice", "ChatStreamChoiceTypedDict": ".chatstreamchoice", "ChatStreamChunk": ".chatstreamchunk", + "ChatStreamChunkError": ".chatstreamchunk", + "ChatStreamChunkErrorTypedDict": ".chatstreamchunk", + "ChatStreamChunkMetadata": ".chatstreamchunk", + "ChatStreamChunkMetadataTypedDict": ".chatstreamchunk", "ChatStreamChunkObject": ".chatstreamchunk", "ChatStreamChunkTypedDict": ".chatstreamchunk", - "Error": ".chatstreamchunk", - "ErrorTypedDict": ".chatstreamchunk", "ChatStreamDelta": ".chatstreamdelta", "ChatStreamDeltaRole": ".chatstreamdelta", "ChatStreamDeltaTypedDict": ".chatstreamdelta", @@ -4767,11 +5017,13 @@ "ChatToolMessageRole": ".chattoolmessage", "ChatToolMessageTypedDict": ".chattoolmessage", "ChatUsage": ".chatusage", + "ChatUsageCompletionTokensDetails": ".chatusage", + "ChatUsageCompletionTokensDetailsTypedDict": ".chatusage", + "ChatUsagePromptTokensDetails": ".chatusage", + "ChatUsagePromptTokensDetailsTypedDict": ".chatusage", "ChatUsageTypedDict": ".chatusage", - "CompletionTokensDetails": ".chatusage", - "CompletionTokensDetailsTypedDict": ".chatusage", - "PromptTokensDetails": ".chatusage", - "PromptTokensDetailsTypedDict": ".chatusage", + "ServerToolUseDetails": ".chatusage", + "ServerToolUseDetailsTypedDict": ".chatusage", "ChatUserMessage": ".chatusermessage", "ChatUserMessageContent": ".chatusermessage", "ChatUserMessageContentTypedDict": ".chatusermessage", @@ -4917,6 +5169,14 @@ "DatetimeServerToolTypedDict": ".datetimeservertool", "DatetimeServerToolConfig": ".datetimeservertoolconfig", "DatetimeServerToolConfigTypedDict": ".datetimeservertoolconfig", + "Debug": ".debugevent", + "DebugEvent": ".debugevent", + "DebugEventType": ".debugevent", + "DebugEventTypedDict": ".debugevent", + "DebugTypedDict": ".debugevent", + "Event": ".debugevent", + "Timings": ".debugevent", + "TimingsTypedDict": ".debugevent", "DefaultParameters": ".defaultparameters", "DefaultParametersTypedDict": ".defaultparameters", "DeleteBYOKKeyResponse": ".deletebyokkeyresponse", @@ -4957,6 +5217,9 @@ "EndpointsMetadata": ".endpointsmetadata", "EndpointsMetadataTypedDict": ".endpointsmetadata", "EndpointStatus": ".endpointstatus", + "EnumCapability": ".enumcapability", + "EnumCapabilityType": ".enumcapability", + "EnumCapabilityTypedDict": ".enumcapability", "ErrorEvent": ".errorevent", "ErrorEventType": ".errorevent", "ErrorEventTypedDict": ".errorevent", @@ -5120,6 +5383,8 @@ "GuardrailInterval": ".guardrailinterval", "ImageConfig": ".imageconfig", "ImageConfigTypedDict": ".imageconfig", + "ImageEndpoint": ".imageendpoint", + "ImageEndpointTypedDict": ".imageendpoint", "ImageGenCallCompletedEvent": ".imagegencallcompletedevent", "ImageGenCallCompletedEventType": ".imagegencallcompletedevent", "ImageGenCallCompletedEventTypedDict": ".imagegencallcompletedevent", @@ -5132,8 +5397,28 @@ "ImageGenCallPartialImageEvent": ".imagegencallpartialimageevent", "ImageGenCallPartialImageEventType": ".imagegencallpartialimageevent", "ImageGenCallPartialImageEventTypedDict": ".imagegencallpartialimageevent", - "Background": ".imagegenerationservertool", + "ImageGenCompletedEvent": ".imagegencompletedevent", + "ImageGenCompletedEventType": ".imagegencompletedevent", + "ImageGenCompletedEventTypedDict": ".imagegencompletedevent", + "ImageGenerationRequest": ".imagegenerationrequest", + "ImageGenerationRequestAspectRatio": ".imagegenerationrequest", + "ImageGenerationRequestBackground": ".imagegenerationrequest", + "ImageGenerationRequestOptions": ".imagegenerationrequest", + "ImageGenerationRequestOptionsTypedDict": ".imagegenerationrequest", + "ImageGenerationRequestOutputFormat": ".imagegenerationrequest", + "ImageGenerationRequestProvider": ".imagegenerationrequest", + "ImageGenerationRequestProviderTypedDict": ".imagegenerationrequest", + "ImageGenerationRequestQuality": ".imagegenerationrequest", + "ImageGenerationRequestResolution": ".imagegenerationrequest", + "ImageGenerationRequestTypedDict": ".imagegenerationrequest", + "ImageGenerationResponse": ".imagegenerationresponse", + "ImageGenerationResponseData": ".imagegenerationresponse", + "ImageGenerationResponseDataTypedDict": ".imagegenerationresponse", + "ImageGenerationResponseTypedDict": ".imagegenerationresponse", "ImageGenerationServerTool": ".imagegenerationservertool", + "ImageGenerationServerToolBackground": ".imagegenerationservertool", + "ImageGenerationServerToolOutputFormat": ".imagegenerationservertool", + "ImageGenerationServerToolQuality": ".imagegenerationservertool", "ImageGenerationServerToolType": ".imagegenerationservertool", "ImageGenerationServerToolTypedDict": ".imagegenerationservertool", "InputFidelity": ".imagegenerationservertool", @@ -5141,8 +5426,6 @@ "InputImageMaskTypedDict": ".imagegenerationservertool", "ModelEnum": ".imagegenerationservertool", "Moderation": ".imagegenerationservertool", - "OutputFormat": ".imagegenerationservertool", - "Quality": ".imagegenerationservertool", "Size": ".imagegenerationservertool", "ImageGenerationServerToolOpenRouter": ".imagegenerationservertool_openrouter", "ImageGenerationServerToolOpenRouterType": ".imagegenerationservertool_openrouter", @@ -5152,6 +5435,39 @@ "ImageGenerationServerToolConfigUnion": ".imagegenerationservertoolconfig_union", "ImageGenerationServerToolConfigUnionTypedDict": ".imagegenerationservertoolconfig_union", "ImageGenerationStatus": ".imagegenerationstatus", + "ImageGenerationUsage": ".imagegenerationusage", + "ImageGenerationUsageCompletionTokensDetails": ".imagegenerationusage", + "ImageGenerationUsageCompletionTokensDetailsTypedDict": ".imagegenerationusage", + "ImageGenerationUsagePromptTokensDetails": ".imagegenerationusage", + "ImageGenerationUsagePromptTokensDetailsTypedDict": ".imagegenerationusage", + "ImageGenerationUsageTypedDict": ".imagegenerationusage", + "ServerToolUse": ".imagegenerationusage", + "ServerToolUseTypedDict": ".imagegenerationusage", + "ImageGenPartialImageEvent": ".imagegenpartialimageevent", + "ImageGenPartialImageEventType": ".imagegenpartialimageevent", + "ImageGenPartialImageEventTypedDict": ".imagegenpartialimageevent", + "ImageGenStreamErrorEvent": ".imagegenstreamerrorevent", + "ImageGenStreamErrorEventError": ".imagegenstreamerrorevent", + "ImageGenStreamErrorEventErrorTypedDict": ".imagegenstreamerrorevent", + "ImageGenStreamErrorEventType": ".imagegenstreamerrorevent", + "ImageGenStreamErrorEventTypedDict": ".imagegenstreamerrorevent", + "ImageModelArchitecture": ".imagemodelarchitecture", + "ImageModelArchitectureTypedDict": ".imagemodelarchitecture", + "ImageModelEndpointsResponse": ".imagemodelendpointsresponse", + "ImageModelEndpointsResponseTypedDict": ".imagemodelendpointsresponse", + "ImageModelListItem": ".imagemodellistitem", + "ImageModelListItemTypedDict": ".imagemodellistitem", + "ImageModelsListResponse": ".imagemodelslistresponse", + "ImageModelsListResponseTypedDict": ".imagemodelslistresponse", + "ImageOutputModality": ".imageoutputmodality", + "Billable": ".imagepricingentry", + "ImagePricingEntry": ".imagepricingentry", + "ImagePricingEntryTypedDict": ".imagepricingentry", + "Unit": ".imagepricingentry", + "ImageStreamingResponse": ".imagestreamingresponse", + "ImageStreamingResponseData": ".imagestreamingresponse", + "ImageStreamingResponseDataTypedDict": ".imagestreamingresponse", + "ImageStreamingResponseTypedDict": ".imagestreamingresponse", "IncompleteDetails": ".incompletedetails", "IncompleteDetailsTypedDict": ".incompletedetails", "Reason": ".incompletedetails", @@ -5380,6 +5696,8 @@ "KeepType": ".messagesrequest", "KeepTypedDict": ".messagesrequest", "MessagesRequest": ".messagesrequest", + "MessagesRequestMetadata": ".messagesrequest", + "MessagesRequestMetadataTypedDict": ".messagesrequest", "MessagesRequestPlugin": ".messagesrequest", "MessagesRequestPluginTypedDict": ".messagesrequest", "MessagesRequestTool": ".messagesrequest", @@ -5387,8 +5705,6 @@ "MessagesRequestToolUnion": ".messagesrequest", "MessagesRequestToolUnionTypedDict": ".messagesrequest", "MessagesRequestTypedDict": ".messagesrequest", - "Metadata": ".messagesrequest", - "MetadataTypedDict": ".messagesrequest", "NameAdvisor": ".messagesrequest", "NameBash": ".messagesrequest", "NameStrReplaceEditor": ".messagesrequest", @@ -5459,6 +5775,9 @@ "ModelGroup": ".modelgroup", "ModelLinks": ".modellinks", "ModelLinksTypedDict": ".modellinks", + "DefaultEffort": ".modelreasoning", + "ModelReasoning": ".modelreasoning", + "ModelReasoningTypedDict": ".modelreasoning", "ModelResponse": ".modelresponse", "ModelResponseTypedDict": ".modelresponse", "ModelsCountResponse": ".modelscountresponse", @@ -5908,6 +6227,9 @@ "PublicPricing": ".publicpricing", "PublicPricingTypedDict": ".publicpricing", "Quantization": ".quantization", + "RangeCapability": ".rangecapability", + "RangeCapabilityType": ".rangecapability", + "RangeCapabilityTypedDict": ".rangecapability", "RankingsDailyItem": ".rankingsdailyitem", "RankingsDailyItemTypedDict": ".rankingsdailyitem", "RankingsDailyMeta": ".rankingsdailymeta", @@ -6101,6 +6423,16 @@ "SubagentServerToolOpenRouterTypedDict": ".subagentservertool_openrouter", "SubagentServerToolConfig": ".subagentservertoolconfig", "SubagentServerToolConfigTypedDict": ".subagentservertoolconfig", + "TaskClassificationItem": ".taskclassificationitem", + "TaskClassificationItemTypedDict": ".taskclassificationitem", + "TaskClassificationMacroCategory": ".taskclassificationmacrocategory", + "TaskClassificationMacroCategoryTypedDict": ".taskclassificationmacrocategory", + "TaskClassificationModel": ".taskclassificationmodel", + "TaskClassificationModelTypedDict": ".taskclassificationmodel", + "TaskClassificationResponse": ".taskclassificationresponse", + "TaskClassificationResponseData": ".taskclassificationresponse", + "TaskClassificationResponseDataTypedDict": ".taskclassificationresponse", + "TaskClassificationResponseTypedDict": ".taskclassificationresponse", "TextDeltaEvent": ".textdeltaevent", "TextDeltaEventType": ".textdeltaevent", "TextDeltaEventTypedDict": ".textdeltaevent", @@ -6127,6 +6459,24 @@ "Truncation": ".truncation", "UnauthorizedResponseErrorData": ".unauthorizedresponseerrordata", "UnauthorizedResponseErrorDataTypedDict": ".unauthorizedresponseerrordata", + "UnifiedBenchmarkPricing": ".unifiedbenchmarkpricing", + "UnifiedBenchmarkPricingTypedDict": ".unifiedbenchmarkpricing", + "UnifiedBenchmarksAAItem": ".unifiedbenchmarksaaitem", + "UnifiedBenchmarksAAItemSource": ".unifiedbenchmarksaaitem", + "UnifiedBenchmarksAAItemTypedDict": ".unifiedbenchmarksaaitem", + "TournamentStats": ".unifiedbenchmarksdaitem", + "TournamentStatsTypedDict": ".unifiedbenchmarksdaitem", + "UnifiedBenchmarksDAItem": ".unifiedbenchmarksdaitem", + "UnifiedBenchmarksDAItemSource": ".unifiedbenchmarksdaitem", + "UnifiedBenchmarksDAItemTypedDict": ".unifiedbenchmarksdaitem", + "UnifiedBenchmarksMeta": ".unifiedbenchmarksmeta", + "UnifiedBenchmarksMetaSource": ".unifiedbenchmarksmeta", + "UnifiedBenchmarksMetaTypedDict": ".unifiedbenchmarksmeta", + "UnifiedBenchmarksMetaVersion": ".unifiedbenchmarksmeta", + "UnifiedBenchmarksResponse": ".unifiedbenchmarksresponse", + "UnifiedBenchmarksResponseData": ".unifiedbenchmarksresponse", + "UnifiedBenchmarksResponseDataTypedDict": ".unifiedbenchmarksresponse", + "UnifiedBenchmarksResponseTypedDict": ".unifiedbenchmarksresponse", "UnprocessableEntityResponseErrorData": ".unprocessableentityresponseerrordata", "UnprocessableEntityResponseErrorDataTypedDict": ".unprocessableentityresponseerrordata", "UpdateBYOKKeyRequest": ".updatebyokkeyrequest", @@ -6160,13 +6510,13 @@ "UsageCostDetails": ".usage", "UsageCostDetailsTypedDict": ".usage", "UsageTypedDict": ".usage", - "AspectRatio": ".videogenerationrequest", - "Options": ".videogenerationrequest", - "OptionsTypedDict": ".videogenerationrequest", - "Resolution": ".videogenerationrequest", "VideoGenerationRequest": ".videogenerationrequest", + "VideoGenerationRequestAspectRatio": ".videogenerationrequest", + "VideoGenerationRequestOptions": ".videogenerationrequest", + "VideoGenerationRequestOptionsTypedDict": ".videogenerationrequest", "VideoGenerationRequestProvider": ".videogenerationrequest", "VideoGenerationRequestProviderTypedDict": ".videogenerationrequest", + "VideoGenerationRequestResolution": ".videogenerationrequest", "VideoGenerationRequestTypedDict": ".videogenerationrequest", "VideoGenerationResponse": ".videogenerationresponse", "VideoGenerationResponseStatus": ".videogenerationresponse", diff --git a/src/openrouter/components/advisorreasoning.py b/src/openrouter/components/advisorreasoning.py index 73763465..a2ab4386 100644 --- a/src/openrouter/components/advisorreasoning.py +++ b/src/openrouter/components/advisorreasoning.py @@ -10,6 +10,7 @@ AdvisorReasoningEffort = Union[ Literal[ + "max", "xhigh", "high", "medium", diff --git a/src/openrouter/components/anthropicadvisormessageusageiteration.py b/src/openrouter/components/anthropicadvisormessageusageiteration.py new file mode 100644 index 00000000..86b0175b --- /dev/null +++ b/src/openrouter/components/anthropicadvisormessageusageiteration.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiciterationcachecreation import ( + AnthropicIterationCacheCreation, + AnthropicIterationCacheCreationTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +AnthropicAdvisorMessageUsageIterationType = Literal["advisor_message",] + + +class AnthropicAdvisorMessageUsageIterationTypedDict(TypedDict): + model: str + type: AnthropicAdvisorMessageUsageIterationType + cache_creation: NotRequired[Nullable[AnthropicIterationCacheCreationTypedDict]] + cache_creation_input_tokens: NotRequired[int] + cache_read_input_tokens: NotRequired[int] + input_tokens: NotRequired[int] + output_tokens: NotRequired[int] + + +class AnthropicAdvisorMessageUsageIteration(BaseModel): + model: str + + type: AnthropicAdvisorMessageUsageIterationType + + cache_creation: OptionalNullable[AnthropicIterationCacheCreation] = UNSET + + cache_creation_input_tokens: Optional[int] = None + + cache_read_input_tokens: Optional[int] = None + + input_tokens: Optional[int] = None + + output_tokens: Optional[int] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "cache_creation", + "cache_creation_input_tokens", + "cache_read_input_tokens", + "input_tokens", + "output_tokens", + ] + nullable_fields = ["cache_creation"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/anthropiccompactionusageiteration.py b/src/openrouter/components/anthropiccompactionusageiteration.py new file mode 100644 index 00000000..5b00555a --- /dev/null +++ b/src/openrouter/components/anthropiccompactionusageiteration.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiciterationcachecreation import ( + AnthropicIterationCacheCreation, + AnthropicIterationCacheCreationTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +AnthropicCompactionUsageIterationType = Literal["compaction",] + + +class AnthropicCompactionUsageIterationTypedDict(TypedDict): + type: AnthropicCompactionUsageIterationType + cache_creation: NotRequired[Nullable[AnthropicIterationCacheCreationTypedDict]] + cache_creation_input_tokens: NotRequired[int] + cache_read_input_tokens: NotRequired[int] + input_tokens: NotRequired[int] + output_tokens: NotRequired[int] + + +class AnthropicCompactionUsageIteration(BaseModel): + type: AnthropicCompactionUsageIterationType + + cache_creation: OptionalNullable[AnthropicIterationCacheCreation] = UNSET + + cache_creation_input_tokens: Optional[int] = None + + cache_read_input_tokens: Optional[int] = None + + input_tokens: Optional[int] = None + + output_tokens: Optional[int] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "cache_creation", + "cache_creation_input_tokens", + "cache_read_input_tokens", + "input_tokens", + "output_tokens", + ] + nullable_fields = ["cache_creation"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/anthropiciterationcachecreation.py b/src/openrouter/components/anthropiciterationcachecreation.py new file mode 100644 index 00000000..94477718 --- /dev/null +++ b/src/openrouter/components/anthropiciterationcachecreation.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class AnthropicIterationCacheCreationTypedDict(TypedDict): + ephemeral_1h_input_tokens: NotRequired[int] + ephemeral_5m_input_tokens: NotRequired[int] + + +class AnthropicIterationCacheCreation(BaseModel): + ephemeral_1h_input_tokens: Optional[int] = None + + ephemeral_5m_input_tokens: Optional[int] = None diff --git a/src/openrouter/components/anthropicmessageusageiteration.py b/src/openrouter/components/anthropicmessageusageiteration.py new file mode 100644 index 00000000..0c76c289 --- /dev/null +++ b/src/openrouter/components/anthropicmessageusageiteration.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiciterationcachecreation import ( + AnthropicIterationCacheCreation, + AnthropicIterationCacheCreationTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +AnthropicMessageUsageIterationType = Literal["message",] + + +class AnthropicMessageUsageIterationTypedDict(TypedDict): + type: AnthropicMessageUsageIterationType + cache_creation: NotRequired[Nullable[AnthropicIterationCacheCreationTypedDict]] + cache_creation_input_tokens: NotRequired[int] + cache_read_input_tokens: NotRequired[int] + input_tokens: NotRequired[int] + output_tokens: NotRequired[int] + model: NotRequired[str] + + +class AnthropicMessageUsageIteration(BaseModel): + type: AnthropicMessageUsageIterationType + + cache_creation: OptionalNullable[AnthropicIterationCacheCreation] = UNSET + + cache_creation_input_tokens: Optional[int] = None + + cache_read_input_tokens: Optional[int] = None + + input_tokens: Optional[int] = None + + output_tokens: Optional[int] = None + + model: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "cache_creation", + "cache_creation_input_tokens", + "cache_read_input_tokens", + "input_tokens", + "output_tokens", + "model", + ] + nullable_fields = ["cache_creation"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/anthropicspeed.py b/src/openrouter/components/anthropicspeed.py new file mode 100644 index 00000000..4f9c2bc7 --- /dev/null +++ b/src/openrouter/components/anthropicspeed.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +AnthropicSpeed = Union[ + Literal[ + "fast", + "standard", + ], + UnrecognizedStr, +] diff --git a/src/openrouter/components/anthropicunknownusageiteration.py b/src/openrouter/components/anthropicunknownusageiteration.py new file mode 100644 index 00000000..5bbd2e0f --- /dev/null +++ b/src/openrouter/components/anthropicunknownusageiteration.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiciterationcachecreation import ( + AnthropicIterationCacheCreation, + AnthropicIterationCacheCreationTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class AnthropicUnknownUsageIterationTypedDict(TypedDict): + type: str + cache_creation: NotRequired[Nullable[AnthropicIterationCacheCreationTypedDict]] + cache_creation_input_tokens: NotRequired[int] + cache_read_input_tokens: NotRequired[int] + input_tokens: NotRequired[int] + output_tokens: NotRequired[int] + + +class AnthropicUnknownUsageIteration(BaseModel): + type: str + + cache_creation: OptionalNullable[AnthropicIterationCacheCreation] = UNSET + + cache_creation_input_tokens: Optional[int] = None + + cache_read_input_tokens: Optional[int] = None + + input_tokens: Optional[int] = None + + output_tokens: Optional[int] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "cache_creation", + "cache_creation_input_tokens", + "cache_read_input_tokens", + "input_tokens", + "output_tokens", + ] + nullable_fields = ["cache_creation"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/anthropicusageiteration.py b/src/openrouter/components/anthropicusageiteration.py new file mode 100644 index 00000000..a984e7a5 --- /dev/null +++ b/src/openrouter/components/anthropicusageiteration.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicadvisormessageusageiteration import ( + AnthropicAdvisorMessageUsageIteration, + AnthropicAdvisorMessageUsageIterationTypedDict, +) +from .anthropiccompactionusageiteration import ( + AnthropicCompactionUsageIteration, + AnthropicCompactionUsageIterationTypedDict, +) +from .anthropicmessageusageiteration import ( + AnthropicMessageUsageIteration, + AnthropicMessageUsageIterationTypedDict, +) +from .anthropicunknownusageiteration import ( + AnthropicUnknownUsageIteration, + AnthropicUnknownUsageIterationTypedDict, +) +from typing import Union +from typing_extensions import TypeAliasType + + +AnthropicUsageIterationTypedDict = TypeAliasType( + "AnthropicUsageIterationTypedDict", + Union[ + AnthropicCompactionUsageIterationTypedDict, + AnthropicUnknownUsageIterationTypedDict, + AnthropicMessageUsageIterationTypedDict, + AnthropicAdvisorMessageUsageIterationTypedDict, + ], +) + + +AnthropicUsageIteration = TypeAliasType( + "AnthropicUsageIteration", + Union[ + AnthropicCompactionUsageIteration, + AnthropicUnknownUsageIteration, + AnthropicMessageUsageIteration, + AnthropicAdvisorMessageUsageIteration, + ], +) diff --git a/src/openrouter/components/apierrortype.py b/src/openrouter/components/apierrortype.py new file mode 100644 index 00000000..cb48803e --- /dev/null +++ b/src/openrouter/components/apierrortype.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +APIErrorType = Union[ + Literal[ + "context_length_exceeded", + "max_tokens_exceeded", + "token_limit_exceeded", + "string_too_long", + "authentication", + "permission_denied", + "payment_required", + "rate_limit_exceeded", + "provider_overloaded", + "provider_unavailable", + "invalid_request", + "invalid_prompt", + "not_found", + "precondition_failed", + "payload_too_large", + "unprocessable", + "content_policy_violation", + "refusal", + "invalid_image", + "image_too_large", + "image_too_small", + "unsupported_image_format", + "image_not_found", + "image_download_failed", + "server", + "timeout", + "unmapped", + ], + UnrecognizedStr, +] +r"""Canonical OpenRouter error type, stable across all API formats""" diff --git a/src/openrouter/components/benchmarksaameta.py b/src/openrouter/components/benchmarksaameta.py deleted file mode 100644 index 9d751f4a..00000000 --- a/src/openrouter/components/benchmarksaameta.py +++ /dev/null @@ -1,53 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from typing import Literal -from typing_extensions import TypedDict - - -BenchmarksAAMetaSource = Literal["artificial-analysis",] -r"""Data source identifier.""" - - -BenchmarksAAMetaSourceURL = Literal["https://artificialanalysis.ai",] -r"""URL of the upstream data source.""" - - -BenchmarksAAMetaVersion = Literal["v1",] -r"""Dataset version.""" - - -class BenchmarksAAMetaTypedDict(TypedDict): - as_of: str - r"""ISO-8601 timestamp of when this data was last updated.""" - citation: str - r"""Required attribution when republishing this data.""" - model_count: int - r"""Number of unique models in the response.""" - source: BenchmarksAAMetaSource - r"""Data source identifier.""" - source_url: BenchmarksAAMetaSourceURL - r"""URL of the upstream data source.""" - version: BenchmarksAAMetaVersion - r"""Dataset version.""" - - -class BenchmarksAAMeta(BaseModel): - as_of: str - r"""ISO-8601 timestamp of when this data was last updated.""" - - citation: str - r"""Required attribution when republishing this data.""" - - model_count: int - r"""Number of unique models in the response.""" - - source: BenchmarksAAMetaSource - r"""Data source identifier.""" - - source_url: BenchmarksAAMetaSourceURL - r"""URL of the upstream data source.""" - - version: BenchmarksAAMetaVersion - r"""Dataset version.""" diff --git a/src/openrouter/components/benchmarksaaresponse.py b/src/openrouter/components/benchmarksaaresponse.py deleted file mode 100644 index 787ae1ca..00000000 --- a/src/openrouter/components/benchmarksaaresponse.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .benchmarksaaitem import BenchmarksAAItem, BenchmarksAAItemTypedDict -from .benchmarksaameta import BenchmarksAAMeta, BenchmarksAAMetaTypedDict -from openrouter.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class BenchmarksAAResponseTypedDict(TypedDict): - data: List[BenchmarksAAItemTypedDict] - meta: BenchmarksAAMetaTypedDict - - -class BenchmarksAAResponse(BaseModel): - data: List[BenchmarksAAItem] - - meta: BenchmarksAAMeta diff --git a/src/openrouter/components/benchmarksdameta.py b/src/openrouter/components/benchmarksdameta.py deleted file mode 100644 index 0ca3550d..00000000 --- a/src/openrouter/components/benchmarksdameta.py +++ /dev/null @@ -1,118 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal -from typing_extensions import TypedDict - - -class EloBoundsTypedDict(TypedDict): - r"""ELO range across all returned models for normalization.""" - - max: float - r"""Maximum ELO in the result set.""" - min: float - r"""Minimum ELO in the result set.""" - - -class EloBounds(BaseModel): - r"""ELO range across all returned models for normalization.""" - - max: float - r"""Maximum ELO in the result set.""" - - min: float - r"""Minimum ELO in the result set.""" - - -BenchmarksDAMetaSource = Literal["design-arena",] -r"""Data source identifier.""" - - -BenchmarksDAMetaSourceURL = Literal["https://www.designarena.ai",] -r"""URL of the upstream data source.""" - - -BenchmarksDAMetaVersion = Literal["v1",] -r"""Dataset version.""" - - -class BenchmarksDAMetaTypedDict(TypedDict): - arena: str - r"""The arena filter applied.""" - as_of: str - r"""ISO-8601 timestamp of when this data was generated.""" - category: Nullable[str] - r"""The category filter applied, or null if showing all.""" - citation: str - r"""Required attribution when republishing this data.""" - elo_bounds: EloBoundsTypedDict - r"""ELO range across all returned models for normalization.""" - model_count: int - r"""Number of unique models in the response.""" - source: BenchmarksDAMetaSource - r"""Data source identifier.""" - source_url: BenchmarksDAMetaSourceURL - r"""URL of the upstream data source.""" - version: BenchmarksDAMetaVersion - r"""Dataset version.""" - - -class BenchmarksDAMeta(BaseModel): - arena: str - r"""The arena filter applied.""" - - as_of: str - r"""ISO-8601 timestamp of when this data was generated.""" - - category: Nullable[str] - r"""The category filter applied, or null if showing all.""" - - citation: str - r"""Required attribution when republishing this data.""" - - elo_bounds: EloBounds - r"""ELO range across all returned models for normalization.""" - - model_count: int - r"""Number of unique models in the response.""" - - source: BenchmarksDAMetaSource - r"""Data source identifier.""" - - source_url: BenchmarksDAMetaSourceURL - r"""URL of the upstream data source.""" - - version: BenchmarksDAMetaVersion - r"""Dataset version.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [] - nullable_fields = ["category"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/openrouter/components/benchmarksdaresponse.py b/src/openrouter/components/benchmarksdaresponse.py deleted file mode 100644 index 7588fc52..00000000 --- a/src/openrouter/components/benchmarksdaresponse.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .benchmarksdaitem import BenchmarksDAItem, BenchmarksDAItemTypedDict -from .benchmarksdameta import BenchmarksDAMeta, BenchmarksDAMetaTypedDict -from openrouter.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class BenchmarksDAResponseTypedDict(TypedDict): - data: List[BenchmarksDAItemTypedDict] - meta: BenchmarksDAMetaTypedDict - - -class BenchmarksDAResponse(BaseModel): - data: List[BenchmarksDAItem] - - meta: BenchmarksDAMeta diff --git a/src/openrouter/components/booleancapability.py b/src/openrouter/components/booleancapability.py new file mode 100644 index 00000000..75d5ed89 --- /dev/null +++ b/src/openrouter/components/booleancapability.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +BooleanCapabilityType = Literal["boolean",] + + +class BooleanCapabilityTypedDict(TypedDict): + r"""A supported-or-not flag. Present means the parameter is accepted.""" + + type: BooleanCapabilityType + + +class BooleanCapability(BaseModel): + r"""A supported-or-not flag. Present means the parameter is accepted.""" + + type: BooleanCapabilityType diff --git a/src/openrouter/components/byokproviderslug.py b/src/openrouter/components/byokproviderslug.py index 1786f6d4..ddb35a6e 100644 --- a/src/openrouter/components/byokproviderslug.py +++ b/src/openrouter/components/byokproviderslug.py @@ -82,6 +82,7 @@ "stepfun", "streamlake", "switchpoint", + "tenstorrent", "together", "upstage", "venice", diff --git a/src/openrouter/components/capabilitydescriptor.py b/src/openrouter/components/capabilitydescriptor.py new file mode 100644 index 00000000..3b40c65b --- /dev/null +++ b/src/openrouter/components/capabilitydescriptor.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .booleancapability import BooleanCapability, BooleanCapabilityTypedDict +from .enumcapability import EnumCapability, EnumCapabilityTypedDict +from .rangecapability import RangeCapability, RangeCapabilityTypedDict +from openrouter.utils import get_discriminator +from pydantic import Discriminator, Tag +from typing import Union +from typing_extensions import Annotated, TypeAliasType + + +CapabilityDescriptorTypedDict = TypeAliasType( + "CapabilityDescriptorTypedDict", + Union[ + BooleanCapabilityTypedDict, EnumCapabilityTypedDict, RangeCapabilityTypedDict + ], +) +r"""A typed descriptor for one supported request parameter.""" + + +CapabilityDescriptor = Annotated[ + Union[ + Annotated[EnumCapability, Tag("enum")], + Annotated[RangeCapability, Tag("range")], + Annotated[BooleanCapability, Tag("boolean")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] +r"""A typed descriptor for one supported request parameter.""" diff --git a/src/openrouter/components/chatrequest.py b/src/openrouter/components/chatrequest.py index f90c2905..f60f367c 100644 --- a/src/openrouter/components/chatrequest.py +++ b/src/openrouter/components/chatrequest.py @@ -106,6 +106,7 @@ ChatRequestEffort = Union[ Literal[ + "max", "xhigh", "high", "medium", @@ -172,6 +173,7 @@ def serialize_model(self, handler): ChatRequestReasoningEffort = Union[ Literal[ + "max", "xhigh", "high", "medium", diff --git a/src/openrouter/components/chatstreamchunk.py b/src/openrouter/components/chatstreamchunk.py index 52c37761..1f00ab13 100644 --- a/src/openrouter/components/chatstreamchunk.py +++ b/src/openrouter/components/chatstreamchunk.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .apierrortype import APIErrorType from .chatstreamchoice import ChatStreamChoice, ChatStreamChoiceTypedDict from .chatusage import ChatUsage, ChatUsageTypedDict from .openroutermetadata import OpenRouterMetadata, OpenRouterMetadataTypedDict @@ -11,21 +12,44 @@ UNSET, UNSET_SENTINEL, ) +from openrouter.utils import validate_open_enum from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict -class ErrorTypedDict(TypedDict): +class ChatStreamChunkMetadataTypedDict(TypedDict): + r"""Structured error metadata""" + + error_type: APIErrorType + r"""Canonical OpenRouter error type, stable across all API formats""" + provider_code: NotRequired[str] + r"""Upstream provider-specific error code, when available""" + + +class ChatStreamChunkMetadata(BaseModel): + r"""Structured error metadata""" + + error_type: Annotated[APIErrorType, PlainValidator(validate_open_enum(False))] + r"""Canonical OpenRouter error type, stable across all API formats""" + + provider_code: Optional[str] = None + r"""Upstream provider-specific error code, when available""" + + +class ChatStreamChunkErrorTypedDict(TypedDict): r"""Error information""" code: int r"""Error code""" message: str r"""Error message""" + metadata: NotRequired[ChatStreamChunkMetadataTypedDict] + r"""Structured error metadata""" -class Error(BaseModel): +class ChatStreamChunkError(BaseModel): r"""Error information""" code: int @@ -34,6 +58,9 @@ class Error(BaseModel): message: str r"""Error message""" + metadata: Optional[ChatStreamChunkMetadata] = None + r"""Structured error metadata""" + ChatStreamChunkObject = Literal["chat.completion.chunk",] @@ -50,7 +77,7 @@ class ChatStreamChunkTypedDict(TypedDict): model: str r"""Model used for completion""" object: ChatStreamChunkObject - error: NotRequired[ErrorTypedDict] + error: NotRequired[ChatStreamChunkErrorTypedDict] r"""Error information""" openrouter_metadata: NotRequired[OpenRouterMetadataTypedDict] service_tier: NotRequired[Nullable[str]] @@ -78,7 +105,7 @@ class ChatStreamChunk(BaseModel): object: ChatStreamChunkObject - error: Optional[Error] = None + error: Optional[ChatStreamChunkError] = None r"""Error information""" openrouter_metadata: Optional[OpenRouterMetadata] = None diff --git a/src/openrouter/components/chatusage.py b/src/openrouter/components/chatusage.py index 3a7357d8..8eb123a2 100644 --- a/src/openrouter/components/chatusage.py +++ b/src/openrouter/components/chatusage.py @@ -14,7 +14,7 @@ from typing_extensions import NotRequired, TypedDict -class CompletionTokensDetailsTypedDict(TypedDict): +class ChatUsageCompletionTokensDetailsTypedDict(TypedDict): r"""Detailed completion token usage""" accepted_prediction_tokens: NotRequired[Nullable[int]] @@ -27,7 +27,7 @@ class CompletionTokensDetailsTypedDict(TypedDict): r"""Rejected prediction tokens""" -class CompletionTokensDetails(BaseModel): +class ChatUsageCompletionTokensDetails(BaseModel): r"""Detailed completion token usage""" accepted_prediction_tokens: OptionalNullable[int] = UNSET @@ -83,7 +83,7 @@ def serialize_model(self, handler): return m -class PromptTokensDetailsTypedDict(TypedDict): +class ChatUsagePromptTokensDetailsTypedDict(TypedDict): r"""Detailed prompt token usage""" audio_tokens: NotRequired[int] @@ -96,7 +96,7 @@ class PromptTokensDetailsTypedDict(TypedDict): r"""Video input tokens""" -class PromptTokensDetails(BaseModel): +class ChatUsagePromptTokensDetails(BaseModel): r"""Detailed prompt token usage""" audio_tokens: Optional[int] = None @@ -112,6 +112,68 @@ class PromptTokensDetails(BaseModel): r"""Video input tokens""" +class ServerToolUseDetailsTypedDict(TypedDict): + r"""Usage for server-side tool execution (e.g., web search)""" + + tool_calls_executed: NotRequired[Nullable[int]] + r"""Number of OpenRouter server tool calls that executed and produced a result""" + tool_calls_requested: NotRequired[Nullable[int]] + r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.""" + web_search_requests: NotRequired[Nullable[int]] + r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.""" + + +class ServerToolUseDetails(BaseModel): + r"""Usage for server-side tool execution (e.g., web search)""" + + tool_calls_executed: OptionalNullable[int] = UNSET + r"""Number of OpenRouter server tool calls that executed and produced a result""" + + tool_calls_requested: OptionalNullable[int] = UNSET + r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.""" + + web_search_requests: OptionalNullable[int] = UNSET + r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "tool_calls_executed", + "tool_calls_requested", + "web_search_requests", + ] + nullable_fields = [ + "tool_calls_executed", + "tool_calls_requested", + "web_search_requests", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + class ChatUsageTypedDict(TypedDict): r"""Token usage statistics""" @@ -121,7 +183,9 @@ class ChatUsageTypedDict(TypedDict): r"""Number of tokens in the prompt""" total_tokens: int r"""Total number of tokens""" - completion_tokens_details: NotRequired[Nullable[CompletionTokensDetailsTypedDict]] + completion_tokens_details: NotRequired[ + Nullable[ChatUsageCompletionTokensDetailsTypedDict] + ] r"""Detailed completion token usage""" cost: NotRequired[Nullable[float]] r"""Cost of the completion""" @@ -129,8 +193,10 @@ class ChatUsageTypedDict(TypedDict): r"""Breakdown of upstream inference costs""" is_byok: NotRequired[bool] r"""Whether a request was made using a Bring Your Own Key configuration""" - prompt_tokens_details: NotRequired[Nullable[PromptTokensDetailsTypedDict]] + prompt_tokens_details: NotRequired[Nullable[ChatUsagePromptTokensDetailsTypedDict]] r"""Detailed prompt token usage""" + server_tool_use_details: NotRequired[Nullable[ServerToolUseDetailsTypedDict]] + r"""Usage for server-side tool execution (e.g., web search)""" class ChatUsage(BaseModel): @@ -145,7 +211,9 @@ class ChatUsage(BaseModel): total_tokens: int r"""Total number of tokens""" - completion_tokens_details: OptionalNullable[CompletionTokensDetails] = UNSET + completion_tokens_details: OptionalNullable[ChatUsageCompletionTokensDetails] = ( + UNSET + ) r"""Detailed completion token usage""" cost: OptionalNullable[float] = UNSET @@ -157,9 +225,12 @@ class ChatUsage(BaseModel): is_byok: Optional[bool] = None r"""Whether a request was made using a Bring Your Own Key configuration""" - prompt_tokens_details: OptionalNullable[PromptTokensDetails] = UNSET + prompt_tokens_details: OptionalNullable[ChatUsagePromptTokensDetails] = UNSET r"""Detailed prompt token usage""" + server_tool_use_details: OptionalNullable[ServerToolUseDetails] = UNSET + r"""Usage for server-side tool execution (e.g., web search)""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -168,12 +239,14 @@ def serialize_model(self, handler): "cost_details", "is_byok", "prompt_tokens_details", + "server_tool_use_details", ] nullable_fields = [ "completion_tokens_details", "cost", "cost_details", "prompt_tokens_details", + "server_tool_use_details", ] null_default_fields = [] diff --git a/src/openrouter/components/debugevent.py b/src/openrouter/components/debugevent.py new file mode 100644 index 00000000..e163680e --- /dev/null +++ b/src/openrouter/components/debugevent.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UnrecognizedStr +from openrouter.utils import validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import Any, Dict, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +Event = Union[ + Literal[ + "adapter_request", + "upstream_headers_received", + "first_token_received", + "upstream_body_ended", + ], + UnrecognizedStr, +] + + +class TimingsTypedDict(TypedDict): + epoch_ms: int + event: Event + start_ms: int + + +class Timings(BaseModel): + epoch_ms: int + + event: Annotated[Event, PlainValidator(validate_open_enum(False))] + + start_ms: int + + +class DebugTypedDict(TypedDict): + echo_upstream_body: NotRequired[Dict[str, Nullable[Any]]] + timings: NotRequired[TimingsTypedDict] + + +class Debug(BaseModel): + echo_upstream_body: Optional[Dict[str, Nullable[Any]]] = None + + timings: Optional[Timings] = None + + +DebugEventType = Literal["response.debug",] + + +class DebugEventTypedDict(TypedDict): + r"""Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones.""" + + debug: DebugTypedDict + sequence_number: int + type: DebugEventType + + +class DebugEvent(BaseModel): + r"""Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones.""" + + debug: Debug + + sequence_number: int + + type: DebugEventType diff --git a/src/openrouter/components/enumcapability.py b/src/openrouter/components/enumcapability.py new file mode 100644 index 00000000..468dba81 --- /dev/null +++ b/src/openrouter/components/enumcapability.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import List, Literal +from typing_extensions import TypedDict + + +EnumCapabilityType = Literal["enum",] + + +class EnumCapabilityTypedDict(TypedDict): + r"""A parameter that accepts one of a discrete set of string values.""" + + type: EnumCapabilityType + values: List[str] + + +class EnumCapability(BaseModel): + r"""A parameter that accepts one of a discrete set of string values.""" + + type: EnumCapabilityType + + values: List[str] diff --git a/src/openrouter/components/fusionservertoolconfig.py b/src/openrouter/components/fusionservertoolconfig.py index 4eae6cf0..a9631f6d 100644 --- a/src/openrouter/components/fusionservertoolconfig.py +++ b/src/openrouter/components/fusionservertoolconfig.py @@ -1,6 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .anthropiccachecontroldirective import ( + AnthropicCacheControlDirective, + AnthropicCacheControlDirectiveTypedDict, +) from openrouter.types import BaseModel, Nullable, UnrecognizedStr from openrouter.utils import validate_open_enum from pydantic.functional_validators import PlainValidator @@ -10,6 +14,7 @@ FusionServerToolConfigEffort = Union[ Literal[ + "max", "xhigh", "high", "medium", @@ -64,6 +69,8 @@ class FusionServerToolConfigTypedDict(TypedDict): analysis_models: NotRequired[List[str]] r"""Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion.""" + cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" max_completion_tokens: NotRequired[int] r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies.""" max_tool_calls: NotRequired[int] @@ -84,6 +91,9 @@ class FusionServerToolConfig(BaseModel): analysis_models: Optional[List[str]] = None r"""Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion.""" + cache_control: Optional[AnthropicCacheControlDirective] = None + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + max_completion_tokens: Optional[int] = None r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies.""" diff --git a/src/openrouter/components/imageendpoint.py b/src/openrouter/components/imageendpoint.py new file mode 100644 index 00000000..8d392046 --- /dev/null +++ b/src/openrouter/components/imageendpoint.py @@ -0,0 +1,81 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .capabilitydescriptor import CapabilityDescriptor, CapabilityDescriptorTypedDict +from .imagepricingentry import ImagePricingEntry, ImagePricingEntryTypedDict +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, List +from typing_extensions import TypedDict + + +class ImageEndpointTypedDict(TypedDict): + r"""An endpoint that serves a given image model.""" + + allowed_passthrough_parameters: List[str] + r"""Provider-specific options accepted under provider.options[provider_slug].""" + pricing: List[ImagePricingEntryTypedDict] + r"""Billable pricing lines for this endpoint.""" + provider_name: str + r"""Provider display name""" + provider_slug: str + r"""Provider slug""" + provider_tag: Nullable[str] + r"""Provider tag for request-side selection""" + supported_parameters: Dict[str, CapabilityDescriptorTypedDict] + supports_streaming: bool + r"""Whether this endpoint supports native SSE streaming (`stream: true` in the request).""" + + +class ImageEndpoint(BaseModel): + r"""An endpoint that serves a given image model.""" + + allowed_passthrough_parameters: List[str] + r"""Provider-specific options accepted under provider.options[provider_slug].""" + + pricing: List[ImagePricingEntry] + r"""Billable pricing lines for this endpoint.""" + + provider_name: str + r"""Provider display name""" + + provider_slug: str + r"""Provider slug""" + + provider_tag: Nullable[str] + r"""Provider tag for request-side selection""" + + supported_parameters: Dict[str, CapabilityDescriptor] + + supports_streaming: bool + r"""Whether this endpoint supports native SSE streaming (`stream: true` in the request).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [] + nullable_fields = ["provider_tag"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/imagegencompletedevent.py b/src/openrouter/components/imagegencompletedevent.py new file mode 100644 index 00000000..e5907de8 --- /dev/null +++ b/src/openrouter/components/imagegencompletedevent.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imagegenerationusage import ImageGenerationUsage, ImageGenerationUsageTypedDict +from openrouter.types import BaseModel +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +ImageGenCompletedEventType = Literal["image_generation.completed",] +r"""The event type""" + + +class ImageGenCompletedEventTypedDict(TypedDict): + r"""Emitted when generation completes and the final image is available""" + + b64_json: str + r"""Base64-encoded final image data""" + created: int + r"""Unix timestamp (seconds) when the image was generated""" + type: ImageGenCompletedEventType + r"""The event type""" + usage: NotRequired[ImageGenerationUsageTypedDict] + r"""Token and cost usage for the image generation request, when available""" + + +class ImageGenCompletedEvent(BaseModel): + r"""Emitted when generation completes and the final image is available""" + + b64_json: str + r"""Base64-encoded final image data""" + + created: int + r"""Unix timestamp (seconds) when the image was generated""" + + type: ImageGenCompletedEventType + r"""The event type""" + + usage: Optional[ImageGenerationUsage] = None + r"""Token and cost usage for the image generation request, when available""" diff --git a/src/openrouter/components/imagegenerationrequest.py b/src/openrouter/components/imagegenerationrequest.py new file mode 100644 index 00000000..a7bdd3ff --- /dev/null +++ b/src/openrouter/components/imagegenerationrequest.py @@ -0,0 +1,593 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contentpartimage import ContentPartImage, ContentPartImageTypedDict +from openrouter.types import BaseModel, Nullable, UnrecognizedStr +from openrouter.utils import validate_open_enum +import pydantic +from pydantic.functional_validators import PlainValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +ImageGenerationRequestAspectRatio = Union[ + Literal[ + "1:1", + "1:2", + "1:4", + "1:8", + "2:1", + "2:3", + "3:2", + "3:4", + "4:1", + "4:3", + "4:5", + "5:4", + "8:1", + "9:16", + "16:9", + "9:19.5", + "19.5:9", + "9:20", + "20:9", + "9:21", + "21:9", + "auto", + ], + UnrecognizedStr, +] +r"""Normalized aspect ratio of the generated image. Providers clamp to their supported subset.""" + + +ImageGenerationRequestBackground = Union[ + Literal[ + "auto", + "transparent", + "opaque", + ], + UnrecognizedStr, +] +r"""Background treatment. `transparent` requires an output_format that supports alpha (png or webp).""" + + +ImageGenerationRequestOutputFormat = Union[ + Literal[ + "png", + "jpeg", + "webp", + ], + UnrecognizedStr, +] +r"""Encoding of the returned image bytes.""" + + +class ImageGenerationRequestOptionsTypedDict(TypedDict): + r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.""" + + oneai: NotRequired[Dict[str, Nullable[Any]]] + ai21: NotRequired[Dict[str, Nullable[Any]]] + aion_labs: NotRequired[Dict[str, Nullable[Any]]] + akashml: NotRequired[Dict[str, Nullable[Any]]] + alibaba: NotRequired[Dict[str, Nullable[Any]]] + amazon_bedrock: NotRequired[Dict[str, Nullable[Any]]] + amazon_nova: NotRequired[Dict[str, Nullable[Any]]] + ambient: NotRequired[Dict[str, Nullable[Any]]] + anthropic: NotRequired[Dict[str, Nullable[Any]]] + anyscale: NotRequired[Dict[str, Nullable[Any]]] + arcee_ai: NotRequired[Dict[str, Nullable[Any]]] + atlas_cloud: NotRequired[Dict[str, Nullable[Any]]] + atoma: NotRequired[Dict[str, Nullable[Any]]] + avian: NotRequired[Dict[str, Nullable[Any]]] + azure: NotRequired[Dict[str, Nullable[Any]]] + baidu: NotRequired[Dict[str, Nullable[Any]]] + baseten: NotRequired[Dict[str, Nullable[Any]]] + black_forest_labs: NotRequired[Dict[str, Nullable[Any]]] + byteplus: NotRequired[Dict[str, Nullable[Any]]] + centml: NotRequired[Dict[str, Nullable[Any]]] + cerebras: NotRequired[Dict[str, Nullable[Any]]] + chutes: NotRequired[Dict[str, Nullable[Any]]] + cirrascale: NotRequired[Dict[str, Nullable[Any]]] + clarifai: NotRequired[Dict[str, Nullable[Any]]] + cloudflare: NotRequired[Dict[str, Nullable[Any]]] + cohere: NotRequired[Dict[str, Nullable[Any]]] + crofai: NotRequired[Dict[str, Nullable[Any]]] + crucible: NotRequired[Dict[str, Nullable[Any]]] + crusoe: NotRequired[Dict[str, Nullable[Any]]] + darkbloom: NotRequired[Dict[str, Nullable[Any]]] + decart: NotRequired[Dict[str, Nullable[Any]]] + deepinfra: NotRequired[Dict[str, Nullable[Any]]] + deepseek: NotRequired[Dict[str, Nullable[Any]]] + dekallm: NotRequired[Dict[str, Nullable[Any]]] + digitalocean: NotRequired[Dict[str, Nullable[Any]]] + enfer: NotRequired[Dict[str, Nullable[Any]]] + fake_provider: NotRequired[Dict[str, Nullable[Any]]] + featherless: NotRequired[Dict[str, Nullable[Any]]] + fireworks: NotRequired[Dict[str, Nullable[Any]]] + friendli: NotRequired[Dict[str, Nullable[Any]]] + gmicloud: NotRequired[Dict[str, Nullable[Any]]] + google_ai_studio: NotRequired[Dict[str, Nullable[Any]]] + google_vertex: NotRequired[Dict[str, Nullable[Any]]] + gopomelo: NotRequired[Dict[str, Nullable[Any]]] + groq: NotRequired[Dict[str, Nullable[Any]]] + huggingface: NotRequired[Dict[str, Nullable[Any]]] + hyperbolic: NotRequired[Dict[str, Nullable[Any]]] + hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]] + inception: NotRequired[Dict[str, Nullable[Any]]] + inceptron: NotRequired[Dict[str, Nullable[Any]]] + inference_net: NotRequired[Dict[str, Nullable[Any]]] + infermatic: NotRequired[Dict[str, Nullable[Any]]] + inflection: NotRequired[Dict[str, Nullable[Any]]] + inocloud: NotRequired[Dict[str, Nullable[Any]]] + io_net: NotRequired[Dict[str, Nullable[Any]]] + ionstream: NotRequired[Dict[str, Nullable[Any]]] + klusterai: NotRequired[Dict[str, Nullable[Any]]] + lambda_: NotRequired[Dict[str, Nullable[Any]]] + lepton: NotRequired[Dict[str, Nullable[Any]]] + liquid: NotRequired[Dict[str, Nullable[Any]]] + lynn: NotRequired[Dict[str, Nullable[Any]]] + lynn_private: NotRequired[Dict[str, Nullable[Any]]] + mancer: NotRequired[Dict[str, Nullable[Any]]] + mancer_old: NotRequired[Dict[str, Nullable[Any]]] + mara: NotRequired[Dict[str, Nullable[Any]]] + meta: NotRequired[Dict[str, Nullable[Any]]] + minimax: NotRequired[Dict[str, Nullable[Any]]] + mistral: NotRequired[Dict[str, Nullable[Any]]] + modal: NotRequired[Dict[str, Nullable[Any]]] + modelrun: NotRequired[Dict[str, Nullable[Any]]] + modular: NotRequired[Dict[str, Nullable[Any]]] + moonshotai: NotRequired[Dict[str, Nullable[Any]]] + morph: NotRequired[Dict[str, Nullable[Any]]] + ncompass: NotRequired[Dict[str, Nullable[Any]]] + nebius: NotRequired[Dict[str, Nullable[Any]]] + nex_agi: NotRequired[Dict[str, Nullable[Any]]] + nextbit: NotRequired[Dict[str, Nullable[Any]]] + nineteen: NotRequired[Dict[str, Nullable[Any]]] + novita: NotRequired[Dict[str, Nullable[Any]]] + nvidia: NotRequired[Dict[str, Nullable[Any]]] + octoai: NotRequired[Dict[str, Nullable[Any]]] + open_inference: NotRequired[Dict[str, Nullable[Any]]] + openai: NotRequired[Dict[str, Nullable[Any]]] + parasail: NotRequired[Dict[str, Nullable[Any]]] + perceptron: NotRequired[Dict[str, Nullable[Any]]] + perplexity: NotRequired[Dict[str, Nullable[Any]]] + phala: NotRequired[Dict[str, Nullable[Any]]] + poolside: NotRequired[Dict[str, Nullable[Any]]] + recraft: NotRequired[Dict[str, Nullable[Any]]] + recursal: NotRequired[Dict[str, Nullable[Any]]] + reflection: NotRequired[Dict[str, Nullable[Any]]] + reka: NotRequired[Dict[str, Nullable[Any]]] + relace: NotRequired[Dict[str, Nullable[Any]]] + replicate: NotRequired[Dict[str, Nullable[Any]]] + sambanova: NotRequired[Dict[str, Nullable[Any]]] + sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]] + seed: NotRequired[Dict[str, Nullable[Any]]] + sf_compute: NotRequired[Dict[str, Nullable[Any]]] + siliconflow: NotRequired[Dict[str, Nullable[Any]]] + sourceful: NotRequired[Dict[str, Nullable[Any]]] + stealth: NotRequired[Dict[str, Nullable[Any]]] + stepfun: NotRequired[Dict[str, Nullable[Any]]] + streamlake: NotRequired[Dict[str, Nullable[Any]]] + switchpoint: NotRequired[Dict[str, Nullable[Any]]] + targon: NotRequired[Dict[str, Nullable[Any]]] + tenstorrent: NotRequired[Dict[str, Nullable[Any]]] + together: NotRequired[Dict[str, Nullable[Any]]] + together_lite: NotRequired[Dict[str, Nullable[Any]]] + ubicloud: NotRequired[Dict[str, Nullable[Any]]] + upstage: NotRequired[Dict[str, Nullable[Any]]] + venice: NotRequired[Dict[str, Nullable[Any]]] + wafer: NotRequired[Dict[str, Nullable[Any]]] + wandb: NotRequired[Dict[str, Nullable[Any]]] + xai: NotRequired[Dict[str, Nullable[Any]]] + xiaomi: NotRequired[Dict[str, Nullable[Any]]] + z_ai: NotRequired[Dict[str, Nullable[Any]]] + + +class ImageGenerationRequestOptions(BaseModel): + r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.""" + + oneai: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="01ai") + ] = None + + ai21: Optional[Dict[str, Nullable[Any]]] = None + + aion_labs: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="aion-labs") + ] = None + + akashml: Optional[Dict[str, Nullable[Any]]] = None + + alibaba: Optional[Dict[str, Nullable[Any]]] = None + + amazon_bedrock: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-bedrock") + ] = None + + amazon_nova: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-nova") + ] = None + + ambient: Optional[Dict[str, Nullable[Any]]] = None + + anthropic: Optional[Dict[str, Nullable[Any]]] = None + + anyscale: Optional[Dict[str, Nullable[Any]]] = None + + arcee_ai: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="arcee-ai") + ] = None + + atlas_cloud: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="atlas-cloud") + ] = None + + atoma: Optional[Dict[str, Nullable[Any]]] = None + + avian: Optional[Dict[str, Nullable[Any]]] = None + + azure: Optional[Dict[str, Nullable[Any]]] = None + + baidu: Optional[Dict[str, Nullable[Any]]] = None + + baseten: Optional[Dict[str, Nullable[Any]]] = None + + black_forest_labs: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="black-forest-labs") + ] = None + + byteplus: Optional[Dict[str, Nullable[Any]]] = None + + centml: Optional[Dict[str, Nullable[Any]]] = None + + cerebras: Optional[Dict[str, Nullable[Any]]] = None + + chutes: Optional[Dict[str, Nullable[Any]]] = None + + cirrascale: Optional[Dict[str, Nullable[Any]]] = None + + clarifai: Optional[Dict[str, Nullable[Any]]] = None + + cloudflare: Optional[Dict[str, Nullable[Any]]] = None + + cohere: Optional[Dict[str, Nullable[Any]]] = None + + crofai: Optional[Dict[str, Nullable[Any]]] = None + + crucible: Optional[Dict[str, Nullable[Any]]] = None + + crusoe: Optional[Dict[str, Nullable[Any]]] = None + + darkbloom: Optional[Dict[str, Nullable[Any]]] = None + + decart: Optional[Dict[str, Nullable[Any]]] = None + + deepinfra: Optional[Dict[str, Nullable[Any]]] = None + + deepseek: Optional[Dict[str, Nullable[Any]]] = None + + dekallm: Optional[Dict[str, Nullable[Any]]] = None + + digitalocean: Optional[Dict[str, Nullable[Any]]] = None + + enfer: Optional[Dict[str, Nullable[Any]]] = None + + fake_provider: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="fake-provider") + ] = None + + featherless: Optional[Dict[str, Nullable[Any]]] = None + + fireworks: Optional[Dict[str, Nullable[Any]]] = None + + friendli: Optional[Dict[str, Nullable[Any]]] = None + + gmicloud: Optional[Dict[str, Nullable[Any]]] = None + + google_ai_studio: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-ai-studio") + ] = None + + google_vertex: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-vertex") + ] = None + + gopomelo: Optional[Dict[str, Nullable[Any]]] = None + + groq: Optional[Dict[str, Nullable[Any]]] = None + + huggingface: Optional[Dict[str, Nullable[Any]]] = None + + hyperbolic: Optional[Dict[str, Nullable[Any]]] = None + + hyperbolic_quantized: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="hyperbolic-quantized") + ] = None + + inception: Optional[Dict[str, Nullable[Any]]] = None + + inceptron: Optional[Dict[str, Nullable[Any]]] = None + + inference_net: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net") + ] = None + + infermatic: Optional[Dict[str, Nullable[Any]]] = None + + inflection: Optional[Dict[str, Nullable[Any]]] = None + + inocloud: Optional[Dict[str, Nullable[Any]]] = None + + io_net: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="io-net") + ] = None + + ionstream: Optional[Dict[str, Nullable[Any]]] = None + + klusterai: Optional[Dict[str, Nullable[Any]]] = None + + lambda_: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lambda") + ] = None + + lepton: Optional[Dict[str, Nullable[Any]]] = None + + liquid: Optional[Dict[str, Nullable[Any]]] = None + + lynn: Optional[Dict[str, Nullable[Any]]] = None + + lynn_private: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lynn-private") + ] = None + + mancer: Optional[Dict[str, Nullable[Any]]] = None + + mancer_old: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="mancer-old") + ] = None + + mara: Optional[Dict[str, Nullable[Any]]] = None + + meta: Optional[Dict[str, Nullable[Any]]] = None + + minimax: Optional[Dict[str, Nullable[Any]]] = None + + mistral: Optional[Dict[str, Nullable[Any]]] = None + + modal: Optional[Dict[str, Nullable[Any]]] = None + + modelrun: Optional[Dict[str, Nullable[Any]]] = None + + modular: Optional[Dict[str, Nullable[Any]]] = None + + moonshotai: Optional[Dict[str, Nullable[Any]]] = None + + morph: Optional[Dict[str, Nullable[Any]]] = None + + ncompass: Optional[Dict[str, Nullable[Any]]] = None + + nebius: Optional[Dict[str, Nullable[Any]]] = None + + nex_agi: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="nex-agi") + ] = None + + nextbit: Optional[Dict[str, Nullable[Any]]] = None + + nineteen: Optional[Dict[str, Nullable[Any]]] = None + + novita: Optional[Dict[str, Nullable[Any]]] = None + + nvidia: Optional[Dict[str, Nullable[Any]]] = None + + octoai: Optional[Dict[str, Nullable[Any]]] = None + + open_inference: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="open-inference") + ] = None + + openai: Optional[Dict[str, Nullable[Any]]] = None + + parasail: Optional[Dict[str, Nullable[Any]]] = None + + perceptron: Optional[Dict[str, Nullable[Any]]] = None + + perplexity: Optional[Dict[str, Nullable[Any]]] = None + + phala: Optional[Dict[str, Nullable[Any]]] = None + + poolside: Optional[Dict[str, Nullable[Any]]] = None + + recraft: Optional[Dict[str, Nullable[Any]]] = None + + recursal: Optional[Dict[str, Nullable[Any]]] = None + + reflection: Optional[Dict[str, Nullable[Any]]] = None + + reka: Optional[Dict[str, Nullable[Any]]] = None + + relace: Optional[Dict[str, Nullable[Any]]] = None + + replicate: Optional[Dict[str, Nullable[Any]]] = None + + sambanova: Optional[Dict[str, Nullable[Any]]] = None + + sambanova_cloaked: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sambanova-cloaked") + ] = None + + seed: Optional[Dict[str, Nullable[Any]]] = None + + sf_compute: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sf-compute") + ] = None + + siliconflow: Optional[Dict[str, Nullable[Any]]] = None + + sourceful: Optional[Dict[str, Nullable[Any]]] = None + + stealth: Optional[Dict[str, Nullable[Any]]] = None + + stepfun: Optional[Dict[str, Nullable[Any]]] = None + + streamlake: Optional[Dict[str, Nullable[Any]]] = None + + switchpoint: Optional[Dict[str, Nullable[Any]]] = None + + targon: Optional[Dict[str, Nullable[Any]]] = None + + tenstorrent: Optional[Dict[str, Nullable[Any]]] = None + + together: Optional[Dict[str, Nullable[Any]]] = None + + together_lite: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="together-lite") + ] = None + + ubicloud: Optional[Dict[str, Nullable[Any]]] = None + + upstage: Optional[Dict[str, Nullable[Any]]] = None + + venice: Optional[Dict[str, Nullable[Any]]] = None + + wafer: Optional[Dict[str, Nullable[Any]]] = None + + wandb: Optional[Dict[str, Nullable[Any]]] = None + + xai: Optional[Dict[str, Nullable[Any]]] = None + + xiaomi: Optional[Dict[str, Nullable[Any]]] = None + + z_ai: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="z-ai") + ] = None + + +class ImageGenerationRequestProviderTypedDict(TypedDict): + r"""Provider-specific passthrough configuration""" + + options: NotRequired[ImageGenerationRequestOptionsTypedDict] + + +class ImageGenerationRequestProvider(BaseModel): + r"""Provider-specific passthrough configuration""" + + options: Optional[ImageGenerationRequestOptions] = None + + +ImageGenerationRequestQuality = Union[ + Literal[ + "auto", + "low", + "medium", + "high", + ], + UnrecognizedStr, +] +r"""Rendering quality. Providers without a quality knob ignore this.""" + + +ImageGenerationRequestResolution = Union[ + Literal[ + "512", + "1K", + "2K", + "4K", + ], + UnrecognizedStr, +] +r"""Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.""" + + +class ImageGenerationRequestTypedDict(TypedDict): + r"""Image generation request input""" + + model: str + r"""The image generation model to use""" + prompt: str + r"""Text description of the desired image""" + aspect_ratio: NotRequired[ImageGenerationRequestAspectRatio] + r"""Normalized aspect ratio of the generated image. Providers clamp to their supported subset.""" + background: NotRequired[ImageGenerationRequestBackground] + r"""Background treatment. `transparent` requires an output_format that supports alpha (png or webp).""" + input_references: NotRequired[List[ContentPartImageTypedDict]] + r"""Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.""" + n: NotRequired[int] + r"""Number of images to generate (1-10). 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.""" + output_format: NotRequired[ImageGenerationRequestOutputFormat] + r"""Encoding of the returned image bytes.""" + provider: NotRequired[ImageGenerationRequestProviderTypedDict] + r"""Provider-specific passthrough configuration""" + quality: NotRequired[ImageGenerationRequestQuality] + r"""Rendering quality. Providers without a quality knob ignore this.""" + resolution: NotRequired[ImageGenerationRequestResolution] + r"""Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.""" + seed: NotRequired[int] + r"""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.""" + 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. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected.""" + 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.""" + + +class ImageGenerationRequest(BaseModel): + r"""Image generation request input""" + + model: str + r"""The image generation model to use""" + + prompt: str + r"""Text description of the desired image""" + + aspect_ratio: Annotated[ + Optional[ImageGenerationRequestAspectRatio], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Normalized aspect ratio of the generated image. Providers clamp to their supported subset.""" + + background: Annotated[ + Optional[ImageGenerationRequestBackground], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Background treatment. `transparent` requires an output_format that supports alpha (png or webp).""" + + input_references: Optional[List[ContentPartImage]] = None + r"""Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.""" + + n: Optional[int] = None + r"""Number of images to generate (1-10). 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.""" + + output_format: Annotated[ + Optional[ImageGenerationRequestOutputFormat], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Encoding of the returned image bytes.""" + + provider: Optional[ImageGenerationRequestProvider] = None + r"""Provider-specific passthrough configuration""" + + quality: Annotated[ + Optional[ImageGenerationRequestQuality], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Rendering quality. Providers without a quality knob ignore this.""" + + resolution: Annotated[ + Optional[ImageGenerationRequestResolution], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.""" + + seed: Optional[int] = None + r"""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.""" + + 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. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected.""" + + 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/imagegenerationresponse.py b/src/openrouter/components/imagegenerationresponse.py new file mode 100644 index 00000000..deb67493 --- /dev/null +++ b/src/openrouter/components/imagegenerationresponse.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imagegenerationusage import ImageGenerationUsage, ImageGenerationUsageTypedDict +from openrouter.types import BaseModel +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class ImageGenerationResponseDataTypedDict(TypedDict): + b64_json: str + r"""Base64-encoded image bytes""" + + +class ImageGenerationResponseData(BaseModel): + b64_json: str + r"""Base64-encoded image bytes""" + + +class ImageGenerationResponseTypedDict(TypedDict): + r"""Image generation response""" + + created: int + r"""Unix timestamp (seconds) when the image was generated""" + data: List[ImageGenerationResponseDataTypedDict] + r"""Generated images""" + usage: NotRequired[ImageGenerationUsageTypedDict] + r"""Token and cost usage for the image generation request, when available""" + + +class ImageGenerationResponse(BaseModel): + r"""Image generation response""" + + created: int + r"""Unix timestamp (seconds) when the image was generated""" + + data: List[ImageGenerationResponseData] + r"""Generated images""" + + usage: Optional[ImageGenerationUsage] = None + r"""Token and cost usage for the image generation request, when available""" diff --git a/src/openrouter/components/imagegenerationservertool.py b/src/openrouter/components/imagegenerationservertool.py index 1bb37648..dfcb122b 100644 --- a/src/openrouter/components/imagegenerationservertool.py +++ b/src/openrouter/components/imagegenerationservertool.py @@ -16,7 +16,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict -Background = Union[ +ImageGenerationServerToolBackground = Union[ Literal[ "transparent", "opaque", @@ -64,7 +64,7 @@ class InputImageMask(BaseModel): ] -OutputFormat = Union[ +ImageGenerationServerToolOutputFormat = Union[ Literal[ "png", "webp", @@ -74,7 +74,7 @@ class InputImageMask(BaseModel): ] -Quality = Union[ +ImageGenerationServerToolQuality = Union[ Literal[ "low", "medium", @@ -103,15 +103,15 @@ class ImageGenerationServerToolTypedDict(TypedDict): r"""Image generation tool configuration""" type: ImageGenerationServerToolType - background: NotRequired[Background] + background: NotRequired[ImageGenerationServerToolBackground] input_fidelity: NotRequired[Nullable[InputFidelity]] input_image_mask: NotRequired[InputImageMaskTypedDict] model: NotRequired[ModelEnum] moderation: NotRequired[Moderation] output_compression: NotRequired[int] - output_format: NotRequired[OutputFormat] + output_format: NotRequired[ImageGenerationServerToolOutputFormat] partial_images: NotRequired[int] - quality: NotRequired[Quality] + quality: NotRequired[ImageGenerationServerToolQuality] size: NotRequired[Size] @@ -121,7 +121,8 @@ class ImageGenerationServerTool(BaseModel): type: ImageGenerationServerToolType background: Annotated[ - Optional[Background], PlainValidator(validate_open_enum(False)) + Optional[ImageGenerationServerToolBackground], + PlainValidator(validate_open_enum(False)), ] = None input_fidelity: Annotated[ @@ -141,14 +142,16 @@ class ImageGenerationServerTool(BaseModel): output_compression: Optional[int] = None output_format: Annotated[ - Optional[OutputFormat], PlainValidator(validate_open_enum(False)) + Optional[ImageGenerationServerToolOutputFormat], + PlainValidator(validate_open_enum(False)), ] = None partial_images: Optional[int] = None - quality: Annotated[Optional[Quality], PlainValidator(validate_open_enum(False))] = ( - None - ) + quality: Annotated[ + Optional[ImageGenerationServerToolQuality], + PlainValidator(validate_open_enum(False)), + ] = None size: Annotated[Optional[Size], PlainValidator(validate_open_enum(False))] = None diff --git a/src/openrouter/components/imagegenerationusage.py b/src/openrouter/components/imagegenerationusage.py new file mode 100644 index 00000000..ddc1c845 --- /dev/null +++ b/src/openrouter/components/imagegenerationusage.py @@ -0,0 +1,331 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicspeed import AnthropicSpeed +from .anthropicusageiteration import ( + AnthropicUsageIteration, + AnthropicUsageIterationTypedDict, +) +from .costdetails import CostDetails, CostDetailsTypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ImageGenerationUsageCompletionTokensDetailsTypedDict(TypedDict): + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for audio output.""" + image_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for image output.""" + reasoning_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for reasoning.""" + + +class ImageGenerationUsageCompletionTokensDetails(BaseModel): + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for audio output.""" + + image_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for image output.""" + + reasoning_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for reasoning.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["audio_tokens", "image_tokens", "reasoning_tokens"] + nullable_fields = ["audio_tokens", "image_tokens", "reasoning_tokens"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class ImageGenerationUsagePromptTokensDetailsTypedDict(TypedDict): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input audio.""" + cache_write_tokens: NotRequired[Nullable[int]] + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + cached_tokens: NotRequired[Nullable[int]] + r"""Tokens cached by the endpoint.""" + file_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input files/documents.""" + video_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input video.""" + + +class ImageGenerationUsagePromptTokensDetails(BaseModel): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input audio.""" + + cache_write_tokens: OptionalNullable[int] = UNSET + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + + cached_tokens: OptionalNullable[int] = UNSET + r"""Tokens cached by the endpoint.""" + + file_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input files/documents.""" + + video_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input video.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_tokens", + ] + nullable_fields = [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_tokens", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class ServerToolUseTypedDict(TypedDict): + r"""Usage for server-side tool execution (e.g., web search)""" + + tool_calls_executed: NotRequired[Nullable[int]] + r"""Number of OpenRouter server tool calls that executed and produced a result.""" + tool_calls_requested: NotRequired[Nullable[int]] + r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.""" + web_search_requests: NotRequired[Nullable[int]] + r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.""" + + +class ServerToolUse(BaseModel): + r"""Usage for server-side tool execution (e.g., web search)""" + + tool_calls_executed: OptionalNullable[int] = UNSET + r"""Number of OpenRouter server tool calls that executed and produced a result.""" + + tool_calls_requested: OptionalNullable[int] = UNSET + r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.""" + + web_search_requests: OptionalNullable[int] = UNSET + r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "tool_calls_executed", + "tool_calls_requested", + "web_search_requests", + ] + nullable_fields = [ + "tool_calls_executed", + "tool_calls_requested", + "web_search_requests", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class ImageGenerationUsageTypedDict(TypedDict): + r"""Token and cost usage for the image generation request, when available""" + + completion_tokens: int + r"""The tokens generated""" + prompt_tokens: int + r"""Including images, input audio, and tools if any""" + total_tokens: int + r"""Sum of the above two fields""" + completion_tokens_details: NotRequired[ + Nullable[ImageGenerationUsageCompletionTokensDetailsTypedDict] + ] + cost: NotRequired[Nullable[float]] + r"""Cost of the completion""" + cost_details: NotRequired[Nullable[CostDetailsTypedDict]] + r"""Breakdown of upstream inference costs""" + is_byok: NotRequired[bool] + r"""Whether a request was made using a Bring Your Own Key configuration""" + iterations: NotRequired[Nullable[List[AnthropicUsageIterationTypedDict]]] + prompt_tokens_details: NotRequired[ + Nullable[ImageGenerationUsagePromptTokensDetailsTypedDict] + ] + r"""Breakdown of tokens used in the prompt.""" + server_tool_use: NotRequired[Nullable[ServerToolUseTypedDict]] + r"""Usage for server-side tool execution (e.g., web search)""" + service_tier: NotRequired[Nullable[str]] + r"""The service tier used by the upstream provider for this request""" + speed: NotRequired[Nullable[AnthropicSpeed]] + + +class ImageGenerationUsage(BaseModel): + r"""Token and cost usage for the image generation request, when available""" + + completion_tokens: int + r"""The tokens generated""" + + prompt_tokens: int + r"""Including images, input audio, and tools if any""" + + total_tokens: int + r"""Sum of the above two fields""" + + completion_tokens_details: OptionalNullable[ + ImageGenerationUsageCompletionTokensDetails + ] = UNSET + + cost: OptionalNullable[float] = UNSET + r"""Cost of the completion""" + + cost_details: OptionalNullable[CostDetails] = UNSET + r"""Breakdown of upstream inference costs""" + + is_byok: Optional[bool] = None + r"""Whether a request was made using a Bring Your Own Key configuration""" + + iterations: OptionalNullable[List[AnthropicUsageIteration]] = UNSET + + prompt_tokens_details: OptionalNullable[ImageGenerationUsagePromptTokensDetails] = ( + UNSET + ) + r"""Breakdown of tokens used in the prompt.""" + + server_tool_use: OptionalNullable[ServerToolUse] = UNSET + r"""Usage for server-side tool execution (e.g., web search)""" + + service_tier: OptionalNullable[str] = UNSET + r"""The service tier used by the upstream provider for this request""" + + speed: Annotated[ + OptionalNullable[AnthropicSpeed], PlainValidator(validate_open_enum(False)) + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "completion_tokens_details", + "cost", + "cost_details", + "is_byok", + "iterations", + "prompt_tokens_details", + "server_tool_use", + "service_tier", + "speed", + ] + nullable_fields = [ + "completion_tokens_details", + "cost", + "cost_details", + "iterations", + "prompt_tokens_details", + "server_tool_use", + "service_tier", + "speed", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/imagegenpartialimageevent.py b/src/openrouter/components/imagegenpartialimageevent.py new file mode 100644 index 00000000..ad454de8 --- /dev/null +++ b/src/openrouter/components/imagegenpartialimageevent.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +ImageGenPartialImageEventType = Literal["image_generation.partial_image",] +r"""The event type""" + + +class ImageGenPartialImageEventTypedDict(TypedDict): + r"""Emitted when a partial image becomes available during streaming generation""" + + b64_json: str + r"""Base64-encoded partial image data""" + partial_image_index: int + r"""0-based index indicating which partial image this is in the sequence""" + type: ImageGenPartialImageEventType + r"""The event type""" + + +class ImageGenPartialImageEvent(BaseModel): + r"""Emitted when a partial image becomes available during streaming generation""" + + b64_json: str + r"""Base64-encoded partial image data""" + + partial_image_index: int + r"""0-based index indicating which partial image this is in the sequence""" + + type: ImageGenPartialImageEventType + r"""The event type""" diff --git a/src/openrouter/components/imagegenstreamerrorevent.py b/src/openrouter/components/imagegenstreamerrorevent.py new file mode 100644 index 00000000..9396413a --- /dev/null +++ b/src/openrouter/components/imagegenstreamerrorevent.py @@ -0,0 +1,95 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Literal +from typing_extensions import NotRequired, TypedDict + + +class ImageGenStreamErrorEventErrorTypedDict(TypedDict): + r"""Provider error details""" + + message: str + r"""Provider error message""" + code: NotRequired[Nullable[str]] + r"""Provider error code, when supplied""" + param: NotRequired[Nullable[str]] + r"""Request parameter associated with the error, when supplied""" + type: NotRequired[Nullable[str]] + r"""Provider error type, when supplied""" + + +class ImageGenStreamErrorEventError(BaseModel): + r"""Provider error details""" + + message: str + r"""Provider error message""" + + code: OptionalNullable[str] = UNSET + r"""Provider error code, when supplied""" + + param: OptionalNullable[str] = UNSET + r"""Request parameter associated with the error, when supplied""" + + type: OptionalNullable[str] = UNSET + r"""Provider error type, when supplied""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["code", "param", "type"] + nullable_fields = ["code", "param", "type"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +ImageGenStreamErrorEventType = Literal["error",] +r"""The event type""" + + +class ImageGenStreamErrorEventTypedDict(TypedDict): + r"""Emitted when streaming generation fails after the SSE response starts""" + + error: ImageGenStreamErrorEventErrorTypedDict + r"""Provider error details""" + type: ImageGenStreamErrorEventType + r"""The event type""" + + +class ImageGenStreamErrorEvent(BaseModel): + r"""Emitted when streaming generation fails after the SSE response starts""" + + error: ImageGenStreamErrorEventError + r"""Provider error details""" + + type: ImageGenStreamErrorEventType + r"""The event type""" diff --git a/src/openrouter/components/imagemodelarchitecture.py b/src/openrouter/components/imagemodelarchitecture.py new file mode 100644 index 00000000..5e93aaa1 --- /dev/null +++ b/src/openrouter/components/imagemodelarchitecture.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imageoutputmodality import ImageOutputModality +from .inputmodality import InputModality +from openrouter.types import BaseModel +from openrouter.utils import validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import List +from typing_extensions import Annotated, TypedDict + + +class ImageModelArchitectureTypedDict(TypedDict): + input_modalities: List[InputModality] + r"""Supported input modalities""" + output_modalities: List[ImageOutputModality] + r"""Supported output modalities""" + + +class ImageModelArchitecture(BaseModel): + input_modalities: List[ + Annotated[InputModality, PlainValidator(validate_open_enum(False))] + ] + r"""Supported input modalities""" + + output_modalities: List[ + Annotated[ImageOutputModality, PlainValidator(validate_open_enum(False))] + ] + r"""Supported output modalities""" diff --git a/src/openrouter/components/imagemodelendpointsresponse.py b/src/openrouter/components/imagemodelendpointsresponse.py new file mode 100644 index 00000000..d97d1ee6 --- /dev/null +++ b/src/openrouter/components/imagemodelendpointsresponse.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imageendpoint import ImageEndpoint, ImageEndpointTypedDict +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ImageModelEndpointsResponseTypedDict(TypedDict): + r"""The full per-endpoint records for an image model.""" + + endpoints: List[ImageEndpointTypedDict] + id: str + r"""Model slug""" + + +class ImageModelEndpointsResponse(BaseModel): + r"""The full per-endpoint records for an image model.""" + + endpoints: List[ImageEndpoint] + + id: str + r"""Model slug""" diff --git a/src/openrouter/components/imagemodellistitem.py b/src/openrouter/components/imagemodellistitem.py new file mode 100644 index 00000000..f2bb3e29 --- /dev/null +++ b/src/openrouter/components/imagemodellistitem.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .capabilitydescriptor import CapabilityDescriptor, CapabilityDescriptorTypedDict +from .imagemodelarchitecture import ( + ImageModelArchitecture, + ImageModelArchitectureTypedDict, +) +from openrouter.types import BaseModel +from typing import Dict +from typing_extensions import TypedDict + + +class ImageModelListItemTypedDict(TypedDict): + r"""A single image model in the discovery listing.""" + + architecture: ImageModelArchitectureTypedDict + created: int + r"""Unix timestamp (seconds) of when the model was created""" + description: str + endpoints: str + r"""Relative URL to the full per-endpoint records for this model""" + id: str + r"""Model slug""" + name: str + r"""Display name""" + supported_parameters: Dict[str, CapabilityDescriptorTypedDict] + r"""Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL.""" + supports_streaming: bool + r"""Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints.""" + + +class ImageModelListItem(BaseModel): + r"""A single image model in the discovery listing.""" + + architecture: ImageModelArchitecture + + created: int + r"""Unix timestamp (seconds) of when the model was created""" + + description: str + + endpoints: str + r"""Relative URL to the full per-endpoint records for this model""" + + id: str + r"""Model slug""" + + name: str + r"""Display name""" + + supported_parameters: Dict[str, CapabilityDescriptor] + r"""Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL.""" + + supports_streaming: bool + r"""Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints.""" diff --git a/src/openrouter/components/imagemodelslistresponse.py b/src/openrouter/components/imagemodelslistresponse.py new file mode 100644 index 00000000..d36ed632 --- /dev/null +++ b/src/openrouter/components/imagemodelslistresponse.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imagemodellistitem import ImageModelListItem, ImageModelListItemTypedDict +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ImageModelsListResponseTypedDict(TypedDict): + r"""List of image generation models.""" + + data: List[ImageModelListItemTypedDict] + + +class ImageModelsListResponse(BaseModel): + r"""List of image generation models.""" + + data: List[ImageModelListItem] diff --git a/src/openrouter/components/imageoutputmodality.py b/src/openrouter/components/imageoutputmodality.py new file mode 100644 index 00000000..9c5a7a43 --- /dev/null +++ b/src/openrouter/components/imageoutputmodality.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +ImageOutputModality = Union[ + Literal[ + "text", + "image", + "embeddings", + "audio", + "video", + "rerank", + "speech", + "transcription", + ], + UnrecognizedStr, +] diff --git a/src/openrouter/components/imagepricingentry.py b/src/openrouter/components/imagepricingentry.py new file mode 100644 index 00000000..8a870046 --- /dev/null +++ b/src/openrouter/components/imagepricingentry.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UnrecognizedStr +from openrouter.utils import validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +Billable = Union[ + Literal[ + "output_image", + "input_image", + "input_font", + "input_reference", + "input_text", + ], + UnrecognizedStr, +] + + +Unit = Union[ + Literal[ + "image", + "megapixel", + "token", + ], + UnrecognizedStr, +] + + +class ImagePricingEntryTypedDict(TypedDict): + r"""One billable pricing line for an image provider.""" + + billable: Billable + cost_usd: float + unit: Unit + variant: NotRequired[str] + + +class ImagePricingEntry(BaseModel): + r"""One billable pricing line for an image provider.""" + + billable: Annotated[Billable, PlainValidator(validate_open_enum(False))] + + cost_usd: float + + unit: Annotated[Unit, PlainValidator(validate_open_enum(False))] + + variant: Optional[str] = None diff --git a/src/openrouter/components/imagestreamingresponse.py b/src/openrouter/components/imagestreamingresponse.py new file mode 100644 index 00000000..74c8f066 --- /dev/null +++ b/src/openrouter/components/imagestreamingresponse.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imagegencompletedevent import ( + ImageGenCompletedEvent, + ImageGenCompletedEventTypedDict, +) +from .imagegenpartialimageevent import ( + ImageGenPartialImageEvent, + ImageGenPartialImageEventTypedDict, +) +from .imagegenstreamerrorevent import ( + ImageGenStreamErrorEvent, + ImageGenStreamErrorEventTypedDict, +) +from openrouter.types import BaseModel +from openrouter.utils import get_discriminator +from pydantic import Discriminator, Tag +from typing import Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +ImageStreamingResponseDataTypedDict = TypeAliasType( + "ImageStreamingResponseDataTypedDict", + Union[ + ImageGenStreamErrorEventTypedDict, + ImageGenPartialImageEventTypedDict, + ImageGenCompletedEventTypedDict, + ], +) + + +ImageStreamingResponseData = Annotated[ + Union[ + Annotated[ImageGenPartialImageEvent, Tag("image_generation.partial_image")], + Annotated[ImageGenCompletedEvent, Tag("image_generation.completed")], + Annotated[ImageGenStreamErrorEvent, Tag("error")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] + + +class ImageStreamingResponseTypedDict(TypedDict): + data: ImageStreamingResponseDataTypedDict + + +class ImageStreamingResponse(BaseModel): + data: ImageStreamingResponseData diff --git a/src/openrouter/components/messagesrequest.py b/src/openrouter/components/messagesrequest.py index 2f93bcfc..2ccd8d8f 100644 --- a/src/openrouter/components/messagesrequest.py +++ b/src/openrouter/components/messagesrequest.py @@ -298,11 +298,11 @@ class ContextManagement(BaseModel): edits: Optional[List[Edit]] = None -class MetadataTypedDict(TypedDict): +class MessagesRequestMetadataTypedDict(TypedDict): user_id: NotRequired[Nullable[str]] -class Metadata(BaseModel): +class MessagesRequestMetadata(BaseModel): user_id: OptionalNullable[str] = UNSET @model_serializer(mode="wrap") @@ -1050,7 +1050,7 @@ class MessagesRequestTypedDict(TypedDict): fallbacks: NotRequired[Nullable[List[MessagesFallbackParamTypedDict]]] r"""Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries.""" max_tokens: NotRequired[int] - metadata: NotRequired[MetadataTypedDict] + metadata: NotRequired[MessagesRequestMetadataTypedDict] models: NotRequired[List[str]] output_config: NotRequired[MessagesOutputConfigTypedDict] r"""Configuration for controlling output behavior. Supports the effort parameter and structured output format.""" @@ -1096,7 +1096,7 @@ class MessagesRequest(BaseModel): max_tokens: Optional[int] = None - metadata: Optional[Metadata] = None + metadata: Optional[MessagesRequestMetadata] = None models: Optional[List[str]] = None diff --git a/src/openrouter/components/model.py b/src/openrouter/components/model.py index 637b3fbe..c0345109 100644 --- a/src/openrouter/components/model.py +++ b/src/openrouter/components/model.py @@ -5,6 +5,7 @@ from .modelarchitecture import ModelArchitecture, ModelArchitectureTypedDict from .modelbenchmarks import ModelBenchmarks, ModelBenchmarksTypedDict from .modellinks import ModelLinks, ModelLinksTypedDict +from .modelreasoning import ModelReasoning, ModelReasoningTypedDict from .parameter import Parameter from .perrequestlimits import PerRequestLimits, PerRequestLimitsTypedDict from .publicpricing import PublicPricing, PublicPricingTypedDict @@ -62,6 +63,8 @@ class ModelTypedDict(TypedDict): r"""Hugging Face model identifier, if applicable""" knowledge_cutoff: NotRequired[Nullable[str]] r"""The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown.""" + reasoning: NotRequired[ModelReasoningTypedDict] + r"""Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models.""" class Model(BaseModel): @@ -123,6 +126,9 @@ class Model(BaseModel): knowledge_cutoff: OptionalNullable[str] = UNSET r"""The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown.""" + reasoning: Optional[ModelReasoning] = None + r"""Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -131,6 +137,7 @@ def serialize_model(self, handler): "expiration_date", "hugging_face_id", "knowledge_cutoff", + "reasoning", ] nullable_fields = [ "context_length", diff --git a/src/openrouter/components/modelreasoning.py b/src/openrouter/components/modelreasoning.py new file mode 100644 index 00000000..fa73b90a --- /dev/null +++ b/src/openrouter/components/modelreasoning.py @@ -0,0 +1,107 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .reasoningeffort import ReasoningEffort +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +DefaultEffort = Union[ + Literal[ + "max", + "xhigh", + "high", + "medium", + "low", + "minimal", + "none", + ], + UnrecognizedStr, +] +r"""Default reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `\"none\"`, prefer omitting effort unless the user explicitly disables reasoning.""" + + +class ModelReasoningTypedDict(TypedDict): + r"""Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models.""" + + mandatory: bool + r"""When true, reasoning cannot be disabled and effort \"none\" is rejected.""" + default_effort: NotRequired[Nullable[DefaultEffort]] + default_enabled: NotRequired[bool] + r"""Default reasoning enabled state when the client does not set `reasoning.enabled`.""" + supported_efforts: NotRequired[Nullable[List[Nullable[ReasoningEffort]]]] + r"""Allowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted.""" + supports_max_tokens: NotRequired[bool] + r"""Present and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise.""" + + +class ModelReasoning(BaseModel): + r"""Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models.""" + + mandatory: bool + r"""When true, reasoning cannot be disabled and effort \"none\" is rejected.""" + + default_effort: Annotated[ + OptionalNullable[DefaultEffort], PlainValidator(validate_open_enum(False)) + ] = UNSET + + default_enabled: Optional[bool] = None + r"""Default reasoning enabled state when the client does not set `reasoning.enabled`.""" + + supported_efforts: OptionalNullable[ + List[ + Annotated[ + Nullable[ReasoningEffort], PlainValidator(validate_open_enum(False)) + ] + ] + ] = UNSET + r"""Allowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted.""" + + supports_max_tokens: Optional[bool] = None + r"""Present and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "default_effort", + "default_enabled", + "supported_efforts", + "supports_max_tokens", + ] + nullable_fields = ["default_effort", "supported_efforts"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/observabilityarizedestination.py b/src/openrouter/components/observabilityarizedestination.py index 142a548b..fdcc98dd 100644 --- a/src/openrouter/components/observabilityarizedestination.py +++ b/src/openrouter/components/observabilityarizedestination.py @@ -15,6 +15,7 @@ class ObservabilityArizeDestinationConfigTypedDict(TypedDict): api_key: str model_id: str + r"""The name of the tracing project in Arize AX""" space_key: str base_url: NotRequired[str] headers: NotRequired[Dict[str, str]] @@ -25,6 +26,7 @@ class ObservabilityArizeDestinationConfig(BaseModel): api_key: Annotated[str, pydantic.Field(alias="apiKey")] model_id: Annotated[str, pydantic.Field(alias="modelId")] + r"""The name of the tracing project in Arize AX""" space_key: Annotated[str, pydantic.Field(alias="spaceKey")] diff --git a/src/openrouter/components/openresponsesresult.py b/src/openrouter/components/openresponsesresult.py index 60eaf9f1..d53fb70e 100644 --- a/src/openrouter/components/openresponsesresult.py +++ b/src/openrouter/components/openresponsesresult.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .apierrortype import APIErrorType from .applypatchservertool import ApplyPatchServerTool, ApplyPatchServerToolTypedDict from .baseinputs_union import BaseInputsUnion, BaseInputsUnionTypedDict from .basereasoningconfig import BaseReasoningConfig, BaseReasoningConfigTypedDict @@ -203,6 +204,8 @@ class OpenResponsesResultTypedDict(TypedDict): usage: NotRequired[Nullable[UsageTypedDict]] r"""Token usage information for the response""" user: NotRequired[Nullable[str]] + error_type: NotRequired[APIErrorType] + r"""Canonical OpenRouter error type, stable across all API formats""" openrouter_metadata: NotRequired[OpenRouterMetadataTypedDict] @@ -285,6 +288,11 @@ class OpenResponsesResult(BaseModel): user: OptionalNullable[str] = UNSET + error_type: Annotated[ + Optional[APIErrorType], PlainValidator(validate_open_enum(False)) + ] = None + r"""Canonical OpenRouter error type, stable across all API formats""" + openrouter_metadata: Optional[OpenRouterMetadata] = None @model_serializer(mode="wrap") @@ -306,6 +314,7 @@ def serialize_model(self, handler): "truncation", "usage", "user", + "error_type", "openrouter_metadata", ] nullable_fields = [ diff --git a/src/openrouter/components/providername.py b/src/openrouter/components/providername.py index bcf5ebc0..2f739208 100644 --- a/src/openrouter/components/providername.py +++ b/src/openrouter/components/providername.py @@ -84,6 +84,7 @@ "Stealth", "StreamLake", "Switchpoint", + "Tenstorrent", "Together", "Upstage", "Venice", diff --git a/src/openrouter/components/provideroptions.py b/src/openrouter/components/provideroptions.py index f5675d66..dfda74d7 100644 --- a/src/openrouter/components/provideroptions.py +++ b/src/openrouter/components/provideroptions.py @@ -115,6 +115,7 @@ class ProviderOptionsTypedDict(TypedDict): streamlake: NotRequired[Dict[str, Nullable[Any]]] switchpoint: NotRequired[Dict[str, Nullable[Any]]] targon: NotRequired[Dict[str, Nullable[Any]]] + tenstorrent: NotRequired[Dict[str, Nullable[Any]]] together: NotRequired[Dict[str, Nullable[Any]]] together_lite: NotRequired[Dict[str, Nullable[Any]]] ubicloud: NotRequired[Dict[str, Nullable[Any]]] @@ -380,6 +381,8 @@ class ProviderOptions(BaseModel): targon: Optional[Dict[str, Nullable[Any]]] = None + tenstorrent: Optional[Dict[str, Nullable[Any]]] = None + together: Optional[Dict[str, Nullable[Any]]] = None together_lite: Annotated[ diff --git a/src/openrouter/components/providerresponse.py b/src/openrouter/components/providerresponse.py index be63eef0..3ce78d77 100644 --- a/src/openrouter/components/providerresponse.py +++ b/src/openrouter/components/providerresponse.py @@ -117,6 +117,7 @@ "Stealth", "StreamLake", "Switchpoint", + "Tenstorrent", "Together", "Upstage", "Venice", diff --git a/src/openrouter/components/rangecapability.py b/src/openrouter/components/rangecapability.py new file mode 100644 index 00000000..76fabc08 --- /dev/null +++ b/src/openrouter/components/rangecapability.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +RangeCapabilityType = Literal["range",] + + +class RangeCapabilityTypedDict(TypedDict): + r"""A parameter that accepts any value within an inclusive numeric range.""" + + max: float + min: float + type: RangeCapabilityType + + +class RangeCapability(BaseModel): + r"""A parameter that accepts any value within an inclusive numeric range.""" + + max: float + + min: float + + type: RangeCapabilityType diff --git a/src/openrouter/components/reasoningeffort.py b/src/openrouter/components/reasoningeffort.py index 3cf5b2e3..fe3562c7 100644 --- a/src/openrouter/components/reasoningeffort.py +++ b/src/openrouter/components/reasoningeffort.py @@ -7,6 +7,7 @@ ReasoningEffort = Union[ Literal[ + "max", "xhigh", "high", "medium", diff --git a/src/openrouter/components/responsesrequest.py b/src/openrouter/components/responsesrequest.py index 8f4b2a3e..683fab4a 100644 --- a/src/openrouter/components/responsesrequest.py +++ b/src/openrouter/components/responsesrequest.py @@ -16,6 +16,7 @@ ) from .autorouterplugin import AutoRouterPlugin, AutoRouterPluginTypedDict from .bashservertool import BashServerTool, BashServerToolTypedDict +from .chatdebugoptions import ChatDebugOptions, ChatDebugOptionsTypedDict from .chatsearchmodelsservertool import ( ChatSearchModelsServerTool, ChatSearchModelsServerToolTypedDict, @@ -291,6 +292,8 @@ class ResponsesRequestTypedDict(TypedDict): background: NotRequired[Nullable[bool]] cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + debug: NotRequired[ChatDebugOptionsTypedDict] + r"""Debug options for inspecting request transformations (streaming only)""" frequency_penalty: NotRequired[Nullable[float]] image_config: NotRequired[Dict[str, ImageConfigTypedDict]] r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details.""" @@ -348,6 +351,9 @@ class ResponsesRequest(BaseModel): cache_control: Optional[AnthropicCacheControlDirective] = None r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + debug: Optional[ChatDebugOptions] = None + r"""Debug options for inspecting request transformations (streaming only)""" + frequency_penalty: OptionalNullable[float] = UNSET image_config: Optional[Dict[str, ImageConfig]] = None @@ -448,6 +454,7 @@ def serialize_model(self, handler): optional_fields = [ "background", "cache_control", + "debug", "frequency_penalty", "image_config", "include", diff --git a/src/openrouter/components/streamevents.py b/src/openrouter/components/streamevents.py index b1e1e147..0761a961 100644 --- a/src/openrouter/components/streamevents.py +++ b/src/openrouter/components/streamevents.py @@ -20,6 +20,7 @@ CustomToolCallInputDoneEvent, CustomToolCallInputDoneEventTypedDict, ) +from .debugevent import DebugEvent, DebugEventTypedDict from .errorevent import ErrorEvent, ErrorEventTypedDict from .functioncallargsdeltaevent import ( FunctionCallArgsDeltaEvent, @@ -152,34 +153,35 @@ StreamEventsTypedDict = TypeAliasType( "StreamEventsTypedDict", Union[ - OpenResponsesCreatedEventTypedDict, + DebugEventTypedDict, OpenResponsesInProgressEventTypedDict, StreamEventsResponseCompletedTypedDict, StreamEventsResponseIncompleteTypedDict, StreamEventsResponseFailedTypedDict, - FusionCallInProgressEventTypedDict, + OpenResponsesCreatedEventTypedDict, + FusionCallCompletedEventTypedDict, + StreamEventsResponseOutputItemAddedTypedDict, WebSearchCallCompletedEventTypedDict, StreamEventsResponseOutputItemDoneTypedDict, - FusionCallCompletedEventTypedDict, ImageGenCallInProgressEventTypedDict, - StreamEventsResponseOutputItemAddedTypedDict, - ImageGenCallCompletedEventTypedDict, ImageGenCallGeneratingEventTypedDict, + ImageGenCallCompletedEventTypedDict, + FusionCallInProgressEventTypedDict, WebSearchCallInProgressEventTypedDict, WebSearchCallSearchingEventTypedDict, - FusionCallAnalysisInProgressEventTypedDict, + FusionCallPanelAddedEventTypedDict, CustomToolCallInputDoneEventTypedDict, CustomToolCallInputDeltaEventTypedDict, - FunctionCallArgsDeltaEventTypedDict, ApplyPatchCallOperationDiffDeltaEventTypedDict, - ErrorEventTypedDict, + FunctionCallArgsDeltaEventTypedDict, ApplyPatchCallOperationDiffDoneEventTypedDict, - FusionCallPanelAddedEventTypedDict, + FusionCallAnalysisInProgressEventTypedDict, FusionCallAnalysisCompletedEventTypedDict, - ReasoningSummaryPartDoneEventTypedDict, - RefusalDoneEventTypedDict, + ErrorEventTypedDict, ReasoningSummaryTextDoneEventTypedDict, + RefusalDoneEventTypedDict, ReasoningSummaryTextDeltaEventTypedDict, + ReasoningSummaryPartDoneEventTypedDict, ReasoningSummaryPartAddedEventTypedDict, ReasoningDoneEventTypedDict, ReasoningDeltaEventTypedDict, @@ -187,13 +189,13 @@ ContentPartAddedEventTypedDict, ImageGenCallPartialImageEventTypedDict, RefusalDeltaEventTypedDict, - ContentPartDoneEventTypedDict, FusionCallPanelDeltaEventTypedDict, FusionCallPanelReasoningDeltaEventTypedDict, FusionCallPanelCompletedEventTypedDict, - FusionCallPanelFailedEventTypedDict, - TextDeltaEventTypedDict, + ContentPartDoneEventTypedDict, TextDoneEventTypedDict, + TextDeltaEventTypedDict, + FusionCallPanelFailedEventTypedDict, AnnotationAddedEventTypedDict, ], ) @@ -221,6 +223,7 @@ Annotated[ CustomToolCallInputDoneEvent, Tag("response.custom_tool_call_input.done") ], + Annotated[DebugEvent, Tag("response.debug")], Annotated[StreamEventsResponseFailed, Tag("response.failed")], Annotated[ FunctionCallArgsDeltaEvent, Tag("response.function_call_arguments.delta") diff --git a/src/openrouter/components/subagentreasoning.py b/src/openrouter/components/subagentreasoning.py index 1eb4e862..d2d50815 100644 --- a/src/openrouter/components/subagentreasoning.py +++ b/src/openrouter/components/subagentreasoning.py @@ -10,6 +10,7 @@ SubagentReasoningEffort = Union[ Literal[ + "max", "xhigh", "high", "medium", diff --git a/src/openrouter/components/taskclassificationitem.py b/src/openrouter/components/taskclassificationitem.py new file mode 100644 index 00000000..ec4567ed --- /dev/null +++ b/src/openrouter/components/taskclassificationitem.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .taskclassificationmodel import ( + TaskClassificationModel, + TaskClassificationModelTypedDict, +) +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class TaskClassificationItemTypedDict(TypedDict): + category_token_share: float + r"""Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`.""" + category_usage_share: float + r"""Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`.""" + display_name: str + r"""Human-readable label for the classification.""" + macro_category: str + r"""Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`.""" + models: List[TaskClassificationModelTypedDict] + r"""Top models for this classification by request volume, sorted descending. Each entry reports the model's share of this classification's requests and tokens.""" + tag: str + r"""Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`).""" + token_share: float + r"""Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator.""" + usage_share: float + r"""Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator.""" + + +class TaskClassificationItem(BaseModel): + category_token_share: float + r"""Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`.""" + + category_usage_share: float + r"""Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`.""" + + display_name: str + r"""Human-readable label for the classification.""" + + macro_category: str + r"""Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`.""" + + models: List[TaskClassificationModel] + r"""Top models for this classification by request volume, sorted descending. Each entry reports the model's share of this classification's requests and tokens.""" + + tag: str + r"""Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`).""" + + token_share: float + r"""Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator.""" + + usage_share: float + r"""Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator.""" diff --git a/src/openrouter/components/taskclassificationmacrocategory.py b/src/openrouter/components/taskclassificationmacrocategory.py new file mode 100644 index 00000000..c9def1e6 --- /dev/null +++ b/src/openrouter/components/taskclassificationmacrocategory.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class TaskClassificationMacroCategoryTypedDict(TypedDict): + key: str + r"""Macro-category identifier.""" + label: str + r"""Human-readable label for the macro-category.""" + token_share: float + r"""Combined token share of all classifications in this macro-category (0–1).""" + usage_share: float + r"""Combined usage share of all classifications in this macro-category (0–1).""" + + +class TaskClassificationMacroCategory(BaseModel): + key: str + r"""Macro-category identifier.""" + + label: str + r"""Human-readable label for the macro-category.""" + + token_share: float + r"""Combined token share of all classifications in this macro-category (0–1).""" + + usage_share: float + r"""Combined usage share of all classifications in this macro-category (0–1).""" diff --git a/src/openrouter/components/taskclassificationmodel.py b/src/openrouter/components/taskclassificationmodel.py new file mode 100644 index 00000000..72f490ab --- /dev/null +++ b/src/openrouter/components/taskclassificationmodel.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class TaskClassificationModelTypedDict(TypedDict): + id: str + r"""Model identifier (permaslug).""" + tag_token_share: float + r"""Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded).""" + tag_usage_share: float + r"""Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded).""" + + +class TaskClassificationModel(BaseModel): + id: str + r"""Model identifier (permaslug).""" + + tag_token_share: float + r"""Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded).""" + + tag_usage_share: float + r"""Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded).""" diff --git a/src/openrouter/components/taskclassificationresponse.py b/src/openrouter/components/taskclassificationresponse.py new file mode 100644 index 00000000..b88e852e --- /dev/null +++ b/src/openrouter/components/taskclassificationresponse.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .taskclassificationitem import ( + TaskClassificationItem, + TaskClassificationItemTypedDict, +) +from .taskclassificationmacrocategory import ( + TaskClassificationMacroCategory, + TaskClassificationMacroCategoryTypedDict, +) +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class TaskClassificationResponseDataTypedDict(TypedDict): + as_of: str + r"""UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that date.""" + classifications: List[TaskClassificationItemTypedDict] + r"""Per-task classification market-share data, sorted by usage_share descending.""" + macro_categories: List[TaskClassificationMacroCategoryTypedDict] + r"""Aggregate market-share data per macro-category (code, data, agent, general).""" + window_days: int + r"""Number of trailing days covered by this snapshot.""" + + +class TaskClassificationResponseData(BaseModel): + as_of: str + r"""UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that date.""" + + classifications: List[TaskClassificationItem] + r"""Per-task classification market-share data, sorted by usage_share descending.""" + + macro_categories: List[TaskClassificationMacroCategory] + r"""Aggregate market-share data per macro-category (code, data, agent, general).""" + + window_days: int + r"""Number of trailing days covered by this snapshot.""" + + +class TaskClassificationResponseTypedDict(TypedDict): + data: TaskClassificationResponseDataTypedDict + + +class TaskClassificationResponse(BaseModel): + data: TaskClassificationResponseData diff --git a/src/openrouter/components/benchmarkpricing.py b/src/openrouter/components/unifiedbenchmarkpricing.py similarity index 87% rename from src/openrouter/components/benchmarkpricing.py rename to src/openrouter/components/unifiedbenchmarkpricing.py index 3524f786..bad387ce 100644 --- a/src/openrouter/components/benchmarkpricing.py +++ b/src/openrouter/components/unifiedbenchmarkpricing.py @@ -5,7 +5,7 @@ from typing_extensions import TypedDict -class BenchmarkPricingTypedDict(TypedDict): +class UnifiedBenchmarkPricingTypedDict(TypedDict): r"""OpenRouter pricing per token for this model. Null if pricing is unavailable.""" completion: str @@ -14,7 +14,7 @@ class BenchmarkPricingTypedDict(TypedDict): r"""Cost per input token (USD, decimal string).""" -class BenchmarkPricing(BaseModel): +class UnifiedBenchmarkPricing(BaseModel): r"""OpenRouter pricing per token for this model. Null if pricing is unavailable.""" completion: str diff --git a/src/openrouter/components/benchmarksaaitem.py b/src/openrouter/components/unifiedbenchmarksaaitem.py similarity index 78% rename from src/openrouter/components/benchmarksaaitem.py rename to src/openrouter/components/unifiedbenchmarksaaitem.py index 2855ffe1..a01518d4 100644 --- a/src/openrouter/components/benchmarksaaitem.py +++ b/src/openrouter/components/unifiedbenchmarksaaitem.py @@ -1,46 +1,59 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .benchmarkpricing import BenchmarkPricing, BenchmarkPricingTypedDict +from .unifiedbenchmarkpricing import ( + UnifiedBenchmarkPricing, + UnifiedBenchmarkPricingTypedDict, +) from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL from pydantic import model_serializer +from typing import Literal from typing_extensions import TypedDict -class BenchmarksAAItemTypedDict(TypedDict): - aa_name: str - r"""Model name as listed on Artificial Analysis.""" +UnifiedBenchmarksAAItemSource = Literal["artificial-analysis",] +r"""Benchmark source discriminator.""" + + +class UnifiedBenchmarksAAItemTypedDict(TypedDict): agentic_index: Nullable[float] r"""Artificial Analysis Agentic Index composite score. Higher is better.""" coding_index: Nullable[float] r"""Artificial Analysis Coding Index composite score. Higher is better.""" + display_name: str + r"""Model name as listed on Artificial Analysis.""" intelligence_index: Nullable[float] r"""Artificial Analysis Intelligence Index composite score. Higher is better.""" model_permaslug: str r"""Stable OpenRouter model identifier.""" - pricing: Nullable[BenchmarkPricingTypedDict] + pricing: Nullable[UnifiedBenchmarkPricingTypedDict] r"""OpenRouter pricing per token for this model. Null if pricing is unavailable.""" + source: UnifiedBenchmarksAAItemSource + r"""Benchmark source discriminator.""" -class BenchmarksAAItem(BaseModel): - aa_name: str - r"""Model name as listed on Artificial Analysis.""" - +class UnifiedBenchmarksAAItem(BaseModel): agentic_index: Nullable[float] r"""Artificial Analysis Agentic Index composite score. Higher is better.""" coding_index: Nullable[float] r"""Artificial Analysis Coding Index composite score. Higher is better.""" + display_name: str + r"""Model name as listed on Artificial Analysis.""" + intelligence_index: Nullable[float] r"""Artificial Analysis Intelligence Index composite score. Higher is better.""" model_permaslug: str r"""Stable OpenRouter model identifier.""" - pricing: Nullable[BenchmarkPricing] + pricing: Nullable[UnifiedBenchmarkPricing] r"""OpenRouter pricing per token for this model. Null if pricing is unavailable.""" + source: UnifiedBenchmarksAAItemSource + r"""Benchmark source discriminator.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [] diff --git a/src/openrouter/components/benchmarksdaitem.py b/src/openrouter/components/unifiedbenchmarksdaitem.py similarity index 83% rename from src/openrouter/components/benchmarksdaitem.py rename to src/openrouter/components/unifiedbenchmarksdaitem.py index 7713e2e8..0bb8159d 100644 --- a/src/openrouter/components/benchmarksdaitem.py +++ b/src/openrouter/components/unifiedbenchmarksdaitem.py @@ -1,12 +1,20 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .benchmarkpricing import BenchmarkPricing, BenchmarkPricingTypedDict +from .unifiedbenchmarkpricing import ( + UnifiedBenchmarkPricing, + UnifiedBenchmarkPricingTypedDict, +) from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL from pydantic import model_serializer +from typing import Literal from typing_extensions import TypedDict +UnifiedBenchmarksDAItemSource = Literal["design-arena",] +r"""Benchmark source discriminator.""" + + class TournamentStatsTypedDict(TypedDict): r"""Placement distribution from tournament matches.""" @@ -67,7 +75,7 @@ def serialize_model(self, handler): return m -class BenchmarksDAItemTypedDict(TypedDict): +class UnifiedBenchmarksDAItemTypedDict(TypedDict): arena: str r"""Arena this ranking belongs to.""" avg_generation_time_ms: Nullable[float] @@ -79,16 +87,18 @@ class BenchmarksDAItemTypedDict(TypedDict): elo: float r"""ELO rating from head-to-head arena battles.""" model_permaslug: str - r"""Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models.""" - pricing: Nullable[BenchmarkPricingTypedDict] + r"""Stable OpenRouter model identifier when mapped; otherwise the upstream Design Arena model id.""" + pricing: Nullable[UnifiedBenchmarkPricingTypedDict] r"""OpenRouter pricing per token for this model. Null if pricing is unavailable.""" + source: UnifiedBenchmarksDAItemSource + r"""Benchmark source discriminator.""" tournament_stats: TournamentStatsTypedDict r"""Placement distribution from tournament matches.""" win_rate: float r"""Win rate as a percentage (0–100).""" -class BenchmarksDAItem(BaseModel): +class UnifiedBenchmarksDAItem(BaseModel): arena: str r"""Arena this ranking belongs to.""" @@ -105,11 +115,14 @@ class BenchmarksDAItem(BaseModel): r"""ELO rating from head-to-head arena battles.""" model_permaslug: str - r"""Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models.""" + r"""Stable OpenRouter model identifier when mapped; otherwise the upstream Design Arena model id.""" - pricing: Nullable[BenchmarkPricing] + pricing: Nullable[UnifiedBenchmarkPricing] r"""OpenRouter pricing per token for this model. Null if pricing is unavailable.""" + source: UnifiedBenchmarksDAItemSource + r"""Benchmark source discriminator.""" + tournament_stats: TournamentStats r"""Placement distribution from tournament matches.""" diff --git a/src/openrouter/components/unifiedbenchmarksmeta.py b/src/openrouter/components/unifiedbenchmarksmeta.py new file mode 100644 index 00000000..6106104d --- /dev/null +++ b/src/openrouter/components/unifiedbenchmarksmeta.py @@ -0,0 +1,95 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import Literal, Union +from typing_extensions import Annotated, TypedDict + + +UnifiedBenchmarksMetaSource = Union[ + Literal[ + "artificial-analysis", + "design-arena", + ], + UnrecognizedStr, +] +r"""The source filter applied, or null when all sources are returned.""" + + +UnifiedBenchmarksMetaVersion = Literal["v1",] +r"""Dataset version.""" + + +class UnifiedBenchmarksMetaTypedDict(TypedDict): + as_of: str + r"""ISO-8601 timestamp of when this data was last updated.""" + citation: Nullable[str] + r"""Required attribution when republishing this data, or null when results span multiple sources (attribute each item individually by its `source` discriminator).""" + model_count: int + r"""Number of unique models in the response.""" + source: Nullable[UnifiedBenchmarksMetaSource] + r"""The source filter applied, or null when all sources are returned.""" + source_url: Nullable[str] + r"""URL of the upstream data source, or null when results span multiple sources.""" + task_type: Nullable[str] + r"""The task_type filter applied, or null if showing all.""" + version: UnifiedBenchmarksMetaVersion + r"""Dataset version.""" + + +class UnifiedBenchmarksMeta(BaseModel): + as_of: str + r"""ISO-8601 timestamp of when this data was last updated.""" + + citation: Nullable[str] + r"""Required attribution when republishing this data, or null when results span multiple sources (attribute each item individually by its `source` discriminator).""" + + model_count: int + r"""Number of unique models in the response.""" + + source: Annotated[ + Nullable[UnifiedBenchmarksMetaSource], PlainValidator(validate_open_enum(False)) + ] + r"""The source filter applied, or null when all sources are returned.""" + + source_url: Nullable[str] + r"""URL of the upstream data source, or null when results span multiple sources.""" + + task_type: Nullable[str] + r"""The task_type filter applied, or null if showing all.""" + + version: UnifiedBenchmarksMetaVersion + r"""Dataset version.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [] + nullable_fields = ["citation", "source", "source_url", "task_type"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/unifiedbenchmarksresponse.py b/src/openrouter/components/unifiedbenchmarksresponse.py new file mode 100644 index 00000000..8f064226 --- /dev/null +++ b/src/openrouter/components/unifiedbenchmarksresponse.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .unifiedbenchmarksaaitem import ( + UnifiedBenchmarksAAItem, + UnifiedBenchmarksAAItemTypedDict, +) +from .unifiedbenchmarksdaitem import ( + UnifiedBenchmarksDAItem, + UnifiedBenchmarksDAItemTypedDict, +) +from .unifiedbenchmarksmeta import UnifiedBenchmarksMeta, UnifiedBenchmarksMetaTypedDict +from openrouter.types import BaseModel +from openrouter.utils import get_discriminator +from pydantic import Discriminator, Tag +from typing import List, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +UnifiedBenchmarksResponseDataTypedDict = TypeAliasType( + "UnifiedBenchmarksResponseDataTypedDict", + Union[UnifiedBenchmarksAAItemTypedDict, UnifiedBenchmarksDAItemTypedDict], +) + + +UnifiedBenchmarksResponseData = Annotated[ + Union[ + Annotated[UnifiedBenchmarksAAItem, Tag("artificial-analysis")], + Annotated[UnifiedBenchmarksDAItem, Tag("design-arena")], + ], + Discriminator(lambda m: get_discriminator(m, "source", "source")), +] + + +class UnifiedBenchmarksResponseTypedDict(TypedDict): + data: List[UnifiedBenchmarksResponseDataTypedDict] + meta: UnifiedBenchmarksMetaTypedDict + + +class UnifiedBenchmarksResponse(BaseModel): + data: List[UnifiedBenchmarksResponseData] + + meta: UnifiedBenchmarksMeta diff --git a/src/openrouter/components/videogenerationrequest.py b/src/openrouter/components/videogenerationrequest.py index ae3bd049..036db7d9 100644 --- a/src/openrouter/components/videogenerationrequest.py +++ b/src/openrouter/components/videogenerationrequest.py @@ -11,7 +11,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict -AspectRatio = Union[ +VideoGenerationRequestAspectRatio = Union[ Literal[ "16:9", "9:16", @@ -28,7 +28,7 @@ r"""Aspect ratio of the generated video""" -class OptionsTypedDict(TypedDict): +class VideoGenerationRequestOptionsTypedDict(TypedDict): r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.""" oneai: NotRequired[Dict[str, Nullable[Any]]] @@ -136,6 +136,7 @@ class OptionsTypedDict(TypedDict): streamlake: NotRequired[Dict[str, Nullable[Any]]] switchpoint: NotRequired[Dict[str, Nullable[Any]]] targon: NotRequired[Dict[str, Nullable[Any]]] + tenstorrent: NotRequired[Dict[str, Nullable[Any]]] together: NotRequired[Dict[str, Nullable[Any]]] together_lite: NotRequired[Dict[str, Nullable[Any]]] ubicloud: NotRequired[Dict[str, Nullable[Any]]] @@ -148,7 +149,7 @@ class OptionsTypedDict(TypedDict): z_ai: NotRequired[Dict[str, Nullable[Any]]] -class Options(BaseModel): +class VideoGenerationRequestOptions(BaseModel): r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.""" oneai: Annotated[ @@ -401,6 +402,8 @@ class Options(BaseModel): targon: Optional[Dict[str, Nullable[Any]]] = None + tenstorrent: Optional[Dict[str, Nullable[Any]]] = None + together: Optional[Dict[str, Nullable[Any]]] = None together_lite: Annotated[ @@ -429,16 +432,16 @@ class Options(BaseModel): class VideoGenerationRequestProviderTypedDict(TypedDict): r"""Provider-specific passthrough configuration""" - options: NotRequired[OptionsTypedDict] + options: NotRequired[VideoGenerationRequestOptionsTypedDict] class VideoGenerationRequestProvider(BaseModel): r"""Provider-specific passthrough configuration""" - options: Optional[Options] = None + options: Optional[VideoGenerationRequestOptions] = None -Resolution = Union[ +VideoGenerationRequestResolution = Union[ Literal[ "480p", "720p", @@ -455,7 +458,7 @@ class VideoGenerationRequestProvider(BaseModel): class VideoGenerationRequestTypedDict(TypedDict): model: str prompt: str - aspect_ratio: NotRequired[AspectRatio] + aspect_ratio: NotRequired[VideoGenerationRequestAspectRatio] r"""Aspect ratio of the generated video""" callback_url: NotRequired[str] r"""URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS.""" @@ -469,7 +472,7 @@ class VideoGenerationRequestTypedDict(TypedDict): r"""Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0); other providers use image references and ignore the rest.""" provider: NotRequired[VideoGenerationRequestProviderTypedDict] r"""Provider-specific passthrough configuration""" - resolution: NotRequired[Resolution] + resolution: NotRequired[VideoGenerationRequestResolution] r"""Resolution of the generated video""" seed: NotRequired[int] r"""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.""" @@ -483,7 +486,8 @@ class VideoGenerationRequest(BaseModel): prompt: str aspect_ratio: Annotated[ - Optional[AspectRatio], PlainValidator(validate_open_enum(False)) + Optional[VideoGenerationRequestAspectRatio], + PlainValidator(validate_open_enum(False)), ] = None r"""Aspect ratio of the generated video""" @@ -506,7 +510,8 @@ class VideoGenerationRequest(BaseModel): r"""Provider-specific passthrough configuration""" resolution: Annotated[ - Optional[Resolution], PlainValidator(validate_open_enum(False)) + Optional[VideoGenerationRequestResolution], + PlainValidator(validate_open_enum(False)), ] = None r"""Resolution of the generated video""" diff --git a/src/openrouter/datasets.py b/src/openrouter/datasets.py index c80a941f..c4839125 100644 --- a/src/openrouter/datasets.py +++ b/src/openrouter/datasets.py @@ -426,542 +426,6 @@ async def empty_result(): raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - def get_benchmarks_artificial_analysis( - self, - *, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - max_results: Optional[int] = 50, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.BenchmarksAAResponse: - r"""Artificial Analysis Benchmark Indices - - Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - - :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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param max_results: Max results to return (1–100, default 50). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetBenchmarksArtificialAnalysisRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - max_results=max_results, - ) - - req = self._build_request( - method="GET", - path="/datasets/benchmarks/artificial-analysis", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetBenchmarksArtificialAnalysisGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getBenchmarksArtificialAnalysis", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - ), - request=req, - error_status_codes=["400", "401", "429", "4XX", "500", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.BenchmarksAAResponse, http_res) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.TooManyRequestsResponseErrorData, http_res - ) - raise errors.TooManyRequestsResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def get_benchmarks_artificial_analysis_async( - self, - *, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - max_results: Optional[int] = 50, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.BenchmarksAAResponse: - r"""Artificial Analysis Benchmark Indices - - Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - - :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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param max_results: Max results to return (1–100, default 50). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetBenchmarksArtificialAnalysisRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - max_results=max_results, - ) - - req = self._build_request_async( - method="GET", - path="/datasets/benchmarks/artificial-analysis", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetBenchmarksArtificialAnalysisGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getBenchmarksArtificialAnalysis", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - ), - request=req, - error_status_codes=["400", "401", "429", "4XX", "500", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.BenchmarksAAResponse, http_res) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.TooManyRequestsResponseErrorData, http_res - ) - raise errors.TooManyRequestsResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def get_benchmarks_design_arena( - self, - *, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - arena: Optional[operations.Arena] = "models", - category: Optional[str] = None, - max_results: Optional[int] = 50, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.BenchmarksDAResponse: - r"""Design Arena Benchmark Rankings - - Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - - :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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param arena: Arena to query. Defaults to `models`. - :param category: Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - :param max_results: Max results to return: per category when no category filter is applied (1–100, default 50). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetBenchmarksDesignArenaRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - arena=arena, - category=category, - max_results=max_results, - ) - - req = self._build_request( - method="GET", - path="/datasets/benchmarks/design-arena", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetBenchmarksDesignArenaGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getBenchmarksDesignArena", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - ), - request=req, - error_status_codes=["400", "401", "429", "4XX", "500", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.BenchmarksDAResponse, http_res) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.TooManyRequestsResponseErrorData, http_res - ) - raise errors.TooManyRequestsResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def get_benchmarks_design_arena_async( - self, - *, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - arena: Optional[operations.Arena] = "models", - category: Optional[str] = None, - max_results: Optional[int] = 50, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.BenchmarksDAResponse: - r"""Design Arena Benchmark Rankings - - Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - - :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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param arena: Arena to query. Defaults to `models`. - :param category: Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - :param max_results: Max results to return: per category when no category filter is applied (1–100, default 50). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetBenchmarksDesignArenaRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - arena=arena, - category=category, - max_results=max_results, - ) - - req = self._build_request_async( - method="GET", - path="/datasets/benchmarks/design-arena", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetBenchmarksDesignArenaGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getBenchmarksDesignArena", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - ), - request=req, - error_status_codes=["400", "401", "429", "4XX", "500", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.BenchmarksDAResponse, http_res) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.TooManyRequestsResponseErrorData, http_res - ) - raise errors.TooManyRequestsResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - def get_rankings_daily( self, *, diff --git a/src/openrouter/images.py b/src/openrouter/images.py new file mode 100644 index 00000000..87b2682c --- /dev/null +++ b/src/openrouter/images.py @@ -0,0 +1,1319 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from enum import Enum +from openrouter import components, errors, operations, utils +from openrouter._hooks import HookContext +from openrouter.types import OptionalNullable, UNSET +from openrouter.utils import eventstreaming, get_security_from_env +from openrouter.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, List, Literal, Mapping, Optional, Union, overload + + +class GenerateAcceptEnum(str, Enum): + APPLICATION_JSON = "application/json" + TEXT_EVENT_STREAM = "text/event-stream" + + +class Images(BaseSDK): + r"""Images endpoints""" + + @overload + def generate( + self, + *, + model: str, + prompt: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None, + background: Optional[components.ImageGenerationRequestBackground] = None, + input_references: Optional[ + Union[ + List[components.ContentPartImage], + List[components.ContentPartImageTypedDict], + ] + ] = None, + n: Optional[int] = None, + output_compression: Optional[int] = None, + output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, + provider: Optional[ + Union[ + components.ImageGenerationRequestProvider, + components.ImageGenerationRequestProviderTypedDict, + ] + ] = None, + quality: Optional[components.ImageGenerationRequestQuality] = None, + resolution: Optional[components.ImageGenerationRequestResolution] = None, + seed: Optional[int] = None, + size: Optional[str] = None, + stream: Union[Literal[False], None] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ImageGenerationResponse: + r"""Generate an image + + Generates an image from a text prompt via the image generation router + + :param model: The image generation model to use + :param prompt: Text description of the desired image + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + :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: Number of images to generate (1-10). 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_format: Encoding of the returned image bytes. + :param provider: 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 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. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :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 retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + + @overload + def generate( + self, + *, + model: str, + prompt: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None, + background: Optional[components.ImageGenerationRequestBackground] = None, + input_references: Optional[ + Union[ + List[components.ContentPartImage], + List[components.ContentPartImageTypedDict], + ] + ] = None, + n: Optional[int] = None, + output_compression: Optional[int] = None, + output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, + provider: Optional[ + Union[ + components.ImageGenerationRequestProvider, + components.ImageGenerationRequestProviderTypedDict, + ] + ] = None, + quality: Optional[components.ImageGenerationRequestQuality] = None, + resolution: Optional[components.ImageGenerationRequestResolution] = None, + seed: Optional[int] = None, + size: Optional[str] = None, + stream: Literal[True], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[components.ImageStreamingResponseData]: + r"""Generate an image + + Generates an image from a text prompt via the image generation router + + :param model: The image generation model to use + :param prompt: Text description of the desired image + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + :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: Number of images to generate (1-10). 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_format: Encoding of the returned image bytes. + :param provider: 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 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. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :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 retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + + def generate( + self, + *, + model: str, + prompt: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None, + background: Optional[components.ImageGenerationRequestBackground] = None, + input_references: Optional[ + Union[ + List[components.ContentPartImage], + List[components.ContentPartImageTypedDict], + ] + ] = None, + n: Optional[int] = None, + output_compression: Optional[int] = None, + output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, + provider: Optional[ + Union[ + components.ImageGenerationRequestProvider, + components.ImageGenerationRequestProviderTypedDict, + ] + ] = None, + quality: Optional[components.ImageGenerationRequestQuality] = None, + resolution: Optional[components.ImageGenerationRequestResolution] = None, + seed: Optional[int] = None, + size: Optional[str] = None, + stream: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreateImagesResponse: + r"""Generate an image + + Generates an image from a text prompt via the image generation router + + :param model: The image generation model to use + :param prompt: Text description of the desired image + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + :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: Number of images to generate (1-10). 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_format: Encoding of the returned image bytes. + :param provider: 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 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. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :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 retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.CreateImagesRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + image_generation_request=components.ImageGenerationRequest( + aspect_ratio=aspect_ratio, + background=background, + input_references=utils.get_pydantic_model( + input_references, Optional[List[components.ContentPartImage]] + ), + model=model, + n=n, + output_compression=output_compression, + output_format=output_format, + prompt=prompt, + provider=utils.get_pydantic_model( + provider, Optional[components.ImageGenerationRequestProvider] + ), + quality=quality, + resolution=resolution, + seed=seed, + size=size, + stream=stream, + ), + ) + + req = self._build_request( + method="POST", + path="/images", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream" if stream else "application/json", + http_headers=http_headers, + _globals=operations.CreateImagesGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.image_generation_request, + False, + False, + "json", + components.ImageGenerationRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createImages", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "502", + "524", + "529", + "5XX", + ], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + http_res_text = utils.stream_to_text(http_res) + return unmarshal_json_response( + components.ImageGenerationResponse, http_res, http_res_text + ) + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json( + raw, components.ImageStreamingResponse + ).data, + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "400", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res, http_res_text + ) + raise errors.BadRequestResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "401", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res, http_res_text + ) + raise errors.UnauthorizedResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "402", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.PaymentRequiredResponseErrorData, http_res, http_res_text + ) + raise errors.PaymentRequiredResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "403", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res, http_res_text + ) + raise errors.ForbiddenResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "404", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res, http_res_text + ) + raise errors.NotFoundResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "429", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res, http_res_text + ) + raise errors.TooManyRequestsResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "500", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res, http_res_text + ) + raise errors.InternalServerResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "502", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res, http_res_text + ) + raise errors.BadGatewayResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "524", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.EdgeNetworkTimeoutResponseErrorData, http_res, http_res_text + ) + raise errors.EdgeNetworkTimeoutResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "529", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.ProviderOverloadedResponseErrorData, http_res, http_res_text + ) + raise errors.ProviderOverloadedResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "Unexpected response received", http_res, http_res_text + ) + + @overload + async def generate_async( + self, + *, + model: str, + prompt: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None, + background: Optional[components.ImageGenerationRequestBackground] = None, + input_references: Optional[ + Union[ + List[components.ContentPartImage], + List[components.ContentPartImageTypedDict], + ] + ] = None, + n: Optional[int] = None, + output_compression: Optional[int] = None, + output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, + provider: Optional[ + Union[ + components.ImageGenerationRequestProvider, + components.ImageGenerationRequestProviderTypedDict, + ] + ] = None, + quality: Optional[components.ImageGenerationRequestQuality] = None, + resolution: Optional[components.ImageGenerationRequestResolution] = None, + seed: Optional[int] = None, + size: Optional[str] = None, + stream: Union[Literal[False], None] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ImageGenerationResponse: + r"""Generate an image + + Generates an image from a text prompt via the image generation router + + :param model: The image generation model to use + :param prompt: Text description of the desired image + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + :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: Number of images to generate (1-10). 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_format: Encoding of the returned image bytes. + :param provider: 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 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. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :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 retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + + @overload + async def generate_async( + self, + *, + model: str, + prompt: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None, + background: Optional[components.ImageGenerationRequestBackground] = None, + input_references: Optional[ + Union[ + List[components.ContentPartImage], + List[components.ContentPartImageTypedDict], + ] + ] = None, + n: Optional[int] = None, + output_compression: Optional[int] = None, + output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, + provider: Optional[ + Union[ + components.ImageGenerationRequestProvider, + components.ImageGenerationRequestProviderTypedDict, + ] + ] = None, + quality: Optional[components.ImageGenerationRequestQuality] = None, + resolution: Optional[components.ImageGenerationRequestResolution] = None, + seed: Optional[int] = None, + size: Optional[str] = None, + stream: Literal[True], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[components.ImageStreamingResponseData]: + r"""Generate an image + + Generates an image from a text prompt via the image generation router + + :param model: The image generation model to use + :param prompt: Text description of the desired image + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + :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: Number of images to generate (1-10). 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_format: Encoding of the returned image bytes. + :param provider: 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 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. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :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 retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + + async def generate_async( + self, + *, + model: str, + prompt: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None, + background: Optional[components.ImageGenerationRequestBackground] = None, + input_references: Optional[ + Union[ + List[components.ContentPartImage], + List[components.ContentPartImageTypedDict], + ] + ] = None, + n: Optional[int] = None, + output_compression: Optional[int] = None, + output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, + provider: Optional[ + Union[ + components.ImageGenerationRequestProvider, + components.ImageGenerationRequestProviderTypedDict, + ] + ] = None, + quality: Optional[components.ImageGenerationRequestQuality] = None, + resolution: Optional[components.ImageGenerationRequestResolution] = None, + seed: Optional[int] = None, + size: Optional[str] = None, + stream: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreateImagesResponse: + r"""Generate an image + + Generates an image from a text prompt via the image generation router + + :param model: The image generation model to use + :param prompt: Text description of the desired image + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + :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: Number of images to generate (1-10). 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_format: Encoding of the returned image bytes. + :param provider: 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 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. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :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 retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.CreateImagesRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + image_generation_request=components.ImageGenerationRequest( + aspect_ratio=aspect_ratio, + background=background, + input_references=utils.get_pydantic_model( + input_references, Optional[List[components.ContentPartImage]] + ), + model=model, + n=n, + output_compression=output_compression, + output_format=output_format, + prompt=prompt, + provider=utils.get_pydantic_model( + provider, Optional[components.ImageGenerationRequestProvider] + ), + quality=quality, + resolution=resolution, + seed=seed, + size=size, + stream=stream, + ), + ) + + req = self._build_request_async( + method="POST", + path="/images", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream" if stream else "application/json", + http_headers=http_headers, + _globals=operations.CreateImagesGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.image_generation_request, + False, + False, + "json", + components.ImageGenerationRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createImages", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "502", + "524", + "529", + "5XX", + ], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + return unmarshal_json_response( + components.ImageGenerationResponse, http_res, http_res_text + ) + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json( + raw, components.ImageStreamingResponse + ).data, + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "400", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res, http_res_text + ) + raise errors.BadRequestResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "401", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res, http_res_text + ) + raise errors.UnauthorizedResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "402", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.PaymentRequiredResponseErrorData, http_res, http_res_text + ) + raise errors.PaymentRequiredResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "403", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res, http_res_text + ) + raise errors.ForbiddenResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "404", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res, http_res_text + ) + raise errors.NotFoundResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "429", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res, http_res_text + ) + raise errors.TooManyRequestsResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "500", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res, http_res_text + ) + raise errors.InternalServerResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "502", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res, http_res_text + ) + raise errors.BadGatewayResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "524", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.EdgeNetworkTimeoutResponseErrorData, http_res, http_res_text + ) + raise errors.EdgeNetworkTimeoutResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "529", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.ProviderOverloadedResponseErrorData, http_res, http_res_text + ) + raise errors.ProviderOverloadedResponseError( + response_data, http_res, http_res_text + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "Unexpected response received", http_res, http_res_text + ) + + def list_models( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ImageModelsListResponse: + r"""List image generation models + + Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records. + + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListImageModelsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + ) + + req = self._build_request( + method="GET", + path="/images/models", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListImageModelsGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listImageModels", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(components.ImageModelsListResponse, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_models_async( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ImageModelsListResponse: + r"""List image generation models + + Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records. + + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListImageModelsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + ) + + req = self._build_request_async( + method="GET", + path="/images/models", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListImageModelsGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listImageModels", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(components.ImageModelsListResponse, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def list_model_endpoints( + self, + *, + author: str, + slug: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ImageModelEndpointsResponse: + r"""List endpoints for an image model + + Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist. + + :param author: Model author/organization + :param slug: Model slug + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListImageModelEndpointsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + author=author, + slug=slug, + ) + + req = self._build_request( + method="GET", + path="/images/models/{author}/{slug}/endpoints", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListImageModelEndpointsGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listImageModelEndpoints", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ImageModelEndpointsResponse, http_res + ) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_model_endpoints_async( + self, + *, + author: str, + slug: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ImageModelEndpointsResponse: + r"""List endpoints for an image model + + Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist. + + :param author: Model author/organization + :param slug: Model slug + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListImageModelEndpointsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + author=author, + slug=slug, + ) + + req = self._build_request_async( + method="GET", + path="/images/models/{author}/{slug}/endpoints", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListImageModelEndpointsGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listImageModelEndpoints", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ImageModelEndpointsResponse, http_res + ) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 8b12f089..8bc044fc 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -81,6 +81,8 @@ ContentText, ContentTextTypedDict, ContentTypedDict, + CostDetails, + CostDetailsTypedDict, CreateEmbeddingsData, CreateEmbeddingsDataTypedDict, CreateEmbeddingsGlobals, @@ -117,6 +119,14 @@ CreateGuardrailRequest, CreateGuardrailRequestTypedDict, ) + from .createimages import ( + CreateImagesGlobals, + CreateImagesGlobalsTypedDict, + CreateImagesRequest, + CreateImagesRequestTypedDict, + CreateImagesResponse, + CreateImagesResponseTypedDict, + ) from .createkeys import ( CreateKeysData, CreateKeysDataTypedDict, @@ -290,18 +300,14 @@ GetAppRankingsSort, Subcategory, ) - from .getbenchmarksartificialanalysis import ( - GetBenchmarksArtificialAnalysisGlobals, - GetBenchmarksArtificialAnalysisGlobalsTypedDict, - GetBenchmarksArtificialAnalysisRequest, - GetBenchmarksArtificialAnalysisRequestTypedDict, - ) - from .getbenchmarksdesignarena import ( + from .getbenchmarks import ( Arena, - GetBenchmarksDesignArenaGlobals, - GetBenchmarksDesignArenaGlobalsTypedDict, - GetBenchmarksDesignArenaRequest, - GetBenchmarksDesignArenaRequestTypedDict, + GetBenchmarksGlobals, + GetBenchmarksGlobalsTypedDict, + GetBenchmarksRequest, + GetBenchmarksRequestTypedDict, + Source, + TaskType, ) from .getbyokkey import ( GetBYOKKeyGlobals, @@ -400,6 +406,13 @@ GetRankingsDailyRequest, GetRankingsDailyRequestTypedDict, ) + from .gettaskclassifications import ( + GetTaskClassificationsGlobals, + GetTaskClassificationsGlobalsTypedDict, + GetTaskClassificationsRequest, + GetTaskClassificationsRequestTypedDict, + Window, + ) from .getuseractivity import ( GetUserActivityGlobals, GetUserActivityGlobalsTypedDict, @@ -497,6 +510,18 @@ ListGuardrailsResponse, ListGuardrailsResponseTypedDict, ) + from .listimagemodelendpoints import ( + ListImageModelEndpointsGlobals, + ListImageModelEndpointsGlobalsTypedDict, + ListImageModelEndpointsRequest, + ListImageModelEndpointsRequestTypedDict, + ) + from .listimagemodels import ( + ListImageModelsGlobals, + ListImageModelsGlobalsTypedDict, + ListImageModelsRequest, + ListImageModelsRequestTypedDict, + ) from .listkeyassignments import ( ListKeyAssignmentsGlobals, ListKeyAssignmentsGlobalsTypedDict, @@ -723,6 +748,8 @@ "ContentText", "ContentTextTypedDict", "ContentTypedDict", + "CostDetails", + "CostDetailsTypedDict", "CreateAudioSpeechGlobals", "CreateAudioSpeechGlobalsTypedDict", "CreateAudioSpeechRequest", @@ -764,6 +791,12 @@ "CreateGuardrailGlobalsTypedDict", "CreateGuardrailRequest", "CreateGuardrailRequestTypedDict", + "CreateImagesGlobals", + "CreateImagesGlobalsTypedDict", + "CreateImagesRequest", + "CreateImagesRequestTypedDict", + "CreateImagesResponse", + "CreateImagesResponseTypedDict", "CreateKeysData", "CreateKeysDataTypedDict", "CreateKeysGlobals", @@ -899,14 +932,10 @@ "GetBYOKKeyGlobalsTypedDict", "GetBYOKKeyRequest", "GetBYOKKeyRequestTypedDict", - "GetBenchmarksArtificialAnalysisGlobals", - "GetBenchmarksArtificialAnalysisGlobalsTypedDict", - "GetBenchmarksArtificialAnalysisRequest", - "GetBenchmarksArtificialAnalysisRequestTypedDict", - "GetBenchmarksDesignArenaGlobals", - "GetBenchmarksDesignArenaGlobalsTypedDict", - "GetBenchmarksDesignArenaRequest", - "GetBenchmarksDesignArenaRequestTypedDict", + "GetBenchmarksGlobals", + "GetBenchmarksGlobalsTypedDict", + "GetBenchmarksRequest", + "GetBenchmarksRequestTypedDict", "GetCreditsData", "GetCreditsDataTypedDict", "GetCreditsGlobals", @@ -969,6 +998,10 @@ "GetRankingsDailyGlobalsTypedDict", "GetRankingsDailyRequest", "GetRankingsDailyRequestTypedDict", + "GetTaskClassificationsGlobals", + "GetTaskClassificationsGlobalsTypedDict", + "GetTaskClassificationsRequest", + "GetTaskClassificationsRequestTypedDict", "GetUserActivityGlobals", "GetUserActivityGlobalsTypedDict", "GetUserActivityRequest", @@ -1045,6 +1078,14 @@ "ListGuardrailsRequestTypedDict", "ListGuardrailsResponse", "ListGuardrailsResponseTypedDict", + "ListImageModelEndpointsGlobals", + "ListImageModelEndpointsGlobalsTypedDict", + "ListImageModelEndpointsRequest", + "ListImageModelEndpointsRequestTypedDict", + "ListImageModelsGlobals", + "ListImageModelsGlobalsTypedDict", + "ListImageModelsRequest", + "ListImageModelsRequestTypedDict", "ListKeyAssignmentsGlobals", "ListKeyAssignmentsGlobalsTypedDict", "ListKeyAssignmentsRequest", @@ -1163,7 +1204,9 @@ "SendChatCompletionRequestRequestTypedDict", "SendChatCompletionRequestResponse", "SendChatCompletionRequestResponseTypedDict", + "Source", "Subcategory", + "TaskType", "TimeRange", "TimeRangeTypedDict", "TypeImageURL", @@ -1211,6 +1254,7 @@ "Value2", "Value2TypedDict", "ValueType", + "Window", "Zdr", ] @@ -1269,6 +1313,8 @@ "ContentText": ".createembeddings", "ContentTextTypedDict": ".createembeddings", "ContentTypedDict": ".createembeddings", + "CostDetails": ".createembeddings", + "CostDetailsTypedDict": ".createembeddings", "CreateEmbeddingsData": ".createembeddings", "CreateEmbeddingsDataTypedDict": ".createembeddings", "CreateEmbeddingsGlobals": ".createembeddings", @@ -1302,6 +1348,12 @@ "CreateGuardrailGlobalsTypedDict": ".createguardrail", "CreateGuardrailRequest": ".createguardrail", "CreateGuardrailRequestTypedDict": ".createguardrail", + "CreateImagesGlobals": ".createimages", + "CreateImagesGlobalsTypedDict": ".createimages", + "CreateImagesRequest": ".createimages", + "CreateImagesRequestTypedDict": ".createimages", + "CreateImagesResponse": ".createimages", + "CreateImagesResponseTypedDict": ".createimages", "CreateKeysData": ".createkeys", "CreateKeysDataTypedDict": ".createkeys", "CreateKeysGlobals": ".createkeys", @@ -1435,15 +1487,13 @@ "GetAppRankingsResponseTypedDict": ".getapprankings", "GetAppRankingsSort": ".getapprankings", "Subcategory": ".getapprankings", - "GetBenchmarksArtificialAnalysisGlobals": ".getbenchmarksartificialanalysis", - "GetBenchmarksArtificialAnalysisGlobalsTypedDict": ".getbenchmarksartificialanalysis", - "GetBenchmarksArtificialAnalysisRequest": ".getbenchmarksartificialanalysis", - "GetBenchmarksArtificialAnalysisRequestTypedDict": ".getbenchmarksartificialanalysis", - "Arena": ".getbenchmarksdesignarena", - "GetBenchmarksDesignArenaGlobals": ".getbenchmarksdesignarena", - "GetBenchmarksDesignArenaGlobalsTypedDict": ".getbenchmarksdesignarena", - "GetBenchmarksDesignArenaRequest": ".getbenchmarksdesignarena", - "GetBenchmarksDesignArenaRequestTypedDict": ".getbenchmarksdesignarena", + "Arena": ".getbenchmarks", + "GetBenchmarksGlobals": ".getbenchmarks", + "GetBenchmarksGlobalsTypedDict": ".getbenchmarks", + "GetBenchmarksRequest": ".getbenchmarks", + "GetBenchmarksRequestTypedDict": ".getbenchmarks", + "Source": ".getbenchmarks", + "TaskType": ".getbenchmarks", "GetBYOKKeyGlobals": ".getbyokkey", "GetBYOKKeyGlobalsTypedDict": ".getbyokkey", "GetBYOKKeyRequest": ".getbyokkey", @@ -1515,6 +1565,11 @@ "GetRankingsDailyGlobalsTypedDict": ".getrankingsdaily", "GetRankingsDailyRequest": ".getrankingsdaily", "GetRankingsDailyRequestTypedDict": ".getrankingsdaily", + "GetTaskClassificationsGlobals": ".gettaskclassifications", + "GetTaskClassificationsGlobalsTypedDict": ".gettaskclassifications", + "GetTaskClassificationsRequest": ".gettaskclassifications", + "GetTaskClassificationsRequestTypedDict": ".gettaskclassifications", + "Window": ".gettaskclassifications", "GetUserActivityGlobals": ".getuseractivity", "GetUserActivityGlobalsTypedDict": ".getuseractivity", "GetUserActivityRequest": ".getuseractivity", @@ -1586,6 +1641,14 @@ "ListGuardrailsRequestTypedDict": ".listguardrails", "ListGuardrailsResponse": ".listguardrails", "ListGuardrailsResponseTypedDict": ".listguardrails", + "ListImageModelEndpointsGlobals": ".listimagemodelendpoints", + "ListImageModelEndpointsGlobalsTypedDict": ".listimagemodelendpoints", + "ListImageModelEndpointsRequest": ".listimagemodelendpoints", + "ListImageModelEndpointsRequestTypedDict": ".listimagemodelendpoints", + "ListImageModelsGlobals": ".listimagemodels", + "ListImageModelsGlobalsTypedDict": ".listimagemodels", + "ListImageModelsRequest": ".listimagemodels", + "ListImageModelsRequestTypedDict": ".listimagemodels", "ListKeyAssignmentsGlobals": ".listkeyassignments", "ListKeyAssignmentsGlobalsTypedDict": ".listkeyassignments", "ListKeyAssignmentsRequest": ".listkeyassignments", diff --git a/src/openrouter/operations/createembeddings.py b/src/openrouter/operations/createembeddings.py index 4cc4c5c0..6459cab7 100644 --- a/src/openrouter/operations/createembeddings.py +++ b/src/openrouter/operations/createembeddings.py @@ -344,6 +344,54 @@ class CreateEmbeddingsData(BaseModel): Object = Literal["list",] +class CostDetailsTypedDict(TypedDict): + r"""Breakdown of upstream inference costs""" + + upstream_inference_completions_cost: float + upstream_inference_prompt_cost: float + upstream_inference_cost: NotRequired[Nullable[float]] + + +class CostDetails(BaseModel): + r"""Breakdown of upstream inference costs""" + + upstream_inference_completions_cost: float + + upstream_inference_prompt_cost: float + + upstream_inference_cost: OptionalNullable[float] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["upstream_inference_cost"] + nullable_fields = ["upstream_inference_cost"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + class PromptTokensDetailsTypedDict(TypedDict): r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.""" @@ -387,6 +435,10 @@ class CreateEmbeddingsUsageTypedDict(TypedDict): r"""Total number of tokens used""" cost: NotRequired[float] r"""Cost of the request in credits""" + cost_details: NotRequired[Nullable[CostDetailsTypedDict]] + r"""Breakdown of upstream inference costs""" + is_byok: NotRequired[bool] + r"""Whether a request was made using a Bring Your Own Key configuration""" prompt_tokens_details: NotRequired[PromptTokensDetailsTypedDict] r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.""" @@ -403,9 +455,45 @@ class CreateEmbeddingsUsage(BaseModel): cost: Optional[float] = None r"""Cost of the request in credits""" + cost_details: OptionalNullable[CostDetails] = UNSET + r"""Breakdown of upstream inference costs""" + + is_byok: Optional[bool] = None + r"""Whether a request was made using a Bring Your Own Key configuration""" + prompt_tokens_details: Optional[PromptTokensDetails] = None r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.""" + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["cost", "cost_details", "is_byok", "prompt_tokens_details"] + nullable_fields = ["cost_details"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + class CreateEmbeddingsResponseBodyTypedDict(TypedDict): r"""Embeddings response containing embedding vectors""" diff --git a/src/openrouter/operations/createimages.py b/src/openrouter/operations/createimages.py new file mode 100644 index 00000000..dcc89c26 --- /dev/null +++ b/src/openrouter/operations/createimages.py @@ -0,0 +1,150 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + imagegenerationrequest as components_imagegenerationrequest, + imagegenerationresponse as components_imagegenerationresponse, + imagestreamingresponse as components_imagestreamingresponse, +) +from openrouter.types import BaseModel +from openrouter.utils import ( + FieldMetadata, + HeaderMetadata, + RequestMetadata, + eventstreaming, +) +import pydantic +from typing import Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +class CreateImagesGlobalsTypedDict(TypedDict): + 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. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class CreateImagesGlobals(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + 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. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class CreateImagesRequestTypedDict(TypedDict): + image_generation_request: ( + components_imagegenerationrequest.ImageGenerationRequestTypedDict + ) + 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. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class CreateImagesRequest(BaseModel): + image_generation_request: Annotated[ + components_imagegenerationrequest.ImageGenerationRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + 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. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +CreateImagesResponseTypedDict = TypeAliasType( + "CreateImagesResponseTypedDict", + Union[ + components_imagegenerationresponse.ImageGenerationResponseTypedDict, + Union[ + eventstreaming.EventStream[ + components_imagestreamingresponse.ImageStreamingResponseDataTypedDict + ], + eventstreaming.EventStreamAsync[ + components_imagestreamingresponse.ImageStreamingResponseDataTypedDict + ], + ], + ], +) + + +CreateImagesResponse = TypeAliasType( + "CreateImagesResponse", + Union[ + components_imagegenerationresponse.ImageGenerationResponse, + Union[ + eventstreaming.EventStream[ + components_imagestreamingresponse.ImageStreamingResponseData + ], + eventstreaming.EventStreamAsync[ + components_imagestreamingresponse.ImageStreamingResponseData + ], + ], + ], +) diff --git a/src/openrouter/operations/getbenchmarks.py b/src/openrouter/operations/getbenchmarks.py new file mode 100644 index 00000000..480c2f31 --- /dev/null +++ b/src/openrouter/operations/getbenchmarks.py @@ -0,0 +1,178 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UnrecognizedStr +from openrouter.utils import ( + FieldMetadata, + HeaderMetadata, + QueryParamMetadata, + validate_open_enum, +) +import pydantic +from pydantic.functional_validators import PlainValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetBenchmarksGlobalsTypedDict(TypedDict): + 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. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class GetBenchmarksGlobals(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + 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. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +Source = Union[ + Literal[ + "artificial-analysis", + "design-arena", + ], + UnrecognizedStr, +] +r"""Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.""" + + +TaskType = Union[ + Literal[ + "coding", + "intelligence", + "agentic", + ], + UnrecognizedStr, +] +r"""Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.""" + + +Arena = Union[ + Literal[ + "models", + "builders", + "agents", + ], + UnrecognizedStr, +] +r"""Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.""" + + +class GetBenchmarksRequestTypedDict(TypedDict): + 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. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + source: NotRequired[Source] + r"""Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.""" + task_type: NotRequired[TaskType] + r"""Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.""" + arena: NotRequired[Arena] + r"""Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.""" + category: NotRequired[str] + r"""Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.""" + max_results: NotRequired[int] + r"""Maximum number of items to return. When omitted, all matching results are returned.""" + + +class GetBenchmarksRequest(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + 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. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + source: Annotated[ + Annotated[Optional[Source], PlainValidator(validate_open_enum(False))], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.""" + + task_type: Annotated[ + Annotated[Optional[TaskType], PlainValidator(validate_open_enum(False))], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.""" + + arena: Annotated[ + Annotated[Optional[Arena], PlainValidator(validate_open_enum(False))], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.""" + + category: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.""" + + max_results: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Maximum number of items to return. When omitted, all matching results are returned.""" diff --git a/src/openrouter/operations/getbenchmarksdesignarena.py b/src/openrouter/operations/gettaskclassifications.py similarity index 64% rename from src/openrouter/operations/getbenchmarksdesignarena.py rename to src/openrouter/operations/gettaskclassifications.py index 2ac2aed2..793d2ca7 100644 --- a/src/openrouter/operations/getbenchmarksdesignarena.py +++ b/src/openrouter/operations/gettaskclassifications.py @@ -1,20 +1,14 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel, UnrecognizedStr -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - QueryParamMetadata, - validate_open_enum, -) +from openrouter.types import BaseModel +from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic -from pydantic.functional_validators import PlainValidator -from typing import Literal, Optional, Union +from typing import Literal, Optional from typing_extensions import Annotated, NotRequired, TypedDict -class GetBenchmarksDesignArenaGlobalsTypedDict(TypedDict): +class GetTaskClassificationsGlobalsTypedDict(TypedDict): 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. @@ -30,7 +24,7 @@ class GetBenchmarksDesignArenaGlobalsTypedDict(TypedDict): """ -class GetBenchmarksDesignArenaGlobals(BaseModel): +class GetTaskClassificationsGlobals(BaseModel): http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -60,18 +54,11 @@ class GetBenchmarksDesignArenaGlobals(BaseModel): """ -Arena = Union[ - Literal[ - "models", - "builders", - "agents", - ], - UnrecognizedStr, -] -r"""Arena to query. Defaults to `models`.""" +Window = Literal["7d",] +r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.""" -class GetBenchmarksDesignArenaRequestTypedDict(TypedDict): +class GetTaskClassificationsRequestTypedDict(TypedDict): 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. @@ -85,15 +72,11 @@ class GetBenchmarksDesignArenaRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ - arena: NotRequired[Arena] - r"""Arena to query. Defaults to `models`.""" - category: NotRequired[str] - r"""Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.""" - max_results: NotRequired[int] - r"""Max results to return: per category when no category filter is applied (1–100, default 50).""" + window: NotRequired[Window] + r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.""" -class GetBenchmarksDesignArenaRequest(BaseModel): +class GetTaskClassificationsRequest(BaseModel): http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -122,20 +105,8 @@ class GetBenchmarksDesignArenaRequest(BaseModel): """ - arena: Annotated[ - Annotated[Optional[Arena], PlainValidator(validate_open_enum(False))], + window: Annotated[ + Optional[Window], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = "models" - r"""Arena to query. Defaults to `models`.""" - - category: Annotated[ - Optional[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None - r"""Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.""" - - max_results: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 50 - r"""Max results to return: per category when no category filter is applied (1–100, default 50).""" + ] = "7d" + r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.""" diff --git a/src/openrouter/operations/listbyokkeys.py b/src/openrouter/operations/listbyokkeys.py index 4b17f290..f450f0da 100644 --- a/src/openrouter/operations/listbyokkeys.py +++ b/src/openrouter/operations/listbyokkeys.py @@ -140,6 +140,7 @@ class ListBYOKKeysGlobals(BaseModel): "stepfun", "streamlake", "switchpoint", + "tenstorrent", "together", "upstage", "venice", diff --git a/src/openrouter/operations/listimagemodelendpoints.py b/src/openrouter/operations/listimagemodelendpoints.py new file mode 100644 index 00000000..15c606cc --- /dev/null +++ b/src/openrouter/operations/listimagemodelendpoints.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListImageModelEndpointsGlobalsTypedDict(TypedDict): + 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. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class ListImageModelEndpointsGlobals(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + 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. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class ListImageModelEndpointsRequestTypedDict(TypedDict): + author: str + r"""Model author/organization""" + slug: str + r"""Model slug""" + 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. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class ListImageModelEndpointsRequest(BaseModel): + author: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Model author/organization""" + + slug: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Model slug""" + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + 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. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ diff --git a/src/openrouter/operations/getbenchmarksartificialanalysis.py b/src/openrouter/operations/listimagemodels.py similarity index 84% rename from src/openrouter/operations/getbenchmarksartificialanalysis.py rename to src/openrouter/operations/listimagemodels.py index 707ed912..e5c89ce7 100644 --- a/src/openrouter/operations/getbenchmarksartificialanalysis.py +++ b/src/openrouter/operations/listimagemodels.py @@ -2,13 +2,13 @@ from __future__ import annotations from openrouter.types import BaseModel -from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +from openrouter.utils import FieldMetadata, HeaderMetadata import pydantic from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict -class GetBenchmarksArtificialAnalysisGlobalsTypedDict(TypedDict): +class ListImageModelsGlobalsTypedDict(TypedDict): 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. @@ -24,7 +24,7 @@ class GetBenchmarksArtificialAnalysisGlobalsTypedDict(TypedDict): """ -class GetBenchmarksArtificialAnalysisGlobals(BaseModel): +class ListImageModelsGlobals(BaseModel): http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -54,7 +54,7 @@ class GetBenchmarksArtificialAnalysisGlobals(BaseModel): """ -class GetBenchmarksArtificialAnalysisRequestTypedDict(TypedDict): +class ListImageModelsRequestTypedDict(TypedDict): 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. @@ -68,11 +68,9 @@ class GetBenchmarksArtificialAnalysisRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ - max_results: NotRequired[int] - r"""Max results to return (1–100, default 50).""" -class GetBenchmarksArtificialAnalysisRequest(BaseModel): +class ListImageModelsRequest(BaseModel): http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -100,9 +98,3 @@ class GetBenchmarksArtificialAnalysisRequest(BaseModel): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ - - max_results: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 50 - r"""Max results to return (1–100, default 50).""" diff --git a/src/openrouter/presets.py b/src/openrouter/presets.py index ae12a80d..4ab1b9cd 100644 --- a/src/openrouter/presets.py +++ b/src/openrouter/presets.py @@ -1295,7 +1295,10 @@ def create_presets_messages( ] = UNSET, max_tokens: Optional[int] = None, metadata: Optional[ - Union[components.Metadata, components.MetadataTypedDict] + Union[ + components.MessagesRequestMetadata, + components.MessagesRequestMetadataTypedDict, + ] ] = None, models: Optional[List[str]] = None, output_config: Optional[ @@ -1424,7 +1427,7 @@ def create_presets_messages( messages, Nullable[List[components.MessagesMessageParam]] ), metadata=utils.get_pydantic_model( - metadata, Optional[components.Metadata] + metadata, Optional[components.MessagesRequestMetadata] ), model=model, models=models, @@ -1599,7 +1602,10 @@ async def create_presets_messages_async( ] = UNSET, max_tokens: Optional[int] = None, metadata: Optional[ - Union[components.Metadata, components.MetadataTypedDict] + Union[ + components.MessagesRequestMetadata, + components.MessagesRequestMetadataTypedDict, + ] ] = None, models: Optional[List[str]] = None, output_config: Optional[ @@ -1728,7 +1734,7 @@ async def create_presets_messages_async( messages, Nullable[List[components.MessagesMessageParam]] ), metadata=utils.get_pydantic_model( - metadata, Optional[components.Metadata] + metadata, Optional[components.MessagesRequestMetadata] ), model=model, models=models, @@ -1886,6 +1892,9 @@ def create_presets_responses( components.AnthropicCacheControlDirectiveTypedDict, ] ] = None, + debug: Optional[ + Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict] + ] = None, frequency_penalty: OptionalNullable[float] = UNSET, image_config: Optional[ Union[ @@ -1981,6 +1990,7 @@ def create_presets_responses( :param background: :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. :param include: @@ -2040,6 +2050,9 @@ def create_presets_responses( cache_control=utils.get_pydantic_model( cache_control, Optional[components.AnthropicCacheControlDirective] ), + debug=utils.get_pydantic_model( + debug, Optional[components.ChatDebugOptions] + ), frequency_penalty=frequency_penalty, image_config=image_config, include=include, @@ -2212,6 +2225,9 @@ async def create_presets_responses_async( components.AnthropicCacheControlDirectiveTypedDict, ] ] = None, + debug: Optional[ + Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict] + ] = None, frequency_penalty: OptionalNullable[float] = UNSET, image_config: Optional[ Union[ @@ -2307,6 +2323,7 @@ async def create_presets_responses_async( :param background: :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. :param include: @@ -2366,6 +2383,9 @@ async def create_presets_responses_async( cache_control=utils.get_pydantic_model( cache_control, Optional[components.AnthropicCacheControlDirective] ), + debug=utils.get_pydantic_model( + debug, Optional[components.ChatDebugOptions] + ), frequency_penalty=frequency_penalty, image_config=image_config, include=include, diff --git a/src/openrouter/responses.py b/src/openrouter/responses.py index 944aff9a..e80404c4 100644 --- a/src/openrouter/responses.py +++ b/src/openrouter/responses.py @@ -33,6 +33,9 @@ def send( components.AnthropicCacheControlDirectiveTypedDict, ] ] = None, + debug: Optional[ + Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict] + ] = None, frequency_penalty: OptionalNullable[float] = UNSET, image_config: Optional[ Union[ @@ -128,6 +131,7 @@ def send( :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. :param include: @@ -184,6 +188,9 @@ def send( components.AnthropicCacheControlDirectiveTypedDict, ] ] = None, + debug: Optional[ + Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict] + ] = None, frequency_penalty: OptionalNullable[float] = UNSET, image_config: Optional[ Union[ @@ -279,6 +286,7 @@ def send( :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. :param include: @@ -334,6 +342,9 @@ def send( components.AnthropicCacheControlDirectiveTypedDict, ] ] = None, + debug: Optional[ + Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict] + ] = None, frequency_penalty: OptionalNullable[float] = UNSET, image_config: Optional[ Union[ @@ -429,6 +440,7 @@ def send( :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. :param include: @@ -489,6 +501,9 @@ def send( cache_control=utils.get_pydantic_model( cache_control, Optional[components.AnthropicCacheControlDirective] ), + debug=utils.get_pydantic_model( + debug, Optional[components.ChatDebugOptions] + ), frequency_penalty=frequency_penalty, image_config=image_config, include=include, @@ -767,6 +782,9 @@ async def send_async( components.AnthropicCacheControlDirectiveTypedDict, ] ] = None, + debug: Optional[ + Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict] + ] = None, frequency_penalty: OptionalNullable[float] = UNSET, image_config: Optional[ Union[ @@ -862,6 +880,7 @@ async def send_async( :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. :param include: @@ -918,6 +937,9 @@ async def send_async( components.AnthropicCacheControlDirectiveTypedDict, ] ] = None, + debug: Optional[ + Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict] + ] = None, frequency_penalty: OptionalNullable[float] = UNSET, image_config: Optional[ Union[ @@ -1013,6 +1035,7 @@ async def send_async( :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. :param include: @@ -1068,6 +1091,9 @@ async def send_async( components.AnthropicCacheControlDirectiveTypedDict, ] ] = None, + debug: Optional[ + Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict] + ] = None, frequency_penalty: OptionalNullable[float] = UNSET, image_config: Optional[ Union[ @@ -1163,6 +1189,7 @@ async def send_async( :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. :param include: @@ -1223,6 +1250,9 @@ async def send_async( cache_control=utils.get_pydantic_model( cache_control, Optional[components.AnthropicCacheControlDirective] ), + debug=utils.get_pydantic_model( + debug, Optional[components.ChatDebugOptions] + ), frequency_penalty=frequency_penalty, image_config=image_config, include=include, diff --git a/src/openrouter/sdk.py b/src/openrouter/sdk.py index abc46c83..8fe36b22 100644 --- a/src/openrouter/sdk.py +++ b/src/openrouter/sdk.py @@ -18,9 +18,11 @@ if TYPE_CHECKING: from openrouter.analytics import Analytics from openrouter.api_keys import APIKeys + from openrouter.benchmarks import Benchmarks from openrouter.beta import Beta from openrouter.byok import Byok from openrouter.chat import Chat + from openrouter.classifications import Classifications from openrouter.credits import Credits from openrouter.datasets import Datasets from openrouter.embeddings import Embeddings @@ -28,6 +30,7 @@ from openrouter.files import Files from openrouter.generations import Generations from openrouter.guardrails import Guardrails + from openrouter.images import Images from openrouter.models_ import Models from openrouter.oauth import OAuth from openrouter.observability import Observability @@ -55,9 +58,13 @@ class OpenRouter(BaseSDK): r"""Speech-to-text endpoints""" o_auth: "OAuth" r"""OAuth authentication endpoints""" + benchmarks: "Benchmarks" + r"""Benchmarks endpoints""" byok: "Byok" r"""BYOK endpoints""" chat: "Chat" + classifications: "Classifications" + r"""Task classification market-share endpoints""" credits: "Credits" r"""Credit management endpoints""" datasets: "Datasets" @@ -72,6 +79,8 @@ class OpenRouter(BaseSDK): r"""Generation history endpoints""" guardrails: "Guardrails" r"""Guardrails endpoints""" + images: "Images" + r"""Images endpoints""" api_keys: "APIKeys" r"""API key management endpoints""" models: "Models" @@ -96,8 +105,10 @@ class OpenRouter(BaseSDK): "tts": ("openrouter.tts", "Tts"), "stt": ("openrouter.stt", "Stt"), "o_auth": ("openrouter.oauth", "OAuth"), + "benchmarks": ("openrouter.benchmarks", "Benchmarks"), "byok": ("openrouter.byok", "Byok"), "chat": ("openrouter.chat", "Chat"), + "classifications": ("openrouter.classifications", "Classifications"), "credits": ("openrouter.credits", "Credits"), "datasets": ("openrouter.datasets", "Datasets"), "embeddings": ("openrouter.embeddings", "Embeddings"), @@ -105,6 +116,7 @@ class OpenRouter(BaseSDK): "files": ("openrouter.files", "Files"), "generations": ("openrouter.generations", "Generations"), "guardrails": ("openrouter.guardrails", "Guardrails"), + "images": ("openrouter.images", "Images"), "api_keys": ("openrouter.api_keys", "APIKeys"), "models": ("openrouter.models_", "Models"), "observability": ("openrouter.observability", "Observability"), diff --git a/src/openrouter/video_generation.py b/src/openrouter/video_generation.py index 30f265d1..cdd7182f 100644 --- a/src/openrouter/video_generation.py +++ b/src/openrouter/video_generation.py @@ -21,7 +21,7 @@ def generate( http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - aspect_ratio: Optional[components.AspectRatio] = None, + aspect_ratio: Optional[components.VideoGenerationRequestAspectRatio] = None, callback_url: Optional[str] = None, duration: Optional[int] = None, frame_images: Optional[ @@ -40,7 +40,7 @@ def generate( components.VideoGenerationRequestProviderTypedDict, ] ] = None, - resolution: Optional[components.Resolution] = None, + resolution: Optional[components.VideoGenerationRequestResolution] = None, seed: Optional[int] = None, size: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -222,7 +222,7 @@ async def generate_async( http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - aspect_ratio: Optional[components.AspectRatio] = None, + aspect_ratio: Optional[components.VideoGenerationRequestAspectRatio] = None, callback_url: Optional[str] = None, duration: Optional[int] = None, frame_images: Optional[ @@ -241,7 +241,7 @@ async def generate_async( components.VideoGenerationRequestProviderTypedDict, ] ] = None, - resolution: Optional[components.Resolution] = None, + resolution: Optional[components.VideoGenerationRequestResolution] = None, seed: Optional[int] = None, size: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, diff --git a/uv.lock b/uv.lock index ac18dd79..0bfff321 100644 --- a/uv.lock +++ b/uv.lock @@ -220,7 +220,7 @@ wheels = [ [[package]] name = "openrouter" -version = "0.10.0" +version = "0.10.1" source = { editable = "." } dependencies = [ { name = "httpcore" }, From 1f53bcd0d8f1f96092595f7610b6e9daae456690 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 00:50:18 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow