Compare commits

..
Author SHA1 Message Date
speakeasy-github[bot]andspeakeasy-bot c83dcf1f47 empty commit to trigger [run-tests] workflow 2026-04-14 00:40:55 +00:00
speakeasybot 0a9e60481a ## Python SDK Changes:
* `open_router.api_keys.list()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.data.[]` **Changed** **Breaking** ⚠️
* `open_router.guardrails.get()`:  `response.data` **Changed** **Breaking** ⚠️
* `open_router.o_auth.create_auth_code()`:  `response.data.app_id` **Changed** **Breaking** ⚠️
* `open_router.guardrails.bulk_unassign_members()`:  `response.unassigned_count` **Changed** **Breaking** ⚠️
* `open_router.guardrails.bulk_unassign_keys()`:  `response.unassigned_count` **Changed** **Breaking** ⚠️
* `open_router.guardrails.bulk_assign_members()`:  `response.assigned_count` **Changed** **Breaking** ⚠️
* `open_router.guardrails.list_guardrail_member_assignments()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.total_count` **Changed** **Breaking** ⚠️
* `open_router.beta.responses.send()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response` **Changed** **Breaking** ⚠️
* `open_router.analytics.get_user_activity()`: 
  *  `request` **Changed**
  *  `response.data.[]` **Changed** **Breaking** ⚠️
  *  `error.status[404]` **Added**
* `open_router.chat.send()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response` **Changed** **Breaking** ⚠️
* `open_router.embeddings.generate()`: 
  *  `request.provider` **Changed** **Breaking** ⚠️
  *  `response` **Changed** **Breaking** ⚠️
* `open_router.embeddings.list_models()`:  `response.data.[]` **Changed** **Breaking** ⚠️
* `open_router.generations.get_generation()`:  `response.data` **Changed** **Breaking** ⚠️
* `open_router.models.count()`:  `response.data.count` **Changed** **Breaking** ⚠️
* `open_router.models.list()`:  `response.data.[]` **Changed** **Breaking** ⚠️
* `open_router.models.list_for_user()`:  `response.data.[]` **Changed** **Breaking** ⚠️
* `open_router.endpoints.list_zdr_endpoints()`:  `response.data.[]` **Changed** **Breaking** ⚠️
* `open_router.guardrails.bulk_assign_keys()`:  `response.assigned_count` **Changed** **Breaking** ⚠️
* `open_router.guardrails.list_member_assignments()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.total_count` **Changed** **Breaking** ⚠️
* `open_router.api_keys.create()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.data` **Changed** **Breaking** ⚠️
* `open_router.api_keys.update()`: 
  *  `request.limit` **Changed** **Breaking** ⚠️
  *  `response.data` **Changed** **Breaking** ⚠️
