@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.
- package/FUNCTIONS.md +1 -3
- package/REACT_QUERY.md +10 -14
- package/README.md +62 -40
- package/dist/commonjs/funcs/analyticsGetActivity.js +3 -2
- package/dist/commonjs/funcs/analyticsGetActivity.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js +3 -2
- package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetAuthKey.js +3 -2
- package/dist/commonjs/funcs/apiKeysGetAuthKey.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKey.js +3 -2
- package/dist/commonjs/funcs/apiKeysGetKey.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKeys.js +3 -2
- package/dist/commonjs/funcs/apiKeysGetKeys.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKeysHash.js +3 -2
- package/dist/commonjs/funcs/apiKeysGetKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysPatchKeysHash.js +3 -2
- package/dist/commonjs/funcs/apiKeysPatchKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysPostKeys.js +3 -2
- package/dist/commonjs/funcs/apiKeysPostKeys.js.map +1 -1
- package/dist/commonjs/funcs/chatSend.js +3 -2
- package/dist/commonjs/funcs/chatSend.js.map +1 -1
- package/dist/{esm/funcs/postCreditsCoinbase.d.ts → commonjs/funcs/creditsPostCreditsCoinbase.d.ts} +2 -2
- package/dist/commonjs/funcs/creditsPostCreditsCoinbase.d.ts.map +1 -0
- package/dist/commonjs/funcs/{postCreditsCoinbase.js → creditsPostCreditsCoinbase.js} +14 -9
- package/dist/commonjs/funcs/creditsPostCreditsCoinbase.js.map +1 -0
- package/dist/commonjs/funcs/{embeddingsPostEmbeddings.d.ts → embeddingsGenerate.d.ts} +2 -2
- package/dist/commonjs/funcs/embeddingsGenerate.d.ts.map +1 -0
- package/dist/commonjs/funcs/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +6 -5
- package/dist/commonjs/funcs/embeddingsGenerate.js.map +1 -0
- package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js +3 -2
- package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js.map +1 -1
- package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js +3 -2
- package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
- package/dist/commonjs/funcs/generationsGetGeneration.js +3 -2
- package/dist/commonjs/funcs/generationsGetGeneration.js.map +1 -1
- package/dist/commonjs/funcs/getCredits.js +3 -2
- package/dist/commonjs/funcs/getCredits.js.map +1 -1
- package/dist/{esm/funcs/parametersGetParametersAuthorSlug.d.ts → commonjs/funcs/modelGetParametersAuthorSlug.d.ts} +2 -2
- package/dist/commonjs/funcs/modelGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/commonjs/funcs/{parametersGetParametersAuthorSlug.js → modelGetParametersAuthorSlug.js} +14 -9
- package/dist/commonjs/funcs/modelGetParametersAuthorSlug.js.map +1 -0
- package/dist/commonjs/funcs/modelsGetModels.js +3 -2
- package/dist/commonjs/funcs/modelsGetModels.js.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsCount.js +3 -2
- package/dist/commonjs/funcs/modelsGetModelsCount.js.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsUser.d.ts +1 -1
- package/dist/commonjs/funcs/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsUser.js +12 -7
- package/dist/commonjs/funcs/modelsGetModelsUser.js.map +1 -1
- package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts +17 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts.map +1 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeys.js +116 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeys.js.map +1 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts +17 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts.map +1 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js +116 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js.map +1 -0
- package/dist/{esm/funcs/getProviders.d.ts → commonjs/funcs/providersGetProviders.d.ts} +5 -2
- package/dist/commonjs/funcs/providersGetProviders.d.ts.map +1 -0
- package/dist/commonjs/funcs/{getProviders.js → providersGetProviders.js} +9 -5
- package/dist/commonjs/funcs/providersGetProviders.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +4 -8
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/env.d.ts +0 -1
- package/dist/commonjs/lib/env.d.ts.map +1 -1
- package/dist/commonjs/lib/env.js +0 -1
- package/dist/commonjs/lib/env.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +1 -7
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/chaterror.d.ts +23 -2
- package/dist/commonjs/models/chaterror.d.ts.map +1 -1
- package/dist/commonjs/models/chaterror.js +27 -3
- package/dist/commonjs/models/chaterror.js.map +1 -1
- package/dist/commonjs/models/chatresponse.d.ts +2 -2
- package/dist/commonjs/models/chatresponse.d.ts.map +1 -1
- package/dist/commonjs/models/chatresponse.js +2 -2
- package/dist/commonjs/models/chatresponse.js.map +1 -1
- package/dist/commonjs/models/chatstreamingresponsechunk.d.ts +2 -2
- package/dist/commonjs/models/chatstreamingresponsechunk.d.ts.map +1 -1
- package/dist/commonjs/models/chatstreamingresponsechunk.js +2 -2
- package/dist/commonjs/models/chatstreamingresponsechunk.js.map +1 -1
- package/dist/commonjs/models/errorresponse.d.ts +8 -8
- package/dist/commonjs/models/errorresponse.d.ts.map +1 -1
- package/dist/commonjs/models/errorresponse.js +14 -13
- package/dist/commonjs/models/errorresponse.js.map +1 -1
- package/dist/commonjs/models/operations/getmodelsuser.d.ts +25 -0
- package/dist/commonjs/models/operations/getmodelsuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getmodelsuser.js +29 -2
- package/dist/commonjs/models/operations/getmodelsuser.js.map +1 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.d.ts +25 -0
- package/dist/commonjs/models/operations/getparametersauthorslug.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.js +28 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/postauthkeys.d.ts +132 -0
- package/dist/commonjs/models/operations/postauthkeys.d.ts.map +1 -0
- package/dist/commonjs/models/operations/postauthkeys.js +175 -0
- package/dist/commonjs/models/operations/postauthkeys.js.map +1 -0
- package/dist/commonjs/models/operations/postauthkeyscode.d.ts +167 -0
- package/dist/commonjs/models/operations/postauthkeyscode.d.ts.map +1 -0
- package/dist/commonjs/models/operations/postauthkeyscode.js +210 -0
- package/dist/commonjs/models/operations/postauthkeyscode.js.map +1 -0
- package/dist/commonjs/models/operations/postcreditscoinbase.d.ts +25 -0
- package/dist/commonjs/models/operations/postcreditscoinbase.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postcreditscoinbase.js +28 -1
- package/dist/commonjs/models/operations/postcreditscoinbase.js.map +1 -1
- package/dist/commonjs/models/security.d.ts +0 -2
- package/dist/commonjs/models/security.d.ts.map +1 -1
- package/dist/commonjs/models/security.js +0 -2
- package/dist/commonjs/models/security.js.map +1 -1
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.d.ts +21 -0
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.d.ts.map +1 -0
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js +44 -0
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js.map +1 -0
- package/dist/commonjs/react-query/embeddingsGenerate.d.ts +23 -0
- package/dist/commonjs/react-query/embeddingsGenerate.d.ts.map +1 -0
- package/dist/commonjs/react-query/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +13 -13
- package/dist/commonjs/react-query/embeddingsGenerate.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +6 -4
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +6 -4
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts +38 -0
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js +88 -0
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js.map +1 -0
- package/dist/commonjs/react-query/modelsGetModelsUser.d.ts +4 -4
- package/dist/commonjs/react-query/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/commonjs/react-query/modelsGetModelsUser.js +8 -8
- package/dist/commonjs/react-query/modelsGetModelsUser.js.map +1 -1
- package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts +23 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts.map +1 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeys.js +47 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeys.js.map +1 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts +23 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts.map +1 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js +47 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js.map +1 -0
- package/dist/commonjs/react-query/providersGetProviders.d.ts +23 -0
- package/dist/commonjs/react-query/providersGetProviders.d.ts.map +1 -0
- package/dist/commonjs/react-query/providersGetProviders.js +69 -0
- package/dist/commonjs/react-query/providersGetProviders.js.map +1 -0
- package/dist/commonjs/sdk/credits.d.ts +9 -0
- package/dist/commonjs/sdk/credits.d.ts.map +1 -0
- package/dist/commonjs/sdk/credits.js +19 -0
- package/dist/commonjs/sdk/credits.js.map +1 -0
- package/dist/commonjs/sdk/embeddings.d.ts +1 -1
- package/dist/commonjs/sdk/embeddings.d.ts.map +1 -1
- package/dist/commonjs/sdk/embeddings.js +3 -3
- package/dist/commonjs/sdk/embeddings.js.map +1 -1
- package/dist/commonjs/sdk/model.d.ts +9 -0
- package/dist/commonjs/sdk/model.d.ts.map +1 -0
- package/dist/commonjs/sdk/model.js +19 -0
- package/dist/commonjs/sdk/model.js.map +1 -0
- package/dist/commonjs/sdk/models.d.ts +1 -1
- package/dist/commonjs/sdk/models.d.ts.map +1 -1
- package/dist/commonjs/sdk/models.js +2 -2
- package/dist/commonjs/sdk/models.js.map +1 -1
- package/dist/commonjs/sdk/oauth.d.ts +19 -0
- package/dist/commonjs/sdk/oauth.d.ts.map +1 -0
- package/dist/commonjs/sdk/oauth.js +32 -0
- package/dist/commonjs/sdk/oauth.js.map +1 -0
- package/dist/commonjs/sdk/providers.d.ts +9 -0
- package/dist/commonjs/sdk/providers.d.ts.map +1 -0
- package/dist/commonjs/sdk/providers.js +19 -0
- package/dist/commonjs/sdk/providers.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +12 -8
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +15 -14
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/analyticsGetActivity.js +3 -2
- package/dist/esm/funcs/analyticsGetActivity.js.map +1 -1
- package/dist/esm/funcs/apiKeysDeleteKeysHash.js +3 -2
- package/dist/esm/funcs/apiKeysDeleteKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetAuthKey.js +3 -2
- package/dist/esm/funcs/apiKeysGetAuthKey.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKey.js +3 -2
- package/dist/esm/funcs/apiKeysGetKey.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKeys.js +3 -2
- package/dist/esm/funcs/apiKeysGetKeys.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKeysHash.js +3 -2
- package/dist/esm/funcs/apiKeysGetKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysPatchKeysHash.js +3 -2
- package/dist/esm/funcs/apiKeysPatchKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysPostKeys.js +3 -2
- package/dist/esm/funcs/apiKeysPostKeys.js.map +1 -1
- package/dist/esm/funcs/chatSend.js +3 -2
- package/dist/esm/funcs/chatSend.js.map +1 -1
- package/dist/{commonjs/funcs/postCreditsCoinbase.d.ts → esm/funcs/creditsPostCreditsCoinbase.d.ts} +2 -2
- package/dist/esm/funcs/creditsPostCreditsCoinbase.d.ts.map +1 -0
- package/dist/esm/funcs/{postCreditsCoinbase.js → creditsPostCreditsCoinbase.js} +14 -9
- package/dist/esm/funcs/creditsPostCreditsCoinbase.js.map +1 -0
- package/dist/esm/funcs/{embeddingsPostEmbeddings.d.ts → embeddingsGenerate.d.ts} +2 -2
- package/dist/esm/funcs/embeddingsGenerate.d.ts.map +1 -0
- package/dist/esm/funcs/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +5 -4
- package/dist/esm/funcs/embeddingsGenerate.js.map +1 -0
- package/dist/esm/funcs/endpointsGetEndpointsZdr.js +3 -2
- package/dist/esm/funcs/endpointsGetEndpointsZdr.js.map +1 -1
- package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js +3 -2
- package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
- package/dist/esm/funcs/generationsGetGeneration.js +3 -2
- package/dist/esm/funcs/generationsGetGeneration.js.map +1 -1
- package/dist/esm/funcs/getCredits.js +3 -2
- package/dist/esm/funcs/getCredits.js.map +1 -1
- package/dist/{commonjs/funcs/parametersGetParametersAuthorSlug.d.ts → esm/funcs/modelGetParametersAuthorSlug.d.ts} +2 -2
- package/dist/esm/funcs/modelGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/esm/funcs/{parametersGetParametersAuthorSlug.js → modelGetParametersAuthorSlug.js} +14 -9
- package/dist/esm/funcs/modelGetParametersAuthorSlug.js.map +1 -0
- package/dist/esm/funcs/modelsGetModels.js +3 -2
- package/dist/esm/funcs/modelsGetModels.js.map +1 -1
- package/dist/esm/funcs/modelsGetModelsCount.js +3 -2
- package/dist/esm/funcs/modelsGetModelsCount.js.map +1 -1
- package/dist/esm/funcs/modelsGetModelsUser.d.ts +1 -1
- package/dist/esm/funcs/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/esm/funcs/modelsGetModelsUser.js +13 -8
- package/dist/esm/funcs/modelsGetModelsUser.js.map +1 -1
- package/dist/esm/funcs/oAuthPostAuthKeys.d.ts +17 -0
- package/dist/esm/funcs/oAuthPostAuthKeys.d.ts.map +1 -0
- package/dist/esm/funcs/oAuthPostAuthKeys.js +80 -0
- package/dist/esm/funcs/oAuthPostAuthKeys.js.map +1 -0
- package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts +17 -0
- package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts.map +1 -0
- package/dist/esm/funcs/oAuthPostAuthKeysCode.js +80 -0
- package/dist/esm/funcs/oAuthPostAuthKeysCode.js.map +1 -0
- package/dist/{commonjs/funcs/getProviders.d.ts → esm/funcs/providersGetProviders.d.ts} +5 -2
- package/dist/esm/funcs/providersGetProviders.d.ts.map +1 -0
- package/dist/esm/funcs/{getProviders.js → providersGetProviders.js} +8 -4
- package/dist/esm/funcs/providersGetProviders.js.map +1 -0
- package/dist/esm/lib/config.d.ts +4 -8
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/env.d.ts +0 -1
- package/dist/esm/lib/env.d.ts.map +1 -1
- package/dist/esm/lib/env.js +0 -1
- package/dist/esm/lib/env.js.map +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +1 -7
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/chaterror.d.ts +23 -2
- package/dist/esm/models/chaterror.d.ts.map +1 -1
- package/dist/esm/models/chaterror.js +24 -2
- package/dist/esm/models/chaterror.js.map +1 -1
- package/dist/esm/models/chatresponse.d.ts +2 -2
- package/dist/esm/models/chatresponse.d.ts.map +1 -1
- package/dist/esm/models/chatresponse.js +2 -2
- package/dist/esm/models/chatresponse.js.map +1 -1
- package/dist/esm/models/chatstreamingresponsechunk.d.ts +2 -2
- package/dist/esm/models/chatstreamingresponsechunk.d.ts.map +1 -1
- package/dist/esm/models/chatstreamingresponsechunk.js +2 -2
- package/dist/esm/models/chatstreamingresponsechunk.js.map +1 -1
- package/dist/esm/models/errorresponse.d.ts +8 -8
- package/dist/esm/models/errorresponse.d.ts.map +1 -1
- package/dist/esm/models/errorresponse.js +13 -12
- package/dist/esm/models/errorresponse.js.map +1 -1
- package/dist/esm/models/operations/getmodelsuser.d.ts +25 -0
- package/dist/esm/models/operations/getmodelsuser.d.ts.map +1 -1
- package/dist/esm/models/operations/getmodelsuser.js +25 -0
- package/dist/esm/models/operations/getmodelsuser.js.map +1 -1
- package/dist/esm/models/operations/getparametersauthorslug.d.ts +25 -0
- package/dist/esm/models/operations/getparametersauthorslug.d.ts.map +1 -1
- package/dist/esm/models/operations/getparametersauthorslug.js +25 -0
- package/dist/esm/models/operations/getparametersauthorslug.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/postauthkeys.d.ts +132 -0
- package/dist/esm/models/operations/postauthkeys.d.ts.map +1 -0
- package/dist/esm/models/operations/postauthkeys.js +133 -0
- package/dist/esm/models/operations/postauthkeys.js.map +1 -0
- package/dist/esm/models/operations/postauthkeyscode.d.ts +167 -0
- package/dist/esm/models/operations/postauthkeyscode.d.ts.map +1 -0
- package/dist/esm/models/operations/postauthkeyscode.js +166 -0
- package/dist/esm/models/operations/postauthkeyscode.js.map +1 -0
- package/dist/esm/models/operations/postcreditscoinbase.d.ts +25 -0
- package/dist/esm/models/operations/postcreditscoinbase.d.ts.map +1 -1
- package/dist/esm/models/operations/postcreditscoinbase.js +25 -0
- package/dist/esm/models/operations/postcreditscoinbase.js.map +1 -1
- package/dist/esm/models/security.d.ts +0 -2
- package/dist/esm/models/security.d.ts.map +1 -1
- package/dist/esm/models/security.js +0 -2
- package/dist/esm/models/security.js.map +1 -1
- package/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts +21 -0
- package/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts.map +1 -0
- package/dist/esm/react-query/{postCreditsCoinbase.js → creditsPostCreditsCoinbase.js} +10 -10
- package/dist/esm/react-query/creditsPostCreditsCoinbase.js.map +1 -0
- package/dist/esm/react-query/embeddingsGenerate.d.ts +23 -0
- package/dist/esm/react-query/embeddingsGenerate.d.ts.map +1 -0
- package/dist/esm/react-query/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +10 -10
- package/dist/esm/react-query/embeddingsGenerate.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +6 -4
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +6 -4
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts +38 -0
- package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/esm/react-query/modelGetParametersAuthorSlug.js +78 -0
- package/dist/esm/react-query/modelGetParametersAuthorSlug.js.map +1 -0
- package/dist/esm/react-query/modelsGetModelsUser.d.ts +4 -4
- package/dist/esm/react-query/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/esm/react-query/modelsGetModelsUser.js +8 -8
- package/dist/esm/react-query/modelsGetModelsUser.js.map +1 -1
- package/dist/esm/react-query/oAuthPostAuthKeys.d.ts +23 -0
- package/dist/esm/react-query/oAuthPostAuthKeys.d.ts.map +1 -0
- package/dist/esm/react-query/oAuthPostAuthKeys.js +42 -0
- package/dist/esm/react-query/oAuthPostAuthKeys.js.map +1 -0
- package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts +23 -0
- package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts.map +1 -0
- package/dist/esm/react-query/oAuthPostAuthKeysCode.js +42 -0
- package/dist/esm/react-query/oAuthPostAuthKeysCode.js.map +1 -0
- package/dist/esm/react-query/providersGetProviders.d.ts +23 -0
- package/dist/esm/react-query/providersGetProviders.d.ts.map +1 -0
- package/dist/esm/react-query/providersGetProviders.js +60 -0
- package/dist/esm/react-query/providersGetProviders.js.map +1 -0
- package/dist/esm/sdk/credits.d.ts +9 -0
- package/dist/esm/sdk/credits.d.ts.map +1 -0
- package/dist/esm/sdk/credits.js +15 -0
- package/dist/esm/sdk/credits.js.map +1 -0
- package/dist/esm/sdk/embeddings.d.ts +1 -1
- package/dist/esm/sdk/embeddings.d.ts.map +1 -1
- package/dist/esm/sdk/embeddings.js +3 -3
- package/dist/esm/sdk/embeddings.js.map +1 -1
- package/dist/esm/sdk/model.d.ts +9 -0
- package/dist/esm/sdk/model.d.ts.map +1 -0
- package/dist/esm/sdk/model.js +15 -0
- package/dist/esm/sdk/model.js.map +1 -0
- package/dist/esm/sdk/models.d.ts +1 -1
- package/dist/esm/sdk/models.d.ts.map +1 -1
- package/dist/esm/sdk/models.js +2 -2
- package/dist/esm/sdk/models.js.map +1 -1
- package/dist/esm/sdk/oauth.d.ts +19 -0
- package/dist/esm/sdk/oauth.d.ts.map +1 -0
- package/dist/esm/sdk/oauth.js +28 -0
- package/dist/esm/sdk/oauth.js.map +1 -0
- package/dist/esm/sdk/providers.d.ts +9 -0
- package/dist/esm/sdk/providers.d.ts.map +1 -0
- package/dist/esm/sdk/providers.js +15 -0
- package/dist/esm/sdk/providers.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +12 -8
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +15 -14
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/analytics/README.md +2 -6
- package/docs/sdks/apikeys/README.md +14 -42
- package/docs/sdks/chat/README.md +2 -6
- package/docs/sdks/credits/README.md +95 -0
- package/docs/sdks/embeddings/README.md +10 -14
- package/docs/sdks/endpoints/README.md +4 -12
- package/docs/sdks/generations/README.md +2 -6
- package/docs/sdks/{parameters → model}/README.md +19 -22
- package/docs/sdks/models/README.md +13 -24
- package/docs/sdks/oauth/README.md +199 -0
- package/docs/sdks/openrouter/README.md +2 -196
- package/docs/sdks/providers/README.md +104 -0
- package/examples/chatCompletions.example.ts +95 -0
- package/examples/getCredits.example.ts +1 -3
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/analyticsGetActivity.ts +3 -2
- package/src/funcs/apiKeysDeleteKeysHash.ts +3 -2
- package/src/funcs/apiKeysGetAuthKey.ts +3 -2
- package/src/funcs/apiKeysGetKey.ts +3 -2
- package/src/funcs/apiKeysGetKeys.ts +3 -2
- package/src/funcs/apiKeysGetKeysHash.ts +3 -2
- package/src/funcs/apiKeysPatchKeysHash.ts +3 -2
- package/src/funcs/apiKeysPostKeys.ts +3 -2
- package/src/funcs/chatSend.ts +3 -2
- package/src/funcs/{postCreditsCoinbase.ts → creditsPostCreditsCoinbase.ts} +16 -6
- package/src/funcs/{embeddingsPostEmbeddings.ts → embeddingsGenerate.ts} +4 -3
- package/src/funcs/endpointsGetEndpointsZdr.ts +3 -2
- package/src/funcs/endpointsGetModelsAuthorSlugEndpoints.ts +3 -2
- package/src/funcs/generationsGetGeneration.ts +3 -2
- package/src/funcs/getCredits.ts +3 -2
- package/src/funcs/{parametersGetParametersAuthorSlug.ts → modelGetParametersAuthorSlug.ts} +16 -6
- package/src/funcs/modelsGetModels.ts +3 -2
- package/src/funcs/modelsGetModelsCount.ts +3 -2
- package/src/funcs/modelsGetModelsUser.ts +15 -5
- package/src/funcs/oAuthPostAuthKeys.ts +164 -0
- package/src/funcs/oAuthPostAuthKeysCode.ts +164 -0
- package/src/funcs/{getProviders.ts → providersGetProviders.ts} +7 -3
- package/src/lib/config.ts +4 -8
- package/src/lib/env.ts +0 -2
- package/src/lib/security.ts +1 -8
- package/src/models/chaterror.ts +44 -4
- package/src/models/chatresponse.ts +4 -4
- package/src/models/chatstreamingresponsechunk.ts +4 -4
- package/src/models/errorresponse.ts +14 -15
- package/src/models/operations/getmodelsuser.ts +58 -0
- package/src/models/operations/getparametersauthorslug.ts +60 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/postauthkeys.ts +272 -0
- package/src/models/operations/postauthkeyscode.ts +352 -0
- package/src/models/operations/postcreditscoinbase.ts +60 -0
- package/src/models/security.ts +0 -4
- package/src/react-query/{postCreditsCoinbase.ts → creditsPostCreditsCoinbase.ts} +21 -18
- package/src/react-query/{embeddingsPostEmbeddings.ts → embeddingsGenerate.ts} +18 -19
- package/src/react-query/index.ts +6 -4
- package/src/react-query/{parametersGetParametersAuthorSlug.ts → modelGetParametersAuthorSlug.ts} +37 -34
- package/src/react-query/modelsGetModelsUser.ts +8 -0
- package/src/react-query/oAuthPostAuthKeys.ts +88 -0
- package/src/react-query/oAuthPostAuthKeysCode.ts +89 -0
- package/src/react-query/{getProviders.ts → providersGetProviders.ts} +35 -27
- package/src/sdk/credits.ts +26 -0
- package/src/sdk/embeddings.ts +3 -3
- package/src/sdk/{parameters.ts → model.ts} +5 -3
- package/src/sdk/models.ts +2 -0
- package/src/sdk/oauth.ts +45 -0
- package/src/sdk/providers.ts +22 -0
- package/src/sdk/sdk.ts +22 -29
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.d.ts.map +0 -1
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.js.map +0 -1
- package/dist/commonjs/funcs/getProviders.d.ts.map +0 -1
- package/dist/commonjs/funcs/getProviders.js.map +0 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.js.map +0 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.d.ts.map +0 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.js.map +0 -1
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.d.ts +0 -23
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.d.ts.map +0 -1
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.js.map +0 -1
- package/dist/commonjs/react-query/getProviders.d.ts +0 -17
- package/dist/commonjs/react-query/getProviders.d.ts.map +0 -1
- package/dist/commonjs/react-query/getProviders.js +0 -63
- package/dist/commonjs/react-query/getProviders.js.map +0 -1
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts +0 -38
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js +0 -88
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js.map +0 -1
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts +0 -20
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts.map +0 -1
- package/dist/commonjs/react-query/postCreditsCoinbase.js +0 -44
- package/dist/commonjs/react-query/postCreditsCoinbase.js.map +0 -1
- package/dist/commonjs/sdk/parameters.d.ts +0 -9
- package/dist/commonjs/sdk/parameters.d.ts.map +0 -1
- package/dist/commonjs/sdk/parameters.js +0 -19
- package/dist/commonjs/sdk/parameters.js.map +0 -1
- package/dist/esm/funcs/embeddingsPostEmbeddings.d.ts.map +0 -1
- package/dist/esm/funcs/embeddingsPostEmbeddings.js.map +0 -1
- package/dist/esm/funcs/getProviders.d.ts.map +0 -1
- package/dist/esm/funcs/getProviders.js.map +0 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.js.map +0 -1
- package/dist/esm/funcs/postCreditsCoinbase.d.ts.map +0 -1
- package/dist/esm/funcs/postCreditsCoinbase.js.map +0 -1
- package/dist/esm/react-query/embeddingsPostEmbeddings.d.ts +0 -23
- package/dist/esm/react-query/embeddingsPostEmbeddings.d.ts.map +0 -1
- package/dist/esm/react-query/embeddingsPostEmbeddings.js.map +0 -1
- package/dist/esm/react-query/getProviders.d.ts +0 -17
- package/dist/esm/react-query/getProviders.d.ts.map +0 -1
- package/dist/esm/react-query/getProviders.js +0 -54
- package/dist/esm/react-query/getProviders.js.map +0 -1
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts +0 -38
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js +0 -78
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js.map +0 -1
- package/dist/esm/react-query/postCreditsCoinbase.d.ts +0 -20
- package/dist/esm/react-query/postCreditsCoinbase.d.ts.map +0 -1
- package/dist/esm/react-query/postCreditsCoinbase.js.map +0 -1
- package/dist/esm/sdk/parameters.d.ts +0 -9
- package/dist/esm/sdk/parameters.d.ts.map +0 -1
- package/dist/esm/sdk/parameters.js +0 -15
- package/dist/esm/sdk/parameters.js.map +0 -1
- package/examples/chatCompletion.example.ts +0 -19
- package/examples/chatCompletionStream.example.ts +0 -30
- package/examples/unauthorized.example.ts +0 -19
package/src/models/security.ts
CHANGED
|
@@ -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 {
|
|
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
|
|
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
|
|
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
|
|
31
|
+
export function useCreditsPostCreditsCoinbaseMutation(
|
|
31
32
|
options?: MutationHookOptions<
|
|
32
|
-
|
|
33
|
+
CreditsPostCreditsCoinbaseMutationData,
|
|
33
34
|
Error,
|
|
34
|
-
|
|
35
|
+
CreditsPostCreditsCoinbaseMutationVariables
|
|
35
36
|
>,
|
|
36
37
|
): UseMutationResult<
|
|
37
|
-
|
|
38
|
+
CreditsPostCreditsCoinbaseMutationData,
|
|
38
39
|
Error,
|
|
39
|
-
|
|
40
|
+
CreditsPostCreditsCoinbaseMutationVariables
|
|
40
41
|
> {
|
|
41
42
|
const client = useOpenRouterContext();
|
|
42
43
|
return useMutation({
|
|
43
|
-
...
|
|
44
|
+
...buildCreditsPostCreditsCoinbaseMutation(client, options),
|
|
44
45
|
...options,
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
export function
|
|
49
|
-
return ["@openrouter/sdk", "postCreditsCoinbase"];
|
|
49
|
+
export function mutationKeyCreditsPostCreditsCoinbase(): MutationKey {
|
|
50
|
+
return ["@openrouter/sdk", "Credits", "postCreditsCoinbase"];
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
export function
|
|
53
|
+
export function buildCreditsPostCreditsCoinbaseMutation(
|
|
53
54
|
client$: OpenRouterCore,
|
|
54
55
|
hookOptions?: RequestOptions,
|
|
55
56
|
): {
|
|
56
57
|
mutationKey: MutationKey;
|
|
57
58
|
mutationFn: (
|
|
58
|
-
variables:
|
|
59
|
-
) => Promise<
|
|
59
|
+
variables: CreditsPostCreditsCoinbaseMutationVariables,
|
|
60
|
+
) => Promise<CreditsPostCreditsCoinbaseMutationData>;
|
|
60
61
|
} {
|
|
61
62
|
return {
|
|
62
|
-
mutationKey:
|
|
63
|
-
mutationFn: function
|
|
63
|
+
mutationKey: mutationKeyCreditsPostCreditsCoinbase(),
|
|
64
|
+
mutationFn: function creditsPostCreditsCoinbaseMutationFn({
|
|
65
|
+
security,
|
|
64
66
|
request,
|
|
65
67
|
options,
|
|
66
|
-
}): Promise<
|
|
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(
|
|
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 {
|
|
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
|
|
19
|
+
export type EmbeddingsGenerateMutationVariables = {
|
|
20
20
|
request?: operations.PostEmbeddingsRequest | undefined;
|
|
21
21
|
options?: RequestOptions;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export type
|
|
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
|
|
32
|
+
export function useEmbeddingsGenerateMutation(
|
|
34
33
|
options?: MutationHookOptions<
|
|
35
|
-
|
|
34
|
+
EmbeddingsGenerateMutationData,
|
|
36
35
|
Error,
|
|
37
|
-
|
|
36
|
+
EmbeddingsGenerateMutationVariables
|
|
38
37
|
>,
|
|
39
38
|
): UseMutationResult<
|
|
40
|
-
|
|
39
|
+
EmbeddingsGenerateMutationData,
|
|
41
40
|
Error,
|
|
42
|
-
|
|
41
|
+
EmbeddingsGenerateMutationVariables
|
|
43
42
|
> {
|
|
44
43
|
const client = useOpenRouterContext();
|
|
45
44
|
return useMutation({
|
|
46
|
-
...
|
|
45
|
+
...buildEmbeddingsGenerateMutation(client, options),
|
|
47
46
|
...options,
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
export function
|
|
52
|
-
return ["@openrouter/sdk", "Embeddings", "
|
|
50
|
+
export function mutationKeyEmbeddingsGenerate(): MutationKey {
|
|
51
|
+
return ["@openrouter/sdk", "Embeddings", "generate"];
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
export function
|
|
54
|
+
export function buildEmbeddingsGenerateMutation(
|
|
56
55
|
client$: OpenRouterCore,
|
|
57
56
|
hookOptions?: RequestOptions,
|
|
58
57
|
): {
|
|
59
58
|
mutationKey: MutationKey;
|
|
60
59
|
mutationFn: (
|
|
61
|
-
variables:
|
|
62
|
-
) => Promise<
|
|
60
|
+
variables: EmbeddingsGenerateMutationVariables,
|
|
61
|
+
) => Promise<EmbeddingsGenerateMutationData>;
|
|
63
62
|
} {
|
|
64
63
|
return {
|
|
65
|
-
mutationKey:
|
|
66
|
-
mutationFn: function
|
|
64
|
+
mutationKey: mutationKeyEmbeddingsGenerate(),
|
|
65
|
+
mutationFn: function embeddingsGenerateMutationFn({
|
|
67
66
|
request,
|
|
68
67
|
options,
|
|
69
|
-
}): Promise<
|
|
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(
|
|
81
|
+
return unwrapAsync(embeddingsGenerate(
|
|
83
82
|
client$,
|
|
84
83
|
request,
|
|
85
84
|
mergedOptions,
|
package/src/react-query/index.ts
CHANGED
|
@@ -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 "./
|
|
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 "./
|
|
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 "./
|
|
27
|
-
export * from "./
|
|
27
|
+
export * from "./oAuthPostAuthKeys.js";
|
|
28
|
+
export * from "./oAuthPostAuthKeysCode.js";
|
|
29
|
+
export * from "./providersGetProviders.js";
|
package/src/react-query/{parametersGetParametersAuthorSlug.ts → modelGetParametersAuthorSlug.ts}
RENAMED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
UseSuspenseQueryResult,
|
|
14
14
|
} from "@tanstack/react-query";
|
|
15
15
|
import { OpenRouterCore } from "../core.js";
|
|
16
|
-
import {
|
|
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
|
|
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
|
|
34
|
+
export function useModelGetParametersAuthorSlug(
|
|
35
|
+
security: operations.GetParametersAuthorSlugSecurity,
|
|
35
36
|
request: operations.GetParametersAuthorSlugRequest,
|
|
36
|
-
options?: QueryHookOptions<
|
|
37
|
-
): UseQueryResult<
|
|
37
|
+
options?: QueryHookOptions<ModelGetParametersAuthorSlugQueryData>,
|
|
38
|
+
): UseQueryResult<ModelGetParametersAuthorSlugQueryData, Error> {
|
|
38
39
|
const client = useOpenRouterContext();
|
|
39
40
|
return useQuery({
|
|
40
|
-
...
|
|
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
|
|
54
|
+
export function useModelGetParametersAuthorSlugSuspense(
|
|
55
|
+
security: operations.GetParametersAuthorSlugSecurity,
|
|
53
56
|
request: operations.GetParametersAuthorSlugRequest,
|
|
54
|
-
options?: SuspenseQueryHookOptions<
|
|
55
|
-
|
|
56
|
-
>,
|
|
57
|
-
): UseSuspenseQueryResult<ParametersGetParametersAuthorSlugQueryData, Error> {
|
|
57
|
+
options?: SuspenseQueryHookOptions<ModelGetParametersAuthorSlugQueryData>,
|
|
58
|
+
): UseSuspenseQueryResult<ModelGetParametersAuthorSlugQueryData, Error> {
|
|
58
59
|
const client = useOpenRouterContext();
|
|
59
60
|
return useSuspenseQuery({
|
|
60
|
-
...
|
|
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
|
|
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
|
-
...
|
|
78
|
+
...buildModelGetParametersAuthorSlugQuery(
|
|
76
79
|
client$,
|
|
80
|
+
security,
|
|
77
81
|
request,
|
|
78
82
|
),
|
|
79
83
|
});
|
|
80
84
|
}
|
|
81
85
|
|
|
82
|
-
export function
|
|
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:
|
|
92
|
-
):
|
|
93
|
-
const key =
|
|
95
|
+
data: ModelGetParametersAuthorSlugQueryData,
|
|
96
|
+
): ModelGetParametersAuthorSlugQueryData | undefined {
|
|
97
|
+
const key = queryKeyModelGetParametersAuthorSlug(...queryKeyBase);
|
|
94
98
|
|
|
95
|
-
return client.setQueryData<
|
|
96
|
-
key,
|
|
97
|
-
data,
|
|
98
|
-
);
|
|
99
|
+
return client.setQueryData<ModelGetParametersAuthorSlugQueryData>(key, data);
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
export function
|
|
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
|
-
"
|
|
119
|
+
"Model",
|
|
119
120
|
"getParametersAuthorSlug",
|
|
120
121
|
...queryKeyBase,
|
|
121
122
|
],
|
|
122
123
|
});
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
export function
|
|
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", "
|
|
132
|
+
queryKey: ["@openrouter/sdk", "Model", "getParametersAuthorSlug"],
|
|
132
133
|
});
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
export function
|
|
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<
|
|
145
|
+
) => Promise<ModelGetParametersAuthorSlugQueryData>;
|
|
144
146
|
} {
|
|
145
147
|
return {
|
|
146
|
-
queryKey:
|
|
148
|
+
queryKey: queryKeyModelGetParametersAuthorSlug(
|
|
147
149
|
request.author,
|
|
148
150
|
request.slug,
|
|
149
151
|
{ provider: request.provider },
|
|
150
152
|
),
|
|
151
|
-
queryFn: async function
|
|
153
|
+
queryFn: async function modelGetParametersAuthorSlugQueryFn(
|
|
152
154
|
ctx,
|
|
153
|
-
): Promise<
|
|
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(
|
|
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
|
|
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
|
-
"
|
|
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
|
+
}
|