openrouter 0.0.8__tar.gz → 0.0.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. openrouter-0.0.18/LICENSE +201 -0
  2. {openrouter-0.0.8 → openrouter-0.0.18}/PKG-INFO +5 -3
  3. openrouter-0.0.18/README-PYPI.md +249 -0
  4. {openrouter-0.0.8 → openrouter-0.0.18}/README.md +0 -2
  5. {openrouter-0.0.8 → openrouter-0.0.18}/pyproject.toml +4 -2
  6. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/_version.py +3 -3
  7. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/analytics.py +12 -10
  8. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/api_keys.py +78 -58
  9. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/basesdk.py +8 -2
  10. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/chat.py +313 -95
  11. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/completions.py +29 -40
  12. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/__init__.py +470 -559
  13. openrouter-0.0.18/src/openrouter/components/_schema0.py +94 -0
  14. openrouter-0.0.18/src/openrouter/components/_schema3.py +229 -0
  15. openrouter-0.0.18/src/openrouter/components/chatgenerationparams.py +834 -0
  16. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatgenerationtokenusage.py +3 -0
  17. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatmessagecontentitem.py +2 -1
  18. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatmessagecontentitemaudio.py +6 -25
  19. openrouter-0.0.18/src/openrouter/components/chatmessagecontentitemcachecontrol.py +32 -0
  20. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatmessagecontentitemtext.py +9 -2
  21. openrouter-0.0.18/src/openrouter/components/chatmessagecontentitemvideo.py +74 -0
  22. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatmessagetokenlogprob.py +4 -4
  23. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatresponsechoice.py +6 -1
  24. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatstreamingmessagechunk.py +12 -1
  25. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/completionchoice.py +18 -5
  26. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/completioncreateparams.py +10 -10
  27. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/completionresponse.py +3 -0
  28. openrouter-0.0.18/src/openrouter/components/datacollection.py +19 -0
  29. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/message.py +10 -9
  30. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesannotation.py +11 -4
  31. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesreasoningeffort.py +2 -0
  32. openrouter-0.0.18/src/openrouter/components/openresponseseasyinputmessage.py +170 -0
  33. openrouter-0.0.18/src/openrouter/components/openresponsesinputmessageitem.py +156 -0
  34. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesnonstreamingresponse.py +33 -19
  35. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesreasoning.py +2 -0
  36. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesrequest.py +246 -142
  37. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesstreamevent.py +110 -39
  38. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/outputmessage.py +10 -4
  39. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/parameter.py +1 -0
  40. openrouter-0.0.18/src/openrouter/components/pdfparserengine.py +16 -0
  41. openrouter-0.0.18/src/openrouter/components/pdfparseroptions.py +25 -0
  42. openrouter-0.0.18/src/openrouter/components/percentilelatencycutoffs.py +71 -0
  43. openrouter-0.0.18/src/openrouter/components/percentilestats.py +34 -0
  44. openrouter-0.0.18/src/openrouter/components/percentilethroughputcutoffs.py +71 -0
  45. openrouter-0.0.18/src/openrouter/components/preferredmaxlatency.py +21 -0
  46. openrouter-0.0.18/src/openrouter/components/preferredminthroughput.py +22 -0
  47. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/providername.py +11 -27
  48. openrouter-0.0.8/src/openrouter/models/createembeddingsop.py → openrouter-0.0.18/src/openrouter/components/providerpreferences.py +175 -186
  49. openrouter-0.0.18/src/openrouter/components/providersort.py +15 -0
  50. openrouter-0.0.18/src/openrouter/components/providersortconfig.py +71 -0
  51. openrouter-0.0.18/src/openrouter/components/providersortunion.py +23 -0
  52. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/publicendpoint.py +61 -45
  53. openrouter-0.0.18/src/openrouter/components/publicpricing.py +78 -0
  54. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseformattextconfig.py +9 -7
  55. openrouter-0.0.18/src/openrouter/components/responseinputvideo.py +26 -0
  56. openrouter-0.0.18/src/openrouter/components/responseoutputtext.py +62 -0
  57. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsesoutputitem.py +13 -11
  58. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsesoutputitemreasoning.py +43 -3
  59. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsesoutputmessage.py +10 -5
  60. openrouter-0.0.18/src/openrouter/components/responsesoutputmodality.py +14 -0
  61. openrouter-0.0.18/src/openrouter/components/websearchengine.py +15 -0
  62. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/credits.py +29 -25
  63. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/embeddings.py +52 -42
  64. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/endpoints.py +24 -20
  65. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/badgatewayresponse_error.py +4 -4
  66. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/badrequestresponse_error.py +4 -4
  67. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/chaterror.py +2 -2
  68. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/edgenetworktimeoutresponse_error.py +4 -6
  69. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/forbiddenresponse_error.py +4 -4
  70. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/internalserverresponse_error.py +4 -4
  71. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/notfoundresponse_error.py +4 -4
  72. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/payloadtoolargeresponse_error.py +4 -4
  73. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/paymentrequiredresponse_error.py +4 -4
  74. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/provideroverloadedresponse_error.py +4 -6
  75. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/requesttimeoutresponse_error.py +4 -4
  76. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/serviceunavailableresponse_error.py +4 -6
  77. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/toomanyrequestsresponse_error.py +4 -4
  78. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/unauthorizedresponse_error.py +4 -4
  79. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/unprocessableentityresponse_error.py +4 -6
  80. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/generations.py +11 -9
  81. openrouter-0.0.18/src/openrouter/models/__init__.py +3 -0
  82. openrouter-0.0.18/src/openrouter/models/internal/__init__.py +54 -0
  83. openrouter-0.0.18/src/openrouter/models/internal/globals.py +41 -0
  84. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/models_.py +38 -29
  85. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/oauth.py +41 -25
  86. openrouter-0.0.18/src/openrouter/operations/__init__.py +499 -0
  87. openrouter-0.0.18/src/openrouter/operations/createembeddings.py +193 -0
  88. openrouter-0.0.18/src/openrouter/operations/createresponses.py +57 -0
  89. openrouter-0.0.18/src/openrouter/operations/getcredits.py +32 -0
  90. openrouter-0.0.8/src/openrouter/models/getgenerationop.py → openrouter-0.0.18/src/openrouter/operations/getgeneration.py +6 -0
  91. openrouter-0.0.8/src/openrouter/models/getparametersop.py → openrouter-0.0.18/src/openrouter/operations/getparameters.py +5 -77
  92. openrouter-0.0.8/src/openrouter/models/getuseractivityop.py → openrouter-0.0.18/src/openrouter/operations/getuseractivity.py +3 -3
  93. openrouter-0.0.8/src/openrouter/models/listendpointsop.py → openrouter-0.0.18/src/openrouter/operations/listendpoints.py +7 -5
  94. openrouter-0.0.8/src/openrouter/models/listendpointszdrop.py → openrouter-0.0.18/src/openrouter/operations/listendpointszdr.py +3 -3
  95. openrouter-0.0.18/src/openrouter/operations/sendchatcompletionrequest.py +42 -0
  96. openrouter-0.0.8/src/openrouter/models/updatekeysop.py → openrouter-0.0.18/src/openrouter/operations/updatekeys.py +2 -2
  97. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/parameters.py +21 -18
  98. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/providers.py +10 -8
  99. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/responses.py +315 -137
  100. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/sdk.py +16 -3
  101. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/sdkconfiguration.py +6 -2
  102. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/forms.py +21 -10
  103. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/oauth_create_authorization_url.py +5 -3
  104. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/queryparams.py +14 -2
  105. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/retries.py +69 -5
  106. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/unmarshal_json_response.py +15 -1
  107. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter.egg-info/PKG-INFO +5 -3
  108. openrouter-0.0.18/src/openrouter.egg-info/SOURCES.txt +260 -0
  109. openrouter-0.0.8/src/openrouter/models/chatgenerationparams.py +0 -291
  110. openrouter-0.0.8/src/openrouter/models/chatmessagecontentitemvideo.py +0 -33
  111. openrouter-0.0.8/src/openrouter/models/createresponsesop.py +0 -53
  112. openrouter-0.0.8/src/openrouter/models/getcreditsop.py +0 -13
  113. openrouter-0.0.8/src/openrouter/models/openresponseseasyinputmessage.py +0 -97
  114. openrouter-0.0.8/src/openrouter/models/openresponsesinputmessageitem.py +0 -83
  115. openrouter-0.0.8/src/openrouter/models/publicpricing.py +0 -73
  116. openrouter-0.0.8/src/openrouter/models/responseoutputtext.py +0 -27
  117. openrouter-0.0.8/src/openrouter/models/sendchatcompletionrequestop.py +0 -35
  118. openrouter-0.0.8/src/openrouter.egg-info/SOURCES.txt +0 -236
  119. {openrouter-0.0.8 → openrouter-0.0.18}/setup.cfg +0 -0
  120. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/__init__.py +0 -0
  121. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/_hooks/__init__.py +0 -0
  122. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/_hooks/registration.py +0 -0
  123. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/_hooks/sdkhooks.py +0 -0
  124. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/_hooks/types.py +0 -0
  125. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/beta.py +0 -0
  126. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/activityitem.py +0 -0
  127. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/assistantmessage.py +0 -0
  128. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/badgatewayresponseerrordata.py +0 -0
  129. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/badrequestresponseerrordata.py +0 -0
  130. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatcompletionfinishreason.py +0 -0
  131. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chaterror.py +0 -0
  132. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatmessagecontentitemimage.py +0 -0
  133. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatmessagetokenlogprobs.py +0 -0
  134. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatmessagetoolcall.py +0 -0
  135. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatresponse.py +0 -0
  136. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatstreamingchoice.py +0 -0
  137. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatstreamingmessagetoolcall.py +0 -0
  138. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatstreamingresponsechunk.py +0 -0
  139. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/chatstreamoptions.py +0 -0
  140. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/completionlogprobs.py +0 -0
  141. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/completionusage.py +0 -0
  142. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/createchargerequest.py +0 -0
  143. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/defaultparameters.py +0 -0
  144. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/edgenetworktimeoutresponseerrordata.py +0 -0
  145. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/endpointstatus.py +0 -0
  146. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/filecitation.py +0 -0
  147. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/filepath.py +0 -0
  148. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/forbiddenresponseerrordata.py +0 -0
  149. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/imagegenerationstatus.py +0 -0
  150. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/inputmodality.py +0 -0
  151. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/instructtype.py +0 -0
  152. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/internalserverresponseerrordata.py +0 -0
  153. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/jsonschemaconfig.py +0 -0
  154. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/listendpointsresponse.py +0 -0
  155. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/model.py +0 -0
  156. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/modelarchitecture.py +0 -0
  157. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/modelgroup.py +0 -0
  158. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/modelscountresponse.py +0 -0
  159. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/modelslistresponse.py +0 -0
  160. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/namedtoolchoice.py +0 -0
  161. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/notfoundresponseerrordata.py +0 -0
  162. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesincludable.py +0 -0
  163. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesincompletedetails.py +0 -0
  164. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesinput_union.py +0 -0
  165. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesprompt.py +0 -0
  166. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesreasoningconfig.py +0 -0
  167. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesrefusalcontent.py +0 -0
  168. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesresponsestatus.py +0 -0
  169. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsesservicetier.py +0 -0
  170. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsestoolchoice_union.py +0 -0
  171. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openairesponsestruncation.py +0 -0
  172. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponseserrorevent.py +0 -0
  173. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesfunctioncalloutput.py +0 -0
  174. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesfunctiontoolcall.py +0 -0
  175. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesimagegencallcompleted.py +0 -0
  176. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesimagegencallgenerating.py +0 -0
  177. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesimagegencallinprogress.py +0 -0
  178. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesimagegencallpartialimage.py +0 -0
  179. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesinput.py +2 -2
  180. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponseslogprobs.py +0 -0
  181. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesreasoningconfig.py +0 -0
  182. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesreasoningdeltaevent.py +0 -0
  183. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesreasoningdoneevent.py +0 -0
  184. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesreasoningsummarypartaddedevent.py +0 -0
  185. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesreasoningsummarytextdeltaevent.py +0 -0
  186. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesreasoningsummarytextdoneevent.py +0 -0
  187. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesresponsetext.py +0 -0
  188. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsestoplogprobs.py +0 -0
  189. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponsesusage.py +0 -0
  190. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponseswebsearch20250826tool.py +0 -0
  191. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponseswebsearchpreview20250311tool.py +0 -0
  192. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponseswebsearchpreviewtool.py +0 -0
  193. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/openresponseswebsearchtool.py +0 -0
  194. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/outputitemimagegenerationcall.py +0 -0
  195. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/outputmodality.py +0 -0
  196. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/payloadtoolargeresponseerrordata.py +0 -0
  197. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/paymentrequiredresponseerrordata.py +0 -0
  198. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/perrequestlimits.py +0 -0
  199. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/provideroverloadedresponseerrordata.py +0 -0
  200. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/quantization.py +0 -0
  201. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/reasoningsummarytext.py +0 -0
  202. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/reasoningsummaryverbosity.py +0 -0
  203. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/reasoningtextcontent.py +0 -0
  204. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/requesttimeoutresponseerrordata.py +0 -0
  205. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseformatjsonschema.py +0 -0
  206. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseformattextgrammar.py +0 -0
  207. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseinputaudio.py +0 -0
  208. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseinputfile.py +0 -0
  209. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseinputimage.py +0 -0
  210. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseinputtext.py +0 -0
  211. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseserrorfield.py +0 -0
  212. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsesformatjsonobject.py +0 -0
  213. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsesformattext.py +0 -0
  214. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsesformattextjsonschemaconfig.py +0 -0
  215. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsesimagegenerationcall.py +0 -0
  216. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsesoutputitemfilesearchcall.py +0 -0
  217. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsesoutputitemfunctioncall.py +0 -0
  218. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsessearchcontextsize.py +0 -0
  219. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseswebsearchcalloutput.py +0 -0
  220. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responseswebsearchuserlocation.py +0 -0
  221. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/responsetextconfig.py +0 -0
  222. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/security.py +0 -0
  223. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/serviceunavailableresponseerrordata.py +0 -0
  224. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/systemmessage.py +0 -0
  225. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/toolcallstatus.py +0 -0
  226. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/tooldefinitionjson.py +0 -0
  227. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/toolresponsemessage.py +0 -0
  228. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/toomanyrequestsresponseerrordata.py +0 -0
  229. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/topproviderinfo.py +0 -0
  230. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/unauthorizedresponseerrordata.py +0 -0
  231. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/unprocessableentityresponseerrordata.py +0 -0
  232. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/urlcitation.py +0 -0
  233. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/usermessage.py +0 -0
  234. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/websearchpreviewtooluserlocation.py +0 -0
  235. {openrouter-0.0.8/src/openrouter/models → openrouter-0.0.18/src/openrouter/components}/websearchstatus.py +0 -0
  236. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/__init__.py +0 -0
  237. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/no_response_error.py +0 -0
  238. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/openrouterdefaulterror.py +0 -0
  239. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/openroutererror.py +0 -0
  240. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/errors/responsevalidationerror.py +0 -0
  241. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/httpclient.py +0 -0
  242. /openrouter-0.0.8/src/openrouter/models/createauthkeyscodeop.py → /openrouter-0.0.18/src/openrouter/operations/createauthkeyscode.py +0 -0
  243. /openrouter-0.0.8/src/openrouter/models/createcoinbasechargeop.py → /openrouter-0.0.18/src/openrouter/operations/createcoinbasecharge.py +0 -0
  244. /openrouter-0.0.8/src/openrouter/models/createkeysop.py → /openrouter-0.0.18/src/openrouter/operations/createkeys.py +0 -0
  245. /openrouter-0.0.8/src/openrouter/models/deletekeysop.py → /openrouter-0.0.18/src/openrouter/operations/deletekeys.py +0 -0
  246. /openrouter-0.0.8/src/openrouter/models/exchangeauthcodeforapikeyop.py → /openrouter-0.0.18/src/openrouter/operations/exchangeauthcodeforapikey.py +0 -0
  247. /openrouter-0.0.8/src/openrouter/models/getcurrentkeyop.py → /openrouter-0.0.18/src/openrouter/operations/getcurrentkey.py +0 -0
  248. /openrouter-0.0.8/src/openrouter/models/getkeyop.py → /openrouter-0.0.18/src/openrouter/operations/getkey.py +0 -0
  249. /openrouter-0.0.8/src/openrouter/models/getmodelsop.py → /openrouter-0.0.18/src/openrouter/operations/getmodels.py +0 -0
  250. /openrouter-0.0.8/src/openrouter/models/listop.py → /openrouter-0.0.18/src/openrouter/operations/list.py +0 -0
  251. /openrouter-0.0.8/src/openrouter/models/listmodelsuserop.py → /openrouter-0.0.18/src/openrouter/operations/listmodelsuser.py +0 -0
  252. /openrouter-0.0.8/src/openrouter/models/listprovidersop.py → /openrouter-0.0.18/src/openrouter/operations/listproviders.py +0 -0
  253. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/py.typed +0 -0
  254. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/types/__init__.py +0 -0
  255. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/types/basemodel.py +0 -0
  256. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/__init__.py +0 -0
  257. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/annotations.py +0 -0
  258. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/datetimes.py +0 -0
  259. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/enums.py +0 -0
  260. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/eventstreaming.py +0 -0
  261. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/headers.py +0 -0
  262. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/logger.py +0 -0
  263. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/metadata.py +0 -0
  264. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/oauth_create_sha256_code_challenge.py +0 -0
  265. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/requestbodies.py +0 -0
  266. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/security.py +0 -0
  267. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/serializers.py +0 -0
  268. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/url.py +0 -0
  269. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter/utils/values.py +0 -0
  270. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter.egg-info/dependency_links.txt +0 -0
  271. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter.egg-info/requires.txt +0 -0
  272. {openrouter-0.0.8 → openrouter-0.0.18}/src/openrouter.egg-info/top_level.txt +0 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,15 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openrouter