* `open_router.api_keys.get()`:  `response.data` **Changed** **Breaking** ⚠️
* `open_router.api_keys.get_current_key_metadata()`:  `response.data` **Changed** **Breaking** ⚠️
* `open_router.guardrails.list()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response` **Changed** **Breaking** ⚠️
* `open_router.guardrails.create()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.data` **Changed** **Breaking** ⚠️
* `open_router.endpoints.list()`:  `response.data` **Changed** **Breaking** ⚠️
* `open_router.guardrails.update()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.data` **Changed** **Breaking** ⚠️
* `open_router.guardrails.list_key_assignments()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.total_count` **Changed** **Breaking** ⚠️
* `open_router.guardrails.list_guardrail_key_assignments()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.total_count` **Changed** **Breaking** ⚠️
* `open_router.organization.list_members()`: **Added**
* `open_router.rerank.rerank()`: **Added**
* `open_router.credits.create_coinbase_charge()`: **Deleted** **Breaking** ⚠️
* `open_router.video_generation.list_videos_models()`: **Added**
* `open_router.video_generation.get_video_content()`: **Added**
* `open_router.video_generation.get_generation()`: **Added**
* `open_router.video_generation.generate()`: **Added**
2026-04-14 00:40:46 +00:00
68 changed files with 695 additions and 1578 deletions
+5
View File
@@ -1,4 +1,9 @@
<div align="center">
<a href="https://codespaces.new/OpenRouterTeam/python-sdk.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
</div>
<br>
> **Remember to shutdown a GitHub Codespace when it is not in use!**
# Dev Containers Quick Start
+148 -189
View File
@@ -1,17 +1,19 @@
lockVersion: 2.0.0
id: c48cf606-fb42-4a45-9c23-8f0555307828
management:
docChecksum: 59bf622329ff2d6d2a28acceada10a6d
docChecksum: 1807bf50cd11992cd56391054618d0d2
docVersion: 1.0.0
speakeasyVersion: 1.680.0
generationVersion: 2.788.4
releaseVersion: 0.9.1
configChecksum: 9c8b936b4b1d37d964e844ee1a15cd4b
releaseVersion: 0.9.0
configChecksum: 45f314c90efc3cbb8bc7916a985dd5bc
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
generation_id: ce3858e4-7fbd-4f52-9d57-24016d5c1504
pristine_commit_hash: c581f0a6ace9e1c793b0f4d759585b420c157610
pristine_tree_hash: c5a3bf3d181c5c54d764cdf6372feb79505d5ed7
generation_id: 1b1a22ef-25ef-48f3-a753-703b11780990
pristine_commit_hash: b0d508fd2c1f91da500ae3c72ea8979ae30331b1
pristine_tree_hash: bcf1b6863d6dfb01db01b192ea9555a5dcd70a29
features:
python:
acceptHeaders: 3.0.0
@@ -50,8 +52,8 @@ features:
trackedFiles:
.devcontainer/README.md:
id: b170c0f184ac
last_write_checksum: sha1:3c63dfd4dcea8df0d4add09e975a6887e6da4aab
pristine_git_object: 396929ab2e57cf09dd25ec83bd4496f733b95701
last_write_checksum: sha1:919a25ed5129d316f05a60131c164011763b7c54
pristine_git_object: c7d8d278438e7906fedb39d99151372b3324ea66
.devcontainer/devcontainer.json:
id: b34062a34eb1
last_write_checksum: sha1:94309e8c8eab5ab063986bf625f513a59825e947
@@ -414,8 +416,8 @@ trackedFiles:
pristine_git_object: f3a972b60a63cdb55670cc56cc92eae40578aa87
docs/components/chatfunctiontool.md:
id: 3c79deefdcc0
last_write_checksum: sha1:b782161259f089ecf304dce269d16c6d4aa3d95d
pristine_git_object: 6a4416a3c9d119186661a8c3987b1bfa63b91882
last_write_checksum: sha1:fcebebac15d379db85bb7122175be171d474632d
pristine_git_object: 113cb5d442456bcfbeb753cc9c07916d2f48ec77
docs/components/chatfunctiontoolfunction.md:
id: 0de29ccfd817
last_write_checksum: sha1:0a25d1c9b64f1da2513e9153682848cf41f324b2
@@ -454,8 +456,12 @@ trackedFiles:
pristine_git_object: ca73483767de32b3d83b7f9e2741011e26ac8e59
docs/components/chatrequest.md:
id: 5e0fa9a2cb13
last_write_checksum: sha1:87b3d27fcc66ed8236442681392750b87ee15209
pristine_git_object: 617ce2091e37323ba91ec47c7e1a6ccff420a710
last_write_checksum: sha1:77efa544c98c633849d584c5ec72efd4f48f7aa9
pristine_git_object: 27ac21d71a864d740c75060514186f52245c6b89
docs/components/chatrequestimageconfig.md:
id: c307e038f375
last_write_checksum: sha1:ae532a9e8878e6ba9dbcb0d8880591cf89aac53b
pristine_git_object: e4431b693da838310e5abca4d4f2292e5a67f325
docs/components/chatrequestplugin.md:
id: 24a908f99472
last_write_checksum: sha1:872a0f5dec13b33dac3aba3616a1b45ce5352feb
@@ -472,14 +478,6 @@ trackedFiles:
id: 668504931d18
last_write_checksum: sha1:6d550246aa007a5be94a9788ae4cfdfb75006980
pristine_git_object: d05e8b4f60163be62354a7f84ac449e87b7418ae
docs/components/chatsearchmodelsservertool.md:
id: 2367c4988883
last_write_checksum: sha1:7965c368b95d094d3ed3ca92f2d3fae05581b1ec
pristine_git_object: e2c29bd6f6cd3b031681abde5393975a0ce38cf8
docs/components/chatsearchmodelsservertooltype.md:
id: 028b0f0740f1
last_write_checksum: sha1:8067bf2a2a0d89edebb08ffb5ac35ba1294ffba2
pristine_git_object: ea4df9be592b40d566202d1d044275e526c7ab8f
docs/components/chatstreamchoice.md:
id: 4267d8be7145
last_write_checksum: sha1:0c16659042a36e7c30fa688275537718582a41b8
@@ -626,8 +624,8 @@ trackedFiles:
pristine_git_object: 3c45dd0765fa97b40928a609a6bbc0e6092be0fa
docs/components/completiontokensdetails.md:
id: 6b7b08e269a0
last_write_checksum: sha1:1731f180f3ed8e9fb0a52137853b0d587f8f703c
pristine_git_object: 79c357c837cdd905fc6e73470401f1477f3539b7
last_write_checksum: sha1:4da2bc38350c65cf19f2b5dc35d79d2eaffd8c15
pristine_git_object: 4a816dc88f20689977ca9d44095ba7e8358c9560
docs/components/compoundfilter.md:
id: 6c881867d341
last_write_checksum: sha1:0afec796142bbf1dd29d5ae73e6926bfc46c7ab6
@@ -714,12 +712,12 @@ trackedFiles:
pristine_git_object: 4922c8b3bb952f712fcc0cf414dd5b505ed2c4a4
docs/components/costdetails.md:
id: 2e3d81b7a646
last_write_checksum: sha1:298cb44901e7c50563597aae9e0606cf83edbc2b
pristine_git_object: ada009ced29fcaf5d19e81bc67276fe9718ccfaa
last_write_checksum: sha1:d059d0f42dc0bdd72b52c1aa704000f362eff281
pristine_git_object: 8a64aa0923a52957e9fcaef30dcd659c051daf64
docs/components/createguardrailrequest.md:
id: 5144188aed43
last_write_checksum: sha1:78119c6dd8cc0b40009afb1da489638ac35f16b6
pristine_git_object: 77b840640f4d30cf4513745df984d3a950b76c12
last_write_checksum: sha1:5a0505ea0516ccb02b670f6df4c5f0048224e1e8
pristine_git_object: beabbf841e39f6d13cafaafdacfa4d5653c55e6b
docs/components/createguardrailresponse.md:
id: 94a5ed00d7b9
last_write_checksum: sha1:bad318ece1219797a8db60631961006554b38cda
@@ -750,8 +748,8 @@ trackedFiles:
pristine_git_object: 870296bd3335da46ecdf4ec1722a3d47037a09c9
docs/components/defaultparameters.md:
id: a84477afcaec
last_write_checksum: sha1:a20e8b576e341dbcdb91884b8fc83cf4316ab106
pristine_git_object: 6941215fa82fae36a554f184e99595e51bf4b150
last_write_checksum: sha1:346866d0ac71746908b6f450584d5ac706225012
pristine_git_object: 59ba90a20dbe46bfa8083dccaea946efcd2c4f35
docs/components/deleteguardrailresponse.md:
id: 78770374c8ed
last_write_checksum: sha1:1ceae5a23d706b158b011b234d968a0fd495d2fc
@@ -1018,8 +1016,8 @@ trackedFiles:
pristine_git_object: d7de0f8ddb4847ec9c60c25f3d46ab408aac707d
docs/components/guardrail.md:
id: ce84902d4cc2
last_write_checksum: sha1:bf7a0be7e156abadc6adf0d426c40bf7c088bcd0
pristine_git_object: 994b02604a9be6a0e9705b182621e9a2df085864
last_write_checksum: sha1:033b4bd2ad9a5406b1526fb7b34bbaea004e47ec
pristine_git_object: c2fa91b7cda0fe6318e953a269e2cbe6d515ce64
docs/components/guardrailinterval.md:
id: 79efeedcb880
last_write_checksum: sha1:3c071c14943c7b26474847eee46925ae884a8a6b
@@ -1028,10 +1026,6 @@ trackedFiles:
id: 854b9623c0dd
last_write_checksum: sha1:7382df94bafcb659bed252f3f3e45fa23ccb430e
pristine_git_object: 5f7870871ac61bf7e1a1f6d4998a7353518f3bbb
docs/components/imageconfig.md:
id: 0b156eedfb3c
last_write_checksum: sha1:09e8882a3b53c99f85610eaddf2cb8ab788527d4
pristine_git_object: ae78526d566a4cc55996515044cebeb36166f7fe
docs/components/imagegencallcompletedevent.md:
id: c26bc1b3854e
last_write_checksum: sha1:487f2664906ce2bf995e5f33739ea14944d4a20b
@@ -1068,22 +1062,6 @@ trackedFiles:
id: 0ddff7f46134
last_write_checksum: sha1:b46e044c36e1518d95bb94572e43311da69a5b6d
pristine_git_object: e38b5c19b6356f255783dfacea66b45418679e21
docs/components/imagegenerationservertoolconfig.md:
id: 4086d42eed1b
last_write_checksum: sha1:9da8f5dbeb8e76419b5ca3041965105934b0ad9b
pristine_git_object: b3fbb8ea61ef0f98681cc1507b2f192556822141
docs/components/imagegenerationservertoolconfigunion.md:
id: 7ba56d56f6bc
last_write_checksum: sha1:99eb92cf87c2e68e8db530d3ebdaaff6be117587
pristine_git_object: b9319d587cbf5118b4b12874b67a4a86ec4d1b16
docs/components/imagegenerationservertoolopenrouter.md:
id: c5bf0021441a
last_write_checksum: sha1:25069e75ba4a6a6b98bc6c168ef09c2e2960f630
pristine_git_object: edee38367aaf7511e2a5d3f386d493005ce3c544
docs/components/imagegenerationservertoolopenroutertype.md:
id: 420c811d4561
last_write_checksum: sha1:6b8ce48b3e662ea3bfd8a9be737e43cd1b051e39
pristine_git_object: 30c86424343ade04282d92095ea92ebf6635ac81
docs/components/imagegenerationservertooltype.md:
id: 5d4b6d6b41ce
last_write_checksum: sha1:125bdc6395723e8fcdd82be5d88e04916b8641fd
@@ -1362,8 +1340,8 @@ trackedFiles:
pristine_git_object: d5bbdc95f658be46eebf13f0ba8b9ae3716f72e2
docs/components/model.md:
id: 673ad57400cd
last_write_checksum: sha1:9af41fb1a8b66fcc4ff3830f3b12c736218bdf7d
pristine_git_object: 106eb5cfac49cfa3106ee1d0142d9166fd6064d2
last_write_checksum: sha1:fb1d37869cb932b7aea2d12d747241f5fddd7e20
pristine_git_object: d7a1f24eebecf4bf99787df37d1567df2e4fefaf
docs/components/modelarchitecture.md:
id: 79816051e6e8
last_write_checksum: sha1:158b04c79b7a32a2d95e3d3fda8fa6da0ab91cd9
@@ -1550,8 +1528,8 @@ trackedFiles:
pristine_git_object: e88886f738fef9ad22e5efc74e3e0ea2cd8ceeb3
docs/components/openresponsesresult.md:
id: 9795b7de3f92
last_write_checksum: sha1:5c1834da4b2297e6cdc0328c8d9c026303f6b9b3
pristine_git_object: 7980a1a0edea51a2fa9cde48f5f9554029ef827b
last_write_checksum: sha1:2d75277fa00f1373256e1e46b44295b09bb006f8
pristine_git_object: 2e608eee0f77d3a630dfaddfb0cebac7de490e44
docs/components/openresponsesresultobject.md:
id: a8c7f7bc0b24
last_write_checksum: sha1:3df49df80dda49ea4cb53f913931fd4754769b66
@@ -1946,16 +1924,16 @@ trackedFiles:
pristine_git_object: 1923aac7c5fae150b9dc96ef9ee63797aebd31da
docs/components/percentilelatencycutoffs.md:
id: 2e543a8a2907
last_write_checksum: sha1:8235ed4e1c6c74a0038d35db3e68571f55482537
pristine_git_object: 6a2c04f7d3c8b6e9f1d5151b92bd08991b836e4d
last_write_checksum: sha1:f47d597ca6c81f9edcfc8b006ac57afc093f7619
pristine_git_object: 7533ba097a0b16ef83ba3f5a2262dca063e4ec1e
docs/components/percentilestats.md:
id: 1b4159e54240
last_write_checksum: sha1:33924fa3e9065174b3d235abfe1da6cd8de3a559
pristine_git_object: 6f47431682a0b8df76b71f7088bd60ae3b719cdf
docs/components/percentilethroughputcutoffs.md:
id: 5b84667c97a1
last_write_checksum: sha1:5dd867ac4a1fecbe3807b8b371f2537ade03f5e4
pristine_git_object: dff209d8cd956e99615d1cf6e7cd06f072cdbd2e
last_write_checksum: sha1:179cc2fa2319b2679655aca315412a738b648de9
pristine_git_object: 41f258ff5306edb8d4b3cf5ce0f3f0499c9354ca
docs/components/perrequestlimits.md:
id: b3e279b3aa17
last_write_checksum: sha1:4b5e8c0bb453b54a0c31faffca45d3ded875be48
@@ -2034,8 +2012,8 @@ trackedFiles:
pristine_git_object: 70db18a3a953e992834a54a5744f1a7245d081d0
docs/components/publicendpoint.md:
id: 46f345cbc943
last_write_checksum: sha1:ad470e4c83669a262f2c7ea5dbc308bd33b14a6f
pristine_git_object: de9798993c11b80d3974f160b2cdf5115bffd9ab
last_write_checksum: sha1:71ffe84c9a502eab6e1050e3e5751b448be0c366
pristine_git_object: 7a67576134989c4e8066a95b558a409dba604790
docs/components/publicendpointquantization.md:
id: c94b72bd3c23
last_write_checksum: sha1:e79fcd7d4a2829c2f696b79f050e56f1343a86a4
@@ -2070,8 +2048,8 @@ trackedFiles:
pristine_git_object: a56f26b8ea8e757ae06a70d89059656024ba7f90
docs/components/reasoningconfig.md:
id: a2d51e262631
last_write_checksum: sha1:28bd5e57b7c9fb68e3f9c6e78343dc6c1e4ea3e6
pristine_git_object: cdd80327b2ef57eb8c50dba3bf85f0b338082883
last_write_checksum: sha1:69ad419f6f469e4c4738efb3e8e2c454cf4997a8
pristine_git_object: 1a736c5530495e18240c72ff5d28cf14e68490e3
docs/components/reasoningdeltaevent.md:
id: 5d657813c9af
last_write_checksum: sha1:14999e0c8cf52d33c9e47309e7f82d85ed3e60ab
@@ -2274,8 +2252,12 @@ trackedFiles:
pristine_git_object: e21193bbab68ee5dfdb0a113e26ba70f82bcab55
docs/components/responsesrequest.md:
id: cb5cd99790f3
last_write_checksum: sha1:41f81240aba6c05767ee1de2bcdf2ed6c1851f22
pristine_git_object: fa27d12757cb1759f2d445125705def9e13a57b9
last_write_checksum: sha1:15e35ede71857674622f0a296694278261c03b9e
pristine_git_object: 3221ec68d813c85b58df3b8b0a00e3aec7032a44
docs/components/responsesrequestimageconfig.md:
id: c7e2eb6479ef
last_write_checksum: sha1:daaf30cc6be1c88f3fef6b71e3266e78b4425a9b
pristine_git_object: 19366580d12681fcba6345af951f1babfac992bc
docs/components/responsesrequestplugin.md:
id: 20da7be12bb9
last_write_checksum: sha1:14dbd6cd32c51d333548f2c43772c43540dc97fd
@@ -2290,8 +2272,8 @@ trackedFiles:
pristine_git_object: 98ae0961e2afdbf95cdc71e2eee23c9c06972889
docs/components/responsesrequesttoolunion.md:
id: d6a807777d03
last_write_checksum: sha1:31403e31e2adebdf6ed12d7c2ddc24637826381e
pristine_git_object: 944ee6cc07e0e55107e75679efeaf3fa65e0a1d7
last_write_checksum: sha1:960564f5db65b06b811859788c41439fb5d73924
pristine_git_object: c8fb972045317bf08461945bccbf6f8c6b96c053
docs/components/responsesrequesttype.md:
id: 5bd80a5ef99f
last_write_checksum: sha1:96aba92528f15b2e26760ec90539b8fd7a0e9cc3
@@ -2300,10 +2282,6 @@ trackedFiles:
id: ba037b375d32
last_write_checksum: sha1:1802fbb5223f07b0db2e7503e12f59647b3608f9
pristine_git_object: 75d3a14d662e8a753b6f8c02082582d16d854226
docs/components/searchmodelsservertoolconfig.md:
id: 4b60c7b1f071
last_write_checksum: sha1:dc167ab001813af5bc0ae1769fe3f0ea15a75087
pristine_git_object: a3dc6194e6abc9a0cc62bd9e20b7131fe106ab36
docs/components/searchqualitylevel.md:
id: a4e6b74956c7
last_write_checksum: sha1:bd89df72f13cb501966c208333fa00f123eff131
@@ -2466,8 +2444,8 @@ trackedFiles:
pristine_git_object: a957677d324419e4de813b33b88a76667d3ca940
docs/components/topproviderinfo.md:
id: c9e56036dd80
last_write_checksum: sha1:4b25308beba5c14f49058889aabd27bcf025c184
pristine_git_object: e66d615faf440dba26e666f28cb740a477df6e84
last_write_checksum: sha1:8efc81e2e84887a1ea96ea87a2444161052cb278
pristine_git_object: 239aaeb9ffe3aba0f920435390f5ff2264bbbdf8
docs/components/traceconfig.md:
id: 639fd1f6f967
last_write_checksum: sha1:560d3f57a9f103eee587ab1f260548161658675f
@@ -2530,8 +2508,8 @@ trackedFiles:
pristine_git_object: 9ccd3c05cd75915c70aa542bb16e2a8f77bb91cd
docs/components/updateguardrailrequest.md:
id: 5a0fb143eaab
last_write_checksum: sha1:76435a23043cc77dfcfd7aab0be4cfbc6de6a7e5
pristine_git_object: 36829dd7af525b1289daa3a84c583689dc5ae125
last_write_checksum: sha1:1087be3cfaf08a25bd8e202557b7448e949038df
pristine_git_object: 8908d6dd084a69919b923782e48052d057911f6c
docs/components/updateguardrailresponse.md:
id: 311d3e7a185a
last_write_checksum: sha1:240e2fc38ee1954caf6afb473cd9d85030b28285
@@ -2546,8 +2524,8 @@ trackedFiles:
pristine_git_object: 2b6e38f54f447f8fc794d3c35c1a0bc690cc4d2e
docs/components/usage.md:
id: 15e3eea02540
last_write_checksum: sha1:f012bc7dd75b18e1aeea794c46f3ea666911d339
pristine_git_object: a7798add67edd29c8712284fb383a59183932157
last_write_checksum: sha1:0ae2193567cd6c719d88160f4855cac92a8bca4f
pristine_git_object: e915b448fba6fa616ed590934da5fd29987c4add
docs/components/value1.md:
id: a13f75759dc0
last_write_checksum: sha1:0c7d94ae129961ad32dbc85fdc0958596316939b
@@ -2574,8 +2552,8 @@ trackedFiles:
pristine_git_object: bcde5432dae5013cab462aac0369c2dff823f87f
docs/components/videogenerationusage.md:
id: cb8b5821f432
last_write_checksum: sha1:58a8026e2941e2f600deedbcb53b3291fc0e1443
pristine_git_object: 3fa07286f36acbe1da47693095cee40bbed0e017
last_write_checksum: sha1:65e1cc35085805c27486bb768677621f5a6bd4c9
pristine_git_object: 69860412b7f25618069e280bbd54252002252009
docs/components/videomodel.md:
id: 903775781ac3
last_write_checksum: sha1:57ceaa8e35d7fa680d60cfde192ccf533f7a287a
@@ -2858,8 +2836,8 @@ trackedFiles:
pristine_git_object: 5a414e26806520a98f50229a063f127f712054b0
docs/operations/createkeysdata.md:
id: 903a6d611ab2
last_write_checksum: sha1:fd7089b7dff765f863b0c02542c9e480656526a8
pristine_git_object: f51f201d1e8c5c7216a508a652b154ca9fa20543
last_write_checksum: sha1:6154a06532e92530eeb880e5e3e400c83944ba26
pristine_git_object: 054ae84199061fd24065a8011ca67c86dbc1c169
docs/operations/createkeysglobals.md:
id: 15dd52d4443e
last_write_checksum: sha1:032800ca0e8b56a1819431b9b27fa09a5b4b09c9
@@ -2874,8 +2852,8 @@ trackedFiles:
pristine_git_object: f587de752afc6f5f82d55ba4b80f6d59336db24a
docs/operations/createkeysrequestbody.md:
id: 9aee51637cee
last_write_checksum: sha1:1d8572e91a7634a55014b51d6eff7be8e8e92690
pristine_git_object: a384fabe3ae8b6d1fa3ead87957d9552591d7664
last_write_checksum: sha1:24567e6e6e94df8c83deb73a01b7e3a567d40b9f
pristine_git_object: e43517f0fb76a68308997868dfae8cbe9b463a52
docs/operations/createkeysresponse.md:
id: 42bb3427e12b
last_write_checksum: sha1:b3aab1702c99f425a12e00607278808682bcf666
@@ -3002,8 +2980,8 @@ trackedFiles:
pristine_git_object: a58a336fb17cd33196da51df89c7803ba0cba363
docs/operations/getcurrentkeydata.md:
id: e357cfe8cdcc
last_write_checksum: sha1:fa6a289f008033a17c6dc0c78d2536cd8996b1c0
pristine_git_object: dc97980a9d3769df52334def41931e1281d82fb3
last_write_checksum: sha1:b27be09197f950cd4147d05183709077ff1b5e92
pristine_git_object: 3f5e088cbdf06185743f1c8821455e1306e6d265
docs/operations/getcurrentkeyglobals.md:
id: 9d0a1314955f
last_write_checksum: sha1:3aaff7ab31036ad4edb525577759ec52c430e180
@@ -3018,8 +2996,8 @@ trackedFiles:
pristine_git_object: 2855d5b95d41a494bc7ffa9f85c74ff27a46ca96
docs/operations/getgenerationdata.md:
id: 89a3aab8da20
last_write_checksum: sha1:a535e1604ef9524eb8fb752711abd36dbe7219c6
pristine_git_object: 7be5766a6c6a5f065834bdbbec761795c255689f
last_write_checksum: sha1:a78e4be50fb3b4de56daee4ea04a1d47f21a081b
pristine_git_object: cf02875be60dbecc3f0a1bd16e9998f2c8723c09
docs/operations/getgenerationglobals.md:
id: 0d6e856c5861
last_write_checksum: sha1:b5236815132dedf2b595fd520f1753d5ec8bb6e0
@@ -3042,8 +3020,8 @@ trackedFiles:
pristine_git_object: ad49c823ffd11b46d8a8ce2a67eed5bd71d09db8
docs/operations/getkeydata.md:
id: 4fba05263947
last_write_checksum: sha1:15596e6d829847c4916aa0c8cc2d53f47cf43295
pristine_git_object: 5ba4a1f8bb80defa921093533a2c7e5f1a4c45a2
last_write_checksum: sha1:9e9eb077c97bd989cc198bd17222972c3a63da9e
pristine_git_object: 8821e8f90d8e4c61b046be1926d2cabed238ed05
docs/operations/getkeyglobals.md:
id: 7f990e0efc1e
last_write_checksum: sha1:12dcc44c433951cdd8c4136ae1a70702e2b3e47d
@@ -3098,8 +3076,8 @@ trackedFiles:
pristine_git_object: 655cca3c9dde2904f47187955063ed1def505e47
docs/operations/listdata.md:
id: 3a3029670d40
last_write_checksum: sha1:3849b8da164914dd9aedabf0982439c1e1bef02e
pristine_git_object: d8fcbe3395bbf9581c75455e3c0c49dae72f73a2
last_write_checksum: sha1:2d89b15dfea6a82353401635a09e502c11633e47
pristine_git_object: c43c8c6cfb755095bb515a33dd923b30bfcf2295
docs/operations/listembeddingsmodelsglobals.md:
id: 29c3a9629ff7
last_write_checksum: sha1:a8b2d679ac7a558761e4289233d31084f4f7663e
@@ -3330,8 +3308,8 @@ trackedFiles:
pristine_git_object: 58ac81b1a12447b17d1da21f1b2275b32e2c2ca7
docs/operations/updatekeysdata.md:
id: 989d7ddeeb46
last_write_checksum: sha1:bf9ed436df63ce56f2b3c570f96bed89ebe42400
pristine_git_object: 499598c65d3218fac3da20e1f6a42e8f6d691c16
last_write_checksum: sha1:ea99e0258ff278a6346f7acfbcd72be2ba19084e
pristine_git_object: ba44333601b75f8ce7c42e71c6f9692c89787321
docs/operations/updatekeysglobals.md:
id: fe06e9820a16
last_write_checksum: sha1:bc44e1936abe8d3ce77e223aacb0326143a4a812
@@ -3346,8 +3324,8 @@ trackedFiles:
pristine_git_object: 1e35e33405525e49a37be85790ccb85b92676050
docs/operations/updatekeysrequestbody.md:
id: fa955b3d03f9
last_write_checksum: sha1:f0c0f65294750db25925a036f987d7e4bc48f1a1
pristine_git_object: a6130fd788229ee52843ebbb537b1a9ef6601278
last_write_checksum: sha1:b80cf926a89a28245c5a9cd2171f1b202ce6b3f9
pristine_git_object: 223702c414a1ee652c5dd849559d967cbcb1f628
docs/operations/updatekeysresponse.md:
id: 594f08a35b03
last_write_checksum: sha1:f4a1479f7df16e20dcc7f9259245163c0550d423
@@ -3362,12 +3340,12 @@ trackedFiles:
pristine_git_object: 44f78122819ded7e472e28ebcf37dd8812707097
docs/sdks/apikeys/README.md:
id: e2bd25998427
last_write_checksum: sha1:59291dbba3de15ee545d124fb51232152b2c7e4a
pristine_git_object: 0e6da8598106dcd4130e57ef747c365915ed0c79
last_write_checksum: sha1:8d511dbb54f0e4828ee49e22cc65daa307fc831b
pristine_git_object: 83c2e81cf7ad8565fb375f2f7e5b36e20d60f896
docs/sdks/chat/README.md:
id: 393193527c2c
last_write_checksum: sha1:74076b3d74207ac98f47e323bd2badbeeb604e3f
pristine_git_object: 03d623c9d94c1d1c85cfacaa292055df0fa04ca7
last_write_checksum: sha1:f9e001787d9e37d51692623c4375e9c1df09a2de
pristine_git_object: df4d756456d9fb569e546bd9bac705a20e4222ea
docs/sdks/credits/README.md:
id: 81608135c0ff
last_write_checksum: sha1:abca02bc25760be47f80100a7cce6bb711202aef
@@ -3386,8 +3364,8 @@ trackedFiles:
pristine_git_object: 332b5683cfe8c07ce4cae93b3247cd56f545f535
docs/sdks/guardrails/README.md:
id: f72b38a5a2a7
last_write_checksum: sha1:e55d9d4938da4dd306775c589d48e99e7f169870
pristine_git_object: 7bcdbb6e6baa29cc411a01eb20c3ee63064dc8ea
last_write_checksum: sha1:b13cefe74bc186fa193c9c47a274dfe0e4692725
pristine_git_object: 6f3a20f6c6ef2fae15974c465da228a0f03622d1
docs/sdks/models/README.md:
id: b35bdf4bc7ed
last_write_checksum: sha1:ac628dd17b528a4772ef0797c4c47906faf8dc40
@@ -3410,8 +3388,8 @@ trackedFiles:
pristine_git_object: 3bda1a6f6fccc91a04e52d373727cac8861e1a26
docs/sdks/responses/README.md:
id: e717bad14f63
last_write_checksum: sha1:02f29159f69cbc264437745e1d7cd54ed7e30ced
pristine_git_object: a38d2b1b819d977c739f6a7b6f55344514c5447c
last_write_checksum: sha1:35da9276b7b942874450f3250f4e90aafeed8399
pristine_git_object: 9f0b8db0cb7af3342ba15767bf1997bd8f39911b
docs/sdks/videogeneration/README.md:
id: b6dbf7b0729c
last_write_checksum: sha1:594c4bbe8b2396d28e4a5fe664e21de4d2dc8444
@@ -3422,12 +3400,16 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
last_write_checksum: sha1:fe68c7165977ede3cf438be1344f72e54cf67919
pristine_git_object: c678027236e18070a0081d37fb78bfd44392a8c0
last_write_checksum: sha1:282f9c22f307301f2f059315894f72506155ddd5
pristine_git_object: c820c26e833e2458a592503c86e74200a3e98265
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
pristine_git_object: 03e9f9b59063c73d6f24995a77cdb971f3318d30
scripts/publish.sh:
id: fe273b08f514
last_write_checksum: sha1:adc9b741c12ad1591ab4870eabe20f0d0a86cd1a
pristine_git_object: ef28dc10c60d7d6a4bac0c6a1e9caba36b471861
last_write_checksum: sha1:b290b25b36dca3d5eb1a2e66a2e1bcf2e7326cf3
pristine_git_object: c35748f360329c2bc370e9b189f49b1a360b2c48
src/openrouter/__init__.py:
id: 4514650f64eb
last_write_checksum: sha1:da077c0bdfcef64a4a5aea91a17292f72fa2b088
@@ -3446,16 +3428,16 @@ trackedFiles:
pristine_git_object: 07ace03229fd3267623c8f48665d2c3a67c3565d
src/openrouter/_version.py:
id: d8d15ad6c586
last_write_checksum: sha1:8283c360656da42036d190270a7ad47551bc4317
pristine_git_object: 4d43d337f71492564f02b651e5bfc78d27932ac5
last_write_checksum: sha1:d6cef74b80a76dcda210290417fd88cd9120832a
pristine_git_object: 9bfbdc043b619529b0edb750ce4a28f07b2bac5d
src/openrouter/analytics.py:
id: cb406b5aaabb
last_write_checksum: sha1:6d47d1ab3da9cb4ac9f0a2bfe442f1a82a614f35
pristine_git_object: ea004eaf47a1a48622d4a4276fba1e329d5559ab
src/openrouter/api_keys.py:
id: 876fac88fff6
last_write_checksum: sha1:749055fb2e5719d1cdc72c4391d83cb498e37080
pristine_git_object: 923a5f8c432f42427caa517e5fb1fab9b10f029e
last_write_checksum: sha1:5b18e23448d79894aba08f0e46d6e7491777bc4c
pristine_git_object: 40474f7e98dd47321618ecc0692defef90d59fce
src/openrouter/basesdk.py:
id: c5733c5a1e12
last_write_checksum: sha1:71f242fd9955e5a17a8d055e2210cc2708bb94fc
@@ -3466,12 +3448,12 @@ trackedFiles:
pristine_git_object: 5e7c70d1f15e0699b4b4099322ef2217f66b4696
src/openrouter/chat.py:
id: 723fdce15c1d
last_write_checksum: sha1:5bce19b139e225e62bb28fd2143bd6fc28b4f9cd
pristine_git_object: bfa078ebbbff63f2c80860abf718fc57abcac2bd
last_write_checksum: sha1:7a48b18631d60bf60a7dda6be10bee9773b2a5ae
pristine_git_object: 3949384c80bee3fd056502478fb3c22b11b68b4a
src/openrouter/components/__init__.py:
id: 81754e97b3f4
last_write_checksum: sha1:fba957e705a1e6222a64cdd71111390c6e14826e
pristine_git_object: e41de295792aaaea529e94d6c70c3ee111266202
last_write_checksum: sha1:4b1be5c5ebf9e218df0a07047cd5523d60b7e27b
pristine_git_object: e4f9cbd6ba44a6a1b1f6dc39478e26a960c798e2
src/openrouter/components/activityitem.py:
id: 3bbe7d35f459
last_write_checksum: sha1:32b873ba5c0a9dbf5f0cf32c0217ce17395ae69e
@@ -3626,8 +3608,8 @@ trackedFiles:
pristine_git_object: 7a6140f2b8afb0cde9b031322a4284c9cbce7e33
src/openrouter/components/chatfunctiontool.py:
id: 1fcf92f8a7da
last_write_checksum: sha1:30bcc6404395f55b361c4e73a9f991f383a9b18b
pristine_git_object: b0c0d436e5389ed1f997414145bb00d605489df0
last_write_checksum: sha1:661e6685c3dac0d479503615a9cfe54dc8dbbc85
pristine_git_object: ab80d60bf82934cc12d92ebda44070fb8af19733
src/openrouter/components/chatjsonschemaconfig.py:
id: d2278e414fab
last_write_checksum: sha1:69efa91d33e4767058c2d377814b820bb5104ab4
@@ -3646,16 +3628,12 @@ trackedFiles:
pristine_git_object: 8bbde153b53887e426989fd5b0486b6dc1122810
src/openrouter/components/chatrequest.py:
id: 5e39eaefa9cf
last_write_checksum: sha1:33d4df3eb6abbe51b5f825ad878809ae5eb04686
pristine_git_object: 7559c771fc127e9e112fbf6fbb80ee6a0e4370ee
last_write_checksum: sha1:b0aaaf512fc2971908ebe2b72555504bd25d2063
pristine_git_object: 6a2482a4a6154c3efee5c10f1010eb5ce42b611b
src/openrouter/components/chatresult.py:
id: 9062fe2935fe
last_write_checksum: sha1:b0a7c4966abc14496a4fbaf9d3cd596c845da797
pristine_git_object: 35a7ea24902a10fb9daf16e7e56c42cf063c7453
src/openrouter/components/chatsearchmodelsservertool.py:
id: e280d3720327
last_write_checksum: sha1:d16ee5aeba32baddf132119bcc46cf390020da63
pristine_git_object: 5c78164f31cfe7fe8d8e64f6b25e8bcf90084b77
src/openrouter/components/chatstreamchoice.py:
id: 356768c2edcc
last_write_checksum: sha1:bb475a522fedfb04084c1b6b0e7cb5d8a0d4cdad
@@ -3702,8 +3680,8 @@ trackedFiles:
pristine_git_object: 2ccba8386486b7a730816a9829b01754935a2e96
src/openrouter/components/chatusage.py:
id: f224a054bf45
last_write_checksum: sha1:441960796299d49d6b7632d0b823250e08bbfccd
pristine_git_object: 12b58ec62abb59b19530dc22f55065a5909aa08a
last_write_checksum: sha1:c2dce05488ace855f6267ea11423f853ffdd7e40
pristine_git_object: 7df37ad7685e4b5265abfda05a39be892c662bac
src/openrouter/components/chatusermessage.py:
id: 7777191e729a
last_write_checksum: sha1:1ecc9101c05178427d73e455de4d679ac8d78015
@@ -3754,8 +3732,8 @@ trackedFiles:
pristine_git_object: 22758a015ceb978263246b58da19d382ae38938e
src/openrouter/components/createguardrailrequest.py:
id: 34d69149fb33
last_write_checksum: sha1:8ee78165a84f16ed848fc6ce3ac7898df7d1a60c
pristine_git_object: c6dd6d6088287c6f1cf8adc4841ba5756e59031e
last_write_checksum: sha1:ccba7f6571884aa3fa3f0202d16a6a5bf973570a
pristine_git_object: d0acbe13ae43d809855f365efb0a9979c77c78ad
src/openrouter/components/createguardrailresponse.py:
id: b4e1bdf1de5b
last_write_checksum: sha1:ae20a5e7425510c240e5697d847b1cae65940bd6
@@ -3774,8 +3752,8 @@ trackedFiles:
pristine_git_object: 3eaaa33c3856a99254c617bcfe98693f31db1234
src/openrouter/components/defaultparameters.py:
id: 548f4f885c22
last_write_checksum: sha1:ed72fc048f61ec663361ab2206cd140c35971a0e
pristine_git_object: 26ed6c6d3d1615aa9b6130e1c751e0d72c138f3b
last_write_checksum: sha1:8eb3e285540840e0d5ce5deacca3c314ec5e7794
pristine_git_object: a59fa40202864f5968163adb7520defd211d28e4
src/openrouter/components/deleteguardrailresponse.py:
id: c3ac908331ef
last_write_checksum: sha1:8984f78ae6a2b3ee8b16d7f0018622ba725c1583
@@ -3858,16 +3836,12 @@ trackedFiles:
pristine_git_object: 6cdeb99e76ab6ad2e22b13164efbdb68cf8f328d
src/openrouter/components/guardrail.py:
id: 67ee78dd06e6
last_write_checksum: sha1:51ab908cd40c1dad9c499c4dec4ebb29ecd94b87
pristine_git_object: afc25c729b3d7583ea116b1fbdb0e0e3e06aac3a
last_write_checksum: sha1:44844d42057c7d41beded21d89b51471ec6e872e
pristine_git_object: d1c779c5e23b11d5c0d74b6318db259121ffeb7b
src/openrouter/components/guardrailinterval.py:
id: 01687fc135ab
last_write_checksum: sha1:430f886f371b85777346de663202d62708cd84cf
pristine_git_object: 9cdf08ab3c380a8ea69b5884bcd40a09464589c6
src/openrouter/components/imageconfig.py:
id: 674f6eca2929
last_write_checksum: sha1:8eaffb70806c74b1111b377b0024375f3c80ef44
pristine_git_object: d24d5e2bf337e19bb80a1aa24b8b27c93d67f1b1
src/openrouter/components/imagegencallcompletedevent.py:
id: cbf654faeb3e
last_write_checksum: sha1:8fb3e34408dd8b167afc6aad641de9cc2483c9f1
@@ -3888,18 +3862,6 @@ trackedFiles:
id: 9c95bc975f2e
last_write_checksum: sha1:5b6cf7e4c433056713467e1fbb680e644a1f47bc
pristine_git_object: 1bb3764815a286c4774d5b0a6b841c1606d57fa0
src/openrouter/components/imagegenerationservertool_openrouter.py:
id: b7499cf15b3a
last_write_checksum: sha1:2a253a105b37e5e1b6b3b9345cdaf64ebe65f703
pristine_git_object: c9609dbda39bbc43666c9625cf58baf469a6160c
src/openrouter/components/imagegenerationservertoolconfig.py:
id: 76f45207c1be
last_write_checksum: sha1:8d092f865ab995390b0370627657a8689c6a36aa
pristine_git_object: 7b7010abb24612645e134c7052a9475ca327b2d5
src/openrouter/components/imagegenerationservertoolconfig_union.py:
id: d1c630a1476a
last_write_checksum: sha1:50d45b5a787e8cc9024c05b31e4113993ffe4038
pristine_git_object: 58280b9d80d3dce4430060fd94ad719b47a92f9c
src/openrouter/components/imagegenerationstatus.py:
id: f257690edb46
last_write_checksum: sha1:8ae33e94dc42144f3269a65834ed7d59aeab3c69
@@ -3986,8 +3948,8 @@ trackedFiles:
pristine_git_object: bf257605d2a5dc41234cb9fcfdda939948b26388
src/openrouter/components/model.py:
id: cef3adaa772b
last_write_checksum: sha1:32480e573bb64c06f1cae9845ca6269b8d5ef926
pristine_git_object: 14dc4b9b71d0dcfc4d55ab086f5a90bf8325c159
last_write_checksum: sha1:d3f7c187d04c26f53197b0ea66f6b40063400041
pristine_git_object: b4be94fbc1d7c973d481d5abf020263e7080e838
src/openrouter/components/modelarchitecture.py:
id: b37ac27e512b
last_write_checksum: sha1:e1dd41aa140b2ca2c3bbf15abf74e034d42b0166
@@ -4058,8 +4020,8 @@ trackedFiles:
pristine_git_object: 08d990d8cc07b7928158fc55784cd9d613f4c58b
src/openrouter/components/openresponsesresult.py:
id: 78f7e33b19e6
last_write_checksum: sha1:8dd339b5021699b49dbfcff86e388947f61d5747
pristine_git_object: fa04955d5675d8aef3ff3deaeb6560c7a0070f4f
last_write_checksum: sha1:fa6f57fed62bfb641a8fbcfa322c2b1c192decb6
pristine_git_object: 1a565178778c0f5f249304e439b193f23dac5353
src/openrouter/components/openrouterwebsearchservertool.py:
id: f5400a5de3cd
last_write_checksum: sha1:e1cd10158e15f88d5c2903b1508a42d4006f4f3f
@@ -4190,16 +4152,16 @@ trackedFiles:
pristine_git_object: 4510e737dd18154f31fb91ea607db550c11f8290
src/openrouter/components/percentilelatencycutoffs.py:
id: 00ca8d5c0100
last_write_checksum: sha1:81d6bd48f353122c5106ecf3a8540588876fb2d9
pristine_git_object: fa8175fcefc672bad9edcc8612dcc447723a723e
last_write_checksum: sha1:8b410420ec880d0d08a6d99f41d4b047bdae9d90
pristine_git_object: 47b987a7d45d94702dcae46496735d5de827c941
src/openrouter/components/percentilestats.py:
id: 9c88efe57f70
last_write_checksum: sha1:c66a32149756893be4e46f16bf166cd9e36dd9f0
pristine_git_object: e979e11469df4f37098d5804ffd3e5da217468b9
src/openrouter/components/percentilethroughputcutoffs.py:
id: 652397163aaa
last_write_checksum: sha1:409e8a4c017d03a4f852bdbfae874fd126a434d5
pristine_git_object: 17b28ced7a9ad1df064a5509d55b1ead8cb2a4a5
last_write_checksum: sha1:9d6b65012c6b2884e883ecc4024fc452622f9d10
pristine_git_object: d6e0323b1ca34ee37890b75373d12385a827f866
src/openrouter/components/perrequestlimits.py:
id: 5a170d7d1f2e
last_write_checksum: sha1:9b269bd87a1f704a0f0fa731da57cb35bc960674
@@ -4250,8 +4212,8 @@ trackedFiles:
pristine_git_object: 4e1073b4e3c10943c7035376f9984cd6559653a2
src/openrouter/components/publicendpoint.py:
id: 848aa2ef9129
last_write_checksum: sha1:a268ea8595c25267ae05b3a2ab9bc452b064c33f
pristine_git_object: 6761c9129979d95e6f44c955e77a2d412bf0eb1b
last_write_checksum: sha1:eaeb6ac6a3b3ab23fb1021bc1c84a0d8ea8264e8
pristine_git_object: 04885b1822518383f68cbc6ceb62488cbf960a3b
src/openrouter/components/publicpricing.py:
id: 96d115d83cc5
last_write_checksum: sha1:ccec3f6d6b07186a612c23561f2bbe6ecfd6839f
@@ -4262,8 +4224,8 @@ trackedFiles:
pristine_git_object: dfcecafdc6d2a3a3dbc7beec2f07e1258415b2b4
src/openrouter/components/reasoningconfig.py:
id: 754fc31a7b69
last_write_checksum: sha1:ac6669cbfddc54d2305d8389881406dd7c79f046
pristine_git_object: 6f390d64620676f40a90ad32fe54c03f7224faba
last_write_checksum: sha1:d5f07c166136b8c271b567a2363432656c758531
pristine_git_object: 7157cd7aad433672c5501959a4eb8a37ca81c5a4
src/openrouter/components/reasoningdeltaevent.py:
id: 6de06228d1f6
last_write_checksum: sha1:efff164cfffbf6b89ab270ac4912243649149457
@@ -4358,16 +4320,12 @@ trackedFiles:
pristine_git_object: d3c77624292ba0985104a6125e462c305a633d84
src/openrouter/components/responsesrequest.py:
id: 8c850080ec5d
last_write_checksum: sha1:d3736138872e8a2af2681707dac0d4b08c9f198f
pristine_git_object: 357c19a3c8198fe785cee157960b438f96d84cb0
last_write_checksum: sha1:0a780f225dd8afae2ce99590bdcec98dd3cde7d1
pristine_git_object: bf396f9a8237fd7733d1d5cdd0d8d5b206bef4d2
src/openrouter/components/searchcontextsizeenum.py:
id: c246413c0bd7
last_write_checksum: sha1:863a664a9f17def86180b0407c8233c263acfae7
pristine_git_object: 7faa97b80bfc0d362fd89c255adb708a4f7afc05
src/openrouter/components/searchmodelsservertoolconfig.py:
id: 6a1174213084
last_write_checksum: sha1:fbafd5baf44fa1f922a357a77ca0ce89eecc54d1
pristine_git_object: 559ecad60dc51d3a30a5b40421fd0e1e5db2aaed
src/openrouter/components/searchqualitylevel.py:
id: 8fdb148edfb2
last_write_checksum: sha1:ef6932e03bc19a234c36b511313826048241b56f
@@ -4450,8 +4408,8 @@ trackedFiles:
pristine_git_object: 19fda103cedcccd94e8feac9ee0a069454b06868
src/openrouter/components/topproviderinfo.py:
id: 0517ce43cc77
last_write_checksum: sha1:5180e3c9ddd7aa2eb66276b46f4170c794ec508e
pristine_git_object: 475bda8f58fa58a990f06d935b3280ba91b2bffe
last_write_checksum: sha1:d00eaf491caa06fd306a8e7ea22980cf5025c86c
pristine_git_object: d5f5d35575889d9a04cc0512fff6910f242aaff8
src/openrouter/components/traceconfig.py:
id: 19375fa88b9a
last_write_checksum: sha1:f8f931bcc35e0b4cd45669a77fddf7fab812da16
@@ -4470,8 +4428,8 @@ trackedFiles:
pristine_git_object: 1c70ab3d8b23363543675abe5d3b3566aea113e7
src/openrouter/components/updateguardrailrequest.py:
id: 6a557cd822a0
last_write_checksum: sha1:c9a41a90ad1eee466855137101ae02def9c7e553
pristine_git_object: c4000777114116a421b2e2f51675497ea89263ce
last_write_checksum: sha1:18e5c377616336011698f7dbc7e7b7f797e85ccd
pristine_git_object: ac199a97e7780b8d15a623a04138f2ae8ab0cb35
src/openrouter/components/updateguardrailresponse.py:
id: 7b068d26ce31
last_write_checksum: sha1:2b63cbb90747f07f775d9a22e80f74c67221fea8
@@ -4482,8 +4440,8 @@ trackedFiles:
pristine_git_object: 5fbad2e52909780be771ec9e3aa3410cf0ed7561
src/openrouter/components/usage.py:
id: 965ca6748bf6
last_write_checksum: sha1:0ad13adb2797e0e9f080bd695e9e349aa4364eb6
pristine_git_object: 3ff415b693496c00c41261d09e7c0c12d83730fd
last_write_checksum: sha1:dd89198ccc0089fc10e4072b66ac8248636fd553
pristine_git_object: bce40413582842d38e334193913889d92ede78e8
src/openrouter/components/videogenerationrequest.py:
id: 70e3c9ff288c
last_write_checksum: sha1:f892d1c5506561312151604aa837b90546603d7f
@@ -4494,8 +4452,8 @@ trackedFiles:
pristine_git_object: ab182a8151bf251a7cb587e3a8dcf07337a468e9
src/openrouter/components/videogenerationusage.py:
id: dded36eba597
last_write_checksum: sha1:eb24fec1c15bc48a958af8c40ac51ac1edf7a3ea
pristine_git_object: 2b555be30b2462ae3065ed6a78918ba764289dae
last_write_checksum: sha1:abe43fc81268db99abab0bc9e6c9076e7e776aff
pristine_git_object: 806f1d0757c87b0e8c6cf166a6c13dbf0710d802
src/openrouter/components/videomodel.py:
id: a544a49f7891
last_write_checksum: sha1:5a49a75ead25b02765b589d207e3bb5e98bb190e
@@ -4658,8 +4616,8 @@ trackedFiles:
pristine_git_object: fddcce7468125b281b22f520928ee5d31f027fc5
src/openrouter/guardrails.py:
id: 705839f34e66
last_write_checksum: sha1:b8b1ea14cd57a7f4100f63efbe76d3baf5e62254
pristine_git_object: 7d1038da0c7b1e6989aaeb070b1a2081157b53e1
last_write_checksum: sha1:aff353ba2abd51c9800cf404316f8cc957fc10cc
pristine_git_object: 50a17b2c63d2ea1fb4645bab913ab69b09813d98
src/openrouter/httpclient.py:
id: e9311185443d
last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7
@@ -4718,8 +4676,8 @@ trackedFiles:
pristine_git_object: 75b9661b38be99f2a067eda4051592111301bed1
src/openrouter/operations/createkeys.py:
id: 64ad31fdaa6c
last_write_checksum: sha1:2d9152fa4d928959e6fa6fd87064a5eff9593f85
pristine_git_object: 5ed218dc83d851e8ccf7da73203c7677c7ef75c5
last_write_checksum: sha1:726f5ba4242c20a684cf67e7b16f97486089c0de
pristine_git_object: d77c96e247be5a7f7eb329565e9baf89395452b0
src/openrouter/operations/creatererank.py:
id: 99b5d368a168
last_write_checksum: sha1:86b7c32d7b0bb77f16b9926384c47774e9e25c6a
@@ -4750,20 +4708,20 @@ trackedFiles:
pristine_git_object: 54ebfd677a4050866cb070a1889169842f08f08a
src/openrouter/operations/getcurrentkey.py:
id: baf3e38db22c
last_write_checksum: sha1:9d59301c91d1a0056c8817195ea4e33d0ca68a08
pristine_git_object: 2d26173fd7e4555e188999eee1e282e85b68c73d
last_write_checksum: sha1:1d1274c7f2fc9fe455dd624d2a9a532dc5782c68
pristine_git_object: 033e231b74631ead7c0f60586e0e33946934b1cf
src/openrouter/operations/getgeneration.py:
id: d7c64961334f
last_write_checksum: sha1:8816e63b89634cc5b5df7ef6119421224965e529
pristine_git_object: 94dfcb738c716d409f17be7a2e11485531d90a34
last_write_checksum: sha1:c4d5f17282e2e62f40256bb58519596037c126f0
pristine_git_object: ab106e6ad1f6464371dd86451a9c3fa1d63c956e
src/openrouter/operations/getguardrail.py:
id: 9b3309b59c64
last_write_checksum: sha1:f83b3d52731324d0bc87c382196b84713e77f6da
pristine_git_object: e3a2ca2914e9add5060e7efa73dd268d5e32a9a5
src/openrouter/operations/getkey.py:
id: d9769da90865
last_write_checksum: sha1:3630fb35d372c6541061cf2d425ebf58acc336f7
pristine_git_object: ec3948b6b7c470258a3dfe10d304c2d52bd68b04
last_write_checksum: sha1:eb81f6e4775e83d22296786c4ed1cb9e08580fcb
pristine_git_object: 77c3f4b78a018ada25945284633b85816e7a71fc
src/openrouter/operations/getmodels.py:
id: 5bd5dfcb0125
last_write_checksum: sha1:013ccee44da99aa609f290aef9f253e64dca38c6
@@ -4778,8 +4736,8 @@ trackedFiles:
pristine_git_object: 3a120ed0aacd7ac94b3421fc1439e1308d53f83f
src/openrouter/operations/list.py:
id: 3ced31e3804e
last_write_checksum: sha1:a160c202d3cce31f3cb2f9cc911d5e4cd9c44c30
pristine_git_object: e1d703cfe6485faee33c1ca4a7599b9c950bb7af
last_write_checksum: sha1:cd0a657c175bf542a82208d8388f88fe042b5da0
pristine_git_object: 2119c129622cb8ee2312090196ea6b0404167daa
src/openrouter/operations/listembeddingsmodels.py:
id: bf749a1f23d6
last_write_checksum: sha1:654a4e7e7b486f1d321eeb11ef7a7fa928e501a6
@@ -4846,8 +4804,8 @@ trackedFiles:
pristine_git_object: b3675a1d1a828f26750e5b7ac98fb7cf42ed49e1
src/openrouter/operations/updatekeys.py:
id: 56fb213253a8
last_write_checksum: sha1:cd60ee4ccc84dc5e491edc2df0780f2ea757d3ae
pristine_git_object: a8d2f865c3915c75bfef1865f567c3ffe6129bf7
last_write_checksum: sha1:745fc6dc0b0de3322ac7efe78e9afb2fb72c449c
pristine_git_object: ba632390fd0f6374850657a4d3a4ecc46d31a043
src/openrouter/organization.py:
id: 6f4c63c416e8
last_write_checksum: sha1:4ca00158cd6a4971e7a4cf6da1ef084da25630d9
@@ -4866,8 +4824,8 @@ trackedFiles:
pristine_git_object: e8fdd1dd0911b8cfb465e577d22079644733f687
src/openrouter/responses.py:
id: f2108fb635e1
last_write_checksum: sha1:0904d495ee9d0e8e08bd2000406c9f147acb730e
pristine_git_object: 4844bc0a635f0d4450e617c4a66810ff9e55890e
last_write_checksum: sha1:d1abb961cf4fc197b34e569c6649e8ae6e9786cb
pristine_git_object: 887a3ab4324c3a03faf3ebf412d9954c5a4c7065
src/openrouter/sdk.py:
id: ee9846c4c9c5
last_write_checksum: sha1:af0469095dac69b5b92dd0f717ecf193a9c353e2
@@ -4963,7 +4921,7 @@ examples:
application/json: {"service_tier": "auto", "store": false, "stream": false}
responses:
"200":
application/json: {"completed_at": 1704067210, "created_at": 1704067200, "error": null, "frequency_penalty": 3967.09, "id": "resp-abc123", "incomplete_details": null, "instructions": null, "metadata": null, "model": "gpt-4", "object": "response", "output": [], "parallel_tool_calls": true, "presence_penalty": 7468.94, "status": "completed", "temperature": null, "tool_choice": "auto", "tools": [], "top_p": null}
application/json: {"completed_at": 1704067210, "created_at": 1704067200, "error": null, "frequency_penalty": 3967.09, "id": "resp-abc123", "incomplete_details": null, "instructions": null, "metadata": null, "model": "gpt-4", "object": "response", "output": [], "parallel_tool_calls": true, "presence_penalty": 7468.94, "status": "completed", "temperature": 9442.28, "tool_choice": "auto", "tools": [], "top_p": 2510.63}
"400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"401":
@@ -5574,3 +5532,4 @@ examples:
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2
releaseNotes: "## Python SDK Changes:\n* `open_router.api_keys.list()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.data.[]` **Changed** **Breaking** :warning:\n* `open_router.guardrails.get()`: `response.data` **Changed** **Breaking** :warning:\n* `open_router.o_auth.create_auth_code()`: `response.data.app_id` **Changed** **Breaking** :warning:\n* `open_router.guardrails.bulk_unassign_members()`: `response.unassigned_count` **Changed** **Breaking** :warning:\n* `open_router.guardrails.bulk_unassign_keys()`: `response.unassigned_count` **Changed** **Breaking** :warning:\n* `open_router.guardrails.bulk_assign_members()`: `response.assigned_count` **Changed** **Breaking** :warning:\n* `open_router.guardrails.list_guardrail_member_assignments()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.total_count` **Changed** **Breaking** :warning:\n* `open_router.beta.responses.send()`: \n * `request` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `open_router.analytics.get_user_activity()`: \n * `request` **Changed**\n * `response.data.[]` **Changed** **Breaking** :warning:\n * `error.status[404]` **Added**\n* `open_router.chat.send()`: \n * `request` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `open_router.embeddings.generate()`: \n * `request.provider` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `open_router.embeddings.list_models()`: `response.data.[]` **Changed** **Breaking** :warning:\n* `open_router.generations.get_generation()`: `response.data` **Changed** **Breaking** :warning:\n* `open_router.models.count()`: `response.data.count` **Changed** **Breaking** :warning:\n* `open_router.models.list()`: `response.data.[]` **Changed** **Breaking** :warning:\n* `open_router.models.list_for_user()`: `response.data.[]` **Changed** **Breaking** :warning:\n* `open_router.endpoints.list_zdr_endpoints()`: `response.data.[]` **Changed** **Breaking** :warning:\n* `open_router.guardrails.bulk_assign_keys()`: `response.assigned_count` **Changed** **Breaking** :warning:\n* `open_router.guardrails.list_member_assignments()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.total_count` **Changed** **Breaking** :warning:\n* `open_router.api_keys.create()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.data` **Changed** **Breaking** :warning:\n* `open_router.api_keys.update()`: \n * `request.limit` **Changed** **Breaking** :warning:\n * `response.data` **Changed** **Breaking** :warning:\n* `open_router.api_keys.get()`: `response.data` **Changed** **Breaking** :warning:\n* `open_router.api_keys.get_current_key_metadata()`: `response.data` **Changed** **Breaking** :warning:\n* `open_router.guardrails.list()`: \n * `request` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `open_router.guardrails.create()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.data` **Changed** **Breaking** :warning:\n* `open_router.endpoints.list()`: `response.data` **Changed** **Breaking** :warning:\n* `open_router.guardrails.update()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.data` **Changed** **Breaking** :warning:\n* `open_router.guardrails.list_key_assignments()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.total_count` **Changed** **Breaking** :warning:\n* `open_router.guardrails.list_guardrail_key_assignments()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.total_count` **Changed** **Breaking** :warning:\n* `open_router.organization.list_members()`: **Added**\n* `open_router.rerank.rerank()`: **Added**\n* `open_router.credits.create_coinbase_charge()`: **Deleted** **Breaking** :warning:\n* `open_router.video_generation.list_videos_models()`: **Added**\n* `open_router.video_generation.get_video_content()`: **Added**\n* `open_router.video_generation.get_generation()`: **Added**\n* `open_router.video_generation.generate()`: **Added**\n"
+1 -1
View File
@@ -32,7 +32,7 @@ generation:
skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true
python:
version: 0.9.1
version: 0.9.0
additionalDependencies:
dev: {}
main: {}
+26 -193
View File
@@ -1326,16 +1326,12 @@ components:
nullable: true
type: array
new_lines:
nullable: true
type: integer
new_start:
nullable: true
type: integer
old_lines:
nullable: true
type: integer
old_start:
nullable: true
type: integer
type:
enum:
@@ -1418,13 +1414,10 @@ components:
- pdf
type: string
num_lines:
nullable: true
type: integer
start_line:
nullable: true
type: integer
total_lines:
nullable: true
type: integer
type:
enum:
@@ -1681,10 +1674,8 @@ components:
cache_creation:
$ref: '#/components/schemas/AnthropicCacheCreation'
cache_creation_input_tokens:
nullable: true
type: integer
cache_read_input_tokens:
nullable: true
type: integer
inference_geo:
nullable: true
@@ -2713,7 +2704,6 @@ components:
nullable: true
type: boolean
completed_at:
nullable: true
type: integer
created_at:
type: integer
@@ -2721,7 +2711,6 @@ components:
$ref: '#/components/schemas/ResponsesErrorField'
frequency_penalty:
format: double
nullable: true
type: number
id:
type: string
@@ -2730,10 +2719,8 @@ components:
instructions:
$ref: '#/components/schemas/BaseInputs'
max_output_tokens:
nullable: true
type: integer
max_tool_calls:
nullable: true
type: integer
metadata:
$ref: '#/components/schemas/RequestMetadata'
@@ -2768,7 +2755,6 @@ components:
type: boolean
presence_penalty:
format: double
nullable: true
type: number
previous_response_id:
nullable: true
@@ -2791,7 +2777,6 @@ components:
type: boolean
temperature:
format: double
nullable: true
type: number
text:
$ref: '#/components/schemas/TextConfig'
@@ -2840,7 +2825,6 @@ components:
type: integer
top_p:
format: double
nullable: true
type: number
truncation:
$ref: '#/components/schemas/Truncation'
@@ -3511,8 +3495,6 @@ components:
- function
type: object
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter'
- $ref: '#/components/schemas/ChatSearchModelsServerTool'
- $ref: '#/components/schemas/OpenRouterWebSearchServerTool'
- $ref: '#/components/schemas/ChatWebSearchShorthand'
description: Tool definition for function calling (regular function or OpenRouter built-in server tool)
@@ -3671,10 +3653,22 @@ components:
description: Frequency penalty (-2.0 to 2.0)
example: 0
format: double
nullable: true
type: number
image_config:
$ref: '#/components/schemas/ImageConfig'
additionalProperties:
anyOf:
- type: string
- format: double
type: number
- items:
nullable: true
type: array
description: >-
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.
example:
aspect_ratio: '16:9'
type: object
logit_bias:
additionalProperties:
format: double
@@ -3692,12 +3686,10 @@ components:
max_completion_tokens:
description: Maximum tokens in completion
example: 100
nullable: true
type: integer
max_tokens:
description: 'Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.'
example: 100
nullable: true
type: integer
messages:
description: List of messages for the conversation
@@ -3763,7 +3755,6 @@ components:
description: Presence penalty (-2.0 to 2.0)
example: 0
format: double
nullable: true
type: number
provider:
$ref: '#/components/schemas/ProviderPreferences'
@@ -3812,7 +3803,6 @@ components:
seed:
description: Random seed for deterministic outputs
example: 42
nullable: true
type: integer
service_tier:
description: The service tier to use for processing this request.
@@ -3856,7 +3846,6 @@ components:
description: Sampling temperature (0-2)
example: 0.7
format: double
nullable: true
type: number
tool_choice:
$ref: '#/components/schemas/ChatToolChoice'
@@ -3873,13 +3862,11 @@ components:
top_logprobs:
description: Number of top log probabilities to return (0-20)
example: 5
nullable: true
type: integer
top_p:
description: Nucleus sampling parameter (0-1)
example: 1
format: double
nullable: true
type: number
trace:
$ref: '#/components/schemas/TraceConfig'
@@ -3949,22 +3936,6 @@ components:
- object
- system_fingerprint
type: object
ChatSearchModelsServerTool:
description: 'OpenRouter built-in server tool: searches and filters AI models available on OpenRouter'
example:
parameters:
max_results: 5
type: openrouter:experimental__search_models
properties:
parameters:
$ref: '#/components/schemas/SearchModelsServerToolConfig'
type:
enum:
- openrouter:experimental__search_models
type: string
required:
- type
type: object
ChatStreamChoice:
description: Streaming completion choice chunk
example:
@@ -4358,19 +4329,15 @@ components:
properties:
accepted_prediction_tokens:
description: Accepted prediction tokens
nullable: true
type: integer
audio_tokens:
description: Tokens used for audio output
nullable: true
type: integer
reasoning_tokens:
description: Tokens used for reasoning
nullable: true
type: integer
rejected_prediction_tokens:
description: Rejected prediction tokens
nullable: true
type: integer
type: object
prompt_tokens:
@@ -4912,7 +4879,6 @@ components:
description: Spending limit in USD
example: 50
format: double
nullable: true
type: number
name:
description: Name for the new guardrail
@@ -5036,26 +5002,22 @@ components:
properties:
frequency_penalty:
format: double
nullable: true
type: number
presence_penalty:
format: double
nullable: true
type: number
repetition_penalty:
format: double
nullable: true
type: number
temperature:
format: double
nullable: true
type: number
top_k:
minimum: 0
nullable: true
type: integer
top_p:
format: double
nullable: true
type: number
type: object
DeleteGuardrailResponse:
@@ -5735,7 +5697,6 @@ components:
description: Spending limit in USD
example: 100
format: double
nullable: true
type: number
name:
description: Name of the guardrail
@@ -5763,22 +5724,6 @@ components:
example: monthly
nullable: true
type: string
ImageConfig:
additionalProperties:
anyOf:
- type: string
- format: double
type: number
- items:
nullable: true
type: array
description: >-
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.
example:
aspect_ratio: '16:9'
quality: high
type: object
ImageGenCallCompletedEvent:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesImageGenCallCompleted'
@@ -5892,46 +5837,6 @@ components:
required:
- type
type: object
ImageGenerationServerTool_OpenRouter:
description: 'OpenRouter built-in server tool: generates images from text prompts using an image generation model'
example:
parameters:
model: openai/gpt-image-1
quality: high
size: 1024x1024
type: openrouter:image_generation
properties:
parameters:
$ref: '#/components/schemas/ImageGenerationServerToolConfig'
type:
enum:
- openrouter:image_generation
type: string
required:
- type
type: object
ImageGenerationServerToolConfig:
additionalProperties:
anyOf:
- type: string
- format: double
type: number
- items:
nullable: true
type: array
description: >-
Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio,
quality, size, background, output_format, output_compression, moderation, etc.) plus a model field.
example:
aspect_ratio: '16:9'
model: openai/gpt-image-1
quality: high
properties:
model:
description: Which image generation model to use (e.g. "openai/gpt-image-1"). Defaults to "openai/gpt-image-1".
example: openai/gpt-image-1
type: string
type: object
ImageGenerationStatus:
enum:
- in_progress
@@ -7573,7 +7478,6 @@ components:
cache_control:
$ref: '#/components/schemas/AnthropicCacheControlDirective'
max_uses:
nullable: true
type: integer
name:
enum:
@@ -7611,7 +7515,6 @@ components:
cache_control:
$ref: '#/components/schemas/AnthropicCacheControlDirective'
max_uses:
nullable: true
type: integer
name:
enum:
@@ -7628,8 +7531,6 @@ components:
- name
type: object
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter'
- $ref: '#/components/schemas/ChatSearchModelsServerTool'
- $ref: '#/components/schemas/OpenRouterWebSearchServerTool'
type: array
top_k:
@@ -7662,7 +7563,6 @@ components:
- properties:
cost:
format: double
nullable: true
type: number
cost_details:
nullable: true
@@ -7672,7 +7572,6 @@ components:
type: number
upstream_inference_cost:
format: double
nullable: true
type: number
upstream_inference_prompt_cost:
format: double
@@ -8004,7 +7903,6 @@ components:
context_length:
description: Maximum context length in tokens
example: 8192
nullable: true
type: integer
created:
description: Unix timestamp of when the model was created
@@ -9970,22 +9868,18 @@ components:
p50:
description: Maximum p50 latency (seconds)
format: double
nullable: true
type: number
p75:
description: Maximum p75 latency (seconds)
format: double
nullable: true
type: number
p90:
description: Maximum p90 latency (seconds)
format: double
nullable: true
type: number
p99:
description: Maximum p99 latency (seconds)
format: double
nullable: true
type: number
type: object
PercentileStats:
@@ -10034,22 +9928,18 @@ components:
p50:
description: Minimum p50 throughput (tokens/sec)
format: double
nullable: true
type: number
p75:
description: Minimum p75 throughput (tokens/sec)
format: double
nullable: true
type: number
p90:
description: Minimum p90 throughput (tokens/sec)
format: double
nullable: true
type: number
p99:
description: Minimum p99 throughput (tokens/sec)
format: double
nullable: true
type: number
type: object
PerRequestLimits:
@@ -10658,10 +10548,8 @@ components:
latency_last_30m:
$ref: '#/components/schemas/PercentileStats'
max_completion_tokens:
nullable: true
type: integer
max_prompt_tokens:
nullable: true
type: integer
model_id:
description: The unique identifier for the model (permaslug)
@@ -10759,18 +10647,15 @@ components:
Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) *
100. Rate-limited requests are excluded. Returns null if insufficient data.
format: double
nullable: true
type: number
uptime_last_30m:
format: double
nullable: true
type: number
uptime_last_5m:
description: >-
Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests)
* 100. Rate-limited requests are excluded. Returns null if insufficient data.
format: double
nullable: true
type: number
required:
- name
@@ -10879,7 +10764,6 @@ components:
nullable: true
type: boolean
max_tokens:
nullable: true
type: integer
type: object
description: Configuration for reasoning mode in the response
@@ -11358,10 +11242,19 @@ components:
type: boolean
frequency_penalty:
format: double
nullable: true
type: number
image_config:
$ref: '#/components/schemas/ImageConfig'
additionalProperties:
anyOf:
- type: string
- format: double
type: number
description: >-
Provider-specific image configuration options. Keys and values vary by model/provider. See
https://openrouter.ai/docs/features/multimodal/image-generation for more details.
example:
aspect_ratio: '16:9'
type: object
include:
items:
$ref: '#/components/schemas/ResponseIncludesEnum'
@@ -11373,10 +11266,8 @@ components:
nullable: true
type: string
max_output_tokens:
nullable: true
type: integer
max_tool_calls:
nullable: true
type: integer
metadata:
$ref: '#/components/schemas/RequestMetadata'
@@ -11419,7 +11310,6 @@ components:
type: array
presence_penalty:
format: double
nullable: true
type: number
previous_response_id:
nullable: true
@@ -11465,7 +11355,6 @@ components:
type: boolean
temperature:
format: double
nullable: true
type: number
text:
$ref: '#/components/schemas/TextExtendedConfig'
@@ -11510,18 +11399,14 @@ components:
- $ref: '#/components/schemas/ApplyPatchServerTool'
- $ref: '#/components/schemas/CustomTool'
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter'
- $ref: '#/components/schemas/ChatSearchModelsServerTool'
- $ref: '#/components/schemas/WebSearchServerTool_OpenRouter'
type: array
top_k:
type: integer
top_logprobs:
nullable: true
type: integer
top_p:
format: double
nullable: true
type: number
trace:
$ref: '#/components/schemas/TraceConfig'
@@ -11543,16 +11428,6 @@ components:
- high
example: medium
type: string
SearchModelsServerToolConfig:
description: Configuration for the openrouter:experimental__search_models server tool
example:
max_results: 5
properties:
max_results:
description: Maximum number of models to return. Defaults to 5, max 20.
example: 5
type: integer
type: object
SearchQualityLevel:
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa
@@ -12031,7 +11906,6 @@ components:
context_length:
description: Context length from the top provider
example: 8192
nullable: true
type: integer
is_moderated:
description: Whether the top provider moderates content
@@ -12040,7 +11914,6 @@ components:
max_completion_tokens:
description: Maximum completion tokens from the top provider
example: 4096
nullable: true
type: integer
required:
- is_moderated
@@ -12203,7 +12076,6 @@ components:
description: New spending limit in USD
example: 75
format: double
nullable: true
type: number
name:
description: New name for the guardrail
@@ -12273,13 +12145,11 @@ components:
cost:
description: Cost of the completion
format: double
nullable: true
type: number
cost_details:
properties:
upstream_inference_cost:
format: double
nullable: true
type: number
upstream_inference_input_cost:
format: double
@@ -12865,7 +12735,6 @@ components:
cost:
description: The cost of the video generation in USD.
format: double
nullable: true
type: number
is_byok:
description: Whether the request was made using a Bring Your Own Key configuration.
@@ -14603,13 +14472,11 @@ paths:
app_id:
description: ID of the app that made the request
example: 12345
nullable: true
type: integer
cache_discount:
description: Discount applied due to caching
example: 0.0002
format: double
nullable: true
type: number
cancelled:
description: Whether the generation was cancelled
@@ -14634,7 +14501,6 @@ paths:
description: Time taken for generation in milliseconds
example: 1200
format: double
nullable: true
type: number
http_referer:
description: Referer header from the request
@@ -14652,7 +14518,6 @@ paths:
description: Total latency in milliseconds
example: 1250
format: double
nullable: true
type: number
model:
description: Model used for the generation
@@ -14662,7 +14527,6 @@ paths:
description: Moderation latency in milliseconds
example: 50
format: double
nullable: true
type: number
native_finish_reason:
description: Native finish reason as reported by provider
@@ -14672,47 +14536,38 @@ paths:
native_tokens_cached:
description: Native cached tokens as reported by provider
example: 3
nullable: true
type: integer
native_tokens_completion:
description: Native completion tokens as reported by provider
example: 25
nullable: true
type: integer
native_tokens_completion_images:
description: Native completion image tokens as reported by provider
example: 0
nullable: true
type: integer
native_tokens_prompt:
description: Native prompt tokens as reported by provider
example: 10
nullable: true
type: integer
native_tokens_reasoning:
description: Native reasoning tokens as reported by provider
example: 5
nullable: true
type: integer
num_input_audio_prompt:
description: Number of audio inputs in the prompt
example: 0
nullable: true
type: integer
num_media_completion:
description: Number of media items in the completion
example: 0
nullable: true
type: integer
num_media_prompt:
description: Number of media items in the prompt
example: 1
nullable: true
type: integer
num_search_results:
description: Number of search results included
example: 5
nullable: true
type: integer
origin:
description: Origin URL of the request
@@ -14751,12 +14606,10 @@ paths:
tokens_completion:
description: Number of tokens in the completion
example: 25
nullable: true
type: integer
tokens_prompt:
description: Number of tokens in the prompt
example: 10
nullable: true
type: integer
total_cost:
description: Total cost of the generation in USD
@@ -14772,7 +14625,6 @@ paths:
description: Cost charged by the upstream provider
example: 0.0012
format: double
nullable: true
type: number
usage:
description: Usage amount in USD
@@ -14923,7 +14775,6 @@ paths:
description: Number of records to skip for pagination
example: 0
minimum: 0
nullable: true
type: integer
- description: Maximum number of records to return (max 100)
in: query
@@ -15319,7 +15170,6 @@ paths:
description: Number of records to skip for pagination
example: 0
minimum: 0
nullable: true
type: integer
- description: Maximum number of records to return (max 100)
in: query
@@ -15572,7 +15422,6 @@ paths:
description: Number of records to skip for pagination
example: 0
minimum: 0
nullable: true
type: integer
- description: Maximum number of records to return (max 100)
in: query
@@ -15817,7 +15666,6 @@ paths:
description: Number of records to skip for pagination
example: 0
minimum: 0
nullable: true
type: integer
- description: Maximum number of records to return (max 100)
in: query
@@ -15896,7 +15744,6 @@ paths:
description: Number of records to skip for pagination
example: 0
minimum: 0
nullable: true
type: integer
- description: Maximum number of records to return (max 100)
in: query
@@ -16101,13 +15948,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -16231,7 +16076,6 @@ paths:
description: Number of API keys to skip for pagination
example: 0
minimum: 0
nullable: true
type: integer
responses:
'200':
@@ -16365,13 +16209,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -16513,7 +16355,6 @@ paths:
description: Optional spending limit for the API key in USD
example: 50
format: double
nullable: true
type: number
limit_reset:
description: >-
@@ -16669,13 +16510,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -17004,13 +16843,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -17156,7 +16993,6 @@ paths:
description: New spending limit for the API key in USD
example: 75
format: double
nullable: true
type: number
limit_reset:
description: >-
@@ -17307,13 +17143,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -17983,7 +17817,6 @@ paths:
description: Number of records to skip for pagination
example: 0
minimum: 0
nullable: true
type: integer
- description: Maximum number of records to return (max 100)
in: query
+24 -191
View File
@@ -1356,16 +1356,12 @@ components:
nullable: true
type: array
new_lines:
nullable: true
type: integer
new_start:
nullable: true
type: integer
old_lines:
nullable: true
type: integer
old_start:
nullable: true
type: integer
type:
enum:
@@ -1450,13 +1446,10 @@ components:
type: string
x-speakeasy-unknown-values: allow
num_lines:
nullable: true
type: integer
start_line:
nullable: true
type: integer
total_lines:
nullable: true
type: integer
type:
enum:
@@ -1713,10 +1706,8 @@ components:
cache_creation:
$ref: '#/components/schemas/AnthropicCacheCreation'
cache_creation_input_tokens:
nullable: true
type: integer
cache_read_input_tokens:
nullable: true
type: integer
inference_geo:
nullable: true
@@ -2746,7 +2737,6 @@ components:
nullable: true
type: boolean
completed_at:
nullable: true
type: integer
created_at:
type: integer
@@ -2754,7 +2744,6 @@ components:
$ref: '#/components/schemas/ResponsesErrorField'
frequency_penalty:
format: double
nullable: true
type: number
id:
type: string
@@ -2763,10 +2752,8 @@ components:
instructions:
$ref: '#/components/schemas/BaseInputs'
max_output_tokens:
nullable: true
type: integer
max_tool_calls:
nullable: true
type: integer
metadata:
$ref: '#/components/schemas/RequestMetadata'
@@ -2801,7 +2788,6 @@ components:
type: boolean
presence_penalty:
format: double
nullable: true
type: number
previous_response_id:
nullable: true
@@ -2824,7 +2810,6 @@ components:
type: boolean
temperature:
format: double
nullable: true
type: number
text:
$ref: '#/components/schemas/TextConfig'
@@ -2874,7 +2859,6 @@ components:
type: integer
top_p:
format: double
nullable: true
type: number
truncation:
$ref: '#/components/schemas/Truncation'
@@ -3545,8 +3529,6 @@ components:
- function
type: object
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter'
- $ref: '#/components/schemas/ChatSearchModelsServerTool'
- $ref: '#/components/schemas/OpenRouterWebSearchServerTool'
- $ref: '#/components/schemas/ChatWebSearchShorthand'
description: Tool definition for function calling (regular function or OpenRouter built-in server tool)
@@ -3706,10 +3688,21 @@ components:
description: Frequency penalty (-2.0 to 2.0)
example: 0
format: double
nullable: true
type: number
image_config:
$ref: '#/components/schemas/ImageConfig'
additionalProperties:
anyOf:
- type: string
- format: double
type: number
- items:
nullable: true
type: array
description: >-
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.
example:
aspect_ratio: '16:9'
type: object
logit_bias:
additionalProperties:
format: double
@@ -3727,12 +3720,10 @@ components:
max_completion_tokens:
description: Maximum tokens in completion
example: 100
nullable: true
type: integer
max_tokens:
description: 'Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.'
example: 100
nullable: true
type: integer
messages:
description: List of messages for the conversation
@@ -3798,7 +3789,6 @@ components:
description: Presence penalty (-2.0 to 2.0)
example: 0
format: double
nullable: true
type: number
provider:
$ref: '#/components/schemas/ProviderPreferences'
@@ -3848,7 +3838,6 @@ components:
seed:
description: Random seed for deterministic outputs
example: 42
nullable: true
type: integer
service_tier:
description: The service tier to use for processing this request.
@@ -3890,7 +3879,6 @@ components:
description: Sampling temperature (0-2)
example: 0.7
format: double
nullable: true
type: number
tool_choice:
$ref: '#/components/schemas/ChatToolChoice'
@@ -3907,13 +3895,11 @@ components:
top_logprobs:
description: Number of top log probabilities to return (0-20)
example: 5
nullable: true
type: integer
top_p:
description: Nucleus sampling parameter (0-1)
example: 1
format: double
nullable: true
type: number
trace:
$ref: '#/components/schemas/TraceConfig'
@@ -3983,22 +3969,6 @@ components:
- object
- system_fingerprint
type: object
ChatSearchModelsServerTool:
description: 'OpenRouter built-in server tool: searches and filters AI models available on OpenRouter'
example:
parameters:
max_results: 5
type: openrouter:experimental__search_models
properties:
parameters:
$ref: '#/components/schemas/SearchModelsServerToolConfig'
type:
enum:
- openrouter:experimental__search_models
type: string
required:
- type
type: object
ChatStreamChoice:
description: Streaming completion choice chunk
example:
@@ -4392,19 +4362,15 @@ components:
properties:
accepted_prediction_tokens:
description: Accepted prediction tokens
nullable: true
type: integer
audio_tokens:
description: Tokens used for audio output
nullable: true
type: integer
reasoning_tokens:
description: Tokens used for reasoning
nullable: true
type: integer
rejected_prediction_tokens:
description: Rejected prediction tokens
nullable: true
type: integer
type: object
prompt_tokens:
@@ -4945,7 +4911,6 @@ components:
description: Spending limit in USD
example: 50
format: double
nullable: true
type: number
name:
description: Name for the new guardrail
@@ -5070,26 +5035,22 @@ components:
properties:
frequency_penalty:
format: double
nullable: true
type: number
presence_penalty:
format: double
nullable: true
type: number
repetition_penalty:
format: double
nullable: true
type: number
temperature:
format: double
nullable: true
type: number
top_k:
minimum: 0
nullable: true
type: integer
top_p:
format: double
nullable: true
type: number
type: object
DeleteGuardrailResponse:
@@ -5770,7 +5731,6 @@ components:
description: Spending limit in USD
example: 100
format: double
nullable: true
type: number
name:
description: Name of the guardrail
@@ -5799,21 +5759,6 @@ components:
nullable: true
type: string
x-speakeasy-unknown-values: allow
ImageConfig:
additionalProperties:
anyOf:
- type: string
- format: double
type: number
- items:
nullable: true
type: array
description: >-
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.
example:
aspect_ratio: '16:9'
quality: high
type: object
ImageGenCallCompletedEvent:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesImageGenCallCompleted'
@@ -5934,45 +5879,6 @@ components:
required:
- type
type: object
ImageGenerationServerTool_OpenRouter:
description: 'OpenRouter built-in server tool: generates images from text prompts using an image generation model'
example:
parameters:
model: openai/gpt-image-1
quality: high
size: 1024x1024
type: openrouter:image_generation
properties:
parameters:
$ref: '#/components/schemas/ImageGenerationServerToolConfig'
type:
enum:
- openrouter:image_generation
type: string
required:
- type
type: object
ImageGenerationServerToolConfig:
additionalProperties:
anyOf:
- type: string
- format: double
type: number
- items:
nullable: true
type: array
description: >-
Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field.
example:
aspect_ratio: '16:9'
model: openai/gpt-image-1
quality: high
properties:
model:
description: Which image generation model to use (e.g. "openai/gpt-image-1"). Defaults to "openai/gpt-image-1".
example: openai/gpt-image-1
type: string
type: object
ImageGenerationStatus:
enum:
- in_progress
@@ -7619,7 +7525,6 @@ components:
cache_control:
$ref: '#/components/schemas/AnthropicCacheControlDirective'
max_uses:
nullable: true
type: integer
name:
enum:
@@ -7658,7 +7563,6 @@ components:
cache_control:
$ref: '#/components/schemas/AnthropicCacheControlDirective'
max_uses:
nullable: true
type: integer
name:
enum:
@@ -7675,8 +7579,6 @@ components:
- name
type: object
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter'
- $ref: '#/components/schemas/ChatSearchModelsServerTool'
- $ref: '#/components/schemas/OpenRouterWebSearchServerTool'
type: array
top_k:
@@ -7707,7 +7609,6 @@ components:
- properties:
cost:
format: double
nullable: true
type: number
cost_details:
nullable: true
@@ -7717,7 +7618,6 @@ components:
type: number
upstream_inference_cost:
format: double
nullable: true
type: number
upstream_inference_prompt_cost:
format: double
@@ -8050,7 +7950,6 @@ components:
context_length:
description: Maximum context length in tokens
example: 8192
nullable: true
type: integer
created:
description: Unix timestamp of when the model was created
@@ -10025,22 +9924,18 @@ components:
p50:
description: Maximum p50 latency (seconds)
format: double
nullable: true
type: number
p75:
description: Maximum p75 latency (seconds)
format: double
nullable: true
type: number
p90:
description: Maximum p90 latency (seconds)
format: double
nullable: true
type: number
p99:
description: Maximum p99 latency (seconds)
format: double
nullable: true
type: number
type: object
PercentileStats:
@@ -10088,22 +9983,18 @@ components:
p50:
description: Minimum p50 throughput (tokens/sec)
format: double
nullable: true
type: number
p75:
description: Minimum p75 throughput (tokens/sec)
format: double
nullable: true
type: number
p90:
description: Minimum p90 throughput (tokens/sec)
format: double
nullable: true
type: number
p99:
description: Minimum p99 throughput (tokens/sec)
format: double
nullable: true
type: number
type: object
PerRequestLimits:
@@ -10699,10 +10590,8 @@ components:
latency_last_30m:
$ref: '#/components/schemas/PercentileStats'
max_completion_tokens:
nullable: true
type: integer
max_prompt_tokens:
nullable: true
type: integer
model_id:
description: The unique identifier for the model (permaslug)
@@ -10797,17 +10686,14 @@ components:
description: >-
Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data.
format: double
nullable: true
type: number
uptime_last_30m:
format: double
nullable: true
type: number
uptime_last_5m:
description: >-
Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data.
format: double
nullable: true
type: number
required:
- name
@@ -10917,7 +10803,6 @@ components:
nullable: true
type: boolean
max_tokens:
nullable: true
type: integer
type: object
description: Configuration for reasoning mode in the response
@@ -11400,10 +11285,18 @@ components:
type: boolean
frequency_penalty:
format: double
nullable: true
type: number
image_config:
$ref: '#/components/schemas/ImageConfig'
additionalProperties:
anyOf:
- type: string
- format: double
type: number
description: >-
Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
example:
aspect_ratio: '16:9'
type: object
include:
items:
$ref: '#/components/schemas/ResponseIncludesEnum'
@@ -11415,10 +11308,8 @@ components:
nullable: true
type: string
max_output_tokens:
nullable: true
type: integer
max_tool_calls:
nullable: true
type: integer
metadata:
$ref: '#/components/schemas/RequestMetadata'
@@ -11461,7 +11352,6 @@ components:
type: array
presence_penalty:
format: double
nullable: true
type: number
previous_response_id:
nullable: true
@@ -11506,7 +11396,6 @@ components:
type: boolean
temperature:
format: double
nullable: true
type: number
text:
$ref: '#/components/schemas/TextExtendedConfig'
@@ -11552,18 +11441,14 @@ components:
- $ref: '#/components/schemas/ApplyPatchServerTool'
- $ref: '#/components/schemas/CustomTool'
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter'
- $ref: '#/components/schemas/ChatSearchModelsServerTool'
- $ref: '#/components/schemas/WebSearchServerTool_OpenRouter'
type: array
top_k:
type: integer
top_logprobs:
nullable: true
type: integer
top_p:
format: double
nullable: true
type: number
trace:
$ref: '#/components/schemas/TraceConfig'
@@ -11584,16 +11469,6 @@ components:
example: medium
type: string
x-speakeasy-unknown-values: allow
SearchModelsServerToolConfig:
description: Configuration for the openrouter:experimental__search_models server tool
example:
max_results: 5
properties:
max_results:
description: Maximum number of models to return. Defaults to 5, max 20.
example: 5
type: integer
type: object
SearchQualityLevel:
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
@@ -12075,7 +11950,6 @@ components:
context_length:
description: Context length from the top provider
example: 8192
nullable: true
type: integer
is_moderated:
description: Whether the top provider moderates content
@@ -12084,7 +11958,6 @@ components:
max_completion_tokens:
description: Maximum completion tokens from the top provider
example: 4096
nullable: true
type: integer
required:
- is_moderated
@@ -12246,7 +12119,6 @@ components:
description: New spending limit in USD
example: 75
format: double
nullable: true
type: number
name:
description: New name for the guardrail
@@ -12316,13 +12188,11 @@ components:
cost:
description: Cost of the completion
format: double
nullable: true
type: number
cost_details:
properties:
upstream_inference_cost:
format: double
nullable: true
type: number
upstream_inference_input_cost:
format: double
@@ -12906,7 +12776,6 @@ components:
cost:
description: The cost of the video generation in USD.
format: double
nullable: true
type: number
is_byok:
description: Whether the request was made using a Bring Your Own Key configuration.
@@ -14675,13 +14544,11 @@ paths:
app_id:
description: ID of the app that made the request
example: 12345
nullable: true
type: integer
cache_discount:
description: Discount applied due to caching
example: 0.0002
format: double
nullable: true
type: number
cancelled:
description: Whether the generation was cancelled
@@ -14706,7 +14573,6 @@ paths:
description: Time taken for generation in milliseconds
example: 1200
format: double
nullable: true
type: number
http_referer:
description: Referer header from the request
@@ -14724,7 +14590,6 @@ paths:
description: Total latency in milliseconds
example: 1250
format: double
nullable: true
type: number
model:
description: Model used for the generation
@@ -14734,7 +14599,6 @@ paths:
description: Moderation latency in milliseconds
example: 50
format: double
nullable: true
type: number
native_finish_reason:
description: Native finish reason as reported by provider
@@ -14744,47 +14608,38 @@ paths:
native_tokens_cached:
description: Native cached tokens as reported by provider
example: 3
nullable: true
type: integer
native_tokens_completion:
description: Native completion tokens as reported by provider
example: 25
nullable: true
type: integer
native_tokens_completion_images:
description: Native completion image tokens as reported by provider
example: 0
nullable: true
type: integer
native_tokens_prompt:
description: Native prompt tokens as reported by provider
example: 10
nullable: true
type: integer
native_tokens_reasoning:
description: Native reasoning tokens as reported by provider
example: 5
nullable: true
type: integer
num_input_audio_prompt:
description: Number of audio inputs in the prompt
example: 0
nullable: true
type: integer
num_media_completion:
description: Number of media items in the completion
example: 0
nullable: true
type: integer
num_media_prompt:
description: Number of media items in the prompt
example: 1
nullable: true
type: integer
num_search_results:
description: Number of search results included
example: 5
nullable: true
type: integer
origin:
description: Origin URL of the request
@@ -14823,12 +14678,10 @@ paths:
tokens_completion:
description: Number of tokens in the completion
example: 25
nullable: true
type: integer
tokens_prompt:
description: Number of tokens in the prompt
example: 10
nullable: true
type: integer
total_cost:
description: Total cost of the generation in USD
@@ -14844,7 +14697,6 @@ paths:
description: Cost charged by the upstream provider
example: 0.0012
format: double
nullable: true
type: number
usage:
description: Usage amount in USD
@@ -14998,7 +14850,6 @@ paths:
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
@@ -15400,7 +15251,6 @@ paths:
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
@@ -15658,7 +15508,6 @@ paths:
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
@@ -15908,7 +15757,6 @@ paths:
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
@@ -15990,7 +15838,6 @@ paths:
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
@@ -16198,13 +16045,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -16331,7 +16176,6 @@ paths:
description: Number of API keys to skip for pagination
example: 0
minimum: 0
nullable: false
type: integer
responses:
'200':
@@ -16464,13 +16308,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -16609,7 +16451,6 @@ paths:
description: Optional spending limit for the API key in USD
example: 50
format: double
nullable: true
type: number
limit_reset:
description: >-
@@ -16764,13 +16605,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -17102,13 +16941,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -17254,7 +17091,6 @@ paths:
description: New spending limit for the API key in USD
example: 75
format: double
nullable: true
type: number
limit_reset:
description: >-
@@ -17404,13 +17240,11 @@ paths:
description: Spending limit for the API key in USD
example: 100
format: double
nullable: true
type: number
limit_remaining:
description: Remaining spending limit in USD
example: 74.5
format: double
nullable: true
type: number
limit_reset:
description: Type of limit reset for the API key
@@ -18073,7 +17907,6 @@ paths:
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
@@ -1,10 +0,0 @@
overlay: 1.0.0
x-speakeasy-jsonpath: rfc9535
info:
title: Fix nullable pagination params
version: 0.0.0
actions:
- target: $..parameters[?@.name == "offset" && @.in == "query"].schema
description: Remove nullable from offset query params to fix mypy errors in pagination helpers
update:
nullable: false
+6 -6
View File
@@ -2,19 +2,20 @@ speakeasyVersion: 1.680.0
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:3982892b2b8f82bfc2a26a0f6fcc9512b665a1051dc240a9cfa29001b9453aa9
sourceBlobDigest: sha256:727d3c1f7d36ffbf94c57b565536d8a16804eaef4c4043dd6c98152fc1629c8f
sourceRevisionDigest: sha256:17976e34475ee87867828c00c8e2d0c66ebb004832cf9c34b937c70b2887fafb
sourceBlobDigest: sha256:1e517208c3664b60ade61442469e33564727eb61906514aab26d32cac4cd8ebe
tags:
- latest
- speakeasy-sdk-regen-1775954251
- 1.0.0
targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:3982892b2b8f82bfc2a26a0f6fcc9512b665a1051dc240a9cfa29001b9453aa9
sourceBlobDigest: sha256:727d3c1f7d36ffbf94c57b565536d8a16804eaef4c4043dd6c98152fc1629c8f
sourceRevisionDigest: sha256:17976e34475ee87867828c00c8e2d0c66ebb004832cf9c34b937c70b2887fafb
sourceBlobDigest: sha256:1e517208c3664b60ade61442469e33564727eb61906514aab26d32cac4cd8ebe
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:db86aed74d199f265e2e20442ef652dac0911c8a657ccb3e6614d56a26b8b44e
codeSamplesRevisionDigest: sha256:51de2c56d26b7522fc0e0774cfc6eb2e7d79a32d463ab345c7b5194e513e9060
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.680.0
@@ -28,7 +29,6 @@ workflow:
- location: .speakeasy/overlays/add-headers.overlay.yaml
- location: .speakeasy/overlays/allof-simplify.overlay.yaml
- location: .speakeasy/overlays/boolean-query-params.overlay.yaml
- location: .speakeasy/overlays/fix-nullable-pagination.overlay.yaml
output: .speakeasy/out.openapi.yaml
registry:
location: registry.speakeasyapi.dev/openrouter/sdk/open-router-chat-completions-api
-1
View File
@@ -10,7 +10,6 @@ sources:
- location: .speakeasy/overlays/add-headers.overlay.yaml
- location: .speakeasy/overlays/allof-simplify.overlay.yaml
- location: .speakeasy/overlays/boolean-query-params.overlay.yaml
- location: .speakeasy/overlays/fix-nullable-pagination.overlay.yaml
output: .speakeasy/out.openapi.yaml
registry:
location: registry.speakeasyapi.dev/openrouter/sdk/open-router-chat-completions-api
+30
View File
@@ -169,6 +169,36 @@ asyncio.run(main())
<!-- No Custom HTTP Client [http-client] -->
<!-- Start Pagination [pagination] -->
## Pagination
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned response object will have a `Next` method that can be called to pull down the next group of results. If the
return value of `Next` is `None`, then there are no more pages to be fetched.
Here's an example of one such pagination call:
```python
from openrouter import OpenRouter
import os
with OpenRouter(
http_referer="<value>",
x_open_router_title="<value>",
x_open_router_categories="<value>",
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
res = open_router.guardrails.list()
while res is not None:
# Handle items
res = res.next()
```
<!-- End Pagination [pagination] -->
<!-- Start Resource Management [resource-management] -->
## Resource Management
+11 -1
View File
@@ -8,4 +8,14 @@ Based on:
### Generated
- [python v0.0.16] .
### Releases
- [PyPI v0.0.16] https://pypi.org/project/openrouter/0.0.16 - .
- [PyPI v0.0.16] https://pypi.org/project/openrouter/0.0.16 - .
## 2026-04-14 00:39:13
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.9.0] .
### Releases
- [PyPI v0.9.0] https://pypi.org/project/openrouter/0.9.0 - .
+4 -4
View File
@@ -7,7 +7,7 @@ Detailed completion token usage
| 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 |
| `accepted_prediction_tokens` | *Optional[int]* | :heavy_minus_sign: | Accepted prediction tokens |
| `audio_tokens` | *Optional[int]* | :heavy_minus_sign: | Tokens used for audio output |
| `reasoning_tokens` | *Optional[int]* | :heavy_minus_sign: | Tokens used for reasoning |
| `rejected_prediction_tokens` | *Optional[int]* | :heavy_minus_sign: | Rejected prediction tokens |
+1 -1
View File
@@ -5,6 +5,6 @@
| Field | Type | Required | Description |
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
| `upstream_inference_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `upstream_inference_cost` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `upstream_inference_input_cost` | *float* | :heavy_check_mark: | N/A |
| `upstream_inference_output_cost` | *float* | :heavy_check_mark: | N/A |
+8 -8
View File
@@ -5,11 +5,11 @@ Default parameters for this model
## Fields
| Field | Type | Required | Description |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `repetition_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `top_k` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| Field | Type | Required | Description |
| ----------------------- | ----------------------- | ----------------------- | ----------------------- |
| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `repetition_penalty` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `temperature` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `top_k` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `top_p` | *Optional[float]* | :heavy_minus_sign: | N/A |
+1 -1
View File
@@ -9,7 +9,7 @@ Information about an AI model available on OpenRouter
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `architecture` | [components.ModelArchitecture](../components/modelarchitecture.md) | :heavy_check_mark: | Model architecture information | {<br/>"input_modalities": [<br/>"text"<br/>],<br/>"instruct_type": "chatml",<br/>"modality": "text-\u003etext",<br/>"output_modalities": [<br/>"text"<br/>],<br/>"tokenizer": "GPT"<br/>} |
| `canonical_slug` | *str* | :heavy_check_mark: | Canonical slug for the model | openai/gpt-4 |
| `context_length` | *Nullable[int]* | :heavy_check_mark: | Maximum context length in tokens | 8192 |
| `context_length` | *int* | :heavy_check_mark: | Maximum context length in tokens | 8192 |
| `created` | *int* | :heavy_check_mark: | Unix timestamp of when the model was created | 1692901234 |
| `default_parameters` | [Nullable[components.DefaultParameters]](../components/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {<br/>"frequency_penalty": 0,<br/>"presence_penalty": 0,<br/>"repetition_penalty": 1,<br/>"temperature": 0.7,<br/>"top_k": 0,<br/>"top_p": 0.9<br/>} |
| `description` | *Optional[str]* | :heavy_minus_sign: | Description of the model | GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. |
+4 -4
View File
@@ -7,7 +7,7 @@ Percentile-based latency cutoffs. All specified cutoffs must be met for an endpo
| Field | Type | Required | Description |
| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- |
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p50 latency (seconds) |
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p75 latency (seconds) |
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p90 latency (seconds) |
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p99 latency (seconds) |
| `p50` | *Optional[float]* | :heavy_minus_sign: | Maximum p50 latency (seconds) |
| `p75` | *Optional[float]* | :heavy_minus_sign: | Maximum p75 latency (seconds) |
| `p90` | *Optional[float]* | :heavy_minus_sign: | Maximum p90 latency (seconds) |
| `p99` | *Optional[float]* | :heavy_minus_sign: | Maximum p99 latency (seconds) |
@@ -7,7 +7,7 @@ Percentile-based throughput cutoffs. All specified cutoffs must be met for an en
| Field | Type | Required | Description |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p50 throughput (tokens/sec) |
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p75 throughput (tokens/sec) |
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p90 throughput (tokens/sec) |
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p99 throughput (tokens/sec) |
| `p50` | *Optional[float]* | :heavy_minus_sign: | Minimum p50 throughput (tokens/sec) |
| `p75` | *Optional[float]* | :heavy_minus_sign: | Minimum p75 throughput (tokens/sec) |
| `p90` | *Optional[float]* | :heavy_minus_sign: | Minimum p90 throughput (tokens/sec) |
| `p99` | *Optional[float]* | :heavy_minus_sign: | Minimum p99 throughput (tokens/sec) |
+5 -5
View File
@@ -9,8 +9,8 @@ Information about a specific model endpoint
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `context_length` | *int* | :heavy_check_mark: | N/A | |
| `latency_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. | {<br/>"p50": 25.5,<br/>"p75": 35.2,<br/>"p90": 48.7,<br/>"p99": 85.3<br/>} |
| `max_completion_tokens` | *Nullable[int]* | :heavy_check_mark: | N/A | |
| `max_prompt_tokens` | *Nullable[int]* | :heavy_check_mark: | N/A | |
| `max_completion_tokens` | *int* | :heavy_check_mark: | N/A | |
| `max_prompt_tokens` | *int* | :heavy_check_mark: | N/A | |
| `model_id` | *str* | :heavy_check_mark: | The unique identifier for the model (permaslug) | openai/gpt-4 |
| `model_name` | *str* | :heavy_check_mark: | N/A | |
| `name` | *str* | :heavy_check_mark: | N/A | |
@@ -22,6 +22,6 @@ Information about a specific model endpoint
| `supports_implicit_caching` | *bool* | :heavy_check_mark: | N/A | |
| `tag` | *str* | :heavy_check_mark: | N/A | |
| `throughput_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | N/A | {<br/>"p50": 25.5,<br/>"p75": 35.2,<br/>"p90": 48.7,<br/>"p99": 85.3<br/>} |
| `uptime_last_1d` | *Nullable[float]* | :heavy_check_mark: | Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. | |
| `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `uptime_last_5m` | *Nullable[float]* | :heavy_check_mark: | Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. | |
| `uptime_last_1d` | *float* | :heavy_check_mark: | Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. | |
| `uptime_last_30m` | *float* | :heavy_check_mark: | N/A | |
| `uptime_last_5m` | *float* | :heavy_check_mark: | Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. | |
+2 -2
View File
@@ -7,6 +7,6 @@ Information about the top provider for this model
| Field | Type | Required | Description | Example |
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| `context_length` | *OptionalNullable[int]* | :heavy_minus_sign: | Context length from the top provider | 8192 |
| `context_length` | *Optional[int]* | :heavy_minus_sign: | Context length from the top provider | 8192 |
| `is_moderated` | *bool* | :heavy_check_mark: | Whether the top provider moderates content | true |
| `max_completion_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Maximum completion tokens from the top provider | 4096 |
| `max_completion_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum completion tokens from the top provider | 4096 |
+2 -2
View File
@@ -18,8 +18,8 @@ The created API key information
| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
| `include_byok_in_limit` | *bool* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false |
| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 |
| `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit` | *float* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *float* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit_reset` | *Nullable[str]* | :heavy_check_mark: | Type of limit reset for the API key | monthly |
| `name` | *str* | :heavy_check_mark: | Name of the API key | My Production Key |
| `updated_at` | *Nullable[str]* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z |
+1 -1
View File
@@ -8,6 +8,6 @@
| `creator_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. | user_2dHFtVWx2n56w6HkM0000000000 |
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected | 2027-12-31T23:59:59Z |
| `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true |
| `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 |
| `limit` | *Optional[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 |
| `limit_reset` | [OptionalNullable[operations.CreateKeysLimitReset]](../operations/createkeyslimitreset.md) | :heavy_minus_sign: | Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | monthly |
| `name` | *str* | :heavy_check_mark: | Name for the new API key | My New API Key |
+2 -2
View File
@@ -18,8 +18,8 @@ Current API key information
| `is_management_key` | *bool* | :heavy_check_mark: | Whether this is a management key | false |
| ~~`is_provisioning_key`~~ | *bool* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>Whether this is a management key | false |
| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 |
| `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit` | *float* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *float* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit_reset` | *Nullable[str]* | :heavy_check_mark: | Type of limit reset for the API key | monthly |
| ~~`rate_limit`~~ | [operations.RateLimit](../operations/ratelimit.md) | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>Legacy rate limit information about a key. Will always return -1. | {<br/>"interval": "1h",<br/>"note": "This field is deprecated and safe to ignore.",<br/>"requests": 1000<br/>} |
| `usage` | *float* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 |
+17 -17
View File
@@ -8,29 +8,29 @@ Generation data
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `api_type` | [Nullable[operations.APIType]](../operations/apitype.md) | :heavy_check_mark: | Type of API used for the generation | |
| `app_id` | *Nullable[int]* | :heavy_check_mark: | ID of the app that made the request | 12345 |
| `cache_discount` | *Nullable[float]* | :heavy_check_mark: | Discount applied due to caching | 0.0002 |
| `app_id` | *int* | :heavy_check_mark: | ID of the app that made the request | 12345 |
| `cache_discount` | *float* | :heavy_check_mark: | Discount applied due to caching | 0.0002 |
| `cancelled` | *Nullable[bool]* | :heavy_check_mark: | Whether the generation was cancelled | false |
| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the generation was created | 2024-07-15T23:33:19.433273+00:00 |
| `external_user` | *Nullable[str]* | :heavy_check_mark: | External user identifier | user-123 |
| `finish_reason` | *Nullable[str]* | :heavy_check_mark: | Reason the generation finished | stop |
| `generation_time` | *Nullable[float]* | :heavy_check_mark: | Time taken for generation in milliseconds | 1200 |
| `generation_time` | *float* | :heavy_check_mark: | Time taken for generation in milliseconds | 1200 |
| `http_referer` | *Nullable[str]* | :heavy_check_mark: | Referer header from the request | |
| `id` | *str* | :heavy_check_mark: | Unique identifier for the generation | gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG |
| `is_byok` | *bool* | :heavy_check_mark: | Whether this used bring-your-own-key | false |
| `latency` | *Nullable[float]* | :heavy_check_mark: | Total latency in milliseconds | 1250 |
| `latency` | *float* | :heavy_check_mark: | Total latency in milliseconds | 1250 |
| `model` | *str* | :heavy_check_mark: | Model used for the generation | sao10k/l3-stheno-8b |
| `moderation_latency` | *Nullable[float]* | :heavy_check_mark: | Moderation latency in milliseconds | 50 |
| `moderation_latency` | *float* | :heavy_check_mark: | Moderation latency in milliseconds | 50 |
| `native_finish_reason` | *Nullable[str]* | :heavy_check_mark: | Native finish reason as reported by provider | stop |
| `native_tokens_cached` | *Nullable[int]* | :heavy_check_mark: | Native cached tokens as reported by provider | 3 |
| `native_tokens_completion` | *Nullable[int]* | :heavy_check_mark: | Native completion tokens as reported by provider | 25 |
| `native_tokens_completion_images` | *Nullable[int]* | :heavy_check_mark: | Native completion image tokens as reported by provider | 0 |
| `native_tokens_prompt` | *Nullable[int]* | :heavy_check_mark: | Native prompt tokens as reported by provider | 10 |
| `native_tokens_reasoning` | *Nullable[int]* | :heavy_check_mark: | Native reasoning tokens as reported by provider | 5 |
| `num_input_audio_prompt` | *Nullable[int]* | :heavy_check_mark: | Number of audio inputs in the prompt | 0 |
| `num_media_completion` | *Nullable[int]* | :heavy_check_mark: | Number of media items in the completion | 0 |
| `num_media_prompt` | *Nullable[int]* | :heavy_check_mark: | Number of media items in the prompt | 1 |
| `num_search_results` | *Nullable[int]* | :heavy_check_mark: | Number of search results included | 5 |
| `native_tokens_cached` | *int* | :heavy_check_mark: | Native cached tokens as reported by provider | 3 |
| `native_tokens_completion` | *int* | :heavy_check_mark: | Native completion tokens as reported by provider | 25 |
| `native_tokens_completion_images` | *int* | :heavy_check_mark: | Native completion image tokens as reported by provider | 0 |
| `native_tokens_prompt` | *int* | :heavy_check_mark: | Native prompt tokens as reported by provider | 10 |
| `native_tokens_reasoning` | *int* | :heavy_check_mark: | Native reasoning tokens as reported by provider | 5 |
| `num_input_audio_prompt` | *int* | :heavy_check_mark: | Number of audio inputs in the prompt | 0 |
| `num_media_completion` | *int* | :heavy_check_mark: | Number of media items in the completion | 0 |
| `num_media_prompt` | *int* | :heavy_check_mark: | Number of media items in the prompt | 1 |
| `num_search_results` | *int* | :heavy_check_mark: | Number of search results included | 5 |
| `origin` | *str* | :heavy_check_mark: | Origin URL of the request | https://openrouter.ai/ |
| `provider_name` | *Nullable[str]* | :heavy_check_mark: | Name of the provider that served the request | Infermatic |
| `provider_responses` | List[[components.ProviderResponse](../components/providerresponse.md)] | :heavy_check_mark: | List of provider responses for this generation, including fallback attempts | |
@@ -38,10 +38,10 @@ Generation data
| `router` | *Nullable[str]* | :heavy_check_mark: | Router used for the request (e.g., openrouter/auto) | openrouter/auto |
| `session_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Session identifier grouping multiple generations in the same session | |
| `streamed` | *Nullable[bool]* | :heavy_check_mark: | Whether the response was streamed | true |
| `tokens_completion` | *Nullable[int]* | :heavy_check_mark: | Number of tokens in the completion | 25 |
| `tokens_prompt` | *Nullable[int]* | :heavy_check_mark: | Number of tokens in the prompt | 10 |
| `tokens_completion` | *int* | :heavy_check_mark: | Number of tokens in the completion | 25 |
| `tokens_prompt` | *int* | :heavy_check_mark: | Number of tokens in the prompt | 10 |
| `total_cost` | *float* | :heavy_check_mark: | Total cost of the generation in USD | 0.0015 |
| `upstream_id` | *Nullable[str]* | :heavy_check_mark: | Upstream provider's identifier for this generation | chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 |
| `upstream_inference_cost` | *Nullable[float]* | :heavy_check_mark: | Cost charged by the upstream provider | 0.0012 |
| `upstream_inference_cost` | *float* | :heavy_check_mark: | Cost charged by the upstream provider | 0.0012 |
| `usage` | *float* | :heavy_check_mark: | Usage amount in USD | 0.0015 |
| `user_agent` | *Nullable[str]* | :heavy_check_mark: | User-Agent header from the request | |
+2 -2
View File
@@ -18,8 +18,8 @@ The API key information
| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
| `include_byok_in_limit` | *bool* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false |
| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 |
| `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit` | *float* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *float* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit_reset` | *Nullable[str]* | :heavy_check_mark: | Type of limit reset for the API key | monthly |
| `name` | *str* | :heavy_check_mark: | Name of the API key | My Production Key |
| `updated_at` | *Nullable[str]* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z |
+2 -2
View File
@@ -16,8 +16,8 @@
| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
| `include_byok_in_limit` | *bool* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false |
| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 |
| `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit` | *float* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *float* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit_reset` | *Nullable[str]* | :heavy_check_mark: | Type of limit reset for the API key | monthly |
| `name` | *str* | :heavy_check_mark: | Name of the API key | My Production Key |
| `updated_at` | *Nullable[str]* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z |
+2 -2
View File
@@ -18,8 +18,8 @@ The updated API key information
| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
| `include_byok_in_limit` | *bool* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false |
| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 |
| `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit` | *float* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *float* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit_reset` | *Nullable[str]* | :heavy_check_mark: | Type of limit reset for the API key | monthly |
| `name` | *str* | :heavy_check_mark: | Name of the API key | My Production Key |
| `updated_at` | *Nullable[str]* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z |
+1 -1
View File
@@ -7,6 +7,6 @@
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `disabled` | *Optional[bool]* | :heavy_minus_sign: | Whether to disable the API key | false |
| `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true |
| `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit for the API key in USD | 75 |
| `limit` | *Optional[float]* | :heavy_minus_sign: | New spending limit for the API key in USD | 75 |
| `limit_reset` | [OptionalNullable[operations.UpdateKeysLimitReset]](../operations/updatekeyslimitreset.md) | :heavy_minus_sign: | New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | daily |
| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the API key | Updated API Key Name |
+2 -2
View File
@@ -148,7 +148,7 @@ with OpenRouter(
| `creator_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. | user_2dHFtVWx2n56w6HkM0000000000 |
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected | 2027-12-31T23:59:59Z |
| `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true |
| `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 |
| `limit` | *Optional[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 |
| `limit_reset` | [OptionalNullable[operations.CreateKeysLimitReset]](../../operations/createkeyslimitreset.md) | :heavy_minus_sign: | Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | monthly |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
@@ -302,7 +302,7 @@ with OpenRouter(
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
| `disabled` | *Optional[bool]* | :heavy_minus_sign: | Whether to disable the API key | false |
| `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true |
| `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit for the API key in USD | 75 |
| `limit` | *Optional[float]* | :heavy_minus_sign: | New spending limit for the API key in USD | 75 |
| `limit_reset` | [OptionalNullable[operations.UpdateKeysLimitReset]](../../operations/updatekeyslimitreset.md) | :heavy_minus_sign: | New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | daily |
| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the API key | Updated API Key Name |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
+9 -9
View File
@@ -53,33 +53,33 @@ with OpenRouter(
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | N/A | {<br/>"type": "ephemeral"<br/>} |
| `debug` | [Optional[components.ChatDebugOptions]](../../components/chatdebugoptions.md) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | {<br/>"echo_upstream_body": true<br/>} |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | 0 |
| `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. | {<br/>"aspect_ratio": "16:9",<br/>"quality": "high"<br/>} |
| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | 0 |
| `image_config` | Dict[str, [components.ChatRequestImageConfig](../../components/chatrequestimageconfig.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. | {<br/>"aspect_ratio": "16:9"<br/>} |
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | {<br/>"50256": -100<br/>} |
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | false |
| `max_completion_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Maximum tokens in completion | 100 |
| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. | 100 |
| `max_completion_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum tokens in completion | 100 |
| `max_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. | 100 |
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | {<br/>"session_id": "session-456",<br/>"user_id": "user-123"<br/>} |
| `modalities` | List[[components.Modality](../../components/modality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text", "image", and "audio". | [<br/>"text",<br/>"image"<br/>] |
| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | openai/gpt-4 |
| `models` | List[*str*] | :heavy_minus_sign: | Models to use for completion | [<br/>"openai/gpt-4",<br/>"openai/gpt-4o"<br/>] |
| `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. | true |
| `plugins` | List[[components.ChatRequestPlugin](../../components/chatrequestplugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 |
| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 |
| `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | {<br/>"allow_fallbacks": true<br/>} |
| `reasoning` | [Optional[components.Reasoning]](../../components/reasoning.md) | :heavy_minus_sign: | Configuration options for reasoning models | {<br/>"effort": "medium",<br/>"summary": "concise"<br/>} |
| `response_format` | [Optional[components.ResponseFormat]](../../components/responseformat.md) | :heavy_minus_sign: | Response format configuration | {<br/>"type": "json_object"<br/>} |
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | 42 |
| `seed` | *Optional[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | 42 |
| `service_tier` | [OptionalNullable[components.ChatRequestServiceTier]](../../components/chatrequestservicetier.md) | :heavy_minus_sign: | The service tier to use for processing this request. | auto |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | |
| `stop` | [OptionalNullable[components.Stop]](../../components/stop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | [<br/>""<br/>] |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | Enable streaming response | false |
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../../components/chatstreamoptions.md) | :heavy_minus_sign: | Streaming configuration options | {<br/>"include_usage": true<br/>} |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | 0.7 |
| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | 0.7 |
| `tool_choice` | [Optional[components.ChatToolChoice]](../../components/chattoolchoice.md) | :heavy_minus_sign: | Tool choice configuration | auto |
| `tools` | List[[components.ChatFunctionTool](../../components/chatfunctiontool.md)] | :heavy_minus_sign: | Available tools for function calling | [<br/>{<br/>"function": {<br/>"description": "Get weather",<br/>"name": "get_weather"<br/>},<br/>"type": "function"<br/>}<br/>] |
| `top_logprobs` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | 5 |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | 1 |
| `top_logprobs` | *Optional[int]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | 5 |
| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | 1 |
| `trace` | [Optional[components.TraceConfig]](../../components/traceconfig.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | {<br/>"trace_id": "trace-abc123",<br/>"trace_name": "my-app-trace"<br/>} |
| `user` | *Optional[str]* | :heavy_minus_sign: | Unique user identifier | user-123 |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
+2 -2
View File
@@ -115,7 +115,7 @@ with OpenRouter(
| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false |
| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [<br/>"openai/gpt-4o-mini"<br/>] |
| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [<br/>"azure"<br/>] |
| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 50 |
| `limit_usd` | *Optional[float]* | :heavy_minus_sign: | Spending limit in USD | 50 |
| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../../components/guardrailinterval.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
@@ -270,7 +270,7 @@ with OpenRouter(
| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | true |
| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [<br/>"openai/gpt-4o-mini"<br/>] |
| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [<br/>"azure"<br/>] |
| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit in USD | 75 |
| `limit_usd` | *Optional[float]* | :heavy_minus_sign: | New spending limit in USD | 75 |
| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name |
| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../../components/guardrailinterval.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
+8 -8
View File
@@ -44,20 +44,20 @@ with OpenRouter(
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
| `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. | {<br/>"aspect_ratio": "16:9",<br/>"quality": "high"<br/>} |
| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| `image_config` | Dict[str, [components.ResponsesRequestImageConfig](../../components/responsesrequestimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9"<br/>} |
| `include` | List[[components.ResponseIncludesEnum](../../components/responseincludesenum.md)] | :heavy_minus_sign: | N/A | |
| `input` | [Optional[components.InputsUnion]](../../components/inputsunion.md) | :heavy_minus_sign: | Input for a response request - can be a string or array of items | [<br/>{<br/>"content": "What is the weather today?",<br/>"role": "user"<br/>}<br/>] |
| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `max_output_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
| `max_tool_calls` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
| `max_output_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `max_tool_calls` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | {<br/>"session_id": "abc-def-ghi",<br/>"user_id": "123"<br/>} |
| `modalities` | List[[components.OutputModalityEnum](../../components/outputmodalityenum.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [<br/>"text",<br/>"image"<br/>] |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A | |
| `models` | List[*str*] | :heavy_minus_sign: | N/A | |
| `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
| `plugins` | List[[components.ResponsesRequestPlugin](../../components/responsesrequestplugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../../components/storedprompttemplate.md) | :heavy_minus_sign: | N/A | {<br/>"id": "prompt-abc123",<br/>"variables": {<br/>"name": "John"<br/>}<br/>} |
| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
@@ -67,13 +67,13 @@ with OpenRouter(
| `service_tier` | [OptionalNullable[components.ResponsesRequestServiceTier]](../../components/responsesrequestservicetier.md) | :heavy_minus_sign: | N/A | |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `temperature` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| `text` | [Optional[components.TextExtendedConfig]](../../components/textextendedconfig.md) | :heavy_minus_sign: | Text output configuration including format and verbosity | {<br/>"format": {<br/>"type": "text"<br/>},<br/>"verbosity": "medium"<br/>} |
| `tool_choice` | [Optional[components.OpenAIResponsesToolChoiceUnion]](../../components/openairesponsestoolchoiceunion.md) | :heavy_minus_sign: | N/A | auto |
| `tools` | List[[components.ResponsesRequestToolUnion](../../components/responsesrequesttoolunion.md)] | :heavy_minus_sign: | N/A | |
| `top_k` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `top_logprobs` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_logprobs` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `top_p` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| `trace` | [Optional[components.TraceConfig]](../../components/traceconfig.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | {<br/>"trace_id": "trace-abc123",<br/>"trace_name": "my-app-trace"<br/>} |
| `truncation` | [OptionalNullable[components.OpenAIResponsesTruncation]](../../components/openairesponsestruncation.md) | :heavy_minus_sign: | N/A | auto |
| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. | |
+3 -2
View File
@@ -1,9 +1,9 @@
[project]
name = "openrouter"
version = "0.9.1"
version = "0.9.0"
description = "Official Python Client SDK for OpenRouter."
authors = [{ name = "OpenRouter" },]
readme = "README.md"
readme = "README-PYPI.md"
requires-python = ">=3.9.2"
dependencies = [
"httpcore >=1.0.9",
@@ -11,6 +11,7 @@ dependencies = [
"jsonpath-python >=1.0.6",
"pydantic >=2.11.2",
]
urls.repository = "https://github.com/OpenRouterTeam/python-sdk.git"
license = { text = "Apache-2.0" }
[dependency-groups]
+2
View File
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
uv run python scripts/prepare_readme.py
uv build
uv publish --token $PYPI_TOKEN
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
__version__: str = "0.9.1"
__version__: str = "0.9.0"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.788.4"
__user_agent__: str = "speakeasy-sdk/python 0.9.1 2.788.4 1.0.0 openrouter"
__user_agent__: str = "speakeasy-sdk/python 0.9.0 2.788.4 1.0.0 openrouter"
try:
if __package__ is not None:
+4 -4
View File
@@ -517,7 +517,7 @@ class APIKeys(BaseSDK):
creator_user_id: OptionalNullable[str] = UNSET,
expires_at: OptionalNullable[datetime] = UNSET,
include_byok_in_limit: Optional[bool] = None,
limit: OptionalNullable[float] = UNSET,
limit: Optional[float] = None,
limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
@@ -672,7 +672,7 @@ class APIKeys(BaseSDK):
creator_user_id: OptionalNullable[str] = UNSET,
expires_at: OptionalNullable[datetime] = UNSET,
include_byok_in_limit: Optional[bool] = None,
limit: OptionalNullable[float] = UNSET,
limit: Optional[float] = None,
limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
@@ -1350,7 +1350,7 @@ class APIKeys(BaseSDK):
x_open_router_categories: Optional[str] = None,
disabled: Optional[bool] = None,
include_byok_in_limit: Optional[bool] = None,
limit: OptionalNullable[float] = UNSET,
limit: Optional[float] = None,
limit_reset: OptionalNullable[operations.UpdateKeysLimitReset] = UNSET,
name: Optional[str] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
@@ -1510,7 +1510,7 @@ class APIKeys(BaseSDK):
x_open_router_categories: Optional[str] = None,
disabled: Optional[bool] = None,
include_byok_in_limit: Optional[bool] = None,
limit: OptionalNullable[float] = UNSET,
limit: Optional[float] = None,
limit_reset: OptionalNullable[operations.UpdateKeysLimitReset] = UNSET,
name: Optional[str] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
+60 -60
View File
@@ -35,17 +35,17 @@ class Chat(BaseSDK):
debug: Optional[
Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict]
] = None,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ChatRequestImageConfig],
Dict[str, components.ChatRequestImageConfigTypedDict],
]
] = None,
logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
logprobs: OptionalNullable[bool] = UNSET,
max_completion_tokens: OptionalNullable[int] = UNSET,
max_tokens: OptionalNullable[int] = UNSET,
max_completion_tokens: Optional[int] = None,
max_tokens: Optional[int] = None,
metadata: Optional[Dict[str, str]] = None,
modalities: Optional[List[components.Modality]] = None,
model: Optional[str] = None,
@@ -57,7 +57,7 @@ class Chat(BaseSDK):
List[components.ChatRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
provider: OptionalNullable[
Union[
components.ProviderPreferences, components.ProviderPreferencesTypedDict
@@ -69,7 +69,7 @@ class Chat(BaseSDK):
response_format: Optional[
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
] = None,
seed: OptionalNullable[int] = UNSET,
seed: Optional[int] = None,
service_tier: OptionalNullable[components.ChatRequestServiceTier] = UNSET,
session_id: Optional[str] = None,
stop: OptionalNullable[
@@ -79,7 +79,7 @@ class Chat(BaseSDK):
stream_options: OptionalNullable[
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
tool_choice: Optional[
Union[components.ChatToolChoice, components.ChatToolChoiceTypedDict]
] = None,
@@ -89,8 +89,8 @@ class Chat(BaseSDK):
List[components.ChatFunctionToolTypedDict],
]
] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -169,17 +169,17 @@ class Chat(BaseSDK):
debug: Optional[
Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict]
] = None,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ChatRequestImageConfig],
Dict[str, components.ChatRequestImageConfigTypedDict],
]
] = None,
logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
logprobs: OptionalNullable[bool] = UNSET,
max_completion_tokens: OptionalNullable[int] = UNSET,
max_tokens: OptionalNullable[int] = UNSET,
max_completion_tokens: Optional[int] = None,
max_tokens: Optional[int] = None,
metadata: Optional[Dict[str, str]] = None,
modalities: Optional[List[components.Modality]] = None,
model: Optional[str] = None,
@@ -191,7 +191,7 @@ class Chat(BaseSDK):
List[components.ChatRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
provider: OptionalNullable[
Union[
components.ProviderPreferences, components.ProviderPreferencesTypedDict
@@ -203,7 +203,7 @@ class Chat(BaseSDK):
response_format: Optional[
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
] = None,
seed: OptionalNullable[int] = UNSET,
seed: Optional[int] = None,
service_tier: OptionalNullable[components.ChatRequestServiceTier] = UNSET,
session_id: Optional[str] = None,
stop: OptionalNullable[
@@ -213,7 +213,7 @@ class Chat(BaseSDK):
stream_options: OptionalNullable[
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
tool_choice: Optional[
Union[components.ChatToolChoice, components.ChatToolChoiceTypedDict]
] = None,
@@ -223,8 +223,8 @@ class Chat(BaseSDK):
List[components.ChatFunctionToolTypedDict],
]
] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -302,17 +302,17 @@ class Chat(BaseSDK):
debug: Optional[
Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict]
] = None,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ChatRequestImageConfig],
Dict[str, components.ChatRequestImageConfigTypedDict],
]
] = None,
logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
logprobs: OptionalNullable[bool] = UNSET,
max_completion_tokens: OptionalNullable[int] = UNSET,
max_tokens: OptionalNullable[int] = UNSET,
max_completion_tokens: Optional[int] = None,
max_tokens: Optional[int] = None,
metadata: Optional[Dict[str, str]] = None,
modalities: Optional[List[components.Modality]] = None,
model: Optional[str] = None,
@@ -324,7 +324,7 @@ class Chat(BaseSDK):
List[components.ChatRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
provider: OptionalNullable[
Union[
components.ProviderPreferences, components.ProviderPreferencesTypedDict
@@ -336,7 +336,7 @@ class Chat(BaseSDK):
response_format: Optional[
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
] = None,
seed: OptionalNullable[int] = UNSET,
seed: Optional[int] = None,
service_tier: OptionalNullable[components.ChatRequestServiceTier] = UNSET,
session_id: Optional[str] = None,
stop: OptionalNullable[
@@ -346,7 +346,7 @@ class Chat(BaseSDK):
stream_options: OptionalNullable[
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
tool_choice: Optional[
Union[components.ChatToolChoice, components.ChatToolChoiceTypedDict]
] = None,
@@ -356,8 +356,8 @@ class Chat(BaseSDK):
List[components.ChatFunctionToolTypedDict],
]
] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -703,17 +703,17 @@ class Chat(BaseSDK):
debug: Optional[
Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict]
] = None,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ChatRequestImageConfig],
Dict[str, components.ChatRequestImageConfigTypedDict],
]
] = None,
logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
logprobs: OptionalNullable[bool] = UNSET,
max_completion_tokens: OptionalNullable[int] = UNSET,
max_tokens: OptionalNullable[int] = UNSET,
max_completion_tokens: Optional[int] = None,
max_tokens: Optional[int] = None,
metadata: Optional[Dict[str, str]] = None,
modalities: Optional[List[components.Modality]] = None,
model: Optional[str] = None,
@@ -725,7 +725,7 @@ class Chat(BaseSDK):
List[components.ChatRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
provider: OptionalNullable[
Union[
components.ProviderPreferences, components.ProviderPreferencesTypedDict
@@ -737,7 +737,7 @@ class Chat(BaseSDK):
response_format: Optional[
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
] = None,
seed: OptionalNullable[int] = UNSET,
seed: Optional[int] = None,
service_tier: OptionalNullable[components.ChatRequestServiceTier] = UNSET,
session_id: Optional[str] = None,
stop: OptionalNullable[
@@ -747,7 +747,7 @@ class Chat(BaseSDK):
stream_options: OptionalNullable[
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
tool_choice: Optional[
Union[components.ChatToolChoice, components.ChatToolChoiceTypedDict]
] = None,
@@ -757,8 +757,8 @@ class Chat(BaseSDK):
List[components.ChatFunctionToolTypedDict],
]
] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -837,17 +837,17 @@ class Chat(BaseSDK):
debug: Optional[
Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict]
] = None,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ChatRequestImageConfig],
Dict[str, components.ChatRequestImageConfigTypedDict],
]
] = None,
logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
logprobs: OptionalNullable[bool] = UNSET,
max_completion_tokens: OptionalNullable[int] = UNSET,
max_tokens: OptionalNullable[int] = UNSET,
max_completion_tokens: Optional[int] = None,
max_tokens: Optional[int] = None,
metadata: Optional[Dict[str, str]] = None,
modalities: Optional[List[components.Modality]] = None,
model: Optional[str] = None,
@@ -859,7 +859,7 @@ class Chat(BaseSDK):
List[components.ChatRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
provider: OptionalNullable[
Union[
components.ProviderPreferences, components.ProviderPreferencesTypedDict
@@ -871,7 +871,7 @@ class Chat(BaseSDK):
response_format: Optional[
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
] = None,
seed: OptionalNullable[int] = UNSET,
seed: Optional[int] = None,
service_tier: OptionalNullable[components.ChatRequestServiceTier] = UNSET,
session_id: Optional[str] = None,
stop: OptionalNullable[
@@ -881,7 +881,7 @@ class Chat(BaseSDK):
stream_options: OptionalNullable[
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
tool_choice: Optional[
Union[components.ChatToolChoice, components.ChatToolChoiceTypedDict]
] = None,
@@ -891,8 +891,8 @@ class Chat(BaseSDK):
List[components.ChatFunctionToolTypedDict],
]
] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -970,17 +970,17 @@ class Chat(BaseSDK):
debug: Optional[
Union[components.ChatDebugOptions, components.ChatDebugOptionsTypedDict]
] = None,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ChatRequestImageConfig],
Dict[str, components.ChatRequestImageConfigTypedDict],
]
] = None,
logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
logprobs: OptionalNullable[bool] = UNSET,
max_completion_tokens: OptionalNullable[int] = UNSET,
max_tokens: OptionalNullable[int] = UNSET,
max_completion_tokens: Optional[int] = None,
max_tokens: Optional[int] = None,
metadata: Optional[Dict[str, str]] = None,
modalities: Optional[List[components.Modality]] = None,
model: Optional[str] = None,
@@ -992,7 +992,7 @@ class Chat(BaseSDK):
List[components.ChatRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
provider: OptionalNullable[
Union[
components.ProviderPreferences, components.ProviderPreferencesTypedDict
@@ -1004,7 +1004,7 @@ class Chat(BaseSDK):
response_format: Optional[
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
] = None,
seed: OptionalNullable[int] = UNSET,
seed: Optional[int] = None,
service_tier: OptionalNullable[components.ChatRequestServiceTier] = UNSET,
session_id: Optional[str] = None,
stop: OptionalNullable[
@@ -1014,7 +1014,7 @@ class Chat(BaseSDK):
stream_options: OptionalNullable[
Union[components.ChatStreamOptions, components.ChatStreamOptionsTypedDict]
] = UNSET,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
tool_choice: Optional[
Union[components.ChatToolChoice, components.ChatToolChoiceTypedDict]
] = None,
@@ -1024,8 +1024,8 @@ class Chat(BaseSDK):
List[components.ChatFunctionToolTypedDict],
]
] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
+12 -51
View File
@@ -203,6 +203,8 @@ if TYPE_CHECKING:
from .chatreasoningsummaryverbosityenum import ChatReasoningSummaryVerbosityEnum
from .chatrequest import (
ChatRequest,
ChatRequestImageConfig,
ChatRequestImageConfigTypedDict,
ChatRequestPlugin,
ChatRequestPluginTypedDict,
ChatRequestServiceTier,
@@ -217,11 +219,6 @@ if TYPE_CHECKING:
StopTypedDict,
)
from .chatresult import ChatResult, ChatResultObject, ChatResultTypedDict
from .chatsearchmodelsservertool import (
ChatSearchModelsServerTool,
ChatSearchModelsServerToolType,
ChatSearchModelsServerToolTypedDict,
)
from .chatstreamchoice import ChatStreamChoice, ChatStreamChoiceTypedDict
from .chatstreamchunk import (
ChatStreamChunk,
@@ -508,7 +505,6 @@ if TYPE_CHECKING:
)
from .guardrail import Guardrail, GuardrailTypedDict
from .guardrailinterval import GuardrailInterval
from .imageconfig import ImageConfig, ImageConfigTypedDict
from .imagegencallcompletedevent import (
ImageGenCallCompletedEvent,
ImageGenCallCompletedEventType,
@@ -543,19 +539,6 @@ if TYPE_CHECKING:
Quality,
Size,
)
from .imagegenerationservertool_openrouter import (
ImageGenerationServerToolOpenRouter,
ImageGenerationServerToolOpenRouterType,
ImageGenerationServerToolOpenRouterTypedDict,
)
from .imagegenerationservertoolconfig import (
ImageGenerationServerToolConfig,
ImageGenerationServerToolConfigTypedDict,
)
from .imagegenerationservertoolconfig_union import (
ImageGenerationServerToolConfigUnion,
ImageGenerationServerToolConfigUnionTypedDict,
)
from .imagegenerationstatus import ImageGenerationStatus
from .incompletedetails import IncompleteDetails, IncompleteDetailsTypedDict, Reason
from .inputaudio import (
@@ -1154,6 +1137,8 @@ if TYPE_CHECKING:
)
from .responsesrequest import (
ResponsesRequest,
ResponsesRequestImageConfig,
ResponsesRequestImageConfigTypedDict,
ResponsesRequestPlugin,
ResponsesRequestPluginTypedDict,
ResponsesRequestServiceTier,
@@ -1165,10 +1150,6 @@ if TYPE_CHECKING:
ResponsesRequestTypedDict,
)
from .searchcontextsizeenum import SearchContextSizeEnum
from .searchmodelsservertoolconfig import (
SearchModelsServerToolConfig,
SearchModelsServerToolConfigTypedDict,
)
from .searchqualitylevel import SearchQualityLevel
from .security import Security, SecurityTypedDict
from .serviceunavailableresponseerrordata import (
@@ -1519,6 +1500,8 @@ __all__ = [
"ChatNamedToolChoiceTypedDict",
"ChatReasoningSummaryVerbosityEnum",
"ChatRequest",
"ChatRequestImageConfig",
"ChatRequestImageConfigTypedDict",
"ChatRequestPlugin",
"ChatRequestPluginTypedDict",
"ChatRequestServiceTier",
@@ -1526,9 +1509,6 @@ __all__ = [
"ChatResult",
"ChatResultObject",
"ChatResultTypedDict",
"ChatSearchModelsServerTool",
"ChatSearchModelsServerToolType",
"ChatSearchModelsServerToolTypedDict",
"ChatStreamChoice",
"ChatStreamChoiceTypedDict",
"ChatStreamChunk",
@@ -1745,8 +1725,6 @@ __all__ = [
"GuardrailTypedDict",
"Ignore",
"IgnoreTypedDict",
"ImageConfig",
"ImageConfigTypedDict",
"ImageGenCallCompletedEvent",
"ImageGenCallCompletedEventType",
"ImageGenCallCompletedEventTypedDict",
@@ -1760,13 +1738,6 @@ __all__ = [
"ImageGenCallPartialImageEventType",
"ImageGenCallPartialImageEventTypedDict",
"ImageGenerationServerTool",
"ImageGenerationServerToolConfig",
"ImageGenerationServerToolConfigTypedDict",
"ImageGenerationServerToolConfigUnion",
"ImageGenerationServerToolConfigUnionTypedDict",
"ImageGenerationServerToolOpenRouter",
"ImageGenerationServerToolOpenRouterType",
"ImageGenerationServerToolOpenRouterTypedDict",
"ImageGenerationServerToolType",
"ImageGenerationServerToolTypedDict",
"ImageGenerationStatus",
@@ -2218,6 +2189,8 @@ __all__ = [
"ResponsesErrorField",
"ResponsesErrorFieldTypedDict",
"ResponsesRequest",
"ResponsesRequestImageConfig",
"ResponsesRequestImageConfigTypedDict",
"ResponsesRequestPlugin",
"ResponsesRequestPluginTypedDict",
"ResponsesRequestServiceTier",
@@ -2228,8 +2201,6 @@ __all__ = [
"ResponsesRequestType",
"ResponsesRequestTypedDict",
"SearchContextSizeEnum",
"SearchModelsServerToolConfig",
"SearchModelsServerToolConfigTypedDict",
"SearchQualityLevel",
"Security",
"SecurityTypedDict",
@@ -2514,6 +2485,8 @@ _dynamic_imports: dict[str, str] = {
"ChatNamedToolChoiceTypedDict": ".chatnamedtoolchoice",
"ChatReasoningSummaryVerbosityEnum": ".chatreasoningsummaryverbosityenum",
"ChatRequest": ".chatrequest",
"ChatRequestImageConfig": ".chatrequest",
"ChatRequestImageConfigTypedDict": ".chatrequest",
"ChatRequestPlugin": ".chatrequest",
"ChatRequestPluginTypedDict": ".chatrequest",
"ChatRequestServiceTier": ".chatrequest",
@@ -2529,9 +2502,6 @@ _dynamic_imports: dict[str, str] = {
"ChatResult": ".chatresult",
"ChatResultObject": ".chatresult",
"ChatResultTypedDict": ".chatresult",
"ChatSearchModelsServerTool": ".chatsearchmodelsservertool",
"ChatSearchModelsServerToolType": ".chatsearchmodelsservertool",
"ChatSearchModelsServerToolTypedDict": ".chatsearchmodelsservertool",
"ChatStreamChoice": ".chatstreamchoice",
"ChatStreamChoiceTypedDict": ".chatstreamchoice",
"ChatStreamChunk": ".chatstreamchunk",
@@ -2750,8 +2720,6 @@ _dynamic_imports: dict[str, str] = {
"Guardrail": ".guardrail",
"GuardrailTypedDict": ".guardrail",
"GuardrailInterval": ".guardrailinterval",
"ImageConfig": ".imageconfig",
"ImageConfigTypedDict": ".imageconfig",
"ImageGenCallCompletedEvent": ".imagegencallcompletedevent",
"ImageGenCallCompletedEventType": ".imagegencallcompletedevent",
"ImageGenCallCompletedEventTypedDict": ".imagegencallcompletedevent",
@@ -2776,13 +2744,6 @@ _dynamic_imports: dict[str, str] = {
"OutputFormat": ".imagegenerationservertool",
"Quality": ".imagegenerationservertool",
"Size": ".imagegenerationservertool",
"ImageGenerationServerToolOpenRouter": ".imagegenerationservertool_openrouter",
"ImageGenerationServerToolOpenRouterType": ".imagegenerationservertool_openrouter",
"ImageGenerationServerToolOpenRouterTypedDict": ".imagegenerationservertool_openrouter",
"ImageGenerationServerToolConfig": ".imagegenerationservertoolconfig",
"ImageGenerationServerToolConfigTypedDict": ".imagegenerationservertoolconfig",
"ImageGenerationServerToolConfigUnion": ".imagegenerationservertoolconfig_union",
"ImageGenerationServerToolConfigUnionTypedDict": ".imagegenerationservertoolconfig_union",
"ImageGenerationStatus": ".imagegenerationstatus",
"IncompleteDetails": ".incompletedetails",
"IncompleteDetailsTypedDict": ".incompletedetails",
@@ -3236,6 +3197,8 @@ _dynamic_imports: dict[str, str] = {
"ResponsesErrorField": ".responseserrorfield",
"ResponsesErrorFieldTypedDict": ".responseserrorfield",
"ResponsesRequest": ".responsesrequest",
"ResponsesRequestImageConfig": ".responsesrequest",
"ResponsesRequestImageConfigTypedDict": ".responsesrequest",
"ResponsesRequestPlugin": ".responsesrequest",
"ResponsesRequestPluginTypedDict": ".responsesrequest",
"ResponsesRequestServiceTier": ".responsesrequest",
@@ -3246,8 +3209,6 @@ _dynamic_imports: dict[str, str] = {
"ResponsesRequestType": ".responsesrequest",
"ResponsesRequestTypedDict": ".responsesrequest",
"SearchContextSizeEnum": ".searchcontextsizeenum",
"SearchModelsServerToolConfig": ".searchmodelsservertoolconfig",
"SearchModelsServerToolConfigTypedDict": ".searchmodelsservertoolconfig",
"SearchQualityLevel": ".searchqualitylevel",
"Security": ".security",
"SecurityTypedDict": ".security",
@@ -5,19 +5,11 @@ from .chatcontentcachecontrol import (
ChatContentCacheControl,
ChatContentCacheControlTypedDict,
)
from .chatsearchmodelsservertool import (
ChatSearchModelsServerTool,
ChatSearchModelsServerToolTypedDict,
)
from .chatwebsearchshorthand import (
ChatWebSearchShorthand,
ChatWebSearchShorthandTypedDict,
)
from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict
from .imagegenerationservertool_openrouter import (
ImageGenerationServerToolOpenRouter,
ImageGenerationServerToolOpenRouterTypedDict,
)
from .openrouterwebsearchservertool import (
OpenRouterWebSearchServerTool,
OpenRouterWebSearchServerToolTypedDict,
@@ -119,8 +111,6 @@ ChatFunctionToolTypedDict = TypeAliasType(
"ChatFunctionToolTypedDict",
Union[
DatetimeServerToolTypedDict,
ImageGenerationServerToolOpenRouterTypedDict,
ChatSearchModelsServerToolTypedDict,
OpenRouterWebSearchServerToolTypedDict,
ChatFunctionToolFunctionTypedDict,
ChatWebSearchShorthandTypedDict,
@@ -133,12 +123,6 @@ ChatFunctionTool = Annotated[
Union[
Annotated[ChatFunctionToolFunction, Tag("function")],
Annotated[DatetimeServerTool, Tag("openrouter:datetime")],
Annotated[
ImageGenerationServerToolOpenRouter, Tag("openrouter:image_generation")
],
Annotated[
ChatSearchModelsServerTool, Tag("openrouter:experimental__search_models")
],
Annotated[OpenRouterWebSearchServerTool, Tag("openrouter:web_search")],
Annotated[ChatWebSearchShorthand, Tag("web_search")],
Annotated[ChatWebSearchShorthand, Tag("web_search_preview")],
+28 -27
View File
@@ -34,7 +34,6 @@ from .formatjsonobjectconfig import (
FormatJSONObjectConfig,
FormatJSONObjectConfigTypedDict,
)
from .imageconfig import ImageConfig, ImageConfigTypedDict
from .moderationplugin import ModerationPlugin, ModerationPluginTypedDict
from .providerpreferences import ProviderPreferences, ProviderPreferencesTypedDict
from .responsehealingplugin import ResponseHealingPlugin, ResponseHealingPluginTypedDict
@@ -55,6 +54,16 @@ from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
ChatRequestImageConfigTypedDict = TypeAliasType(
"ChatRequestImageConfigTypedDict", Union[str, float, List[Nullable[Any]]]
)
ChatRequestImageConfig = TypeAliasType(
"ChatRequestImageConfig", Union[str, float, List[Nullable[Any]]]
)
Modality = Union[
Literal[
"text",
@@ -212,17 +221,17 @@ class ChatRequestTypedDict(TypedDict):
cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
debug: NotRequired[ChatDebugOptionsTypedDict]
r"""Debug options for inspecting request transformations (streaming only)"""
frequency_penalty: NotRequired[Nullable[float]]
frequency_penalty: NotRequired[float]
r"""Frequency penalty (-2.0 to 2.0)"""
image_config: NotRequired[Dict[str, ImageConfigTypedDict]]
image_config: NotRequired[Dict[str, ChatRequestImageConfigTypedDict]]
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."""
logit_bias: NotRequired[Nullable[Dict[str, float]]]
r"""Token logit bias adjustments"""
logprobs: NotRequired[Nullable[bool]]
r"""Return log probabilities"""
max_completion_tokens: NotRequired[Nullable[int]]
max_completion_tokens: NotRequired[int]
r"""Maximum tokens in completion"""
max_tokens: NotRequired[Nullable[int]]
max_tokens: NotRequired[int]
r"""Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16."""
metadata: NotRequired[Dict[str, str]]
r"""Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)"""
@@ -236,7 +245,7 @@ class ChatRequestTypedDict(TypedDict):
r"""Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response."""
plugins: NotRequired[List[ChatRequestPluginTypedDict]]
r"""Plugins you want to enable for this request, including their settings."""
presence_penalty: NotRequired[Nullable[float]]
presence_penalty: NotRequired[float]
r"""Presence penalty (-2.0 to 2.0)"""
provider: NotRequired[Nullable[ProviderPreferencesTypedDict]]
r"""When multiple model providers are available, optionally indicate your routing preference."""
@@ -244,7 +253,7 @@ class ChatRequestTypedDict(TypedDict):
r"""Configuration options for reasoning models"""
response_format: NotRequired[ResponseFormatTypedDict]
r"""Response format configuration"""
seed: NotRequired[Nullable[int]]
seed: NotRequired[int]
r"""Random seed for deterministic outputs"""
service_tier: NotRequired[Nullable[ChatRequestServiceTier]]
r"""The service tier to use for processing this request."""
@@ -256,15 +265,15 @@ class ChatRequestTypedDict(TypedDict):
r"""Enable streaming response"""
stream_options: NotRequired[Nullable[ChatStreamOptionsTypedDict]]
r"""Streaming configuration options"""
temperature: NotRequired[Nullable[float]]
temperature: NotRequired[float]
r"""Sampling temperature (0-2)"""
tool_choice: NotRequired[ChatToolChoiceTypedDict]
r"""Tool choice configuration"""
tools: NotRequired[List[ChatFunctionToolTypedDict]]
r"""Available tools for function calling"""
top_logprobs: NotRequired[Nullable[int]]
top_logprobs: NotRequired[int]
r"""Number of top log probabilities to return (0-20)"""
top_p: NotRequired[Nullable[float]]
top_p: NotRequired[float]
r"""Nucleus sampling parameter (0-1)"""
trace: NotRequired[TraceConfigTypedDict]
r"""Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."""
@@ -283,10 +292,10 @@ class ChatRequest(BaseModel):
debug: Optional[ChatDebugOptions] = None
r"""Debug options for inspecting request transformations (streaming only)"""
frequency_penalty: OptionalNullable[float] = UNSET
frequency_penalty: Optional[float] = None
r"""Frequency penalty (-2.0 to 2.0)"""
image_config: Optional[Dict[str, ImageConfig]] = None
image_config: Optional[Dict[str, ChatRequestImageConfig]] = None
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."""
logit_bias: OptionalNullable[Dict[str, float]] = UNSET
@@ -295,10 +304,10 @@ class ChatRequest(BaseModel):
logprobs: OptionalNullable[bool] = UNSET
r"""Return log probabilities"""
max_completion_tokens: OptionalNullable[int] = UNSET
max_completion_tokens: Optional[int] = None
r"""Maximum tokens in completion"""
max_tokens: OptionalNullable[int] = UNSET
max_tokens: Optional[int] = None
r"""Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16."""
metadata: Optional[Dict[str, str]] = None
@@ -321,7 +330,7 @@ class ChatRequest(BaseModel):
plugins: Optional[List[ChatRequestPlugin]] = None
r"""Plugins you want to enable for this request, including their settings."""
presence_penalty: OptionalNullable[float] = UNSET
presence_penalty: Optional[float] = None
r"""Presence penalty (-2.0 to 2.0)"""
provider: OptionalNullable[ProviderPreferences] = UNSET
@@ -333,7 +342,7 @@ class ChatRequest(BaseModel):
response_format: Optional[ResponseFormat] = None
r"""Response format configuration"""
seed: OptionalNullable[int] = UNSET
seed: Optional[int] = None
r"""Random seed for deterministic outputs"""
service_tier: Annotated[
@@ -354,7 +363,7 @@ class ChatRequest(BaseModel):
stream_options: OptionalNullable[ChatStreamOptions] = UNSET
r"""Streaming configuration options"""
temperature: OptionalNullable[float] = UNSET
temperature: Optional[float] = None
r"""Sampling temperature (0-2)"""
tool_choice: Optional[ChatToolChoice] = None
@@ -363,10 +372,10 @@ class ChatRequest(BaseModel):
tools: Optional[List[ChatFunctionTool]] = None
r"""Available tools for function calling"""
top_logprobs: OptionalNullable[int] = UNSET
top_logprobs: Optional[int] = None
r"""Number of top log probabilities to return (0-20)"""
top_p: OptionalNullable[float] = UNSET
top_p: Optional[float] = None
r"""Nucleus sampling parameter (0-1)"""
trace: Optional[TraceConfig] = None
@@ -411,21 +420,13 @@ class ChatRequest(BaseModel):
"user",
]
nullable_fields = [
"frequency_penalty",
"logit_bias",
"logprobs",
"max_completion_tokens",
"max_tokens",
"parallel_tool_calls",
"presence_penalty",
"provider",
"seed",
"service_tier",
"stop",
"stream_options",
"temperature",
"top_logprobs",
"top_p",
]
null_default_fields = []
@@ -1,30 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .searchmodelsservertoolconfig import (
SearchModelsServerToolConfig,
SearchModelsServerToolConfigTypedDict,
)
from openrouter.types import BaseModel
from typing import Literal, Optional
from typing_extensions import NotRequired, TypedDict
ChatSearchModelsServerToolType = Literal["openrouter:experimental__search_models",]
class ChatSearchModelsServerToolTypedDict(TypedDict):
r"""OpenRouter built-in server tool: searches and filters AI models available on OpenRouter"""
type: ChatSearchModelsServerToolType
parameters: NotRequired[SearchModelsServerToolConfigTypedDict]
r"""Configuration for the openrouter:experimental__search_models server tool"""
class ChatSearchModelsServerTool(BaseModel):
r"""OpenRouter built-in server tool: searches and filters AI models available on OpenRouter"""
type: ChatSearchModelsServerToolType
parameters: Optional[SearchModelsServerToolConfig] = None
r"""Configuration for the openrouter:experimental__search_models server tool"""
+8 -48
View File
@@ -16,71 +16,31 @@ from typing_extensions import NotRequired, TypedDict
class CompletionTokensDetailsTypedDict(TypedDict):
r"""Detailed completion token usage"""
accepted_prediction_tokens: NotRequired[Nullable[int]]
accepted_prediction_tokens: NotRequired[int]
r"""Accepted prediction tokens"""
audio_tokens: NotRequired[Nullable[int]]
audio_tokens: NotRequired[int]
r"""Tokens used for audio output"""
reasoning_tokens: NotRequired[Nullable[int]]
reasoning_tokens: NotRequired[int]
r"""Tokens used for reasoning"""
rejected_prediction_tokens: NotRequired[Nullable[int]]
rejected_prediction_tokens: NotRequired[int]
r"""Rejected prediction tokens"""
class CompletionTokensDetails(BaseModel):
r"""Detailed completion token usage"""
accepted_prediction_tokens: OptionalNullable[int] = UNSET
accepted_prediction_tokens: Optional[int] = None
r"""Accepted prediction tokens"""
audio_tokens: OptionalNullable[int] = UNSET
audio_tokens: Optional[int] = None
r"""Tokens used for audio output"""
reasoning_tokens: OptionalNullable[int] = UNSET
reasoning_tokens: Optional[int] = None
r"""Tokens used for reasoning"""
rejected_prediction_tokens: OptionalNullable[int] = UNSET
rejected_prediction_tokens: Optional[int] = None
r"""Rejected prediction tokens"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = [
"accepted_prediction_tokens",
"audio_tokens",
"reasoning_tokens",
"rejected_prediction_tokens",
]
nullable_fields = [
"accepted_prediction_tokens",
"audio_tokens",
"reasoning_tokens",
"rejected_prediction_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 PromptTokensDetailsTypedDict(TypedDict):
r"""Detailed prompt token usage"""
@@ -12,7 +12,7 @@ from openrouter.types import (
from openrouter.utils import validate_open_enum
from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator
from typing import List
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
@@ -31,7 +31,7 @@ class CreateGuardrailRequestTypedDict(TypedDict):
r"""Array of model identifiers to exclude from routing (slug or canonical_slug accepted)"""
ignored_providers: NotRequired[Nullable[List[str]]]
r"""List of provider IDs to exclude from routing"""
limit_usd: NotRequired[Nullable[float]]
limit_usd: NotRequired[float]
r"""Spending limit in USD"""
reset_interval: NotRequired[Nullable[GuardrailInterval]]
r"""Interval at which the limit resets (daily, weekly, monthly)"""
@@ -59,7 +59,7 @@ class CreateGuardrailRequest(BaseModel):
ignored_providers: OptionalNullable[List[str]] = UNSET
r"""List of provider IDs to exclude from routing"""
limit_usd: OptionalNullable[float] = UNSET
limit_usd: Optional[float] = None
r"""Spending limit in USD"""
reset_interval: Annotated[
@@ -86,7 +86,6 @@ class CreateGuardrailRequest(BaseModel):
"enforce_zdr",
"ignored_models",
"ignored_providers",
"limit_usd",
"reset_interval",
]
null_default_fields = []
+12 -18
View File
@@ -9,34 +9,35 @@ from openrouter.types import (
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing import Optional
from typing_extensions import NotRequired, TypedDict
class DefaultParametersTypedDict(TypedDict):
r"""Default parameters for this model"""
frequency_penalty: NotRequired[Nullable[float]]
presence_penalty: NotRequired[Nullable[float]]
repetition_penalty: NotRequired[Nullable[float]]
temperature: NotRequired[Nullable[float]]
frequency_penalty: NotRequired[float]
presence_penalty: NotRequired[float]
repetition_penalty: NotRequired[float]
temperature: NotRequired[float]
top_k: NotRequired[Nullable[int]]
top_p: NotRequired[Nullable[float]]
top_p: NotRequired[float]
class DefaultParameters(BaseModel):
r"""Default parameters for this model"""
frequency_penalty: OptionalNullable[float] = UNSET
frequency_penalty: Optional[float] = None
presence_penalty: OptionalNullable[float] = UNSET
presence_penalty: Optional[float] = None
repetition_penalty: OptionalNullable[float] = UNSET
repetition_penalty: Optional[float] = None
temperature: OptionalNullable[float] = UNSET
temperature: Optional[float] = None
top_k: OptionalNullable[int] = UNSET
top_p: OptionalNullable[float] = UNSET
top_p: Optional[float] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
@@ -48,14 +49,7 @@ class DefaultParameters(BaseModel):
"top_k",
"top_p",
]
nullable_fields = [
"frequency_penalty",
"presence_penalty",
"repetition_penalty",
"temperature",
"top_k",
"top_p",
]
nullable_fields = ["top_k"]
null_default_fields = []
serialized = handler(self)
+3 -4
View File
@@ -12,7 +12,7 @@ from openrouter.types import (
from openrouter.utils import validate_open_enum
from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator
from typing import List
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
@@ -35,7 +35,7 @@ class GuardrailTypedDict(TypedDict):
r"""Array of model canonical_slugs to exclude from routing"""
ignored_providers: NotRequired[Nullable[List[str]]]
r"""List of provider IDs to exclude from routing"""
limit_usd: NotRequired[Nullable[float]]
limit_usd: NotRequired[float]
r"""Spending limit in USD"""
reset_interval: NotRequired[Nullable[GuardrailInterval]]
r"""Interval at which the limit resets (daily, weekly, monthly)"""
@@ -71,7 +71,7 @@ class Guardrail(BaseModel):
ignored_providers: OptionalNullable[List[str]] = UNSET
r"""List of provider IDs to exclude from routing"""
limit_usd: OptionalNullable[float] = UNSET
limit_usd: Optional[float] = None
r"""Spending limit in USD"""
reset_interval: Annotated[
@@ -102,7 +102,6 @@ class Guardrail(BaseModel):
"enforce_zdr",
"ignored_models",
"ignored_providers",
"limit_usd",
"reset_interval",
"updated_at",
]
-14
View File
@@ -1,14 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import Nullable
from typing import Any, List, Union
from typing_extensions import TypeAliasType
ImageConfigTypedDict = TypeAliasType(
"ImageConfigTypedDict", Union[str, float, List[Nullable[Any]]]
)
ImageConfig = TypeAliasType("ImageConfig", Union[str, float, List[Nullable[Any]]])
@@ -1,30 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .imagegenerationservertoolconfig import (
ImageGenerationServerToolConfig,
ImageGenerationServerToolConfigTypedDict,
)
from openrouter.types import BaseModel
from typing import Literal, Optional
from typing_extensions import NotRequired, TypedDict
ImageGenerationServerToolOpenRouterType = Literal["openrouter:image_generation",]
class ImageGenerationServerToolOpenRouterTypedDict(TypedDict):
r"""OpenRouter built-in server tool: generates images from text prompts using an image generation model"""
type: ImageGenerationServerToolOpenRouterType
parameters: NotRequired[ImageGenerationServerToolConfigTypedDict]
r"""Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field."""
class ImageGenerationServerToolOpenRouter(BaseModel):
r"""OpenRouter built-in server tool: generates images from text prompts using an image generation model"""
type: ImageGenerationServerToolOpenRouterType
parameters: Optional[ImageGenerationServerToolConfig] = None
r"""Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field."""
@@ -1,38 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .imagegenerationservertoolconfig_union import ImageGenerationServerToolConfigUnion
from openrouter.types import BaseModel
import pydantic
from pydantic import ConfigDict
from typing import Dict, Optional
from typing_extensions import NotRequired, TypedDict
class ImageGenerationServerToolConfigTypedDict(TypedDict):
r"""Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field."""
model: NotRequired[str]
r"""Which image generation model to use (e.g. \"openai/gpt-image-1\"). Defaults to \"openai/gpt-image-1\"."""
class ImageGenerationServerToolConfig(BaseModel):
r"""Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field."""
model_config = ConfigDict(
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
)
__pydantic_extra__: Dict[str, ImageGenerationServerToolConfigUnion] = (
pydantic.Field(init=False)
)
model: Optional[str] = None
r"""Which image generation model to use (e.g. \"openai/gpt-image-1\"). Defaults to \"openai/gpt-image-1\"."""
@property
def additional_properties(self):
return self.__pydantic_extra__
@additional_properties.setter
def additional_properties(self, value):
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@@ -1,17 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import Nullable
from typing import Any, List, Union
from typing_extensions import TypeAliasType
ImageGenerationServerToolConfigUnionTypedDict = TypeAliasType(
"ImageGenerationServerToolConfigUnionTypedDict",
Union[str, float, List[Nullable[Any]]],
)
ImageGenerationServerToolConfigUnion = TypeAliasType(
"ImageGenerationServerToolConfigUnion", Union[str, float, List[Nullable[Any]]]
)
+2 -3
View File
@@ -29,7 +29,7 @@ class ModelTypedDict(TypedDict):
r"""Model architecture information"""
canonical_slug: str
r"""Canonical slug for the model"""
context_length: Nullable[int]
context_length: int
r"""Maximum context length in tokens"""
created: int
r"""Unix timestamp of when the model was created"""
@@ -68,7 +68,7 @@ class Model(BaseModel):
canonical_slug: str
r"""Canonical slug for the model"""
context_length: Nullable[int]
context_length: int
r"""Maximum context length in tokens"""
created: int
@@ -121,7 +121,6 @@ class Model(BaseModel):
"knowledge_cutoff",
]
nullable_fields = [
"context_length",
"default_parameters",
"expiration_date",
"hugging_face_id",
@@ -164,11 +164,11 @@ OpenResponsesResultToolUnion = Annotated[
class OpenResponsesResultTypedDict(TypedDict):
r"""Complete non-streaming response from the Responses API"""
completed_at: Nullable[int]
completed_at: int
created_at: int
error: Nullable[ResponsesErrorFieldTypedDict]
r"""Error information returned from the API"""
frequency_penalty: Nullable[float]
frequency_penalty: float
id: str
incomplete_details: Nullable[IncompleteDetailsTypedDict]
instructions: Nullable[BaseInputsUnionTypedDict]
@@ -178,15 +178,15 @@ class OpenResponsesResultTypedDict(TypedDict):
object: OpenResponsesResultObject
output: List[OutputItemsTypedDict]
parallel_tool_calls: bool
presence_penalty: Nullable[float]
presence_penalty: float
status: OpenAIResponsesResponseStatus
temperature: Nullable[float]
temperature: float
tool_choice: OpenAIResponsesToolChoiceUnionTypedDict
tools: List[OpenResponsesResultToolUnionTypedDict]
top_p: Nullable[float]
top_p: float
background: NotRequired[Nullable[bool]]
max_output_tokens: NotRequired[Nullable[int]]
max_tool_calls: NotRequired[Nullable[int]]
max_output_tokens: NotRequired[int]
max_tool_calls: NotRequired[int]
output_text: NotRequired[str]
previous_response_id: NotRequired[Nullable[str]]
prompt: NotRequired[Nullable[StoredPromptTemplateTypedDict]]
@@ -207,14 +207,14 @@ class OpenResponsesResultTypedDict(TypedDict):
class OpenResponsesResult(BaseModel):
r"""Complete non-streaming response from the Responses API"""
completed_at: Nullable[int]
completed_at: int
created_at: int
error: Nullable[ResponsesErrorField]
r"""Error information returned from the API"""
frequency_penalty: Nullable[float]
frequency_penalty: float
id: str
@@ -233,25 +233,25 @@ class OpenResponsesResult(BaseModel):
parallel_tool_calls: bool
presence_penalty: Nullable[float]
presence_penalty: float
status: Annotated[
OpenAIResponsesResponseStatus, PlainValidator(validate_open_enum(False))
]
temperature: Nullable[float]
temperature: float
tool_choice: OpenAIResponsesToolChoiceUnion
tools: List[OpenResponsesResultToolUnion]
top_p: Nullable[float]
top_p: float
background: OptionalNullable[bool] = UNSET
max_output_tokens: OptionalNullable[int] = UNSET
max_output_tokens: Optional[int] = None
max_tool_calls: OptionalNullable[int] = UNSET
max_tool_calls: Optional[int] = None
output_text: Optional[str] = None
@@ -305,23 +305,16 @@ class OpenResponsesResult(BaseModel):
]
nullable_fields = [
"background",
"completed_at",
"error",
"frequency_penalty",
"incomplete_details",
"instructions",
"max_output_tokens",
"max_tool_calls",
"metadata",
"presence_penalty",
"previous_response_id",
"prompt",
"prompt_cache_key",
"reasoning",
"safety_identifier",
"service_tier",
"temperature",
"top_p",
"truncation",
"usage",
"user",
@@ -1,71 +1,35 @@
"""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 openrouter.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict
class PercentileLatencyCutoffsTypedDict(TypedDict):
r"""Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred."""
p50: NotRequired[Nullable[float]]
p50: NotRequired[float]
r"""Maximum p50 latency (seconds)"""
p75: NotRequired[Nullable[float]]
p75: NotRequired[float]
r"""Maximum p75 latency (seconds)"""
p90: NotRequired[Nullable[float]]
p90: NotRequired[float]
r"""Maximum p90 latency (seconds)"""
p99: NotRequired[Nullable[float]]
p99: NotRequired[float]
r"""Maximum p99 latency (seconds)"""
class PercentileLatencyCutoffs(BaseModel):
r"""Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred."""
p50: OptionalNullable[float] = UNSET
p50: Optional[float] = None
r"""Maximum p50 latency (seconds)"""
p75: OptionalNullable[float] = UNSET
p75: Optional[float] = None
r"""Maximum p75 latency (seconds)"""
p90: OptionalNullable[float] = UNSET
p90: Optional[float] = None
r"""Maximum p90 latency (seconds)"""
p99: OptionalNullable[float] = UNSET
p99: Optional[float] = None
r"""Maximum p99 latency (seconds)"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["p50", "p75", "p90", "p99"]
nullable_fields = ["p50", "p75", "p90", "p99"]
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
@@ -1,71 +1,35 @@
"""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 openrouter.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict
class PercentileThroughputCutoffsTypedDict(TypedDict):
r"""Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred."""
p50: NotRequired[Nullable[float]]
p50: NotRequired[float]
r"""Minimum p50 throughput (tokens/sec)"""
p75: NotRequired[Nullable[float]]
p75: NotRequired[float]
r"""Minimum p75 throughput (tokens/sec)"""
p90: NotRequired[Nullable[float]]
p90: NotRequired[float]
r"""Minimum p90 throughput (tokens/sec)"""
p99: NotRequired[Nullable[float]]
p99: NotRequired[float]
r"""Minimum p99 throughput (tokens/sec)"""
class PercentileThroughputCutoffs(BaseModel):
r"""Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred."""
p50: OptionalNullable[float] = UNSET
p50: Optional[float] = None
r"""Minimum p50 throughput (tokens/sec)"""
p75: OptionalNullable[float] = UNSET
p75: Optional[float] = None
r"""Minimum p75 throughput (tokens/sec)"""
p90: OptionalNullable[float] = UNSET
p90: Optional[float] = None
r"""Minimum p90 throughput (tokens/sec)"""
p99: OptionalNullable[float] = UNSET
p99: Optional[float] = None
r"""Minimum p99 throughput (tokens/sec)"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["p50", "p75", "p90", "p99"]
nullable_fields = ["p50", "p75", "p90", "p99"]
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
+11 -20
View File
@@ -82,8 +82,8 @@ class PublicEndpointTypedDict(TypedDict):
context_length: int
latency_last_30m: Nullable[PercentileStatsTypedDict]
r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests."""
max_completion_tokens: Nullable[int]
max_prompt_tokens: Nullable[int]
max_completion_tokens: int
max_prompt_tokens: int
model_id: str
r"""The unique identifier for the model (permaslug)"""
model_name: str
@@ -95,10 +95,10 @@ class PublicEndpointTypedDict(TypedDict):
supports_implicit_caching: bool
tag: str
throughput_last_30m: Nullable[PercentileStatsTypedDict]
uptime_last_1d: Nullable[float]
uptime_last_1d: float
r"""Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data."""
uptime_last_30m: Nullable[float]
uptime_last_5m: Nullable[float]
uptime_last_30m: float
uptime_last_5m: float
r"""Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data."""
status: NotRequired[EndpointStatus]
@@ -111,9 +111,9 @@ class PublicEndpoint(BaseModel):
latency_last_30m: Nullable[PercentileStats]
r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests."""
max_completion_tokens: Nullable[int]
max_completion_tokens: int
max_prompt_tokens: Nullable[int]
max_prompt_tokens: int
model_id: str
r"""The unique identifier for the model (permaslug)"""
@@ -140,12 +140,12 @@ class PublicEndpoint(BaseModel):
throughput_last_30m: Nullable[PercentileStats]
uptime_last_1d: Nullable[float]
uptime_last_1d: float
r"""Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data."""
uptime_last_30m: Nullable[float]
uptime_last_30m: float
uptime_last_5m: Nullable[float]
uptime_last_5m: float
r"""Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data."""
status: Annotated[
@@ -155,16 +155,7 @@ class PublicEndpoint(BaseModel):
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["status"]
nullable_fields = [
"latency_last_30m",
"max_completion_tokens",
"max_prompt_tokens",
"quantization",
"throughput_last_30m",
"uptime_last_1d",
"uptime_last_30m",
"uptime_last_5m",
]
nullable_fields = ["latency_last_30m", "quantization", "throughput_last_30m"]
null_default_fields = []
serialized = handler(self)
+4 -3
View File
@@ -13,6 +13,7 @@ from openrouter.types import (
from openrouter.utils import validate_open_enum
from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
@@ -22,7 +23,7 @@ class ReasoningConfigTypedDict(TypedDict):
effort: NotRequired[Nullable[ReasoningEffort]]
summary: NotRequired[Nullable[ReasoningSummaryVerbosity]]
enabled: NotRequired[Nullable[bool]]
max_tokens: NotRequired[Nullable[int]]
max_tokens: NotRequired[int]
class ReasoningConfig(BaseModel):
@@ -39,12 +40,12 @@ class ReasoningConfig(BaseModel):
enabled: OptionalNullable[bool] = UNSET
max_tokens: OptionalNullable[int] = UNSET
max_tokens: Optional[int] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["effort", "summary", "enabled", "max_tokens"]
nullable_fields = ["effort", "summary", "enabled", "max_tokens"]
nullable_fields = ["effort", "summary", "enabled"]
null_default_fields = []
serialized = handler(self)
+31 -45
View File
@@ -3,10 +3,6 @@
from __future__ import annotations
from .applypatchservertool import ApplyPatchServerTool, ApplyPatchServerToolTypedDict
from .autorouterplugin import AutoRouterPlugin, AutoRouterPluginTypedDict
from .chatsearchmodelsservertool import (
ChatSearchModelsServerTool,
ChatSearchModelsServerToolTypedDict,
)
from .codeinterpreterservertool import (
CodeInterpreterServerTool,
CodeInterpreterServerToolTypedDict,
@@ -21,15 +17,10 @@ from .customtool import CustomTool, CustomToolTypedDict
from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict
from .fileparserplugin import FileParserPlugin, FileParserPluginTypedDict
from .filesearchservertool import FileSearchServerTool, FileSearchServerToolTypedDict
from .imageconfig import ImageConfig, ImageConfigTypedDict
from .imagegenerationservertool import (
ImageGenerationServerTool,
ImageGenerationServerToolTypedDict,
)
from .imagegenerationservertool_openrouter import (
ImageGenerationServerToolOpenRouter,
ImageGenerationServerToolOpenRouterTypedDict,
)
from .inputs_union import InputsUnion, InputsUnionTypedDict
from .legacy_websearchservertool import (
LegacyWebSearchServerTool,
@@ -81,6 +72,16 @@ from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
ResponsesRequestImageConfigTypedDict = TypeAliasType(
"ResponsesRequestImageConfigTypedDict", Union[str, float]
)
ResponsesRequestImageConfig = TypeAliasType(
"ResponsesRequestImageConfig", Union[str, float]
)
ResponsesRequestPluginTypedDict = TypeAliasType(
"ResponsesRequestPluginTypedDict",
Union[
@@ -179,16 +180,14 @@ class ResponsesRequestToolFunction(BaseModel):
ResponsesRequestToolUnionTypedDict = TypeAliasType(
"ResponsesRequestToolUnionTypedDict",
Union[
ApplyPatchServerToolTypedDict,
CodexLocalShellToolTypedDict,
ApplyPatchServerToolTypedDict,
ShellServerToolTypedDict,
WebSearchServerToolOpenRouterTypedDict,
ChatSearchModelsServerToolTypedDict,
ImageGenerationServerToolOpenRouterTypedDict,
CodeInterpreterServerToolTypedDict,
DatetimeServerToolTypedDict,
ComputerUseServerToolTypedDict,
CodeInterpreterServerToolTypedDict,
CustomToolTypedDict,
ComputerUseServerToolTypedDict,
ResponsesRequestToolFunctionTypedDict,
FileSearchServerToolTypedDict,
WebSearchServerToolTypedDict,
@@ -220,12 +219,6 @@ ResponsesRequestToolUnion = Annotated[
Annotated[ApplyPatchServerTool, Tag("apply_patch")],
Annotated[CustomTool, Tag("custom")],
Annotated[DatetimeServerTool, Tag("openrouter:datetime")],
Annotated[
ImageGenerationServerToolOpenRouter, Tag("openrouter:image_generation")
],
Annotated[
ChatSearchModelsServerTool, Tag("openrouter:experimental__search_models")
],
Annotated[WebSearchServerToolOpenRouter, Tag("openrouter:web_search")],
],
Discriminator(lambda m: get_discriminator(m, "type", "type")),
@@ -236,15 +229,15 @@ class ResponsesRequestTypedDict(TypedDict):
r"""Request schema for Responses endpoint"""
background: NotRequired[Nullable[bool]]
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."""
frequency_penalty: NotRequired[float]
image_config: NotRequired[Dict[str, ResponsesRequestImageConfigTypedDict]]
r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details."""
include: NotRequired[Nullable[List[ResponseIncludesEnum]]]
input: NotRequired[InputsUnionTypedDict]
r"""Input for a response request - can be a string or array of items"""
instructions: NotRequired[Nullable[str]]
max_output_tokens: NotRequired[Nullable[int]]
max_tool_calls: NotRequired[Nullable[int]]
max_output_tokens: NotRequired[int]
max_tool_calls: NotRequired[int]
metadata: NotRequired[Nullable[Dict[str, str]]]
r"""Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed."""
modalities: NotRequired[List[OutputModalityEnum]]
@@ -254,7 +247,7 @@ class ResponsesRequestTypedDict(TypedDict):
parallel_tool_calls: NotRequired[Nullable[bool]]
plugins: NotRequired[List[ResponsesRequestPluginTypedDict]]
r"""Plugins you want to enable for this request, including their settings."""
presence_penalty: NotRequired[Nullable[float]]
presence_penalty: NotRequired[float]
previous_response_id: NotRequired[Nullable[str]]
prompt: NotRequired[Nullable[StoredPromptTemplateTypedDict]]
prompt_cache_key: NotRequired[Nullable[str]]
@@ -268,14 +261,14 @@ class ResponsesRequestTypedDict(TypedDict):
r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."""
store: Literal[False]
stream: NotRequired[bool]
temperature: NotRequired[Nullable[float]]
temperature: NotRequired[float]
text: NotRequired[TextExtendedConfigTypedDict]
r"""Text output configuration including format and verbosity"""
tool_choice: NotRequired[OpenAIResponsesToolChoiceUnionTypedDict]
tools: NotRequired[List[ResponsesRequestToolUnionTypedDict]]
top_k: NotRequired[int]
top_logprobs: NotRequired[Nullable[int]]
top_p: NotRequired[Nullable[float]]
top_logprobs: NotRequired[int]
top_p: NotRequired[float]
trace: NotRequired[TraceConfigTypedDict]
r"""Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."""
truncation: NotRequired[Nullable[OpenAIResponsesTruncation]]
@@ -288,10 +281,10 @@ class ResponsesRequest(BaseModel):
background: OptionalNullable[bool] = UNSET
frequency_penalty: OptionalNullable[float] = UNSET
frequency_penalty: Optional[float] = None
image_config: Optional[Dict[str, ImageConfig]] = None
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."""
image_config: Optional[Dict[str, ResponsesRequestImageConfig]] = None
r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details."""
include: OptionalNullable[
List[Annotated[ResponseIncludesEnum, PlainValidator(validate_open_enum(False))]]
@@ -302,9 +295,9 @@ class ResponsesRequest(BaseModel):
instructions: OptionalNullable[str] = UNSET
max_output_tokens: OptionalNullable[int] = UNSET
max_output_tokens: Optional[int] = None
max_tool_calls: OptionalNullable[int] = UNSET
max_tool_calls: Optional[int] = None
metadata: OptionalNullable[Dict[str, str]] = UNSET
r"""Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed."""
@@ -323,7 +316,7 @@ class ResponsesRequest(BaseModel):
plugins: Optional[List[ResponsesRequestPlugin]] = None
r"""Plugins you want to enable for this request, including their settings."""
presence_penalty: OptionalNullable[float] = UNSET
presence_penalty: Optional[float] = None
previous_response_id: OptionalNullable[str] = UNSET
@@ -354,7 +347,7 @@ class ResponsesRequest(BaseModel):
stream: Optional[bool] = False
temperature: OptionalNullable[float] = UNSET
temperature: Optional[float] = None
text: Optional[TextExtendedConfig] = None
r"""Text output configuration including format and verbosity"""
@@ -365,9 +358,9 @@ class ResponsesRequest(BaseModel):
top_k: Optional[int] = None
top_logprobs: OptionalNullable[int] = UNSET
top_logprobs: Optional[int] = None
top_p: OptionalNullable[float] = UNSET
top_p: Optional[float] = None
trace: Optional[TraceConfig] = None
r"""Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."""
@@ -421,14 +414,10 @@ class ResponsesRequest(BaseModel):
]
nullable_fields = [
"background",
"frequency_penalty",
"include",
"instructions",
"max_output_tokens",
"max_tool_calls",
"metadata",
"parallel_tool_calls",
"presence_penalty",
"previous_response_id",
"prompt",
"prompt_cache_key",
@@ -436,9 +425,6 @@ class ResponsesRequest(BaseModel):
"reasoning",
"safety_identifier",
"service_tier",
"temperature",
"top_logprobs",
"top_p",
"truncation",
]
null_default_fields = []
@@ -1,20 +0,0 @@
"""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 SearchModelsServerToolConfigTypedDict(TypedDict):
r"""Configuration for the openrouter:experimental__search_models server tool"""
max_results: NotRequired[int]
r"""Maximum number of models to return. Defaults to 5, max 20."""
class SearchModelsServerToolConfig(BaseModel):
r"""Configuration for the openrouter:experimental__search_models server tool"""
max_results: Optional[int] = None
r"""Maximum number of models to return. Defaults to 5, max 20."""
+6 -42
View File
@@ -1,14 +1,8 @@
"""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 openrouter.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict
@@ -17,9 +11,9 @@ class TopProviderInfoTypedDict(TypedDict):
is_moderated: bool
r"""Whether the top provider moderates content"""
context_length: NotRequired[Nullable[int]]
context_length: NotRequired[int]
r"""Context length from the top provider"""
max_completion_tokens: NotRequired[Nullable[int]]
max_completion_tokens: NotRequired[int]
r"""Maximum completion tokens from the top provider"""
@@ -29,38 +23,8 @@ class TopProviderInfo(BaseModel):
is_moderated: bool
r"""Whether the top provider moderates content"""
context_length: OptionalNullable[int] = UNSET
context_length: Optional[int] = None
r"""Context length from the top provider"""
max_completion_tokens: OptionalNullable[int] = UNSET
max_completion_tokens: Optional[int] = None
r"""Maximum completion tokens from the top provider"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["context_length", "max_completion_tokens"]
nullable_fields = ["context_length", "max_completion_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
@@ -29,7 +29,7 @@ class UpdateGuardrailRequestTypedDict(TypedDict):
r"""Array of model identifiers to exclude from routing (slug or canonical_slug accepted)"""
ignored_providers: NotRequired[Nullable[List[str]]]
r"""List of provider IDs to exclude from routing"""
limit_usd: NotRequired[Nullable[float]]
limit_usd: NotRequired[float]
r"""New spending limit in USD"""
name: NotRequired[str]
r"""New name for the guardrail"""
@@ -56,7 +56,7 @@ class UpdateGuardrailRequest(BaseModel):
ignored_providers: OptionalNullable[List[str]] = UNSET
r"""List of provider IDs to exclude from routing"""
limit_usd: OptionalNullable[float] = UNSET
limit_usd: Optional[float] = None
r"""New spending limit in USD"""
name: Optional[str] = None
@@ -87,7 +87,6 @@ class UpdateGuardrailRequest(BaseModel):
"enforce_zdr",
"ignored_models",
"ignored_providers",
"limit_usd",
"reset_interval",
]
null_default_fields = []
+5 -72
View File
@@ -1,14 +1,7 @@
"""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 openrouter.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict
@@ -32,7 +25,7 @@ class OutputTokensDetails(BaseModel):
class CostDetailsTypedDict(TypedDict):
upstream_inference_input_cost: float
upstream_inference_output_cost: float
upstream_inference_cost: NotRequired[Nullable[float]]
upstream_inference_cost: NotRequired[float]
class CostDetails(BaseModel):
@@ -40,37 +33,7 @@ class CostDetails(BaseModel):
upstream_inference_output_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
upstream_inference_cost: Optional[float] = None
class UsageTypedDict(TypedDict):
@@ -81,7 +44,7 @@ class UsageTypedDict(TypedDict):
output_tokens: int
output_tokens_details: OutputTokensDetailsTypedDict
total_tokens: int
cost: NotRequired[Nullable[float]]
cost: NotRequired[float]
r"""Cost of the completion"""
cost_details: NotRequired[CostDetailsTypedDict]
is_byok: NotRequired[bool]
@@ -101,40 +64,10 @@ class Usage(BaseModel):
total_tokens: int
cost: OptionalNullable[float] = UNSET
cost: Optional[float] = None
r"""Cost of the completion"""
cost_details: Optional[CostDetails] = None
is_byok: Optional[bool] = None
r"""Whether a request was made using a Bring Your Own Key configuration"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["cost", "cost_details", "is_byok"]
nullable_fields = ["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
@@ -1,14 +1,7 @@
"""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 openrouter.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict
@@ -16,7 +9,7 @@ from typing_extensions import NotRequired, TypedDict
class VideoGenerationUsageTypedDict(TypedDict):
r"""Usage and cost information for the video generation. Available once the job has completed."""
cost: NotRequired[Nullable[float]]
cost: NotRequired[float]
r"""The cost of the video generation in USD."""
is_byok: NotRequired[bool]
r"""Whether the request was made using a Bring Your Own Key configuration."""
@@ -25,38 +18,8 @@ class VideoGenerationUsageTypedDict(TypedDict):
class VideoGenerationUsage(BaseModel):
r"""Usage and cost information for the video generation. Available once the job has completed."""
cost: OptionalNullable[float] = UNSET
cost: Optional[float] = None
r"""The cost of the video generation in USD."""
is_byok: Optional[bool] = None
r"""Whether the request was made using a Bring Your Own Key configuration."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["cost", "is_byok"]
nullable_fields = ["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
+4 -4
View File
@@ -335,7 +335,7 @@ class Guardrails(BaseSDK):
enforce_zdr: OptionalNullable[bool] = UNSET,
ignored_models: OptionalNullable[List[str]] = UNSET,
ignored_providers: OptionalNullable[List[str]] = UNSET,
limit_usd: OptionalNullable[float] = UNSET,
limit_usd: Optional[float] = None,
reset_interval: OptionalNullable[components.GuardrailInterval] = UNSET,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
@@ -494,7 +494,7 @@ class Guardrails(BaseSDK):
enforce_zdr: OptionalNullable[bool] = UNSET,
ignored_models: OptionalNullable[List[str]] = UNSET,
ignored_providers: OptionalNullable[List[str]] = UNSET,
limit_usd: OptionalNullable[float] = UNSET,
limit_usd: Optional[float] = None,
reset_interval: OptionalNullable[components.GuardrailInterval] = UNSET,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
@@ -1157,7 +1157,7 @@ class Guardrails(BaseSDK):
enforce_zdr: OptionalNullable[bool] = UNSET,
ignored_models: OptionalNullable[List[str]] = UNSET,
ignored_providers: OptionalNullable[List[str]] = UNSET,
limit_usd: OptionalNullable[float] = UNSET,
limit_usd: Optional[float] = None,
name: Optional[str] = None,
reset_interval: OptionalNullable[components.GuardrailInterval] = UNSET,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
@@ -1324,7 +1324,7 @@ class Guardrails(BaseSDK):
enforce_zdr: OptionalNullable[bool] = UNSET,
ignored_models: OptionalNullable[List[str]] = UNSET,
ignored_providers: OptionalNullable[List[str]] = UNSET,
limit_usd: OptionalNullable[float] = UNSET,
limit_usd: Optional[float] = None,
name: Optional[str] = None,
reset_interval: OptionalNullable[components.GuardrailInterval] = UNSET,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
+8 -15
View File
@@ -89,7 +89,7 @@ class CreateKeysRequestBodyTypedDict(TypedDict):
r"""Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected"""
include_byok_in_limit: NotRequired[bool]
r"""Whether to include BYOK usage in the limit"""
limit: NotRequired[Nullable[float]]
limit: NotRequired[float]
r"""Optional spending limit for the API key in USD"""
limit_reset: NotRequired[Nullable[CreateKeysLimitReset]]
r"""Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday."""
@@ -108,7 +108,7 @@ class CreateKeysRequestBody(BaseModel):
include_byok_in_limit: Optional[bool] = None
r"""Whether to include BYOK usage in the limit"""
limit: OptionalNullable[float] = UNSET
limit: Optional[float] = None
r"""Optional spending limit for the API key in USD"""
limit_reset: Annotated[
@@ -126,7 +126,7 @@ class CreateKeysRequestBody(BaseModel):
"limit",
"limit_reset",
]
nullable_fields = ["creator_user_id", "expires_at", "limit", "limit_reset"]
nullable_fields = ["creator_user_id", "expires_at", "limit_reset"]
null_default_fields = []
serialized = handler(self)
@@ -229,9 +229,9 @@ class CreateKeysDataTypedDict(TypedDict):
r"""Whether to include external BYOK usage in the credit limit"""
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
r"""Type of limit reset for the API key"""
@@ -284,10 +284,10 @@ class CreateKeysData(BaseModel):
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
@@ -317,14 +317,7 @@ class CreateKeysData(BaseModel):
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["expires_at"]
nullable_fields = [
"creator_user_id",
"expires_at",
"limit",
"limit_remaining",
"limit_reset",
"updated_at",
]
nullable_fields = ["creator_user_id", "expires_at", "limit_reset", "updated_at"]
null_default_fields = []
serialized = handler(self)
+5 -11
View File
@@ -161,9 +161,9 @@ class GetCurrentKeyDataTypedDict(TypedDict):
r"""Whether this is a management key"""
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
r"""Type of limit reset for the API key"""
@@ -219,10 +219,10 @@ class GetCurrentKeyData(BaseModel):
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
@@ -254,13 +254,7 @@ class GetCurrentKeyData(BaseModel):
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["expires_at"]
nullable_fields = [
"creator_user_id",
"expires_at",
"limit",
"limit_remaining",
"limit_reset",
]
nullable_fields = ["creator_user_id", "expires_at", "limit_reset"]
null_default_fields = []
serialized = handler(self)
+34 -51
View File
@@ -139,9 +139,9 @@ class GetGenerationDataTypedDict(TypedDict):
api_type: Nullable[APIType]
r"""Type of API used for the generation"""
app_id: Nullable[int]
app_id: int
r"""ID of the app that made the request"""
cache_discount: Nullable[float]
cache_discount: float
r"""Discount applied due to caching"""
cancelled: Nullable[bool]
r"""Whether the generation was cancelled"""
@@ -151,7 +151,7 @@ class GetGenerationDataTypedDict(TypedDict):
r"""External user identifier"""
finish_reason: Nullable[str]
r"""Reason the generation finished"""
generation_time: Nullable[float]
generation_time: float
r"""Time taken for generation in milliseconds"""
http_referer: Nullable[str]
r"""Referer header from the request"""
@@ -159,31 +159,31 @@ class GetGenerationDataTypedDict(TypedDict):
r"""Unique identifier for the generation"""
is_byok: bool
r"""Whether this used bring-your-own-key"""
latency: Nullable[float]
latency: float
r"""Total latency in milliseconds"""
model: str
r"""Model used for the generation"""
moderation_latency: Nullable[float]
moderation_latency: float
r"""Moderation latency in milliseconds"""
native_finish_reason: Nullable[str]
r"""Native finish reason as reported by provider"""
native_tokens_cached: Nullable[int]
native_tokens_cached: int
r"""Native cached tokens as reported by provider"""
native_tokens_completion: Nullable[int]
native_tokens_completion: int
r"""Native completion tokens as reported by provider"""
native_tokens_completion_images: Nullable[int]
native_tokens_completion_images: int
r"""Native completion image tokens as reported by provider"""
native_tokens_prompt: Nullable[int]
native_tokens_prompt: int
r"""Native prompt tokens as reported by provider"""
native_tokens_reasoning: Nullable[int]
native_tokens_reasoning: int
r"""Native reasoning tokens as reported by provider"""
num_input_audio_prompt: Nullable[int]
num_input_audio_prompt: int
r"""Number of audio inputs in the prompt"""
num_media_completion: Nullable[int]
num_media_completion: int
r"""Number of media items in the completion"""
num_media_prompt: Nullable[int]
num_media_prompt: int
r"""Number of media items in the prompt"""
num_search_results: Nullable[int]
num_search_results: int
r"""Number of search results included"""
origin: str
r"""Origin URL of the request"""
@@ -197,15 +197,15 @@ class GetGenerationDataTypedDict(TypedDict):
r"""Router used for the request (e.g., openrouter/auto)"""
streamed: Nullable[bool]
r"""Whether the response was streamed"""
tokens_completion: Nullable[int]
tokens_completion: int
r"""Number of tokens in the completion"""
tokens_prompt: Nullable[int]
tokens_prompt: int
r"""Number of tokens in the prompt"""
total_cost: float
r"""Total cost of the generation in USD"""
upstream_id: Nullable[str]
r"""Upstream provider's identifier for this generation"""
upstream_inference_cost: Nullable[float]
upstream_inference_cost: float
r"""Cost charged by the upstream provider"""
usage: float
r"""Usage amount in USD"""
@@ -223,10 +223,10 @@ class GetGenerationData(BaseModel):
api_type: Annotated[Nullable[APIType], PlainValidator(validate_open_enum(False))]
r"""Type of API used for the generation"""
app_id: Nullable[int]
app_id: int
r"""ID of the app that made the request"""
cache_discount: Nullable[float]
cache_discount: float
r"""Discount applied due to caching"""
cancelled: Nullable[bool]
@@ -241,7 +241,7 @@ class GetGenerationData(BaseModel):
finish_reason: Nullable[str]
r"""Reason the generation finished"""
generation_time: Nullable[float]
generation_time: float
r"""Time taken for generation in milliseconds"""
http_referer: Nullable[str]
@@ -253,43 +253,43 @@ class GetGenerationData(BaseModel):
is_byok: bool
r"""Whether this used bring-your-own-key"""
latency: Nullable[float]
latency: float
r"""Total latency in milliseconds"""
model: str
r"""Model used for the generation"""
moderation_latency: Nullable[float]
moderation_latency: float
r"""Moderation latency in milliseconds"""
native_finish_reason: Nullable[str]
r"""Native finish reason as reported by provider"""
native_tokens_cached: Nullable[int]
native_tokens_cached: int
r"""Native cached tokens as reported by provider"""
native_tokens_completion: Nullable[int]
native_tokens_completion: int
r"""Native completion tokens as reported by provider"""
native_tokens_completion_images: Nullable[int]
native_tokens_completion_images: int
r"""Native completion image tokens as reported by provider"""
native_tokens_prompt: Nullable[int]
native_tokens_prompt: int
r"""Native prompt tokens as reported by provider"""
native_tokens_reasoning: Nullable[int]
native_tokens_reasoning: int
r"""Native reasoning tokens as reported by provider"""
num_input_audio_prompt: Nullable[int]
num_input_audio_prompt: int
r"""Number of audio inputs in the prompt"""
num_media_completion: Nullable[int]
num_media_completion: int
r"""Number of media items in the completion"""
num_media_prompt: Nullable[int]
num_media_prompt: int
r"""Number of media items in the prompt"""
num_search_results: Nullable[int]
num_search_results: int
r"""Number of search results included"""
origin: str
@@ -307,10 +307,10 @@ class GetGenerationData(BaseModel):
streamed: Nullable[bool]
r"""Whether the response was streamed"""
tokens_completion: Nullable[int]
tokens_completion: int
r"""Number of tokens in the completion"""
tokens_prompt: Nullable[int]
tokens_prompt: int
r"""Number of tokens in the prompt"""
total_cost: float
@@ -319,7 +319,7 @@ class GetGenerationData(BaseModel):
upstream_id: Nullable[str]
r"""Upstream provider's identifier for this generation"""
upstream_inference_cost: Nullable[float]
upstream_inference_cost: float
r"""Cost charged by the upstream provider"""
usage: float
@@ -339,35 +339,18 @@ class GetGenerationData(BaseModel):
optional_fields = ["request_id", "session_id"]
nullable_fields = [
"api_type",
"app_id",
"cache_discount",
"cancelled",
"external_user",
"finish_reason",
"generation_time",
"http_referer",
"latency",
"moderation_latency",
"native_finish_reason",
"native_tokens_cached",
"native_tokens_completion",
"native_tokens_completion_images",
"native_tokens_prompt",
"native_tokens_reasoning",
"num_input_audio_prompt",
"num_media_completion",
"num_media_prompt",
"num_search_results",
"provider_name",
"provider_responses",
"request_id",
"router",
"session_id",
"streamed",
"tokens_completion",
"tokens_prompt",
"upstream_id",
"upstream_inference_cost",
"user_agent",
]
null_default_fields = []
+5 -12
View File
@@ -138,9 +138,9 @@ class GetKeyDataTypedDict(TypedDict):
r"""Whether to include external BYOK usage in the credit limit"""
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
r"""Type of limit reset for the API key"""
@@ -193,10 +193,10 @@ class GetKeyData(BaseModel):
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
@@ -226,14 +226,7 @@ class GetKeyData(BaseModel):
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["expires_at"]
nullable_fields = [
"creator_user_id",
"expires_at",
"limit",
"limit_remaining",
"limit_reset",
"updated_at",
]
nullable_fields = ["creator_user_id", "expires_at", "limit_reset", "updated_at"]
null_default_fields = []
serialized = handler(self)
+5 -12
View File
@@ -145,9 +145,9 @@ class ListDataTypedDict(TypedDict):
r"""Whether to include external BYOK usage in the credit limit"""
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
r"""Type of limit reset for the API key"""
@@ -198,10 +198,10 @@ class ListData(BaseModel):
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
@@ -231,14 +231,7 @@ class ListData(BaseModel):
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["expires_at"]
nullable_fields = [
"creator_user_id",
"expires_at",
"limit",
"limit_remaining",
"limit_reset",
"updated_at",
]
nullable_fields = ["creator_user_id", "expires_at", "limit_reset", "updated_at"]
null_default_fields = []
serialized = handler(self)
+8 -15
View File
@@ -86,7 +86,7 @@ class UpdateKeysRequestBodyTypedDict(TypedDict):
r"""Whether to disable the API key"""
include_byok_in_limit: NotRequired[bool]
r"""Whether to include BYOK usage in the limit"""
limit: NotRequired[Nullable[float]]
limit: NotRequired[float]
r"""New spending limit for the API key in USD"""
limit_reset: NotRequired[Nullable[UpdateKeysLimitReset]]
r"""New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday."""
@@ -101,7 +101,7 @@ class UpdateKeysRequestBody(BaseModel):
include_byok_in_limit: Optional[bool] = None
r"""Whether to include BYOK usage in the limit"""
limit: OptionalNullable[float] = UNSET
limit: Optional[float] = None
r"""New spending limit for the API key in USD"""
limit_reset: Annotated[
@@ -122,7 +122,7 @@ class UpdateKeysRequestBody(BaseModel):
"limit_reset",
"name",
]
nullable_fields = ["limit", "limit_reset"]
nullable_fields = ["limit_reset"]
null_default_fields = []
serialized = handler(self)
@@ -232,9 +232,9 @@ class UpdateKeysDataTypedDict(TypedDict):
r"""Whether to include external BYOK usage in the credit limit"""
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
r"""Type of limit reset for the API key"""
@@ -287,10 +287,10 @@ class UpdateKeysData(BaseModel):
label: str
r"""Human-readable label for the API key"""
limit: Nullable[float]
limit: float
r"""Spending limit for the API key in USD"""
limit_remaining: Nullable[float]
limit_remaining: float
r"""Remaining spending limit in USD"""
limit_reset: Nullable[str]
@@ -320,14 +320,7 @@ class UpdateKeysData(BaseModel):
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["expires_at"]
nullable_fields = [
"creator_user_id",
"expires_at",
"limit",
"limit_remaining",
"limit_reset",
"updated_at",
]
nullable_fields = ["creator_user_id", "expires_at", "limit_reset", "updated_at"]
null_default_fields = []
serialized = handler(self)
+60 -60
View File
@@ -26,11 +26,11 @@ class Responses(BaseSDK):
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
background: OptionalNullable[bool] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ResponsesRequestImageConfig],
Dict[str, components.ResponsesRequestImageConfigTypedDict],
]
] = None,
include: OptionalNullable[List[components.ResponseIncludesEnum]] = UNSET,
@@ -38,8 +38,8 @@ class Responses(BaseSDK):
Union[components.InputsUnion, components.InputsUnionTypedDict]
] = None,
instructions: OptionalNullable[str] = UNSET,
max_output_tokens: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
max_output_tokens: Optional[int] = None,
max_tool_calls: Optional[int] = None,
metadata: OptionalNullable[Dict[str, str]] = UNSET,
modalities: Optional[List[components.OutputModalityEnum]] = None,
model: Optional[str] = None,
@@ -51,7 +51,7 @@ class Responses(BaseSDK):
List[components.ResponsesRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
Union[
@@ -72,7 +72,7 @@ class Responses(BaseSDK):
service_tier: OptionalNullable[components.ResponsesRequestServiceTier] = "auto",
session_id: Optional[str] = None,
stream: Union[Literal[False], None] = None,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
text: Optional[
Union[components.TextExtendedConfig, components.TextExtendedConfigTypedDict]
] = None,
@@ -89,8 +89,8 @@ class Responses(BaseSDK):
]
] = None,
top_k: Optional[int] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -114,7 +114,7 @@ class Responses(BaseSDK):
:param background:
: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 image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param include:
:param input: Input for a response request - can be a string or array of items
:param instructions:
@@ -161,11 +161,11 @@ class Responses(BaseSDK):
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
background: OptionalNullable[bool] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ResponsesRequestImageConfig],
Dict[str, components.ResponsesRequestImageConfigTypedDict],
]
] = None,
include: OptionalNullable[List[components.ResponseIncludesEnum]] = UNSET,
@@ -173,8 +173,8 @@ class Responses(BaseSDK):
Union[components.InputsUnion, components.InputsUnionTypedDict]
] = None,
instructions: OptionalNullable[str] = UNSET,
max_output_tokens: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
max_output_tokens: Optional[int] = None,
max_tool_calls: Optional[int] = None,
metadata: OptionalNullable[Dict[str, str]] = UNSET,
modalities: Optional[List[components.OutputModalityEnum]] = None,
model: Optional[str] = None,
@@ -186,7 +186,7 @@ class Responses(BaseSDK):
List[components.ResponsesRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
Union[
@@ -207,7 +207,7 @@ class Responses(BaseSDK):
service_tier: OptionalNullable[components.ResponsesRequestServiceTier] = "auto",
session_id: Optional[str] = None,
stream: Literal[True],
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
text: Optional[
Union[components.TextExtendedConfig, components.TextExtendedConfigTypedDict]
] = None,
@@ -224,8 +224,8 @@ class Responses(BaseSDK):
]
] = None,
top_k: Optional[int] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -249,7 +249,7 @@ class Responses(BaseSDK):
:param background:
: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 image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param include:
:param input: Input for a response request - can be a string or array of items
:param instructions:
@@ -295,11 +295,11 @@ class Responses(BaseSDK):
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
background: OptionalNullable[bool] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ResponsesRequestImageConfig],
Dict[str, components.ResponsesRequestImageConfigTypedDict],
]
] = None,
include: OptionalNullable[List[components.ResponseIncludesEnum]] = UNSET,
@@ -307,8 +307,8 @@ class Responses(BaseSDK):
Union[components.InputsUnion, components.InputsUnionTypedDict]
] = None,
instructions: OptionalNullable[str] = UNSET,
max_output_tokens: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
max_output_tokens: Optional[int] = None,
max_tool_calls: Optional[int] = None,
metadata: OptionalNullable[Dict[str, str]] = UNSET,
modalities: Optional[List[components.OutputModalityEnum]] = None,
model: Optional[str] = None,
@@ -320,7 +320,7 @@ class Responses(BaseSDK):
List[components.ResponsesRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
Union[
@@ -341,7 +341,7 @@ class Responses(BaseSDK):
service_tier: OptionalNullable[components.ResponsesRequestServiceTier] = "auto",
session_id: Optional[str] = None,
stream: Optional[bool] = False,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
text: Optional[
Union[components.TextExtendedConfig, components.TextExtendedConfigTypedDict]
] = None,
@@ -358,8 +358,8 @@ class Responses(BaseSDK):
]
] = None,
top_k: Optional[int] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -383,7 +383,7 @@ class Responses(BaseSDK):
:param background:
: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 image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param include:
:param input: Input for a response request - can be a string or array of items
:param instructions:
@@ -697,11 +697,11 @@ class Responses(BaseSDK):
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
background: OptionalNullable[bool] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ResponsesRequestImageConfig],
Dict[str, components.ResponsesRequestImageConfigTypedDict],
]
] = None,
include: OptionalNullable[List[components.ResponseIncludesEnum]] = UNSET,
@@ -709,8 +709,8 @@ class Responses(BaseSDK):
Union[components.InputsUnion, components.InputsUnionTypedDict]
] = None,
instructions: OptionalNullable[str] = UNSET,
max_output_tokens: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
max_output_tokens: Optional[int] = None,
max_tool_calls: Optional[int] = None,
metadata: OptionalNullable[Dict[str, str]] = UNSET,
modalities: Optional[List[components.OutputModalityEnum]] = None,
model: Optional[str] = None,
@@ -722,7 +722,7 @@ class Responses(BaseSDK):
List[components.ResponsesRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
Union[
@@ -743,7 +743,7 @@ class Responses(BaseSDK):
service_tier: OptionalNullable[components.ResponsesRequestServiceTier] = "auto",
session_id: Optional[str] = None,
stream: Union[Literal[False], None] = None,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
text: Optional[
Union[components.TextExtendedConfig, components.TextExtendedConfigTypedDict]
] = None,
@@ -760,8 +760,8 @@ class Responses(BaseSDK):
]
] = None,
top_k: Optional[int] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -785,7 +785,7 @@ class Responses(BaseSDK):
:param background:
: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 image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param include:
:param input: Input for a response request - can be a string or array of items
:param instructions:
@@ -832,11 +832,11 @@ class Responses(BaseSDK):
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
background: OptionalNullable[bool] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ResponsesRequestImageConfig],
Dict[str, components.ResponsesRequestImageConfigTypedDict],
]
] = None,
include: OptionalNullable[List[components.ResponseIncludesEnum]] = UNSET,
@@ -844,8 +844,8 @@ class Responses(BaseSDK):
Union[components.InputsUnion, components.InputsUnionTypedDict]
] = None,
instructions: OptionalNullable[str] = UNSET,
max_output_tokens: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
max_output_tokens: Optional[int] = None,
max_tool_calls: Optional[int] = None,
metadata: OptionalNullable[Dict[str, str]] = UNSET,
modalities: Optional[List[components.OutputModalityEnum]] = None,
model: Optional[str] = None,
@@ -857,7 +857,7 @@ class Responses(BaseSDK):
List[components.ResponsesRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
Union[
@@ -878,7 +878,7 @@ class Responses(BaseSDK):
service_tier: OptionalNullable[components.ResponsesRequestServiceTier] = "auto",
session_id: Optional[str] = None,
stream: Literal[True],
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
text: Optional[
Union[components.TextExtendedConfig, components.TextExtendedConfigTypedDict]
] = None,
@@ -895,8 +895,8 @@ class Responses(BaseSDK):
]
] = None,
top_k: Optional[int] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -920,7 +920,7 @@ class Responses(BaseSDK):
:param background:
: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 image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param include:
:param input: Input for a response request - can be a string or array of items
:param instructions:
@@ -966,11 +966,11 @@ class Responses(BaseSDK):
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
background: OptionalNullable[bool] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.ImageConfig],
Dict[str, components.ImageConfigTypedDict],
Dict[str, components.ResponsesRequestImageConfig],
Dict[str, components.ResponsesRequestImageConfigTypedDict],
]
] = None,
include: OptionalNullable[List[components.ResponseIncludesEnum]] = UNSET,
@@ -978,8 +978,8 @@ class Responses(BaseSDK):
Union[components.InputsUnion, components.InputsUnionTypedDict]
] = None,
instructions: OptionalNullable[str] = UNSET,
max_output_tokens: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
max_output_tokens: Optional[int] = None,
max_tool_calls: Optional[int] = None,
metadata: OptionalNullable[Dict[str, str]] = UNSET,
modalities: Optional[List[components.OutputModalityEnum]] = None,
model: Optional[str] = None,
@@ -991,7 +991,7 @@ class Responses(BaseSDK):
List[components.ResponsesRequestPluginTypedDict],
]
] = None,
presence_penalty: OptionalNullable[float] = UNSET,
presence_penalty: Optional[float] = None,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
Union[
@@ -1012,7 +1012,7 @@ class Responses(BaseSDK):
service_tier: OptionalNullable[components.ResponsesRequestServiceTier] = "auto",
session_id: Optional[str] = None,
stream: Optional[bool] = False,
temperature: OptionalNullable[float] = UNSET,
temperature: Optional[float] = None,
text: Optional[
Union[components.TextExtendedConfig, components.TextExtendedConfigTypedDict]
] = None,
@@ -1029,8 +1029,8 @@ class Responses(BaseSDK):
]
] = None,
top_k: Optional[int] = None,
top_logprobs: OptionalNullable[int] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: Optional[int] = None,
top_p: Optional[float] = None,
trace: Optional[
Union[components.TraceConfig, components.TraceConfigTypedDict]
] = None,
@@ -1054,7 +1054,7 @@ class Responses(BaseSDK):
:param background:
: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 image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param include:
:param input: Input for a response request - can be a string or array of items
:param instructions:
Generated
+1 -1
View File
@@ -220,7 +220,7 @@ wheels = [
[[package]]
name = "openrouter"
version = "0.9.1"
version = "0.9.0"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },