@openrouter/sdk 0.0.0-beta.2 → 0.0.0-beta.5

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 (472) hide show
  1. package/FUNCTIONS.md +1 -3
  2. package/REACT_QUERY.md +10 -14
  3. package/README.md +62 -40
  4. package/dist/commonjs/funcs/analyticsGetActivity.js +3 -2
  5. package/dist/commonjs/funcs/analyticsGetActivity.js.map +1 -1
  6. package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js +3 -2
  7. package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js.map +1 -1
  8. package/dist/commonjs/funcs/apiKeysGetAuthKey.js +3 -2
  9. package/dist/commonjs/funcs/apiKeysGetAuthKey.js.map +1 -1
  10. package/dist/commonjs/funcs/apiKeysGetKey.js +3 -2
  11. package/dist/commonjs/funcs/apiKeysGetKey.js.map +1 -1
  12. package/dist/commonjs/funcs/apiKeysGetKeys.js +3 -2
  13. package/dist/commonjs/funcs/apiKeysGetKeys.js.map +1 -1
  14. package/dist/commonjs/funcs/apiKeysGetKeysHash.js +3 -2
  15. package/dist/commonjs/funcs/apiKeysGetKeysHash.js.map +1 -1
  16. package/dist/commonjs/funcs/apiKeysPatchKeysHash.js +3 -2
  17. package/dist/commonjs/funcs/apiKeysPatchKeysHash.js.map +1 -1
  18. package/dist/commonjs/funcs/apiKeysPostKeys.js +3 -2
  19. package/dist/commonjs/funcs/apiKeysPostKeys.js.map +1 -1
  20. package/dist/commonjs/funcs/chatSend.js +3 -2
  21. package/dist/commonjs/funcs/chatSend.js.map +1 -1
  22. package/dist/{esm/funcs/postCreditsCoinbase.d.ts → commonjs/funcs/creditsPostCreditsCoinbase.d.ts} +2 -2
  23. package/dist/commonjs/funcs/creditsPostCreditsCoinbase.d.ts.map +1 -0
  24. package/dist/commonjs/funcs/{postCreditsCoinbase.js → creditsPostCreditsCoinbase.js} +14 -9
  25. package/dist/commonjs/funcs/creditsPostCreditsCoinbase.js.map +1 -0
  26. package/dist/commonjs/funcs/{embeddingsPostEmbeddings.d.ts → embeddingsGenerate.d.ts} +2 -2
  27. package/dist/commonjs/funcs/embeddingsGenerate.d.ts.map +1 -0
  28. package/dist/commonjs/funcs/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +6 -5
  29. package/dist/commonjs/funcs/embeddingsGenerate.js.map +1 -0
  30. package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js +3 -2
  31. package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js.map +1 -1
  32. package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js +3 -2
  33. package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
  34. package/dist/commonjs/funcs/generationsGetGeneration.js +3 -2
  35. package/dist/commonjs/funcs/generationsGetGeneration.js.map +1 -1
  36. package/dist/commonjs/funcs/getCredits.js +3 -2
  37. package/dist/commonjs/funcs/getCredits.js.map +1 -1
  38. package/dist/{esm/funcs/parametersGetParametersAuthorSlug.d.ts → commonjs/funcs/modelGetParametersAuthorSlug.d.ts} +2 -2
  39. package/dist/commonjs/funcs/modelGetParametersAuthorSlug.d.ts.map +1 -0
  40. package/dist/commonjs/funcs/{parametersGetParametersAuthorSlug.js → modelGetParametersAuthorSlug.js} +14 -9
  41. package/dist/commonjs/funcs/modelGetParametersAuthorSlug.js.map +1 -0
  42. package/dist/commonjs/funcs/modelsGetModels.js +3 -2
  43. package/dist/commonjs/funcs/modelsGetModels.js.map +1 -1
  44. package/dist/commonjs/funcs/modelsGetModelsCount.js +3 -2
  45. package/dist/commonjs/funcs/modelsGetModelsCount.js.map +1 -1
  46. package/dist/commonjs/funcs/modelsGetModelsUser.d.ts +1 -1
  47. package/dist/commonjs/funcs/modelsGetModelsUser.d.ts.map +1 -1
  48. package/dist/commonjs/funcs/modelsGetModelsUser.js +12 -7
  49. package/dist/commonjs/funcs/modelsGetModelsUser.js.map +1 -1
  50. package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts +17 -0
  51. package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts.map +1 -0
  52. package/dist/commonjs/funcs/oAuthPostAuthKeys.js +116 -0
  53. package/dist/commonjs/funcs/oAuthPostAuthKeys.js.map +1 -0
  54. package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts +17 -0
  55. package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts.map +1 -0
  56. package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js +116 -0
  57. package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js.map +1 -0
  58. package/dist/{esm/funcs/getProviders.d.ts → commonjs/funcs/providersGetProviders.d.ts} +5 -2
  59. package/dist/commonjs/funcs/providersGetProviders.d.ts.map +1 -0
  60. package/dist/commonjs/funcs/{getProviders.js → providersGetProviders.js} +9 -5
  61. package/dist/commonjs/funcs/providersGetProviders.js.map +1 -0
  62. package/dist/commonjs/lib/config.d.ts +4 -8
  63. package/dist/commonjs/lib/config.d.ts.map +1 -1
  64. package/dist/commonjs/lib/config.js +3 -3
  65. package/dist/commonjs/lib/config.js.map +1 -1
  66. package/dist/commonjs/lib/env.d.ts +0 -1
  67. package/dist/commonjs/lib/env.d.ts.map +1 -1
  68. package/dist/commonjs/lib/env.js +0 -1
  69. package/dist/commonjs/lib/env.js.map +1 -1
  70. package/dist/commonjs/lib/security.d.ts.map +1 -1
  71. package/dist/commonjs/lib/security.js +1 -7
  72. package/dist/commonjs/lib/security.js.map +1 -1
  73. package/dist/commonjs/models/chaterror.d.ts +23 -2
  74. package/dist/commonjs/models/chaterror.d.ts.map +1 -1
  75. package/dist/commonjs/models/chaterror.js +27 -3
  76. package/dist/commonjs/models/chaterror.js.map +1 -1
  77. package/dist/commonjs/models/chatresponse.d.ts +2 -2
  78. package/dist/commonjs/models/chatresponse.d.ts.map +1 -1
  79. package/dist/commonjs/models/chatresponse.js +2 -2
  80. package/dist/commonjs/models/chatresponse.js.map +1 -1
  81. package/dist/commonjs/models/chatstreamingresponsechunk.d.ts +2 -2
  82. package/dist/commonjs/models/chatstreamingresponsechunk.d.ts.map +1 -1
  83. package/dist/commonjs/models/chatstreamingresponsechunk.js +2 -2
  84. package/dist/commonjs/models/chatstreamingresponsechunk.js.map +1 -1
  85. package/dist/commonjs/models/errorresponse.d.ts +8 -8
  86. package/dist/commonjs/models/errorresponse.d.ts.map +1 -1
  87. package/dist/commonjs/models/errorresponse.js +14 -13
  88. package/dist/commonjs/models/errorresponse.js.map +1 -1
  89. package/dist/commonjs/models/operations/getmodelsuser.d.ts +25 -0
  90. package/dist/commonjs/models/operations/getmodelsuser.d.ts.map +1 -1
  91. package/dist/commonjs/models/operations/getmodelsuser.js +29 -2
  92. package/dist/commonjs/models/operations/getmodelsuser.js.map +1 -1
  93. package/dist/commonjs/models/operations/getparametersauthorslug.d.ts +25 -0
  94. package/dist/commonjs/models/operations/getparametersauthorslug.d.ts.map +1 -1
  95. package/dist/commonjs/models/operations/getparametersauthorslug.js +28 -1
  96. package/dist/commonjs/models/operations/getparametersauthorslug.js.map +1 -1
  97. package/dist/commonjs/models/operations/index.d.ts +2 -0
  98. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  99. package/dist/commonjs/models/operations/index.js +2 -0
  100. package/dist/commonjs/models/operations/index.js.map +1 -1
  101. package/dist/commonjs/models/operations/postauthkeys.d.ts +132 -0
  102. package/dist/commonjs/models/operations/postauthkeys.d.ts.map +1 -0
  103. package/dist/commonjs/models/operations/postauthkeys.js +175 -0
  104. package/dist/commonjs/models/operations/postauthkeys.js.map +1 -0
  105. package/dist/commonjs/models/operations/postauthkeyscode.d.ts +167 -0
  106. package/dist/commonjs/models/operations/postauthkeyscode.d.ts.map +1 -0
  107. package/dist/commonjs/models/operations/postauthkeyscode.js +210 -0
  108. package/dist/commonjs/models/operations/postauthkeyscode.js.map +1 -0
  109. package/dist/commonjs/models/operations/postcreditscoinbase.d.ts +25 -0
  110. package/dist/commonjs/models/operations/postcreditscoinbase.d.ts.map +1 -1
  111. package/dist/commonjs/models/operations/postcreditscoinbase.js +28 -1
  112. package/dist/commonjs/models/operations/postcreditscoinbase.js.map +1 -1
  113. package/dist/commonjs/models/security.d.ts +0 -2
  114. package/dist/commonjs/models/security.d.ts.map +1 -1
  115. package/dist/commonjs/models/security.js +0 -2
  116. package/dist/commonjs/models/security.js.map +1 -1
  117. package/dist/commonjs/react-query/creditsPostCreditsCoinbase.d.ts +21 -0
  118. package/dist/commonjs/react-query/creditsPostCreditsCoinbase.d.ts.map +1 -0
  119. package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js +44 -0
  120. package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js.map +1 -0
  121. package/dist/commonjs/react-query/embeddingsGenerate.d.ts +23 -0
  122. package/dist/commonjs/react-query/embeddingsGenerate.d.ts.map +1 -0
  123. package/dist/commonjs/react-query/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +13 -13
  124. package/dist/commonjs/react-query/embeddingsGenerate.js.map +1 -0
  125. package/dist/commonjs/react-query/index.d.ts +6 -4
  126. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  127. package/dist/commonjs/react-query/index.js +6 -4
  128. package/dist/commonjs/react-query/index.js.map +1 -1
  129. package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts +38 -0
  130. package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts.map +1 -0
  131. package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js +88 -0
  132. package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js.map +1 -0
  133. package/dist/commonjs/react-query/modelsGetModelsUser.d.ts +4 -4
  134. package/dist/commonjs/react-query/modelsGetModelsUser.d.ts.map +1 -1
  135. package/dist/commonjs/react-query/modelsGetModelsUser.js +8 -8
  136. package/dist/commonjs/react-query/modelsGetModelsUser.js.map +1 -1
  137. package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts +23 -0
  138. package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts.map +1 -0
  139. package/dist/commonjs/react-query/oAuthPostAuthKeys.js +47 -0
  140. package/dist/commonjs/react-query/oAuthPostAuthKeys.js.map +1 -0
  141. package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts +23 -0
  142. package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts.map +1 -0
  143. package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js +47 -0
  144. package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js.map +1 -0
  145. package/dist/commonjs/react-query/providersGetProviders.d.ts +23 -0
  146. package/dist/commonjs/react-query/providersGetProviders.d.ts.map +1 -0
  147. package/dist/commonjs/react-query/providersGetProviders.js +69 -0
  148. package/dist/commonjs/react-query/providersGetProviders.js.map +1 -0
  149. package/dist/commonjs/sdk/credits.d.ts +9 -0
  150. package/dist/commonjs/sdk/credits.d.ts.map +1 -0
  151. package/dist/commonjs/sdk/credits.js +19 -0
  152. package/dist/commonjs/sdk/credits.js.map +1 -0
  153. package/dist/commonjs/sdk/embeddings.d.ts +1 -1
  154. package/dist/commonjs/sdk/embeddings.d.ts.map +1 -1
  155. package/dist/commonjs/sdk/embeddings.js +3 -3
  156. package/dist/commonjs/sdk/embeddings.js.map +1 -1
  157. package/dist/commonjs/sdk/model.d.ts +9 -0
  158. package/dist/commonjs/sdk/model.d.ts.map +1 -0
  159. package/dist/commonjs/sdk/model.js +19 -0
  160. package/dist/commonjs/sdk/model.js.map +1 -0
  161. package/dist/commonjs/sdk/models.d.ts +1 -1
  162. package/dist/commonjs/sdk/models.d.ts.map +1 -1
  163. package/dist/commonjs/sdk/models.js +2 -2
  164. package/dist/commonjs/sdk/models.js.map +1 -1
  165. package/dist/commonjs/sdk/oauth.d.ts +19 -0
  166. package/dist/commonjs/sdk/oauth.d.ts.map +1 -0
  167. package/dist/commonjs/sdk/oauth.js +32 -0
  168. package/dist/commonjs/sdk/oauth.js.map +1 -0
  169. package/dist/commonjs/sdk/providers.d.ts +9 -0
  170. package/dist/commonjs/sdk/providers.d.ts.map +1 -0
  171. package/dist/commonjs/sdk/providers.js +19 -0
  172. package/dist/commonjs/sdk/providers.js.map +1 -0
  173. package/dist/commonjs/sdk/sdk.d.ts +12 -8
  174. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  175. package/dist/commonjs/sdk/sdk.js +15 -14
  176. package/dist/commonjs/sdk/sdk.js.map +1 -1
  177. package/dist/esm/funcs/analyticsGetActivity.js +3 -2
  178. package/dist/esm/funcs/analyticsGetActivity.js.map +1 -1
  179. package/dist/esm/funcs/apiKeysDeleteKeysHash.js +3 -2
  180. package/dist/esm/funcs/apiKeysDeleteKeysHash.js.map +1 -1
  181. package/dist/esm/funcs/apiKeysGetAuthKey.js +3 -2
  182. package/dist/esm/funcs/apiKeysGetAuthKey.js.map +1 -1
  183. package/dist/esm/funcs/apiKeysGetKey.js +3 -2
  184. package/dist/esm/funcs/apiKeysGetKey.js.map +1 -1
  185. package/dist/esm/funcs/apiKeysGetKeys.js +3 -2
  186. package/dist/esm/funcs/apiKeysGetKeys.js.map +1 -1
  187. package/dist/esm/funcs/apiKeysGetKeysHash.js +3 -2
  188. package/dist/esm/funcs/apiKeysGetKeysHash.js.map +1 -1
  189. package/dist/esm/funcs/apiKeysPatchKeysHash.js +3 -2
  190. package/dist/esm/funcs/apiKeysPatchKeysHash.js.map +1 -1
  191. package/dist/esm/funcs/apiKeysPostKeys.js +3 -2
  192. package/dist/esm/funcs/apiKeysPostKeys.js.map +1 -1
  193. package/dist/esm/funcs/chatSend.js +3 -2
  194. package/dist/esm/funcs/chatSend.js.map +1 -1
  195. package/dist/{commonjs/funcs/postCreditsCoinbase.d.ts → esm/funcs/creditsPostCreditsCoinbase.d.ts} +2 -2
  196. package/dist/esm/funcs/creditsPostCreditsCoinbase.d.ts.map +1 -0
  197. package/dist/esm/funcs/{postCreditsCoinbase.js → creditsPostCreditsCoinbase.js} +14 -9
  198. package/dist/esm/funcs/creditsPostCreditsCoinbase.js.map +1 -0
  199. package/dist/esm/funcs/{embeddingsPostEmbeddings.d.ts → embeddingsGenerate.d.ts} +2 -2
  200. package/dist/esm/funcs/embeddingsGenerate.d.ts.map +1 -0
  201. package/dist/esm/funcs/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +5 -4
  202. package/dist/esm/funcs/embeddingsGenerate.js.map +1 -0
  203. package/dist/esm/funcs/endpointsGetEndpointsZdr.js +3 -2
  204. package/dist/esm/funcs/endpointsGetEndpointsZdr.js.map +1 -1
  205. package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js +3 -2
  206. package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
  207. package/dist/esm/funcs/generationsGetGeneration.js +3 -2
  208. package/dist/esm/funcs/generationsGetGeneration.js.map +1 -1
  209. package/dist/esm/funcs/getCredits.js +3 -2
  210. package/dist/esm/funcs/getCredits.js.map +1 -1
  211. package/dist/{commonjs/funcs/parametersGetParametersAuthorSlug.d.ts → esm/funcs/modelGetParametersAuthorSlug.d.ts} +2 -2
  212. package/dist/esm/funcs/modelGetParametersAuthorSlug.d.ts.map +1 -0
  213. package/dist/esm/funcs/{parametersGetParametersAuthorSlug.js → modelGetParametersAuthorSlug.js} +14 -9
  214. package/dist/esm/funcs/modelGetParametersAuthorSlug.js.map +1 -0
  215. package/dist/esm/funcs/modelsGetModels.js +3 -2
  216. package/dist/esm/funcs/modelsGetModels.js.map +1 -1
  217. package/dist/esm/funcs/modelsGetModelsCount.js +3 -2
  218. package/dist/esm/funcs/modelsGetModelsCount.js.map +1 -1
  219. package/dist/esm/funcs/modelsGetModelsUser.d.ts +1 -1
  220. package/dist/esm/funcs/modelsGetModelsUser.d.ts.map +1 -1
  221. package/dist/esm/funcs/modelsGetModelsUser.js +13 -8
  222. package/dist/esm/funcs/modelsGetModelsUser.js.map +1 -1
  223. package/dist/esm/funcs/oAuthPostAuthKeys.d.ts +17 -0
  224. package/dist/esm/funcs/oAuthPostAuthKeys.d.ts.map +1 -0
  225. package/dist/esm/funcs/oAuthPostAuthKeys.js +80 -0
  226. package/dist/esm/funcs/oAuthPostAuthKeys.js.map +1 -0
  227. package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts +17 -0
  228. package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts.map +1 -0
  229. package/dist/esm/funcs/oAuthPostAuthKeysCode.js +80 -0
  230. package/dist/esm/funcs/oAuthPostAuthKeysCode.js.map +1 -0
  231. package/dist/{commonjs/funcs/getProviders.d.ts → esm/funcs/providersGetProviders.d.ts} +5 -2
  232. package/dist/esm/funcs/providersGetProviders.d.ts.map +1 -0
  233. package/dist/esm/funcs/{getProviders.js → providersGetProviders.js} +8 -4
  234. package/dist/esm/funcs/providersGetProviders.js.map +1 -0
  235. package/dist/esm/lib/config.d.ts +4 -8
  236. package/dist/esm/lib/config.d.ts.map +1 -1
  237. package/dist/esm/lib/config.js +3 -3
  238. package/dist/esm/lib/config.js.map +1 -1
  239. package/dist/esm/lib/env.d.ts +0 -1
  240. package/dist/esm/lib/env.d.ts.map +1 -1
  241. package/dist/esm/lib/env.js +0 -1
  242. package/dist/esm/lib/env.js.map +1 -1
  243. package/dist/esm/lib/security.d.ts.map +1 -1
  244. package/dist/esm/lib/security.js +1 -7
  245. package/dist/esm/lib/security.js.map +1 -1
  246. package/dist/esm/models/chaterror.d.ts +23 -2
  247. package/dist/esm/models/chaterror.d.ts.map +1 -1
  248. package/dist/esm/models/chaterror.js +24 -2
  249. package/dist/esm/models/chaterror.js.map +1 -1
  250. package/dist/esm/models/chatresponse.d.ts +2 -2
  251. package/dist/esm/models/chatresponse.d.ts.map +1 -1
  252. package/dist/esm/models/chatresponse.js +2 -2
  253. package/dist/esm/models/chatresponse.js.map +1 -1
  254. package/dist/esm/models/chatstreamingresponsechunk.d.ts +2 -2
  255. package/dist/esm/models/chatstreamingresponsechunk.d.ts.map +1 -1
  256. package/dist/esm/models/chatstreamingresponsechunk.js +2 -2
  257. package/dist/esm/models/chatstreamingresponsechunk.js.map +1 -1
  258. package/dist/esm/models/errorresponse.d.ts +8 -8
  259. package/dist/esm/models/errorresponse.d.ts.map +1 -1
  260. package/dist/esm/models/errorresponse.js +13 -12
  261. package/dist/esm/models/errorresponse.js.map +1 -1
  262. package/dist/esm/models/operations/getmodelsuser.d.ts +25 -0
  263. package/dist/esm/models/operations/getmodelsuser.d.ts.map +1 -1
  264. package/dist/esm/models/operations/getmodelsuser.js +25 -0
  265. package/dist/esm/models/operations/getmodelsuser.js.map +1 -1
  266. package/dist/esm/models/operations/getparametersauthorslug.d.ts +25 -0
  267. package/dist/esm/models/operations/getparametersauthorslug.d.ts.map +1 -1
  268. package/dist/esm/models/operations/getparametersauthorslug.js +25 -0
  269. package/dist/esm/models/operations/getparametersauthorslug.js.map +1 -1
  270. package/dist/esm/models/operations/index.d.ts +2 -0
  271. package/dist/esm/models/operations/index.d.ts.map +1 -1
  272. package/dist/esm/models/operations/index.js +2 -0
  273. package/dist/esm/models/operations/index.js.map +1 -1
  274. package/dist/esm/models/operations/postauthkeys.d.ts +132 -0
  275. package/dist/esm/models/operations/postauthkeys.d.ts.map +1 -0
  276. package/dist/esm/models/operations/postauthkeys.js +133 -0
  277. package/dist/esm/models/operations/postauthkeys.js.map +1 -0
  278. package/dist/esm/models/operations/postauthkeyscode.d.ts +167 -0
  279. package/dist/esm/models/operations/postauthkeyscode.d.ts.map +1 -0
  280. package/dist/esm/models/operations/postauthkeyscode.js +166 -0
  281. package/dist/esm/models/operations/postauthkeyscode.js.map +1 -0
  282. package/dist/esm/models/operations/postcreditscoinbase.d.ts +25 -0
  283. package/dist/esm/models/operations/postcreditscoinbase.d.ts.map +1 -1
  284. package/dist/esm/models/operations/postcreditscoinbase.js +25 -0
  285. package/dist/esm/models/operations/postcreditscoinbase.js.map +1 -1
  286. package/dist/esm/models/security.d.ts +0 -2
  287. package/dist/esm/models/security.d.ts.map +1 -1
  288. package/dist/esm/models/security.js +0 -2
  289. package/dist/esm/models/security.js.map +1 -1
  290. package/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts +21 -0
  291. package/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts.map +1 -0
  292. package/dist/esm/react-query/{postCreditsCoinbase.js → creditsPostCreditsCoinbase.js} +10 -10
  293. package/dist/esm/react-query/creditsPostCreditsCoinbase.js.map +1 -0
  294. package/dist/esm/react-query/embeddingsGenerate.d.ts +23 -0
  295. package/dist/esm/react-query/embeddingsGenerate.d.ts.map +1 -0
  296. package/dist/esm/react-query/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +10 -10
  297. package/dist/esm/react-query/embeddingsGenerate.js.map +1 -0
  298. package/dist/esm/react-query/index.d.ts +6 -4
  299. package/dist/esm/react-query/index.d.ts.map +1 -1
  300. package/dist/esm/react-query/index.js +6 -4
  301. package/dist/esm/react-query/index.js.map +1 -1
  302. package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts +38 -0
  303. package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts.map +1 -0
  304. package/dist/esm/react-query/modelGetParametersAuthorSlug.js +78 -0
  305. package/dist/esm/react-query/modelGetParametersAuthorSlug.js.map +1 -0
  306. package/dist/esm/react-query/modelsGetModelsUser.d.ts +4 -4
  307. package/dist/esm/react-query/modelsGetModelsUser.d.ts.map +1 -1
  308. package/dist/esm/react-query/modelsGetModelsUser.js +8 -8
  309. package/dist/esm/react-query/modelsGetModelsUser.js.map +1 -1
  310. package/dist/esm/react-query/oAuthPostAuthKeys.d.ts +23 -0
  311. package/dist/esm/react-query/oAuthPostAuthKeys.d.ts.map +1 -0
  312. package/dist/esm/react-query/oAuthPostAuthKeys.js +42 -0
  313. package/dist/esm/react-query/oAuthPostAuthKeys.js.map +1 -0
  314. package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts +23 -0
  315. package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts.map +1 -0
  316. package/dist/esm/react-query/oAuthPostAuthKeysCode.js +42 -0
  317. package/dist/esm/react-query/oAuthPostAuthKeysCode.js.map +1 -0
  318. package/dist/esm/react-query/providersGetProviders.d.ts +23 -0
  319. package/dist/esm/react-query/providersGetProviders.d.ts.map +1 -0
  320. package/dist/esm/react-query/providersGetProviders.js +60 -0
  321. package/dist/esm/react-query/providersGetProviders.js.map +1 -0
  322. package/dist/esm/sdk/credits.d.ts +9 -0
  323. package/dist/esm/sdk/credits.d.ts.map +1 -0
  324. package/dist/esm/sdk/credits.js +15 -0
  325. package/dist/esm/sdk/credits.js.map +1 -0
  326. package/dist/esm/sdk/embeddings.d.ts +1 -1
  327. package/dist/esm/sdk/embeddings.d.ts.map +1 -1
  328. package/dist/esm/sdk/embeddings.js +3 -3
  329. package/dist/esm/sdk/embeddings.js.map +1 -1
  330. package/dist/esm/sdk/model.d.ts +9 -0
  331. package/dist/esm/sdk/model.d.ts.map +1 -0
  332. package/dist/esm/sdk/model.js +15 -0
  333. package/dist/esm/sdk/model.js.map +1 -0
  334. package/dist/esm/sdk/models.d.ts +1 -1
  335. package/dist/esm/sdk/models.d.ts.map +1 -1
  336. package/dist/esm/sdk/models.js +2 -2
  337. package/dist/esm/sdk/models.js.map +1 -1
  338. package/dist/esm/sdk/oauth.d.ts +19 -0
  339. package/dist/esm/sdk/oauth.d.ts.map +1 -0
  340. package/dist/esm/sdk/oauth.js +28 -0
  341. package/dist/esm/sdk/oauth.js.map +1 -0
  342. package/dist/esm/sdk/providers.d.ts +9 -0
  343. package/dist/esm/sdk/providers.d.ts.map +1 -0
  344. package/dist/esm/sdk/providers.js +15 -0
  345. package/dist/esm/sdk/providers.js.map +1 -0
  346. package/dist/esm/sdk/sdk.d.ts +12 -8
  347. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  348. package/dist/esm/sdk/sdk.js +15 -14
  349. package/dist/esm/sdk/sdk.js.map +1 -1
  350. package/docs/sdks/analytics/README.md +2 -6
  351. package/docs/sdks/apikeys/README.md +14 -42
  352. package/docs/sdks/chat/README.md +2 -6
  353. package/docs/sdks/credits/README.md +95 -0
  354. package/docs/sdks/embeddings/README.md +10 -14
  355. package/docs/sdks/endpoints/README.md +4 -12
  356. package/docs/sdks/generations/README.md +2 -6
  357. package/docs/sdks/{parameters → model}/README.md +19 -22
  358. package/docs/sdks/models/README.md +13 -24
  359. package/docs/sdks/oauth/README.md +199 -0
  360. package/docs/sdks/openrouter/README.md +2 -196
  361. package/docs/sdks/providers/README.md +104 -0
  362. package/examples/chatCompletions.example.ts +95 -0
  363. package/examples/getCredits.example.ts +1 -3
  364. package/jsr.json +1 -1
  365. package/package.json +1 -1
  366. package/src/funcs/analyticsGetActivity.ts +3 -2
  367. package/src/funcs/apiKeysDeleteKeysHash.ts +3 -2
  368. package/src/funcs/apiKeysGetAuthKey.ts +3 -2
  369. package/src/funcs/apiKeysGetKey.ts +3 -2
  370. package/src/funcs/apiKeysGetKeys.ts +3 -2
  371. package/src/funcs/apiKeysGetKeysHash.ts +3 -2
  372. package/src/funcs/apiKeysPatchKeysHash.ts +3 -2
  373. package/src/funcs/apiKeysPostKeys.ts +3 -2
  374. package/src/funcs/chatSend.ts +3 -2
  375. package/src/funcs/{postCreditsCoinbase.ts → creditsPostCreditsCoinbase.ts} +16 -6
  376. package/src/funcs/{embeddingsPostEmbeddings.ts → embeddingsGenerate.ts} +4 -3
  377. package/src/funcs/endpointsGetEndpointsZdr.ts +3 -2
  378. package/src/funcs/endpointsGetModelsAuthorSlugEndpoints.ts +3 -2
  379. package/src/funcs/generationsGetGeneration.ts +3 -2
  380. package/src/funcs/getCredits.ts +3 -2
  381. package/src/funcs/{parametersGetParametersAuthorSlug.ts → modelGetParametersAuthorSlug.ts} +16 -6
  382. package/src/funcs/modelsGetModels.ts +3 -2
  383. package/src/funcs/modelsGetModelsCount.ts +3 -2
  384. package/src/funcs/modelsGetModelsUser.ts +15 -5
  385. package/src/funcs/oAuthPostAuthKeys.ts +164 -0
  386. package/src/funcs/oAuthPostAuthKeysCode.ts +164 -0
  387. package/src/funcs/{getProviders.ts → providersGetProviders.ts} +7 -3
  388. package/src/lib/config.ts +4 -8
  389. package/src/lib/env.ts +0 -2
  390. package/src/lib/security.ts +1 -8
  391. package/src/models/chaterror.ts +44 -4
  392. package/src/models/chatresponse.ts +4 -4
  393. package/src/models/chatstreamingresponsechunk.ts +4 -4
  394. package/src/models/errorresponse.ts +14 -15
  395. package/src/models/operations/getmodelsuser.ts +58 -0
  396. package/src/models/operations/getparametersauthorslug.ts +60 -0
  397. package/src/models/operations/index.ts +2 -0
  398. package/src/models/operations/postauthkeys.ts +272 -0
  399. package/src/models/operations/postauthkeyscode.ts +352 -0
  400. package/src/models/operations/postcreditscoinbase.ts +60 -0
  401. package/src/models/security.ts +0 -4
  402. package/src/react-query/{postCreditsCoinbase.ts → creditsPostCreditsCoinbase.ts} +21 -18
  403. package/src/react-query/{embeddingsPostEmbeddings.ts → embeddingsGenerate.ts} +18 -19
  404. package/src/react-query/index.ts +6 -4
  405. package/src/react-query/{parametersGetParametersAuthorSlug.ts → modelGetParametersAuthorSlug.ts} +37 -34
  406. package/src/react-query/modelsGetModelsUser.ts +8 -0
  407. package/src/react-query/oAuthPostAuthKeys.ts +88 -0
  408. package/src/react-query/oAuthPostAuthKeysCode.ts +89 -0
  409. package/src/react-query/{getProviders.ts → providersGetProviders.ts} +35 -27
  410. package/src/sdk/credits.ts +26 -0
  411. package/src/sdk/embeddings.ts +3 -3
  412. package/src/sdk/{parameters.ts → model.ts} +5 -3
  413. package/src/sdk/models.ts +2 -0
  414. package/src/sdk/oauth.ts +45 -0
  415. package/src/sdk/providers.ts +22 -0
  416. package/src/sdk/sdk.ts +22 -29
  417. package/dist/commonjs/funcs/embeddingsPostEmbeddings.d.ts.map +0 -1
  418. package/dist/commonjs/funcs/embeddingsPostEmbeddings.js.map +0 -1
  419. package/dist/commonjs/funcs/getProviders.d.ts.map +0 -1
  420. package/dist/commonjs/funcs/getProviders.js.map +0 -1
  421. package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.d.ts.map +0 -1
  422. package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.js.map +0 -1
  423. package/dist/commonjs/funcs/postCreditsCoinbase.d.ts.map +0 -1
  424. package/dist/commonjs/funcs/postCreditsCoinbase.js.map +0 -1
  425. package/dist/commonjs/react-query/embeddingsPostEmbeddings.d.ts +0 -23
  426. package/dist/commonjs/react-query/embeddingsPostEmbeddings.d.ts.map +0 -1
  427. package/dist/commonjs/react-query/embeddingsPostEmbeddings.js.map +0 -1
  428. package/dist/commonjs/react-query/getProviders.d.ts +0 -17
  429. package/dist/commonjs/react-query/getProviders.d.ts.map +0 -1
  430. package/dist/commonjs/react-query/getProviders.js +0 -63
  431. package/dist/commonjs/react-query/getProviders.js.map +0 -1
  432. package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts +0 -38
  433. package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts.map +0 -1
  434. package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js +0 -88
  435. package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js.map +0 -1
  436. package/dist/commonjs/react-query/postCreditsCoinbase.d.ts +0 -20
  437. package/dist/commonjs/react-query/postCreditsCoinbase.d.ts.map +0 -1
  438. package/dist/commonjs/react-query/postCreditsCoinbase.js +0 -44
  439. package/dist/commonjs/react-query/postCreditsCoinbase.js.map +0 -1
  440. package/dist/commonjs/sdk/parameters.d.ts +0 -9
  441. package/dist/commonjs/sdk/parameters.d.ts.map +0 -1
  442. package/dist/commonjs/sdk/parameters.js +0 -19
  443. package/dist/commonjs/sdk/parameters.js.map +0 -1
  444. package/dist/esm/funcs/embeddingsPostEmbeddings.d.ts.map +0 -1
  445. package/dist/esm/funcs/embeddingsPostEmbeddings.js.map +0 -1
  446. package/dist/esm/funcs/getProviders.d.ts.map +0 -1
  447. package/dist/esm/funcs/getProviders.js.map +0 -1
  448. package/dist/esm/funcs/parametersGetParametersAuthorSlug.d.ts.map +0 -1
  449. package/dist/esm/funcs/parametersGetParametersAuthorSlug.js.map +0 -1
  450. package/dist/esm/funcs/postCreditsCoinbase.d.ts.map +0 -1
  451. package/dist/esm/funcs/postCreditsCoinbase.js.map +0 -1
  452. package/dist/esm/react-query/embeddingsPostEmbeddings.d.ts +0 -23
  453. package/dist/esm/react-query/embeddingsPostEmbeddings.d.ts.map +0 -1
  454. package/dist/esm/react-query/embeddingsPostEmbeddings.js.map +0 -1
  455. package/dist/esm/react-query/getProviders.d.ts +0 -17
  456. package/dist/esm/react-query/getProviders.d.ts.map +0 -1
  457. package/dist/esm/react-query/getProviders.js +0 -54
  458. package/dist/esm/react-query/getProviders.js.map +0 -1
  459. package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts +0 -38
  460. package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts.map +0 -1
  461. package/dist/esm/react-query/parametersGetParametersAuthorSlug.js +0 -78
  462. package/dist/esm/react-query/parametersGetParametersAuthorSlug.js.map +0 -1
  463. package/dist/esm/react-query/postCreditsCoinbase.d.ts +0 -20
  464. package/dist/esm/react-query/postCreditsCoinbase.d.ts.map +0 -1
  465. package/dist/esm/react-query/postCreditsCoinbase.js.map +0 -1
  466. package/dist/esm/sdk/parameters.d.ts +0 -9
  467. package/dist/esm/sdk/parameters.d.ts.map +0 -1
  468. package/dist/esm/sdk/parameters.js +0 -15
  469. package/dist/esm/sdk/parameters.js.map +0 -1
  470. package/examples/chatCompletion.example.ts +0 -19
  471. package/examples/chatCompletionStream.example.ts +0 -30
  472. package/examples/unauthorized.example.ts +0 -19
@@ -9,7 +9,6 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
9
 
10
10
  export type Security = {
11
11
  apiKey?: string | undefined;
12
- bearer?: string | undefined;
13
12
  };
14
13
 
15
14
  /** @internal */
@@ -19,13 +18,11 @@ export const Security$inboundSchema: z.ZodType<
19
18
  unknown
20
19
  > = z.object({
21
20
  apiKey: z.string().optional(),
22
- bearer: z.string().optional(),
23
21
  });
24
22
 
25
23
  /** @internal */
26
24
  export type Security$Outbound = {
27
25
  apiKey?: string | undefined;
28
- bearer?: string | undefined;
29
26
  };
30
27
 
31
28
  /** @internal */
@@ -35,7 +32,6 @@ export const Security$outboundSchema: z.ZodType<
35
32
  Security
36
33
  > = z.object({
37
34
  apiKey: z.string().optional(),
38
- bearer: z.string().optional(),
39
35
  });
40
36
 
41
37
  /**
@@ -8,7 +8,7 @@ import {
8
8
  UseMutationResult,
9
9
  } from "@tanstack/react-query";
10
10
  import { OpenRouterCore } from "../core.js";
11
- import { postCreditsCoinbase } from "../funcs/postCreditsCoinbase.js";
11
+ import { creditsPostCreditsCoinbase } from "../funcs/creditsPostCreditsCoinbase.js";
12
12
  import { combineSignals } from "../lib/primitives.js";
13
13
  import { RequestOptions } from "../lib/sdks.js";
14
14
  import * as operations from "../models/operations/index.js";
@@ -16,54 +16,56 @@ import { unwrapAsync } from "../types/fp.js";
16
16
  import { useOpenRouterContext } from "./_context.js";
17
17
  import { MutationHookOptions } from "./_types.js";
18
18
 
19
- export type PostCreditsCoinbaseMutationVariables = {
19
+ export type CreditsPostCreditsCoinbaseMutationVariables = {
20
+ security: operations.PostCreditsCoinbaseSecurity;
20
21
  request?: operations.PostCreditsCoinbaseRequest | undefined;
21
22
  options?: RequestOptions;
22
23
  };
23
24
 
24
- export type PostCreditsCoinbaseMutationData =
25
+ export type CreditsPostCreditsCoinbaseMutationData =
25
26
  operations.PostCreditsCoinbaseResponse;
26
27
 
27
28
  /**
28
29
  * Create a Coinbase charge for crypto payment
29
30
  */