3
- Version: 0.0.8
3
+ Version: 0.0.18
4
4
  Summary: Official Python Client SDK for OpenRouter.
5
5
  Author: OpenRouter
6
+ License: Apache-2.0
7
+ Project-URL: repository, https://github.com/OpenRouterTeam/python-sdk.git
6
8
  Requires-Python: >=3.9.2
7
9
  Description-Content-Type: text/markdown
10
+ License-File: LICENSE
8
11
  Requires-Dist: httpcore>=1.0.9
9
12
  Requires-Dist: httpx>=0.28.1
10
13
  Requires-Dist: pydantic>=2.11.2
11
-
12
- ![hero illustration](./assets/banner.png)
14
+ Dynamic: license-file
13
15
 
14
16
  # OpenRouter SDK (Beta)
15
17
 
@@ -0,0 +1,249 @@
1
+ # OpenRouter SDK (Beta)
2
+
3
+ The [OpenRouter SDK](https://openrouter.ai/docs/sdks/python) is a Python toolkit designed to help you build AI-powered features and solutions. Giving you easy access to over 300 models across providers in an easy and type-safe way.
4
+
5
+ To learn more about how to use the OpenRouter SDK, check out our [API Reference](https://openrouter.ai/docs/sdks/python/reference) and [Documentation](https://openrouter.ai/docs/sdks/python).
6
+
7
+ <!-- No Summary [summary] -->
8
+
9
+ <!-- No Table of Contents [toc] -->
10
+
11
+ <!-- Start SDK Installation [installation] -->
12
+ ## SDK Installation
13
+
14
+ > [!NOTE]
15
+ > **Python version upgrade policy**
16
+ >
17
+ > Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
18
+
19
+ The SDK can be installed with *uv*, *pip*, or *poetry* package managers.
20
+
21
+ ### uv
22
+
23
+ *uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.
24
+
25
+ ```bash
26
+ uv add openrouter
27
+ ```
28
+
29
+ ### PIP
30
+
31
+ *PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
32
+
33
+ ```bash
34
+ pip install openrouter
35
+ ```
36
+
37
+ ### Poetry
38
+
39
+ *Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
40
+
41
+ ```bash
42
+ poetry add openrouter
43
+ ```
44
+
45
+ ### Shell and script usage with `uv`
46
+
47
+ You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:
48
+
49
+ ```shell
50
+ uvx --from openrouter python
51
+ ```
52
+
53
+ It's also possible to write a standalone Python script without needing to set up a whole project like so:
54
+
55
+ ```python
56
+ #!/usr/bin/env -S uv run --script
57
+ # /// script
58
+ # requires-python = ">=3.9"
59
+ # dependencies = [
60
+ # "openrouter",
61
+ # ]
62
+ # ///
63
+
64
+ from openrouter import OpenRouter
65
+
66
+ sdk = OpenRouter(
67
+ # SDK arguments
68
+ )
69
+
70
+ # Rest of script here...
71
+ ```
72
+
73
+ Once that is saved to a file, you can run it with `uv run script.py` where
74
+ `script.py` can be replaced with the actual file name.
75
+ <!-- End SDK Installation [installation] -->
76
+
77
+ <!-- Start Requirements [requirements] -->
78
+ ## Requirements
79
+
80
+ This SDK requires Python 3.9 or higher. For Python version support policy, see the SDK Installation section above.
81
+ <!-- End Requirements [requirements] -->
82
+
83
+ <!-- Start IDE Support [idesupport] -->
84
+ ## IDE Support
85
+
86
+ ### PyCharm
87
+
88
+ Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
89
+
90
+ - [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
91
+ <!-- End IDE Support [idesupport] -->
92
+
93
+ <!-- No SDK Example Usage [usage] -->
94
+ ## SDK Usage
95
+
96
+ ```python
97
+ # Synchronous Example
98
+ from openrouter import OpenRouter
99
+ import os
100
+
101
+
102
+ with OpenRouter(
103
+ api_key=os.getenv("OPENROUTER_API_KEY", ""),
104
+ ) as open_router:
105
+
106
+ res = open_router.chat.send(messages=[
107
+ {
108
+ "role": "user",
109
+ "content": "Hello, how are you?",
110
+ },
111
+ ], model="anthropic/claude-4.5-sonnet", provider={
112
+ "zdr": True,
113
+ "sort": "price",
114
+ }, stream=True)
115
+
116
+ for event in event_stream:
117
+ # handle event
118
+ print(event, flush=True)
119
+ ```
120
+
121
+ </br>
122
+
123
+ The same SDK client can also be used to make asynchronous requests by importing asyncio.
124
+
125
+ ```python
126
+ # Asynchronous Example
127
+ import asyncio
128
+ from openrouter import OpenRouter
129
+ import os
130
+
131
+ async def main():
132
+
133
+ async with OpenRouter(
134
+ api_key=os.getenv("OPENROUTER_API_KEY", ""),
135
+ ) as open_router:
136
+
137
+ res = await open_router.chat.send_async(messages=[
138
+ {
139
+ "role": "user",
140
+ "content": "Hello, how are you?",
141
+ },
142
+ ], model="anthropic/claude-4.5-sonnet", provider={
143
+ "zdr": True,
144
+ "sort": "price",
145
+ }, stream=True)
146
+
147
+ async for event in event_stream:
148
+ # handle event
149
+ print(event, flush=True)
150
+
151
+ asyncio.run(main())
152
+ ```
153
+
154
+ <!-- No Authentication [security] -->
155
+
156
+ <!-- No Available Resources and Operations [operations] -->
157
+
158
+ <!-- No Standalone functions [standalone-funcs] -->
159
+
160
+ <!-- No React hooks with TanStack Query [react-query] -->
161
+
162
+ <!-- No Server-sent event streaming [eventstream] -->
163
+
164
+ <!-- No Retries [retries] -->
165
+
166
+ <!-- No Error Handling [errors] -->
167
+
168
+ <!-- No Server Selection [server] -->
169
+
170
+ <!-- No Custom HTTP Client [http-client] -->
171
+
172
+ <!-- Start Resource Management [resource-management] -->
173
+ ## Resource Management
174
+
175
+ The `OpenRouter` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
176
+
177
+ [context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
178
+
179
+ ```python
180
+ from openrouter import OpenRouter
181
+ import os
182
+ def main():
183
+
184
+ with OpenRouter(
185
+ api_key=os.getenv("OPENROUTER_API_KEY", ""),
186
+ ) as open_router:
187
+ # Rest of application here...
188
+
189
+
190
+ # Or when using async:
191
+ async def amain():
192
+
193
+ async with OpenRouter(
194
+ api_key=os.getenv("OPENROUTER_API_KEY", ""),
195
+ ) as open_router:
196
+ # Rest of application here...
197
+ ```
198
+ <!-- End Resource Management [resource-management] -->
199
+
200
+ <!-- Start Debugging [debug] -->
201
+ ## Debugging
202
+
203
+ You can setup your SDK to emit debug logs for SDK requests and responses.
204
+
205
+ You can pass your own logger class directly into your SDK.
206
+ ```python
207
+ from openrouter import OpenRouter
208
+ import logging
209
+
210
+ logging.basicConfig(level=logging.DEBUG)
211
+ s = OpenRouter(debug_logger=logging.getLogger("openrouter"))
212
+ ```
213
+
214
+ You can also enable a default debug logger by setting an environment variable `OPENROUTER_DEBUG` to true.
215
+ <!-- End Debugging [debug] -->
216
+
217
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
218
+
219
+ # Development
220
+
221
+ ## Running Tests
222
+
223
+ To run the test suite, you'll need to set up your environment with an OpenRouter API key.
224
+
225
+ ### Local Development
226
+
227
+ 1. Copy the example environment file:
228
+
229
+ ```bash
230
+ cp .env.example .env
231
+ ```
232
+
233
+ 2. Edit `.env` and add your OpenRouter API key:
234
+
235
+ ```bash
236
+ OPENROUTER_API_KEY=your_api_key_here
237
+ ```
238
+
239
+ 3. Run the tests:
240
+
241
+ ```bash
242
+ pytest
243
+ ```
244
+
245
+ ## Maturity
246
+
247
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
248
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
249
+ looking for the latest version.
@@ -1,5 +1,3 @@
1
- ![hero illustration](./assets/banner.png)
2
-
3
1
  # OpenRouter SDK (Beta)
4
2
 
5
3
  The [OpenRouter SDK](https://openrouter.ai/docs/sdks/python) is a Python toolkit designed to help you build AI-powered features and solutions. Giving you easy access to over 300 models across providers in an easy and type-safe way.
@@ -1,15 +1,17 @@
1
1
  [project]
2
2
  name = "openrouter"
3
- version = "0.0.8"
3
+ version = "0.0.18"
4
4
  description = "Official Python Client SDK for OpenRouter."
5
5
  authors = [{ name = "OpenRouter" },]
6
- readme = "README.md"
6
+ readme = "README-PYPI.md"
7
7
  requires-python = ">=3.9.2"
8
8
  dependencies = [
9
9
  "httpcore >=1.0.9",
10
10
  "httpx >=0.28.1",
11
11
  "pydantic >=2.11.2",
12
12
  ]
13
+ urls.repository = "https://github.com/OpenRouterTeam/python-sdk.git"
14
+ license = { text = "Apache-2.0" }
13
15
 
14
16
  [dependency-groups]
15
17
  dev = [
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "openrouter"
6
- __version__: str = "0.0.8"
6
+ __version__: str = "0.0.18"
7
7
  __openapi_doc_version__: str = "1.0.0"
8
- __gen_version__: str = "2.753.6"
9
- __user_agent__: str = "speakeasy-sdk/python 0.0.8 2.753.6 1.0.0 openrouter"
8
+ __gen_version__: str = "2.768.0"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.0.18 2.768.0 1.0.0 openrouter"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -1,12 +1,12 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from .basesdk import BaseSDK
4
- from openrouter import errors, models, utils
4
+ from openrouter import components, errors, operations, utils
5
5
  from openrouter._hooks import HookContext
6
6
  from openrouter.types import OptionalNullable, UNSET
7
7
  from openrouter.utils import get_security_from_env
8
8
  from openrouter.utils.unmarshal_json_response import unmarshal_json_response
9
- from typing import Any, List, Mapping, Optional
9
+ from typing import Any, Mapping, Optional
10
10
 
11
11
 
12
12
  class Analytics(BaseSDK):
@@ -20,7 +20,7 @@ class Analytics(BaseSDK):
20
20
  server_url: Optional[str] = None,
21
21
  timeout_ms: Optional[int] = None,
22
22
  http_headers: Optional[Mapping[str, str]] = None,
23
- ) -> List[models.ActivityItem]:
23
+ ) -> operations.GetUserActivityResponse:
24
24
  r"""Get user activity grouped by endpoint
25
25
 
26
26
  Returns user activity data grouped by endpoint for the last 30 (completed) UTC days
@@ -41,7 +41,7 @@ class Analytics(BaseSDK):
41
41
  else:
42
42
  base_url = self._get_url(base_url, url_variables)
43
43
 
44
- request = models.GetUserActivityRequest(
44
+ request = operations.GetUserActivityRequest(
45
45
  date_=date_,
46
46
  )
47
47
 
@@ -58,6 +58,7 @@ class Analytics(BaseSDK):
58
58
  accept_header_value="application/json",
59
59
  http_headers=http_headers,
60
60
  security=self.sdk_configuration.security,
61
+ allow_empty_value=None,
61
62
  timeout_ms=timeout_ms,
62
63
  )
63
64
 
@@ -76,7 +77,7 @@ class Analytics(BaseSDK):
76
77
  operation_id="getUserActivity",
77
78
  oauth2_scopes=None,
78
79
  security_source=get_security_from_env(
79
- self.sdk_configuration.security, models.Security
80
+ self.sdk_configuration.security, components.Security
80
81
  ),
81
82
  ),
82
83
  request=req,
@@ -86,7 +87,7 @@ class Analytics(BaseSDK):
86
87
 
87
88
  response_data: Any = None
88
89
  if utils.match_response(http_res, "200", "application/json"):
89
- return unmarshal_json_response(models.GetUserActivityResponse, http_res)
90
+ return unmarshal_json_response(operations.GetUserActivityResponse, http_res)
90
91
  if utils.match_response(http_res, "400", "application/json"):
91
92
  response_data = unmarshal_json_response(
92
93
  errors.BadRequestResponseErrorData, http_res
@@ -128,7 +129,7 @@ class Analytics(BaseSDK):
128
129
  server_url: Optional[str] = None,
129
130
  timeout_ms: Optional[int] = None,
130
131
  http_headers: Optional[Mapping[str, str]] = None,
131
- ) -> List[models.ActivityItem]:
132
+ ) -> operations.GetUserActivityResponse:
132
133
  r"""Get user activity grouped by endpoint
133
134
 
134
135
  Returns user activity data grouped by endpoint for the last 30 (completed) UTC days
@@ -149,7 +150,7 @@ class Analytics(BaseSDK):
149
150
  else:
150
151
  base_url = self._get_url(base_url, url_variables)
151
152
 
152
- request = models.GetUserActivityRequest(
153
+ request = operations.GetUserActivityRequest(
153
154
  date_=date_,
154
155
  )
155
156
 
@@ -166,6 +167,7 @@ class Analytics(BaseSDK):
166
167
  accept_header_value="application/json",
167
168
  http_headers=http_headers,
168
169
  security=self.sdk_configuration.security,
170
+ allow_empty_value=None,
169
171
  timeout_ms=timeout_ms,
170
172
  )
171
173
 
@@ -184,7 +186,7 @@ class Analytics(BaseSDK):
184
186
  operation_id="getUserActivity",
185
187
  oauth2_scopes=None,
186
188
  security_source=get_security_from_env(
187
- self.sdk_configuration.security, models.Security
189
+ self.sdk_configuration.security, components.Security
188
190
  ),
189
191
  ),
190
192
  request=req,
@@ -194,7 +196,7 @@ class Analytics(BaseSDK):
194
196
 
195
197
  response_data: Any = None
196
198
  if utils.match_response(http_res, "200", "application/json"):
197
- return unmarshal_json_response(models.GetUserActivityResponse, http_res)
199
+ return unmarshal_json_response(operations.GetUserActivityResponse, http_res)
198
200
  if utils.match_response(http_res, "400", "application/json"):
199
201
  response_data = unmarshal_json_response(
200
202
  errors.BadRequestResponseErrorData, http_res