diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 724629f3..b0d351fe 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: 09df6acb8d33fc0a6e700e04d4655ba0 + docChecksum: d7b69b574731b7c9c94be5901ee7a5c5 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 0.11.14 - configChecksum: f50be4abc577933c26adbd554a8c0a32 + releaseVersion: 0.11.15 + configChecksum: 90c0043479fd28548bbe6b76d7541742 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: a013eea8-05d8-4341-bd1d-eece9f6abc6a - pristine_commit_hash: 956ac8e76c81a4ebd4c9924aad87c7aae1c20436 - pristine_tree_hash: fb3578808042a59c539cc83b5cfc79991d33712a + generation_id: c1cfa591-61b4-49f2-80a7-e1007bcbe17f + pristine_commit_hash: 1a48d7424a4c6692678c01def7f1d0e12d687c0c + pristine_tree_hash: e1b850bb5a9838612c0137a69be76c48ef66ac8e features: python: acceptHeaders: 3.0.0 @@ -610,8 +610,8 @@ trackedFiles: pristine_git_object: 633bd16e1abe0e3894c12f551761ad1a9da37d5e docs/components/basereasoningconfig.mdx: id: 3c6f03de40b1 - last_write_checksum: sha1:eb6d9ba91551e795f59a1fd85bef0df0c0c04fea - pristine_git_object: 3ccce9e99c37e70708c2aff1e1f4891a59c31979 + last_write_checksum: sha1:036514fae32cb43664cd47805eeb2f848a340547 + pristine_git_object: 6f900a92fdf544de9b1531b7c2865fa9564cbeb1 docs/components/bashservertool.mdx: id: 664dbaf53aa3 last_write_checksum: sha1:0b276c752d22836d67b31aab477b4ebba24c17c1 @@ -2410,16 +2410,16 @@ trackedFiles: pristine_git_object: 9d37626f96de3c19d39e4901d041ef41b01bdc98 docs/components/inputtext.mdx: id: c8a97322a50a - last_write_checksum: sha1:5462885a683c2ca29551281c9fcf3ad1bceb0634 - pristine_git_object: 5ebcb8365d9d55c2032d5d4739ceeb30831d1ebb + last_write_checksum: sha1:58653e40ea0a33629dda40d2a11c8d21a75b0467 + pristine_git_object: ece32d6edb601578cdb56fc8b4a60e40bc089f22 docs/components/inputtexttype.mdx: id: 91f958925357 last_write_checksum: sha1:42a8d9a6d3506e02f6024592691292b7ac255075 pristine_git_object: 18baf9c9090c0696427dfebf69ed7e12a8fd77af docs/components/inputtokensdetails.mdx: id: 1b569c720e5c - last_write_checksum: sha1:f6b5b4912a20dfea2515994f9656374d3fc56676 - pristine_git_object: c58b1d023f8ebca70e803c0128b0ade367b4ae35 + last_write_checksum: sha1:c77b55a6ef458ebd7c03cb877aa9ce3d6eec3114 + pristine_git_object: daa531b4e153c105de1905f44bfce078f755f3fb docs/components/inputunion.mdx: id: 94f68c6e9582 last_write_checksum: sha1:85c3b78897569c4572f3fc43f6b1143c293b452d @@ -3796,6 +3796,22 @@ trackedFiles: id: 6816d700f8b1 last_write_checksum: sha1:ac5c56af4e56eb98da5686e33a224950dfbb8207 pristine_git_object: 78ac34b5053103dc4261c2fbeb9833f97ef109db + docs/components/promptcachebreakpoint.mdx: + id: c135956dc623 + last_write_checksum: sha1:1b0c9884eb9b6fe1d4fdf822c75cb566ead67e07 + pristine_git_object: 1d1ff6162c98c1639ea8e2e4dfa7f6d5cd7d3fcd + docs/components/promptcachebreakpointmode.mdx: + id: 05abe4e54869 + last_write_checksum: sha1:f7ca9f8ff280c1fa750609f4aa13b0706d1dd7cd + pristine_git_object: 37263b53e0db06966ac692cd11558cd68c515637 + docs/components/promptcacheoptions.mdx: + id: 84100012ff84 + last_write_checksum: sha1:fee66864b36bed40090f8e330a390f12b8847dec + pristine_git_object: a9b20d3f963b738ae414738b0b96d42ab8f9ab13 + docs/components/promptcacheoptionsmode.mdx: + id: fbdb2c936b50 + last_write_checksum: sha1:9ad96fb9d26840c0088b7013ef9cba7a7d0431c9 + pristine_git_object: b9df1b4b846931011deabad7c556720ec383ce45 docs/components/promptinjectionscanscope.mdx: id: 27b252a0e798 last_write_checksum: sha1:a8947423372ce9b2edee232b8da4aa0afe5c6619 @@ -3886,8 +3902,12 @@ trackedFiles: pristine_git_object: 99c4a374a4dacb8e64c8a1cf5efb815fb177e22d docs/components/reasoningconfig.mdx: id: e5500b541923 - last_write_checksum: sha1:368c0d607d496c07707b24ce67b1603294c6c91e - pristine_git_object: 42457ac688a05ee75ac807d882c7c949744f2919 + last_write_checksum: sha1:b83b9e28c2808197ddfe72729f5f2795b5df3b33 + pristine_git_object: d087355d2333bdff545bcfcb351aca98dbd8a4ab + docs/components/reasoningcontext.mdx: + id: 8187c67b9cf1 + last_write_checksum: sha1:b24b2ff096dbdf64839e0842812a043a95f2f9a8 + pristine_git_object: fa199a5442e9a1af6f58a63fc04bc597e1e660d0 docs/components/reasoningdeltaevent.mdx: id: 2ec3838c029f last_write_checksum: sha1:15dccf12992148893efb3325d86be310d339fda5 @@ -4110,8 +4130,8 @@ trackedFiles: pristine_git_object: 996cffee821435729436d7f29bce4333f4900382 docs/components/responsesrequest.mdx: id: 0dbcef40a4b1 - last_write_checksum: sha1:6349c1560ef2f55875ce6d926e42117d1b069cee - pristine_git_object: eb2f6540a39471b65545174c8f5658303868f00f + last_write_checksum: sha1:462f684189fca9eefc0809564ab964d89025724d + pristine_git_object: 371d94f398a631b4146a2a76b46dbd257637caba docs/components/responsesrequestplugin.mdx: id: 4d550c41c85f last_write_checksum: sha1:ab9d1e6c062cd51fc976da6ccf393e9974171f7b @@ -6434,8 +6454,8 @@ trackedFiles: pristine_git_object: 6e199abaeb2f5269a885637d65bb176fd235a61c docs/sdks/presets/README.mdx: id: eeb505928d52 - last_write_checksum: sha1:6f71a463dd8d32e2a002e86c3ff37a44350b54af - pristine_git_object: 5e8523f49f3809d1a9f0af88342148d40cf8bb4d + last_write_checksum: sha1:c61b06287a4f3e854cf729a6621a8760ef3c73c0 + pristine_git_object: 5f20994a95b6c41ceab181a1523d1b03935d0ac0 docs/sdks/providers/README.mdx: id: 5ea9af111324 last_write_checksum: sha1:570b55655ee7602d3807c3218e450741f634eed6 @@ -6446,8 +6466,8 @@ trackedFiles: pristine_git_object: cd1b341b1b7c0284b9ba9b102bd8020e0d7ce707 docs/sdks/responses/README.mdx: id: abab319e080e - last_write_checksum: sha1:c93ea3f5b1bedad1e7ac32b47a28dc3fc1bc8bae - pristine_git_object: 03281f8cf709ebb9a81700ade4cf9bc0db665eb6 + last_write_checksum: sha1:69540ef8f6a556c86c4ba8a6ebd4ed03e36ee927 + pristine_git_object: bbd2952598bc9e67b6080bf8ee53d7f6ac838d9c docs/sdks/stt/README.mdx: id: 190b0dc9a5d1 last_write_checksum: sha1:a8e68ac2b0bb8640e01d962177b42ab47b24898b @@ -6470,8 +6490,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:3177e6621f92622eaa6776a68dd2bb077cdcfdc8 - pristine_git_object: d177de9881a5636e96018d98b7d221ec0124761b + last_write_checksum: sha1:e16ca23f9cddf95638b28905c555da47d4c09f0d + pristine_git_object: 31212f7a50ba4ee6134fe7460c6fe12ca48fbfba scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -6498,8 +6518,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:f6992fba8825a552cf53e8a013d7e6fa7ca2530c - pristine_git_object: 97bfd4246432cf5e50e7008f1125f9e6db969f75 + last_write_checksum: sha1:1a938199eea20cbbf018bdd7bcdb63590b81ea8b + pristine_git_object: b953813a40461fccd42607239baebf1b5fae2b83 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841 @@ -6538,8 +6558,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:85cd21f3c0b6b129b5b09b952fa3c4e48a9d93a9 - pristine_git_object: d6a693898dda47aad55259292807fc7d31be4e10 + last_write_checksum: sha1:969fd835f76893c65f98b4776374df55095f590d + pristine_git_object: 3e5280df638221322326c598c530d0d7efe6ac44 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -6786,12 +6806,12 @@ trackedFiles: pristine_git_object: c59b958cb34640b4cc6329be5154480e4116929f src/openrouter/components/baseinputs_union.py: id: d85e19ff642b - last_write_checksum: sha1:0d8178381a828cc9db2f7b7eb36e0b657f0e1d52 - pristine_git_object: 56b48e741547abaae734d07a4022808fb082f899 + last_write_checksum: sha1:ef1fd31c14b1d9ee88ce2a927e4d68c199d5dce0 + pristine_git_object: f662ef47202e2685b0342486507c31ef27341c8d src/openrouter/components/basereasoningconfig.py: id: 8bd09a7e873a - last_write_checksum: sha1:fbc371f27810d872041ed3e6b24a9f892c71d84b - pristine_git_object: 2e7bcf61a1b6d47a86c755720c1d4ccd0b419e49 + last_write_checksum: sha1:db86178d4a8ebbd0279ba6107b9ae8a6eafa1c44 + pristine_git_object: c70517b14d7851590774b1a21cd813827a875e5e src/openrouter/components/bashservertool.py: id: 1c5881bea648 last_write_checksum: sha1:fd74247241c7371ff595e3b5e8fb1cac31f66ddc @@ -7242,8 +7262,8 @@ trackedFiles: pristine_git_object: 708dfac62530c5fcd29f6bb0be113dc34fd24718 src/openrouter/components/easyinputmessage.py: id: 72619a312585 - last_write_checksum: sha1:6fe16f2a35b373420e6b5289132da3557a3daaca - pristine_git_object: acc023a14c9edefd377c7d213fa928fd046ec999 + last_write_checksum: sha1:d239d7043ffc81d1fa3ec0779f6170f3d494a8f6 + pristine_git_object: 814efc2c2b79781d126d77e0d7fda85dcae7608f src/openrouter/components/edgenetworktimeoutresponseerrordata.py: id: dc53aae5b171 last_write_checksum: sha1:cfbbb83051f349bedda3d81a81ef2d3aea2916d6 @@ -7562,8 +7582,8 @@ trackedFiles: pristine_git_object: 0e7edf2ba9a0c7cfa1e395b240ab55ada9bbd436 src/openrouter/components/inputmessageitem.py: id: 6c5260d62714 - last_write_checksum: sha1:98b5f65b95e9b984ed78a2555e58b33ded517f41 - pristine_git_object: 654f64256a1cc0fdcdcf60c22e0bdc99256fba5a + last_write_checksum: sha1:b3d5ab531388f83247f204f15b9bba082f8aa035 + pristine_git_object: e6332882b51e720126426ccdede1a60f2e90819f src/openrouter/components/inputmodality.py: id: ffa999fb401a last_write_checksum: sha1:da607c1deed71fcc11d880b7cebe92471e2ec5d4 @@ -7578,8 +7598,8 @@ trackedFiles: pristine_git_object: 1371934ab909d77965b050958080277ca8988f09 src/openrouter/components/inputtext.py: id: a995ae96be99 - last_write_checksum: sha1:0e30dbfa1813d3e69e0ccd2511f50080cce0fb6e - pristine_git_object: 088b7564b2d7a76d0a1aef448050975fbc18663c + last_write_checksum: sha1:f78a6a35792b704f18ee6e1312c24f78f38cca36 + pristine_git_object: ab1dcb92e9370c9252ac5623a447669cca01e0ee src/openrouter/components/inputvideo.py: id: d262affd6f7e last_write_checksum: sha1:60c1792ab1f440ae67b5b451fd4d195e02783161 @@ -7850,8 +7870,8 @@ trackedFiles: pristine_git_object: af8258c63d88899948741f0597c89203e461fea1 src/openrouter/components/openairesponseinputmessageitem.py: id: 90c7fe9366e7 - last_write_checksum: sha1:629ebc3b56ae4570554eef76220d9394d189ac0d - pristine_git_object: 3dedde3ce07be821316ef8b9eda0999071d5946b + last_write_checksum: sha1:36c63c2364d5bdb82ab06b91a9cb0c19121d9b69 + pristine_git_object: d96f09596b5e0d88b4de5e5df6315022bb6a65b0 src/openrouter/components/openairesponsesannotation.py: id: 092d7d770eb3 last_write_checksum: sha1:7fed7001721d065ceb1644217e397d7c76ee7203 @@ -8116,6 +8136,14 @@ trackedFiles: id: 40414eada27a last_write_checksum: sha1:0e241830bf9014e8ea814465c573711d8a7caa2c pristine_git_object: 90bdb267893360608210843a5da0d5d68e80d41e + src/openrouter/components/promptcachebreakpoint.py: + id: f1e589a13300 + last_write_checksum: sha1:458ef5170c7c9ea1367dcfb090b1b28333aff73d + pristine_git_object: a082e2d9b4d27d0cffb7794279ab5fb9d9e06789 + src/openrouter/components/promptcacheoptions.py: + id: 5c39fe555e03 + last_write_checksum: sha1:77647b94fd80f6cfcae368bff4c87cbaf903a98e + pristine_git_object: 9d3586245623788e9accd1fe5ff883de89dc4bbe src/openrouter/components/promptinjectionscanscope.py: id: e78ab231a530 last_write_checksum: sha1:f257e3ae2b6385cf758e891ba02601c435e92098 @@ -8178,8 +8206,12 @@ trackedFiles: pristine_git_object: 9adc8e68c6993b0490e8d14e1d2c0f15694dde97 src/openrouter/components/reasoningconfig.py: id: 754fc31a7b69 - last_write_checksum: sha1:7320173c0dd16ceac04a722ac138ee1d00a71165 - pristine_git_object: b0c9375431363731a4a6eb3de53a140e03104244 + last_write_checksum: sha1:03e4e2ec1a964e9d549604a6883001cd241c3b62 + pristine_git_object: fc8b0fb192b13cc1bd9700df1ee91bab73f446c2 + src/openrouter/components/reasoningcontext.py: + id: 39d2491701d9 + last_write_checksum: sha1:91e931a7ef777351be84e50d342fe635b0e1d8be + pristine_git_object: 79fc4af70b05b0bb716ccd1ba43ec1e7443ec41a src/openrouter/components/reasoningdeltaevent.py: id: 6de06228d1f6 last_write_checksum: sha1:efff164cfffbf6b89ab270ac4912243649149457 @@ -8282,8 +8314,8 @@ trackedFiles: pristine_git_object: 1c7f8a0ef6bc011cd6196c4a4c77a94b1cbb6b73 src/openrouter/components/responsesrequest.py: id: 8c850080ec5d - last_write_checksum: sha1:a473bffe268a505095e26b83c4eb52cf1ebe3b4b - pristine_git_object: 9a98af5bc71c7be9fd3ec851cebce9b806b384a7 + last_write_checksum: sha1:b6afc18fad09f40c0f343cf5944e80070ef45077 + pristine_git_object: 7331187ebb7ad8010f213526e172d64d2e08d268 src/openrouter/components/responsesstreamingresponse.py: id: 142379f3bd90 last_write_checksum: sha1:a48d6f3610f5d15248ef4d25a0d88a0a4a1a9db7 @@ -8586,8 +8618,8 @@ trackedFiles: pristine_git_object: a0491cc8fd3bd9986146cb1176e27d5b9c9beb60 src/openrouter/components/usage.py: id: 965ca6748bf6 - last_write_checksum: sha1:859ca57d253deee9ccf672095bbe59b52df571d3 - pristine_git_object: 62c5e14fb1646a51b213ce3b5f822d0dc75ad979 + last_write_checksum: sha1:712340f3df2194c53f37d0491e220296ad3c3dbd + pristine_git_object: 572d04f457607099ae7e041922de146de10e2eae src/openrouter/components/videogenerationrequest.py: id: 70e3c9ff288c last_write_checksum: sha1:bb81c3a4684e20898148e1415980457732da28d2 @@ -9198,8 +9230,8 @@ trackedFiles: pristine_git_object: d24bfa86c4b67290033a18eced04435a3fc3d69f src/openrouter/presets.py: id: bd0c40379dcd - last_write_checksum: sha1:ff4882369524258936055676e9516ebeb68959d5 - pristine_git_object: 83085f60d38d0cb0b5540b8dd1cc1dfb7dc613ee + last_write_checksum: sha1:69ad1119617e8e5af1294075eceb9502492724d0 + pristine_git_object: 13b309db7d8dc063c26af9479110eca7fa5b9641 src/openrouter/providers.py: id: debc4c48f149 last_write_checksum: sha1:11dbc607825edee8dcc84b39ee8171e097c47acf @@ -9214,8 +9246,8 @@ trackedFiles: pristine_git_object: 76378ffba1806e0ca66fc873db1a568be0becebb src/openrouter/responses.py: id: f2108fb635e1 - last_write_checksum: sha1:9d6782aa347b58754a77cacbd85c3fec63febbac - pristine_git_object: 28b31f4ca269976764c47bd9a27f4d942e08f1d4 + last_write_checksum: sha1:b0e886f229ea3a440be77c9a037de5ffcf824100 + pristine_git_object: fbf686bae92410678880d1bbdb8da82c04b1869d src/openrouter/sdk.py: id: ee9846c4c9c5 last_write_checksum: sha1:2247537eca7f88a8f36e53fe011904b98569ad52 @@ -10800,4 +10832,4 @@ examples: "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.reasoning.mode` **Added**\n * `response` **Changed**\n* `open_router.presets.create_presets_responses()`: \n * `request.reasoning.mode` **Added**\n" +releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request` **Changed**\n * `response` **Changed**\n* `open_router.presets.create_presets_responses()`: `request` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1cee56d6..7d6f9ffd 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 0.11.14 + version: 0.11.15 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 719cd054..2851dde4 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -3098,6 +3098,8 @@ components: summary: auto nullable: true properties: + context: + $ref: '#/components/schemas/ReasoningContext' effort: $ref: '#/components/schemas/ReasoningEffort' mode: @@ -10356,6 +10358,8 @@ components: text: Hello, how can I help you? type: input_text properties: + prompt_cache_breakpoint: + $ref: '#/components/schemas/PromptCacheBreakpoint' text: type: string type: @@ -15519,6 +15523,9 @@ components: type: integer input_tokens_details: properties: + cache_write_tokens: + nullable: true + type: integer cached_tokens: type: integer required: @@ -17911,6 +17918,38 @@ components: required: - type type: object + PromptCacheBreakpoint: + description: >- + Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer. + example: + mode: explicit + nullable: true + properties: + mode: + enum: + - explicit + type: string + required: + - mode + type: object + PromptCacheOptions: + description: >- + Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + example: + mode: explicit + ttl: 30m + nullable: true + properties: + mode: + enum: + - explicit + type: string + ttl: + nullable: true + type: string + required: + - mode + type: object PromptInjectionScanScope: description: >- Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages. @@ -19243,6 +19282,18 @@ components: example: enabled: true summary: auto + ReasoningContext: + description: >- + Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer. + enum: + - auto + - all_turns + - current_turn + - null + example: all_turns + nullable: true + type: string + x-speakeasy-unknown-values: allow ReasoningDeltaEvent: allOf: - $ref: '#/components/schemas/BaseReasoningDeltaEvent' @@ -19855,6 +19906,8 @@ components: prompt_cache_key: nullable: true type: string + prompt_cache_options: + $ref: '#/components/schemas/PromptCacheOptions' provider: $ref: '#/components/schemas/ProviderPreferences' reasoning: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 83e115df..c153a707 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:d327ecf77f0054c2b8ef6744061285c669e336bcffefed3734162fa92619b7da - sourceBlobDigest: sha256:cecf0268e9e30429f9c9d516f5c6a5881ea046b4c6f53f8997c1f8c9a9108898 + sourceRevisionDigest: sha256:638456160de19dc7f76c9dc98b0b3d709f41eeadeb33db0842cc4a2ef4b6bf83 + sourceBlobDigest: sha256:20ee9b71a9893734705e46acd21f565ff71406ed4c0269adabc2fef3e20b1c48 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:d327ecf77f0054c2b8ef6744061285c669e336bcffefed3734162fa92619b7da - sourceBlobDigest: sha256:cecf0268e9e30429f9c9d516f5c6a5881ea046b4c6f53f8997c1f8c9a9108898 + sourceRevisionDigest: sha256:638456160de19dc7f76c9dc98b0b3d709f41eeadeb33db0842cc4a2ef4b6bf83 + sourceBlobDigest: sha256:20ee9b71a9893734705e46acd21f565ff71406ed4c0269adabc2fef3e20b1c48 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:a276c0ed9f4e7618be962a296d3e456696c53c9f8f83d787218fe50779ff395f + codeSamplesRevisionDigest: sha256:bd0f33f1c085bdb89c4eb8b925b93de8b35cc7286fc4f00041955a4f0bafea09 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 0d26d508..5b43d9bb 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -248,4 +248,14 @@ Based on: ### Generated - [python v0.11.14] . ### Releases -- [PyPI v0.11.14] https://pypi.org/project/openrouter/0.11.14 - . \ No newline at end of file +- [PyPI v0.11.14] https://pypi.org/project/openrouter/0.11.14 - . + +## 2026-07-09 18:16:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.15] . +### Releases +- [PyPI v0.11.15] https://pypi.org/project/openrouter/0.11.15 - . \ No newline at end of file diff --git a/docs/components/basereasoningconfig.mdx b/docs/components/basereasoningconfig.mdx index 3ccce9e9..6f900a92 100644 --- a/docs/components/basereasoningconfig.mdx +++ b/docs/components/basereasoningconfig.mdx @@ -4,8 +4,9 @@ title: "BaseReasoningConfig" ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `effort` | [OptionalNullable[components.ReasoningEffort]](../components/reasoningeffort.mdx) | :heavy_minus_sign: | N/A | medium | -| `mode` | [OptionalNullable[components.ReasoningMode]](../components/reasoningmode.mdx) | :heavy_minus_sign: | Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer. | standard | -| `summary` | [OptionalNullable[components.ReasoningSummaryVerbosity]](../components/reasoningsummaryverbosity.mdx) | :heavy_minus_sign: | N/A | auto | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `context` | [OptionalNullable[components.ReasoningContext]](../components/reasoningcontext.mdx) | :heavy_minus_sign: | Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer. | all_turns | +| `effort` | [OptionalNullable[components.ReasoningEffort]](../components/reasoningeffort.mdx) | :heavy_minus_sign: | N/A | medium | +| `mode` | [OptionalNullable[components.ReasoningMode]](../components/reasoningmode.mdx) | :heavy_minus_sign: | Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer. | standard | +| `summary` | [OptionalNullable[components.ReasoningSummaryVerbosity]](../components/reasoningsummaryverbosity.mdx) | :heavy_minus_sign: | N/A | auto | \ No newline at end of file diff --git a/docs/components/inputtext.mdx b/docs/components/inputtext.mdx index 5ebcb836..ece32d6e 100644 --- a/docs/components/inputtext.mdx +++ b/docs/components/inputtext.mdx @@ -7,7 +7,8 @@ Text input content item ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `text` | *str* | :heavy_check_mark: | N/A | -| `type` | [components.InputTextType](../components/inputtexttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `prompt_cache_breakpoint` | [OptionalNullable[components.PromptCacheBreakpoint]](../components/promptcachebreakpoint.mdx) | :heavy_minus_sign: | Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit"
} | +| `text` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.InputTextType](../components/inputtexttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/inputtokensdetails.mdx b/docs/components/inputtokensdetails.mdx index c58b1d02..daa531b4 100644 --- a/docs/components/inputtokensdetails.mdx +++ b/docs/components/inputtokensdetails.mdx @@ -4,6 +4,7 @@ title: "InputTokensDetails" ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `cached_tokens` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `cache_write_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `cached_tokens` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/promptcachebreakpoint.mdx b/docs/components/promptcachebreakpoint.mdx new file mode 100644 index 00000000..1d1ff616 --- /dev/null +++ b/docs/components/promptcachebreakpoint.mdx @@ -0,0 +1,12 @@ +--- +title: "PromptCacheBreakpoint" +--- + +Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `mode` | [components.PromptCacheBreakpointMode](../components/promptcachebreakpointmode.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/promptcachebreakpointmode.mdx b/docs/components/promptcachebreakpointmode.mdx new file mode 100644 index 00000000..37263b53 --- /dev/null +++ b/docs/components/promptcachebreakpointmode.mdx @@ -0,0 +1,15 @@ +--- +title: "PromptCacheBreakpointMode" +--- + +## Example Usage + +```python +from openrouter.components import PromptCacheBreakpointMode +value: PromptCacheBreakpointMode = "explicit" +``` + + +## Values + +- `"explicit"` diff --git a/docs/components/promptcacheoptions.mdx b/docs/components/promptcacheoptions.mdx new file mode 100644 index 00000000..a9b20d3f --- /dev/null +++ b/docs/components/promptcacheoptions.mdx @@ -0,0 +1,13 @@ +--- +title: "PromptCacheOptions" +--- + +Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `mode` | [components.PromptCacheOptionsMode](../components/promptcacheoptionsmode.mdx) | :heavy_check_mark: | N/A | +| `ttl` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/promptcacheoptionsmode.mdx b/docs/components/promptcacheoptionsmode.mdx new file mode 100644 index 00000000..b9df1b4b --- /dev/null +++ b/docs/components/promptcacheoptionsmode.mdx @@ -0,0 +1,15 @@ +--- +title: "PromptCacheOptionsMode" +--- + +## Example Usage + +```python +from openrouter.components import PromptCacheOptionsMode +value: PromptCacheOptionsMode = "explicit" +``` + + +## Values + +- `"explicit"` diff --git a/docs/components/reasoningconfig.mdx b/docs/components/reasoningconfig.mdx index 42457ac6..d087355d 100644 --- a/docs/components/reasoningconfig.mdx +++ b/docs/components/reasoningconfig.mdx @@ -7,10 +7,11 @@ Configuration for reasoning mode in the response ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `effort` | [OptionalNullable[components.ReasoningEffort]](../components/reasoningeffort.mdx) | :heavy_minus_sign: | N/A | medium | -| `mode` | [OptionalNullable[components.ReasoningMode]](../components/reasoningmode.mdx) | :heavy_minus_sign: | Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer. | standard | -| `summary` | [OptionalNullable[components.ReasoningSummaryVerbosity]](../components/reasoningsummaryverbosity.mdx) | :heavy_minus_sign: | N/A | auto | -| `enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `context` | [OptionalNullable[components.ReasoningContext]](../components/reasoningcontext.mdx) | :heavy_minus_sign: | Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer. | all_turns | +| `effort` | [OptionalNullable[components.ReasoningEffort]](../components/reasoningeffort.mdx) | :heavy_minus_sign: | N/A | medium | +| `mode` | [OptionalNullable[components.ReasoningMode]](../components/reasoningmode.mdx) | :heavy_minus_sign: | Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer. | standard | +| `summary` | [OptionalNullable[components.ReasoningSummaryVerbosity]](../components/reasoningsummaryverbosity.mdx) | :heavy_minus_sign: | N/A | auto | +| `enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/components/reasoningcontext.mdx b/docs/components/reasoningcontext.mdx new file mode 100644 index 00000000..fa199a54 --- /dev/null +++ b/docs/components/reasoningcontext.mdx @@ -0,0 +1,23 @@ +--- +title: "ReasoningContext" +--- + +Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer. + +## Example Usage + +```python +from openrouter.components import ReasoningContext + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ReasoningContext = "auto" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"auto"` +- `"all_turns"` +- `"current_turn"` diff --git a/docs/components/responsesrequest.mdx b/docs/components/responsesrequest.mdx index eb2f6540..371d94f3 100644 --- a/docs/components/responsesrequest.mdx +++ b/docs/components/responsesrequest.mdx @@ -29,6 +29,7 @@ Request schema for Responses endpoint | `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../components/storedprompttemplate.mdx) | :heavy_minus_sign: | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../components/providerpreferences.mdx) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../components/reasoningconfig.mdx) | :heavy_minus_sign: | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | diff --git a/docs/sdks/presets/README.mdx b/docs/sdks/presets/README.mdx index 5e8523f4..5f20994a 100644 --- a/docs/sdks/presets/README.mdx +++ b/docs/sdks/presets/README.mdx @@ -350,6 +350,7 @@ with OpenRouter( | `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../../components/storedprompttemplate.mdx) | :heavy_minus_sign: | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../../components/reasoningconfig.mdx) | :heavy_minus_sign: | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | diff --git a/docs/sdks/responses/README.mdx b/docs/sdks/responses/README.mdx index 03281f8c..bbd29525 100644 --- a/docs/sdks/responses/README.mdx +++ b/docs/sdks/responses/README.mdx @@ -88,6 +88,7 @@ with OpenRouter( | `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../../components/storedprompttemplate.mdx) | :heavy_minus_sign: | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../../components/reasoningconfig.mdx) | :heavy_minus_sign: | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | diff --git a/pyproject.toml b/pyproject.toml index d177de98..31212f7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "0.11.14" +version = "0.11.15" 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 97bfd424..b953813a 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "0.11.14" +__version__: str = "0.11.15" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 0.11.14 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 0.11.15 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index d6a69389..3e5280df 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -2139,6 +2139,16 @@ PreviewWebSearchUserLocationType, PreviewWebSearchUserLocationTypedDict, ) + from .promptcachebreakpoint import ( + PromptCacheBreakpoint, + PromptCacheBreakpointMode, + PromptCacheBreakpointTypedDict, + ) + from .promptcacheoptions import ( + PromptCacheOptions, + PromptCacheOptionsMode, + PromptCacheOptionsTypedDict, + ) from .promptinjectionscanscope import PromptInjectionScanScope from .providername import ProviderName from .provideroptions import ProviderOptions, ProviderOptionsTypedDict @@ -2199,6 +2209,7 @@ RankingsDailyResponseTypedDict, ) from .reasoningconfig import ReasoningConfig, ReasoningConfigTypedDict + from .reasoningcontext import ReasoningContext from .reasoningdeltaevent import ( ReasoningDeltaEvent, ReasoningDeltaEventType, @@ -4217,6 +4228,12 @@ "PriceSource", "Pricing", "PricingTypedDict", + "PromptCacheBreakpoint", + "PromptCacheBreakpointMode", + "PromptCacheBreakpointTypedDict", + "PromptCacheOptions", + "PromptCacheOptionsMode", + "PromptCacheOptionsTypedDict", "PromptInjectionScanScope", "ProviderName", "ProviderOptions", @@ -4253,6 +4270,7 @@ "Reason", "ReasoningConfig", "ReasoningConfigTypedDict", + "ReasoningContext", "ReasoningDeltaEvent", "ReasoningDeltaEventType", "ReasoningDeltaEventTypedDict", @@ -6342,6 +6360,12 @@ "PreviewWebSearchUserLocation": ".preview_websearchuserlocation", "PreviewWebSearchUserLocationType": ".preview_websearchuserlocation", "PreviewWebSearchUserLocationTypedDict": ".preview_websearchuserlocation", + "PromptCacheBreakpoint": ".promptcachebreakpoint", + "PromptCacheBreakpointMode": ".promptcachebreakpoint", + "PromptCacheBreakpointTypedDict": ".promptcachebreakpoint", + "PromptCacheOptions": ".promptcacheoptions", + "PromptCacheOptionsMode": ".promptcacheoptions", + "PromptCacheOptionsTypedDict": ".promptcacheoptions", "PromptInjectionScanScope": ".promptinjectionscanscope", "ProviderName": ".providername", "ProviderOptions": ".provideroptions", @@ -6390,6 +6414,7 @@ "RankingsDailyResponseTypedDict": ".rankingsdailyresponse", "ReasoningConfig": ".reasoningconfig", "ReasoningConfigTypedDict": ".reasoningconfig", + "ReasoningContext": ".reasoningcontext", "ReasoningDeltaEvent": ".reasoningdeltaevent", "ReasoningDeltaEventType": ".reasoningdeltaevent", "ReasoningDeltaEventTypedDict": ".reasoningdeltaevent", diff --git a/src/openrouter/components/baseinputs_union.py b/src/openrouter/components/baseinputs_union.py index 56b48e74..f662ef47 100644 --- a/src/openrouter/components/baseinputs_union.py +++ b/src/openrouter/components/baseinputs_union.py @@ -53,7 +53,7 @@ BaseInputsContent1TypedDict = TypeAliasType( "BaseInputsContent1TypedDict", Union[ - InputTextTypedDict, InputAudioTypedDict, InputImageTypedDict, InputFileTypedDict + InputAudioTypedDict, InputTextTypedDict, InputImageTypedDict, InputFileTypedDict ], ) diff --git a/src/openrouter/components/basereasoningconfig.py b/src/openrouter/components/basereasoningconfig.py index 2e7bcf61..c70517b1 100644 --- a/src/openrouter/components/basereasoningconfig.py +++ b/src/openrouter/components/basereasoningconfig.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .reasoningcontext import ReasoningContext from .reasoningeffort import ReasoningEffort from .reasoningmode import ReasoningMode from .reasoningsummaryverbosity import ReasoningSummaryVerbosity @@ -16,6 +17,8 @@ class BaseReasoningConfigTypedDict(TypedDict): + context: NotRequired[Nullable[ReasoningContext]] + r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" effort: NotRequired[Nullable[ReasoningEffort]] mode: NotRequired[Nullable[ReasoningMode]] r"""Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.""" @@ -23,6 +26,9 @@ class BaseReasoningConfigTypedDict(TypedDict): class BaseReasoningConfig(BaseModel): + context: OptionalNullable[ReasoningContext] = UNSET + r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" + effort: OptionalNullable[ReasoningEffort] = UNSET mode: OptionalNullable[ReasoningMode] = UNSET @@ -32,8 +38,8 @@ class BaseReasoningConfig(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["effort", "mode", "summary"]) - nullable_fields = set(["effort", "mode", "summary"]) + optional_fields = set(["context", "effort", "mode", "summary"]) + nullable_fields = set(["context", "effort", "mode", "summary"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/easyinputmessage.py b/src/openrouter/components/easyinputmessage.py index acc023a1..814efc2c 100644 --- a/src/openrouter/components/easyinputmessage.py +++ b/src/openrouter/components/easyinputmessage.py @@ -79,9 +79,9 @@ def serialize_model(self, handler): EasyInputMessageContentUnion1TypedDict = TypeAliasType( "EasyInputMessageContentUnion1TypedDict", Union[ - InputTextTypedDict, InputAudioTypedDict, InputVideoTypedDict, + InputTextTypedDict, EasyInputMessageContentInputImageTypedDict, InputFileTypedDict, ], diff --git a/src/openrouter/components/inputmessageitem.py b/src/openrouter/components/inputmessageitem.py index 654f6425..e6332882 100644 --- a/src/openrouter/components/inputmessageitem.py +++ b/src/openrouter/components/inputmessageitem.py @@ -79,9 +79,9 @@ def serialize_model(self, handler): InputMessageItemContentUnionTypedDict = TypeAliasType( "InputMessageItemContentUnionTypedDict", Union[ - InputTextTypedDict, InputAudioTypedDict, InputVideoTypedDict, + InputTextTypedDict, InputMessageItemContentInputImageTypedDict, InputFileTypedDict, ], diff --git a/src/openrouter/components/inputtext.py b/src/openrouter/components/inputtext.py index 088b7564..ab1dcb92 100644 --- a/src/openrouter/components/inputtext.py +++ b/src/openrouter/components/inputtext.py @@ -1,9 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel +from .promptcachebreakpoint import PromptCacheBreakpoint, PromptCacheBreakpointTypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer from typing import Literal -from typing_extensions import TypedDict +from typing_extensions import NotRequired, TypedDict InputTextType = Literal["input_text",] @@ -14,6 +22,8 @@ class InputTextTypedDict(TypedDict): text: str type: InputTextType + prompt_cache_breakpoint: NotRequired[Nullable[PromptCacheBreakpointTypedDict]] + r"""Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer.""" class InputText(BaseModel): @@ -22,3 +32,31 @@ class InputText(BaseModel): text: str type: InputTextType + + prompt_cache_breakpoint: OptionalNullable[PromptCacheBreakpoint] = UNSET + r"""Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["prompt_cache_breakpoint"]) + nullable_fields = set(["prompt_cache_breakpoint"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/openrouter/components/openairesponseinputmessageitem.py b/src/openrouter/components/openairesponseinputmessageitem.py index 3dedde3c..d96f0959 100644 --- a/src/openrouter/components/openairesponseinputmessageitem.py +++ b/src/openrouter/components/openairesponseinputmessageitem.py @@ -17,7 +17,7 @@ OpenAIResponseInputMessageItemContentTypedDict = TypeAliasType( "OpenAIResponseInputMessageItemContentTypedDict", Union[ - InputTextTypedDict, InputAudioTypedDict, InputImageTypedDict, InputFileTypedDict + InputAudioTypedDict, InputTextTypedDict, InputImageTypedDict, InputFileTypedDict ], ) diff --git a/src/openrouter/components/promptcachebreakpoint.py b/src/openrouter/components/promptcachebreakpoint.py new file mode 100644 index 00000000..a082e2d9 --- /dev/null +++ b/src/openrouter/components/promptcachebreakpoint.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 + + +PromptCacheBreakpointMode = Literal["explicit",] + + +class PromptCacheBreakpointTypedDict(TypedDict): + r"""Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer.""" + + mode: PromptCacheBreakpointMode + + +class PromptCacheBreakpoint(BaseModel): + r"""Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer.""" + + mode: PromptCacheBreakpointMode diff --git a/src/openrouter/components/promptcacheoptions.py b/src/openrouter/components/promptcacheoptions.py new file mode 100644 index 00000000..9d358624 --- /dev/null +++ b/src/openrouter/components/promptcacheoptions.py @@ -0,0 +1,56 @@ +"""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 + + +PromptCacheOptionsMode = Literal["explicit",] + + +class PromptCacheOptionsTypedDict(TypedDict): + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + + mode: PromptCacheOptionsMode + ttl: NotRequired[Nullable[str]] + + +class PromptCacheOptions(BaseModel): + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + + mode: PromptCacheOptionsMode + + ttl: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ttl"]) + nullable_fields = set(["ttl"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/openrouter/components/reasoningconfig.py b/src/openrouter/components/reasoningconfig.py index b0c93754..fc8b0fb1 100644 --- a/src/openrouter/components/reasoningconfig.py +++ b/src/openrouter/components/reasoningconfig.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .reasoningcontext import ReasoningContext from .reasoningeffort import ReasoningEffort from .reasoningmode import ReasoningMode from .reasoningsummaryverbosity import ReasoningSummaryVerbosity @@ -18,6 +19,8 @@ class ReasoningConfigTypedDict(TypedDict): r"""Configuration for reasoning mode in the response""" + context: NotRequired[Nullable[ReasoningContext]] + r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" effort: NotRequired[Nullable[ReasoningEffort]] mode: NotRequired[Nullable[ReasoningMode]] r"""Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.""" @@ -29,6 +32,9 @@ class ReasoningConfigTypedDict(TypedDict): class ReasoningConfig(BaseModel): r"""Configuration for reasoning mode in the response""" + context: OptionalNullable[ReasoningContext] = UNSET + r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" + effort: OptionalNullable[ReasoningEffort] = UNSET mode: OptionalNullable[ReasoningMode] = UNSET @@ -42,8 +48,12 @@ class ReasoningConfig(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["effort", "mode", "summary", "enabled", "max_tokens"]) - nullable_fields = set(["effort", "mode", "summary", "enabled", "max_tokens"]) + optional_fields = set( + ["context", "effort", "mode", "summary", "enabled", "max_tokens"] + ) + nullable_fields = set( + ["context", "effort", "mode", "summary", "enabled", "max_tokens"] + ) serialized = handler(self) m = {} diff --git a/src/openrouter/components/reasoningcontext.py b/src/openrouter/components/reasoningcontext.py new file mode 100644 index 00000000..79fc4af7 --- /dev/null +++ b/src/openrouter/components/reasoningcontext.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +ReasoningContext = Union[ + Literal[ + "auto", + "all_turns", + "current_turn", + ], + UnrecognizedStr, +] +r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" diff --git a/src/openrouter/components/responsesrequest.py b/src/openrouter/components/responsesrequest.py index 9a98af5b..7331187e 100644 --- a/src/openrouter/components/responsesrequest.py +++ b/src/openrouter/components/responsesrequest.py @@ -72,6 +72,7 @@ PreviewWebSearchServerTool, PreviewWebSearchServerToolTypedDict, ) +from .promptcacheoptions import PromptCacheOptions, PromptCacheOptionsTypedDict from .providerpreferences import ProviderPreferences, ProviderPreferencesTypedDict from .reasoningconfig import ReasoningConfig, ReasoningConfigTypedDict from .responsehealingplugin import ResponseHealingPlugin, ResponseHealingPluginTypedDict @@ -314,6 +315,8 @@ class ResponsesRequestTypedDict(TypedDict): previous_response_id: NotRequired[Nullable[str]] prompt: NotRequired[Nullable[StoredPromptTemplateTypedDict]] prompt_cache_key: NotRequired[Nullable[str]] + prompt_cache_options: NotRequired[Nullable[PromptCacheOptionsTypedDict]] + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" provider: NotRequired[Nullable[ProviderPreferencesTypedDict]] r"""When multiple model providers are available, optionally indicate your routing preference.""" reasoning: NotRequired[Nullable[ReasoningConfigTypedDict]] @@ -391,6 +394,9 @@ class ResponsesRequest(BaseModel): prompt_cache_key: OptionalNullable[str] = UNSET + prompt_cache_options: OptionalNullable[PromptCacheOptions] = UNSET + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + provider: OptionalNullable[ProviderPreferences] = UNSET r"""When multiple model providers are available, optionally indicate your routing preference.""" @@ -461,6 +467,7 @@ def serialize_model(self, handler): "previous_response_id", "prompt", "prompt_cache_key", + "prompt_cache_options", "provider", "reasoning", "safety_identifier", @@ -495,6 +502,7 @@ def serialize_model(self, handler): "previous_response_id", "prompt", "prompt_cache_key", + "prompt_cache_options", "provider", "reasoning", "safety_identifier", diff --git a/src/openrouter/components/usage.py b/src/openrouter/components/usage.py index 62c5e14f..572d04f4 100644 --- a/src/openrouter/components/usage.py +++ b/src/openrouter/components/usage.py @@ -15,11 +15,39 @@ class InputTokensDetailsTypedDict(TypedDict): cached_tokens: int + cache_write_tokens: NotRequired[Nullable[int]] class InputTokensDetails(BaseModel): cached_tokens: int + cache_write_tokens: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["cache_write_tokens"]) + nullable_fields = set(["cache_write_tokens"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + class OutputTokensDetailsTypedDict(TypedDict): reasoning_tokens: int diff --git a/src/openrouter/presets.py b/src/openrouter/presets.py index 83085f60..13b309db 100644 --- a/src/openrouter/presets.py +++ b/src/openrouter/presets.py @@ -1989,6 +1989,9 @@ def create_presets_responses( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -2070,6 +2073,7 @@ def create_presets_responses( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -2142,6 +2146,10 @@ def create_presets_responses( prompt, OptionalNullable[components.StoredPromptTemplate] ), prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), @@ -2333,6 +2341,9 @@ async def create_presets_responses_async( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -2414,6 +2425,7 @@ async def create_presets_responses_async( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -2486,6 +2498,10 @@ async def create_presets_responses_async( prompt, OptionalNullable[components.StoredPromptTemplate] ), prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), diff --git a/src/openrouter/responses.py b/src/openrouter/responses.py index 28b31f4c..fbf686ba 100644 --- a/src/openrouter/responses.py +++ b/src/openrouter/responses.py @@ -74,6 +74,9 @@ def send( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -153,6 +156,7 @@ def send( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -228,6 +232,9 @@ def send( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -307,6 +314,7 @@ def send( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -382,6 +390,9 @@ def send( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -464,6 +475,7 @@ def send( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -538,6 +550,9 @@ def send( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -620,6 +635,7 @@ def send( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -692,6 +708,10 @@ def send( prompt, OptionalNullable[components.StoredPromptTemplate] ), prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), @@ -973,6 +993,9 @@ async def send_async( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1052,6 +1075,7 @@ async def send_async( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -1127,6 +1151,9 @@ async def send_async( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1206,6 +1233,7 @@ async def send_async( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -1281,6 +1309,9 @@ async def send_async( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1363,6 +1394,7 @@ async def send_async( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -1437,6 +1469,9 @@ async def send_async( ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1519,6 +1554,7 @@ async def send_async( :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -1591,6 +1627,10 @@ async def send_async( prompt, OptionalNullable[components.StoredPromptTemplate] ), prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), diff --git a/uv.lock b/uv.lock index 41606a85..0f343e9e 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "0.11.14" +version = "0.11.15" source = { editable = "." } dependencies = [ { name = "httpcore" },