30
- export function usePostCreditsCoinbaseMutation(
31
+ export function useCreditsPostCreditsCoinbaseMutation(
31
32
  options?: MutationHookOptions<
32
- PostCreditsCoinbaseMutationData,
33
+ CreditsPostCreditsCoinbaseMutationData,
33
34
  Error,
34
- PostCreditsCoinbaseMutationVariables
35
+ CreditsPostCreditsCoinbaseMutationVariables
35
36
  >,
36
37
  ): UseMutationResult<
37
- PostCreditsCoinbaseMutationData,
38
+ CreditsPostCreditsCoinbaseMutationData,
38
39
  Error,
39
- PostCreditsCoinbaseMutationVariables
40
+ CreditsPostCreditsCoinbaseMutationVariables
40
41
  > {
41
42
  const client = useOpenRouterContext();
42
43
  return useMutation({
43
- ...buildPostCreditsCoinbaseMutation(client, options),
44
+ ...buildCreditsPostCreditsCoinbaseMutation(client, options),
44
45
  ...options,
45
46
  });
46
47
  }
47
48
 
48
- export function mutationKeyPostCreditsCoinbase(): MutationKey {
49
- return ["@openrouter/sdk", "postCreditsCoinbase"];
49
+ export function mutationKeyCreditsPostCreditsCoinbase(): MutationKey {
50
+ return ["@openrouter/sdk", "Credits", "postCreditsCoinbase"];
50
51
  }
51
52
 
52
- export function buildPostCreditsCoinbaseMutation(
53
+ export function buildCreditsPostCreditsCoinbaseMutation(
53
54
  client$: OpenRouterCore,
54
55
  hookOptions?: RequestOptions,
55
56
  ): {
56
57
  mutationKey: MutationKey;
57
58
  mutationFn: (
58
- variables: PostCreditsCoinbaseMutationVariables,
59
- ) => Promise<PostCreditsCoinbaseMutationData>;
59
+ variables: CreditsPostCreditsCoinbaseMutationVariables,
60
+ ) => Promise<CreditsPostCreditsCoinbaseMutationData>;
60
61
  } {
61
62
  return {
62
- mutationKey: mutationKeyPostCreditsCoinbase(),
63
- mutationFn: function postCreditsCoinbaseMutationFn({
63
+ mutationKey: mutationKeyCreditsPostCreditsCoinbase(),
64
+ mutationFn: function creditsPostCreditsCoinbaseMutationFn({
65
+ security,
64
66
  request,
65
67
  options,
66
- }): Promise<PostCreditsCoinbaseMutationData> {
68
+ }): Promise<CreditsPostCreditsCoinbaseMutationData> {
67
69
  const mergedOptions = {
68
70
  ...hookOptions,
69
71
  ...options,
@@ -76,8 +78,9 @@ export function buildPostCreditsCoinbaseMutation(
76
78
  ),
77
79
  },
78
80
  };
79
- return unwrapAsync(postCreditsCoinbase(
81
+ return unwrapAsync(creditsPostCreditsCoinbase(
80
82
  client$,
83
+ security,
81
84
  request,
82
85
  mergedOptions,
83
86
  ));
@@ -8,7 +8,7 @@ import {
8
8
  UseMutationResult,
9
9
  } from "@tanstack/react-query";
10
10
  import { OpenRouterCore } from "../core.js";
11
- import { embeddingsPostEmbeddings } from "../funcs/embeddingsPostEmbeddings.js";
11
+ import { embeddingsGenerate } from "../funcs/embeddingsGenerate.js";
12
12
  import { combineSignals } from "../lib/primitives.js";
13
13
  import { RequestOptions } from "../lib/sdks.js";
14
14
  import * as operations from "../models/operations/index.js";
@@ -16,13 +16,12 @@ import { unwrapAsync } from "../types/fp.js";
16
16
  import { useOpenRouterContext } from "./_context.js";
17
17
  import { MutationHookOptions } from "./_types.js";
18
18
 
19
- export type EmbeddingsPostEmbeddingsMutationVariables = {
19
+ export type EmbeddingsGenerateMutationVariables = {
20
20
  request?: operations.PostEmbeddingsRequest | undefined;
21
21
  options?: RequestOptions;
22
22
  };
23
23
 
24
- export type EmbeddingsPostEmbeddingsMutationData =
25
- operations.PostEmbeddingsResponse;
24
+ export type EmbeddingsGenerateMutationData = operations.PostEmbeddingsResponse;
26
25
 
27
26
  /**
28
27
  * Submit an embedding request
@@ -30,43 +29,43 @@ export type EmbeddingsPostEmbeddingsMutationData =
30
29
  * @remarks
31
30
  * Submits an embedding request to the embeddings router
32
31
  */
33
- export function useEmbeddingsPostEmbeddingsMutation(
32
+ export function useEmbeddingsGenerateMutation(
34
33
  options?: MutationHookOptions<
35
- EmbeddingsPostEmbeddingsMutationData,
34
+ EmbeddingsGenerateMutationData,
36
35
  Error,
37
- EmbeddingsPostEmbeddingsMutationVariables
36
+ EmbeddingsGenerateMutationVariables
38
37
  >,
39
38
  ): UseMutationResult<
40
- EmbeddingsPostEmbeddingsMutationData,
39
+ EmbeddingsGenerateMutationData,
41
40
  Error,
42
- EmbeddingsPostEmbeddingsMutationVariables
41
+ EmbeddingsGenerateMutationVariables
43
42
  > {
44
43
  const client = useOpenRouterContext();
45
44
  return useMutation({
46
- ...buildEmbeddingsPostEmbeddingsMutation(client, options),
45
+ ...buildEmbeddingsGenerateMutation(client, options),
47
46
  ...options,
48
47
  });
49
48
  }
50
49
 
51
- export function mutationKeyEmbeddingsPostEmbeddings(): MutationKey {
52
- return ["@openrouter/sdk", "Embeddings", "postEmbeddings"];
50
+ export function mutationKeyEmbeddingsGenerate(): MutationKey {
51
+ return ["@openrouter/sdk", "Embeddings", "generate"];
53
52
  }
54
53
 
55
- export function buildEmbeddingsPostEmbeddingsMutation(
54
+ export function buildEmbeddingsGenerateMutation(
56
55
  client$: OpenRouterCore,
57
56
  hookOptions?: RequestOptions,
58
57
  ): {
59
58
  mutationKey: MutationKey;
60
59
  mutationFn: (
61
- variables: EmbeddingsPostEmbeddingsMutationVariables,
62
- ) => Promise<EmbeddingsPostEmbeddingsMutationData>;
60
+ variables: EmbeddingsGenerateMutationVariables,
61
+ ) => Promise<EmbeddingsGenerateMutationData>;
63
62
  } {
64
63
  return {
65
- mutationKey: mutationKeyEmbeddingsPostEmbeddings(),
66
- mutationFn: function embeddingsPostEmbeddingsMutationFn({
64
+ mutationKey: mutationKeyEmbeddingsGenerate(),
65
+ mutationFn: function embeddingsGenerateMutationFn({
67
66
  request,
68
67
  options,
69
- }): Promise<EmbeddingsPostEmbeddingsMutationData> {
68
+ }): Promise<EmbeddingsGenerateMutationData> {
70
69
  const mergedOptions = {
71
70
  ...hookOptions,
72
71
  ...options,
@@ -79,7 +78,7 @@ export function buildEmbeddingsPostEmbeddingsMutation(
79
78
  ),
80
79
  },
81
80
  };
82
- return unwrapAsync(embeddingsPostEmbeddings(
81
+ return unwrapAsync(embeddingsGenerate(
83
82
  client$,
84
83
  request,
85
84
  mergedOptions,
@@ -14,14 +14,16 @@ export * from "./apiKeysGetKeysHash.js";
14
14
  export * from "./apiKeysPatchKeysHash.js";
15
15
  export * from "./apiKeysPostKeys.js";
16
16
  export * from "./chatSend.js";
17
- export * from "./embeddingsPostEmbeddings.js";
17
+ export * from "./creditsPostCreditsCoinbase.js";
18
+ export * from "./embeddingsGenerate.js";
18
19
  export * from "./endpointsGetEndpointsZdr.js";
19
20
  export * from "./endpointsGetModelsAuthorSlugEndpoints.js";
20
21
  export * from "./generationsGetGeneration.js";
21
22
  export * from "./getCredits.js";
22
- export * from "./getProviders.js";
23
+ export * from "./modelGetParametersAuthorSlug.js";
23
24
  export * from "./modelsGetModels.js";
24
25
  export * from "./modelsGetModelsCount.js";
25
26
  export * from "./modelsGetModelsUser.js";
26
- export * from "./parametersGetParametersAuthorSlug.js";
27
- export * from "./postCreditsCoinbase.js";
27
+ export * from "./oAuthPostAuthKeys.js";
28
+ export * from "./oAuthPostAuthKeysCode.js";
29
+ export * from "./providersGetProviders.js";
@@ -13,7 +13,7 @@ import {
13
13
  UseSuspenseQueryResult,
14
14
  } from "@tanstack/react-query";
15
15
  import { OpenRouterCore } from "../core.js";
16
- import { parametersGetParametersAuthorSlug } from "../funcs/parametersGetParametersAuthorSlug.js";
16
+ import { modelGetParametersAuthorSlug } from "../funcs/modelGetParametersAuthorSlug.js";
17
17
  import { combineSignals } from "../lib/primitives.js";
18
18
  import { RequestOptions } from "../lib/sdks.js";
19
19
  import * as operations from "../models/operations/index.js";
@@ -25,20 +25,22 @@ import {
25
25
  TupleToPrefixes,
26
26
  } from "./_types.js";
27
27
 
28
- export type ParametersGetParametersAuthorSlugQueryData =
28
+ export type ModelGetParametersAuthorSlugQueryData =
29
29
  operations.GetParametersAuthorSlugResponse;
30
30
 
31
31
  /**
32
32
  * Get a model's supported parameters and data about which are most popular
33
33
  */
34
- export function useParametersGetParametersAuthorSlug(
34
+ export function useModelGetParametersAuthorSlug(
35
+ security: operations.GetParametersAuthorSlugSecurity,
35
36
  request: operations.GetParametersAuthorSlugRequest,
36
- options?: QueryHookOptions<ParametersGetParametersAuthorSlugQueryData>,
37
- ): UseQueryResult<ParametersGetParametersAuthorSlugQueryData, Error> {
37
+ options?: QueryHookOptions<ModelGetParametersAuthorSlugQueryData>,
38
+ ): UseQueryResult<ModelGetParametersAuthorSlugQueryData, Error> {
38
39
  const client = useOpenRouterContext();
39
40
  return useQuery({
40
- ...buildParametersGetParametersAuthorSlugQuery(
41
+ ...buildModelGetParametersAuthorSlugQuery(
41
42
  client,
43
+ security,
42
44
  request,
43
45
  options,
44
46
  ),
@@ -49,16 +51,16 @@ export function useParametersGetParametersAuthorSlug(
49
51
  /**
50
52
  * Get a model's supported parameters and data about which are most popular
51
53
  */
52
- export function useParametersGetParametersAuthorSlugSuspense(
54
+ export function useModelGetParametersAuthorSlugSuspense(
55
+ security: operations.GetParametersAuthorSlugSecurity,
53
56
  request: operations.GetParametersAuthorSlugRequest,
54
- options?: SuspenseQueryHookOptions<
55
- ParametersGetParametersAuthorSlugQueryData
56
- >,
57
- ): UseSuspenseQueryResult<ParametersGetParametersAuthorSlugQueryData, Error> {
57
+ options?: SuspenseQueryHookOptions<ModelGetParametersAuthorSlugQueryData>,
58
+ ): UseSuspenseQueryResult<ModelGetParametersAuthorSlugQueryData, Error> {
58
59
  const client = useOpenRouterContext();
59
60
  return useSuspenseQuery({
60
- ...buildParametersGetParametersAuthorSlugQuery(
61
+ ...buildModelGetParametersAuthorSlugQuery(
61
62
  client,
63
+ security,
62
64
  request,
63
65
  options,
64
66
  ),
@@ -66,20 +68,22 @@ export function useParametersGetParametersAuthorSlugSuspense(
66
68
  });
67
69
  }
68
70
 
69
- export function prefetchParametersGetParametersAuthorSlug(
71
+ export function prefetchModelGetParametersAuthorSlug(
70
72
  queryClient: QueryClient,
71
73
  client$: OpenRouterCore,
74
+ security: operations.GetParametersAuthorSlugSecurity,
72
75
  request: operations.GetParametersAuthorSlugRequest,
73
76
  ): Promise<void> {
74
77
  return queryClient.prefetchQuery({
75
- ...buildParametersGetParametersAuthorSlugQuery(
78
+ ...buildModelGetParametersAuthorSlugQuery(
76
79
  client$,
80
+ security,
77
81
  request,
78
82
  ),
79
83
  });
80
84
  }
81
85
 
82
- export function setParametersGetParametersAuthorSlugData(
86
+ export function setModelGetParametersAuthorSlugData(
83
87
  client: QueryClient,
84
88
  queryKeyBase: [
85
89
  author: string,
@@ -88,17 +92,14 @@ export function setParametersGetParametersAuthorSlugData(
88
92
  provider?: operations.GetParametersAuthorSlugProvider | undefined;
89
93
  },
90
94
  ],
91
- data: ParametersGetParametersAuthorSlugQueryData,
92
- ): ParametersGetParametersAuthorSlugQueryData | undefined {
93
- const key = queryKeyParametersGetParametersAuthorSlug(...queryKeyBase);
95
+ data: ModelGetParametersAuthorSlugQueryData,
96
+ ): ModelGetParametersAuthorSlugQueryData | undefined {
97
+ const key = queryKeyModelGetParametersAuthorSlug(...queryKeyBase);
94
98
 
95
- return client.setQueryData<ParametersGetParametersAuthorSlugQueryData>(
96
- key,
97
- data,
98
- );
99
+ return client.setQueryData<ModelGetParametersAuthorSlugQueryData>(key, data);
99
100
  }
100
101
 
101
- export function invalidateParametersGetParametersAuthorSlug(
102
+ export function invalidateModelGetParametersAuthorSlug(
102
103
  client: QueryClient,
103
104
  queryKeyBase: TupleToPrefixes<
104
105
  [
@@ -115,50 +116,52 @@ export function invalidateParametersGetParametersAuthorSlug(
115
116
  ...filters,
116
117
  queryKey: [
117
118
  "@openrouter/sdk",
118
- "Parameters",
119
+ "Model",
119
120
  "getParametersAuthorSlug",
120
121
  ...queryKeyBase,
121
122
  ],
122
123
  });
123
124
  }
124
125
 
125
- export function invalidateAllParametersGetParametersAuthorSlug(
126
+ export function invalidateAllModelGetParametersAuthorSlug(
126
127
  client: QueryClient,
127
128
  filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
128
129
  ): Promise<void> {
129
130
  return client.invalidateQueries({
130
131
  ...filters,
131
- queryKey: ["@openrouter/sdk", "Parameters", "getParametersAuthorSlug"],
132
+ queryKey: ["@openrouter/sdk", "Model", "getParametersAuthorSlug"],
132
133
  });
133
134
  }
134
135
 
135
- export function buildParametersGetParametersAuthorSlugQuery(
136
+ export function buildModelGetParametersAuthorSlugQuery(
136
137
  client$: OpenRouterCore,
138
+ security: operations.GetParametersAuthorSlugSecurity,
137
139
  request: operations.GetParametersAuthorSlugRequest,
138
140
  options?: RequestOptions,
139
141
  ): {
140
142
  queryKey: QueryKey;
141
143
  queryFn: (
142
144
  context: QueryFunctionContext,
143
- ) => Promise<ParametersGetParametersAuthorSlugQueryData>;
145
+ ) => Promise<ModelGetParametersAuthorSlugQueryData>;
144
146
  } {
145
147
  return {
146
- queryKey: queryKeyParametersGetParametersAuthorSlug(
148
+ queryKey: queryKeyModelGetParametersAuthorSlug(
147
149
  request.author,
148
150
  request.slug,
149
151
  { provider: request.provider },
150
152
  ),
151
- queryFn: async function parametersGetParametersAuthorSlugQueryFn(
153
+ queryFn: async function modelGetParametersAuthorSlugQueryFn(
152
154
  ctx,
153
- ): Promise<ParametersGetParametersAuthorSlugQueryData> {
155
+ ): Promise<ModelGetParametersAuthorSlugQueryData> {
154
156
  const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
155
157
  const mergedOptions = {
156
158
  ...options,
157
159
  fetchOptions: { ...options?.fetchOptions, signal: sig },
158
160
  };
159
161
 
160
- return unwrapAsync(parametersGetParametersAuthorSlug(
162
+ return unwrapAsync(modelGetParametersAuthorSlug(
161
163
  client$,
164
+ security,
162
165
  request,
163
166
  mergedOptions,
164
167
  ));
@@ -166,7 +169,7 @@ export function buildParametersGetParametersAuthorSlugQuery(
166
169
  };
167
170
  }
168
171
 
169
- export function queryKeyParametersGetParametersAuthorSlug(
172
+ export function queryKeyModelGetParametersAuthorSlug(
170
173
  author: string,
171
174
  slug: string,
172
175
  parameters: {
@@ -175,7 +178,7 @@ export function queryKeyParametersGetParametersAuthorSlug(
175
178
  ): QueryKey {
176
179
  return [
177
180
  "@openrouter/sdk",
178
- "Parameters",
181
+ "Model",
179
182
  "getParametersAuthorSlug",
180
183
  author,
181
184
  slug,
@@ -27,12 +27,14 @@ export type ModelsGetModelsUserQueryData = operations.GetModelsUserResponse;
27
27
  * List models filtered by user provider preferences
28
28
  */
29
29
  export function useModelsGetModelsUser(
30
+ security: operations.GetModelsUserSecurity,
30
31
  options?: QueryHookOptions<ModelsGetModelsUserQueryData>,
31
32
  ): UseQueryResult<ModelsGetModelsUserQueryData, Error> {
32
33
  const client = useOpenRouterContext();
33
34
  return useQuery({
34
35
  ...buildModelsGetModelsUserQuery(
35
36
  client,
37
+ security,
36
38
  options,
37
39
  ),
38
40
  ...options,
@@ -43,12 +45,14 @@ export function useModelsGetModelsUser(
43
45
  * List models filtered by user provider preferences
44
46
  */
45
47
  export function useModelsGetModelsUserSuspense(
48
+ security: operations.GetModelsUserSecurity,
46
49
  options?: SuspenseQueryHookOptions<ModelsGetModelsUserQueryData>,
47
50
  ): UseSuspenseQueryResult<ModelsGetModelsUserQueryData, Error> {
48
51
  const client = useOpenRouterContext();
49
52
  return useSuspenseQuery({
50
53
  ...buildModelsGetModelsUserQuery(
51
54
  client,
55
+ security,
52
56
  options,
53
57
  ),
54
58
  ...options,
@@ -58,10 +62,12 @@ export function useModelsGetModelsUserSuspense(
58
62
  export function prefetchModelsGetModelsUser(
59
63
  queryClient: QueryClient,
60
64
  client$: OpenRouterCore,
65
+ security: operations.GetModelsUserSecurity,
61
66
  ): Promise<void> {
62
67
  return queryClient.prefetchQuery({
63
68
  ...buildModelsGetModelsUserQuery(
64
69
  client$,
70
+ security,
65
71
  ),
66
72
  });
67
73
  }
@@ -87,6 +93,7 @@ export function invalidateAllModelsGetModelsUser(
87
93
 
88
94
  export function buildModelsGetModelsUserQuery(
89
95
  client$: OpenRouterCore,
96
+ security: operations.GetModelsUserSecurity,
90
97
  options?: RequestOptions,
91
98
  ): {
92
99
  queryKey: QueryKey;
@@ -107,6 +114,7 @@ export function buildModelsGetModelsUserQuery(
107
114
 
108
115
  return unwrapAsync(modelsGetModelsUser(
109
116
  client$,
117
+ security,
110
118
  mergedOptions,
111
119
  ));
112
120
  },
@@ -0,0 +1,88 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ MutationKey,
7
+ useMutation,
8
+ UseMutationResult,
9
+ } from "@tanstack/react-query";
10
+ import { OpenRouterCore } from "../core.js";
11
+ import { oAuthPostAuthKeys } from "../funcs/oAuthPostAuthKeys.js";
12
+ import { combineSignals } from "../lib/primitives.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import * as operations from "../models/operations/index.js";
15
+ import { unwrapAsync } from "../types/fp.js";
16
+ import { useOpenRouterContext } from "./_context.js";
17
+ import { MutationHookOptions } from "./_types.js";
18
+
19
+ export type OAuthPostAuthKeysMutationVariables = {
20
+ request?: operations.PostAuthKeysRequest | undefined;
21
+ options?: RequestOptions;
22
+ };
23
+
24
+ export type OAuthPostAuthKeysMutationData = operations.PostAuthKeysResponse;
25
+
26
+ /**
27
+ * Exchange authorization code for API key
28
+ *
29
+ * @remarks
30
+ * Exchange an authorization code from the PKCE flow for a user-controlled API key
31
+ */
32
+ export function useOAuthPostAuthKeysMutation(
33
+ options?: MutationHookOptions<
34
+ OAuthPostAuthKeysMutationData,
35
+ Error,
36
+ OAuthPostAuthKeysMutationVariables
37
+ >,
38
+ ): UseMutationResult<
39
+ OAuthPostAuthKeysMutationData,
40
+ Error,
41
+ OAuthPostAuthKeysMutationVariables
42
+ > {
43
+ const client = useOpenRouterContext();
44
+ return useMutation({
45
+ ...buildOAuthPostAuthKeysMutation(client, options),
46
+ ...options,
47
+ });
48
+ }
49
+
50
+ export function mutationKeyOAuthPostAuthKeys(): MutationKey {
51
+ return ["@openrouter/sdk", "OAuth", "postAuthKeys"];
52
+ }
53
+
54
+ export function buildOAuthPostAuthKeysMutation(
55
+ client$: OpenRouterCore,
56
+ hookOptions?: RequestOptions,
57
+ ): {
58
+ mutationKey: MutationKey;
59
+ mutationFn: (
60
+ variables: OAuthPostAuthKeysMutationVariables,
61
+ ) => Promise<OAuthPostAuthKeysMutationData>;
62
+ } {
63
+ return {
64
+ mutationKey: mutationKeyOAuthPostAuthKeys(),
65
+ mutationFn: function oAuthPostAuthKeysMutationFn({
66
+ request,
67
+ options,
68
+ }): Promise<OAuthPostAuthKeysMutationData> {
69
+ const mergedOptions = {
70
+ ...hookOptions,
71
+ ...options,
72
+ fetchOptions: {
73
+ ...hookOptions?.fetchOptions,
74
+ ...options?.fetchOptions,
75
+ signal: combineSignals(
76
+ hookOptions?.fetchOptions?.signal,
77
+ options?.fetchOptions?.signal,
78
+ ),
79
+ },
80
+ };
81
+ return unwrapAsync(oAuthPostAuthKeys(
82
+ client$,
83
+ request,
84
+ mergedOptions,
85
+ ));
86
+ },
87
+ };
88
+ }
@@ -0,0 +1,89 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ MutationKey,
7
+ useMutation,
8
+ UseMutationResult,
9
+ } from "@tanstack/react-query";
10
+ import { OpenRouterCore } from "../core.js";
11
+ import { oAuthPostAuthKeysCode } from "../funcs/oAuthPostAuthKeysCode.js";
12
+ import { combineSignals } from "../lib/primitives.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import * as operations from "../models/operations/index.js";
15
+ import { unwrapAsync } from "../types/fp.js";
16
+ import { useOpenRouterContext } from "./_context.js";
17
+ import { MutationHookOptions } from "./_types.js";
18
+
19
+ export type OAuthPostAuthKeysCodeMutationVariables = {
20
+ request?: operations.PostAuthKeysCodeRequest | undefined;
21
+ options?: RequestOptions;
22
+ };
23
+
24
+ export type OAuthPostAuthKeysCodeMutationData =
25
+ operations.PostAuthKeysCodeResponse;
26
+
27
+ /**
28
+ * Create authorization code
29
+ *
30
+ * @remarks
31
+ * Create an authorization code for the PKCE flow to generate a user-controlled API key
32
+ */
33
+ export function useOAuthPostAuthKeysCodeMutation(
34
+ options?: MutationHookOptions<
35
+ OAuthPostAuthKeysCodeMutationData,
36
+ Error,
37
+ OAuthPostAuthKeysCodeMutationVariables
38
+ >,
39
+ ): UseMutationResult<
40
+ OAuthPostAuthKeysCodeMutationData,
41
+ Error,
42
+ OAuthPostAuthKeysCodeMutationVariables
43
+ > {
44
+ const client = useOpenRouterContext();
45
+ return useMutation({
46
+ ...buildOAuthPostAuthKeysCodeMutation(client, options),
47
+ ...options,
48
+ });
49
+ }
50
+
51
+ export function mutationKeyOAuthPostAuthKeysCode(): MutationKey {
52
+ return ["@openrouter/sdk", "OAuth", "postAuthKeysCode"];
53
+ }
54
+
55
+ export function buildOAuthPostAuthKeysCodeMutation(
56
+ client$: OpenRouterCore,
57
+ hookOptions?: RequestOptions,
58
+ ): {
59
+ mutationKey: MutationKey;
60
+ mutationFn: (
61
+ variables: OAuthPostAuthKeysCodeMutationVariables,
62
+ ) => Promise<OAuthPostAuthKeysCodeMutationData>;
63
+ } {
64
+ return {
65
+ mutationKey: mutationKeyOAuthPostAuthKeysCode(),
66
+ mutationFn: function oAuthPostAuthKeysCodeMutationFn({
67
+ request,
68
+ options,
69
+ }): Promise<OAuthPostAuthKeysCodeMutationData> {
70
+ const mergedOptions = {
71
+ ...hookOptions,
72
+ ...options,
73
+ fetchOptions: {
74
+ ...hookOptions?.fetchOptions,
75
+ ...options?.fetchOptions,
76
+ signal: combineSignals(
77
+ hookOptions?.fetchOptions?.signal,
78
+ options?.fetchOptions?.signal,
79
+ ),
80
+ },
81
+ };
82
+ return unwrapAsync(oAuthPostAuthKeysCode(
83
+ client$,
84
+ request,
85
+ mergedOptions,
86
+ ));
87
+ },
88
+ };
89
+ }