@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
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Credits
|
|
2
|
+
(*credits*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [postCreditsCoinbase](#postcreditscoinbase) - Create a Coinbase charge for crypto payment
|
|
9
|
+
|
|
10
|
+
## postCreditsCoinbase
|
|
11
|
+
|
|
12
|
+
Create a Coinbase charge for crypto payment
|
|
13
|
+
|
|
14
|
+
### Example Usage
|
|
15
|
+
|
|
16
|
+
<!-- UsageSnippet language="typescript" operationID="post_/credits/coinbase" method="post" path="/credits/coinbase" -->
|
|
17
|
+
```typescript
|
|
18
|
+
import { OpenRouter } from "@openrouter/sdk";
|
|
19
|
+
|
|
20
|
+
const openRouter = new OpenRouter();
|
|
21
|
+
|
|
22
|
+
async function run() {
|
|
23
|
+
const result = await openRouter.credits.postCreditsCoinbase({
|
|
24
|
+
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
console.log(result);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
run();
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Standalone function
|
|
34
|
+
|
|
35
|
+
The standalone function version of this method:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
39
|
+
import { creditsPostCreditsCoinbase } from "@openrouter/sdk/funcs/creditsPostCreditsCoinbase.js";
|
|
40
|
+
|
|
41
|
+
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
42
|
+
// You can create one instance of it to use across an application.
|
|
43
|
+
const openRouter = new OpenRouterCore();
|
|
44
|
+
|
|
45
|
+
async function run() {
|
|
46
|
+
const res = await creditsPostCreditsCoinbase(openRouter, {
|
|
47
|
+
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
48
|
+
});
|
|
49
|
+
if (res.ok) {
|
|
50
|
+
const { value: result } = res;
|
|
51
|
+
console.log(result);
|
|
52
|
+
} else {
|
|
53
|
+
console.log("creditsPostCreditsCoinbase failed:", res.error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
run();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### React hooks and utilities
|
|
61
|
+
|
|
62
|
+
This method can be used in React components through the following hooks and
|
|
63
|
+
associated utilities.
|
|
64
|
+
|
|
65
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
66
|
+
> below and how to get started using React hooks.
|
|
67
|
+
|
|
68
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import {
|
|
72
|
+
// Mutation hook for triggering the API call.
|
|
73
|
+
useCreditsPostCreditsCoinbaseMutation
|
|
74
|
+
} from "@openrouter/sdk/react-query/creditsPostCreditsCoinbase.js";
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Parameters
|
|
78
|
+
|
|
79
|
+
| Parameter | Type | Required | Description |
|
|
80
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
81
|
+
| `request` | [operations.PostCreditsCoinbaseRequest](../../models/operations/postcreditscoinbaserequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
82
|
+
| `security` | [operations.PostCreditsCoinbaseSecurity](../../models/operations/postcreditscoinbasesecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
|
|
83
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
84
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
85
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
86
|
+
|
|
87
|
+
### Response
|
|
88
|
+
|
|
89
|
+
**Promise\<[operations.PostCreditsCoinbaseResponse](../../models/operations/postcreditscoinbaseresponse.md)\>**
|
|
90
|
+
|
|
91
|
+
### Errors
|
|
92
|
+
|
|
93
|
+
| Error Type | Status Code | Content Type |
|
|
94
|
+
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
95
|
+
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
-
* [
|
|
8
|
+
* [generate](#generate) - Submit an embedding request
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## generate
|
|
11
11
|
|
|
12
12
|
Submits an embedding request to the embeddings router
|
|
13
13
|
|
|
@@ -18,13 +18,11 @@ Submits an embedding request to the embeddings router
|
|
|
18
18
|
import { OpenRouter } from "@openrouter/sdk";
|
|
19
19
|
|
|
20
20
|
const openRouter = new OpenRouter({
|
|
21
|
-
|
|
22
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
23
|
-
},
|
|
21
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
24
22
|
});
|
|
25
23
|
|
|
26
24
|
async function run() {
|
|
27
|
-
const result = await openRouter.embeddings.
|
|
25
|
+
const result = await openRouter.embeddings.generate({
|
|
28
26
|
input: [],
|
|
29
27
|
provider: {
|
|
30
28
|
zdr: true,
|
|
@@ -43,18 +41,16 @@ The standalone function version of this method:
|
|
|
43
41
|
|
|
44
42
|
```typescript
|
|
45
43
|
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
46
|
-
import {
|
|
44
|
+
import { embeddingsGenerate } from "@openrouter/sdk/funcs/embeddingsGenerate.js";
|
|
47
45
|
|
|
48
46
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
49
47
|
// You can create one instance of it to use across an application.
|
|
50
48
|
const openRouter = new OpenRouterCore({
|
|
51
|
-
|
|
52
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
53
|
-
},
|
|
49
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
54
50
|
});
|
|
55
51
|
|
|
56
52
|
async function run() {
|
|
57
|
-
const res = await
|
|
53
|
+
const res = await embeddingsGenerate(openRouter, {
|
|
58
54
|
input: [],
|
|
59
55
|
provider: {
|
|
60
56
|
zdr: true,
|
|
@@ -64,7 +60,7 @@ async function run() {
|
|
|
64
60
|
const { value: result } = res;
|
|
65
61
|
console.log(result);
|
|
66
62
|
} else {
|
|
67
|
-
console.log("
|
|
63
|
+
console.log("embeddingsGenerate failed:", res.error);
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
|
|
@@ -84,8 +80,8 @@ associated utilities.
|
|
|
84
80
|
```tsx
|
|
85
81
|
import {
|
|
86
82
|
// Mutation hook for triggering the API call.
|
|
87
|
-
|
|
88
|
-
} from "@openrouter/sdk/react-query/
|
|
83
|
+
useEmbeddingsGenerateMutation
|
|
84
|
+
} from "@openrouter/sdk/react-query/embeddingsGenerate.js";
|
|
89
85
|
```
|
|
90
86
|
|
|
91
87
|
### Parameters
|
|
@@ -19,9 +19,7 @@ List all endpoints for a model
|
|
|
19
19
|
import { OpenRouter } from "@openrouter/sdk";
|
|
20
20
|
|
|
21
21
|
const openRouter = new OpenRouter({
|
|
22
|
-
|
|
23
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
24
|
-
},
|
|
22
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
25
23
|
});
|
|
26
24
|
|
|
27
25
|
async function run() {
|
|
@@ -47,9 +45,7 @@ import { endpointsGetModelsAuthorSlugEndpoints } from "@openrouter/sdk/funcs/end
|
|
|
47
45
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
48
46
|
// You can create one instance of it to use across an application.
|
|
49
47
|
const openRouter = new OpenRouterCore({
|
|
50
|
-
|
|
51
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
52
|
-
},
|
|
48
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
53
49
|
});
|
|
54
50
|
|
|
55
51
|
async function run() {
|
|
@@ -126,9 +122,7 @@ Preview the impact of ZDR on the available endpoints
|
|
|
126
122
|
import { OpenRouter } from "@openrouter/sdk";
|
|
127
123
|
|
|
128
124
|
const openRouter = new OpenRouter({
|
|
129
|
-
|
|
130
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
131
|
-
},
|
|
125
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
132
126
|
});
|
|
133
127
|
|
|
134
128
|
async function run() {
|
|
@@ -151,9 +145,7 @@ import { endpointsGetEndpointsZdr } from "@openrouter/sdk/funcs/endpointsGetEndp
|
|
|
151
145
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
152
146
|
// You can create one instance of it to use across an application.
|
|
153
147
|
const openRouter = new OpenRouterCore({
|
|
154
|
-
|
|
155
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
156
|
-
},
|
|
148
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
157
149
|
});
|
|
158
150
|
|
|
159
151
|
async function run() {
|
|
@@ -18,9 +18,7 @@ Get request & usage metadata for a generation
|
|
|
18
18
|
import { OpenRouter } from "@openrouter/sdk";
|
|
19
19
|
|
|
20
20
|
const openRouter = new OpenRouter({
|
|
21
|
-
|
|
22
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
23
|
-
},
|
|
21
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
24
22
|
});
|
|
25
23
|
|
|
26
24
|
async function run() {
|
|
@@ -45,9 +43,7 @@ import { generationsGetGeneration } from "@openrouter/sdk/funcs/generationsGetGe
|
|
|
45
43
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
46
44
|
// You can create one instance of it to use across an application.
|
|
47
45
|
const openRouter = new OpenRouterCore({
|
|
48
|
-
|
|
49
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
50
|
-
},
|
|
46
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
51
47
|
});
|
|
52
48
|
|
|
53
49
|
async function run() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
(*
|
|
1
|
+
# Model
|
|
2
|
+
(*model*)
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
5
|
|
|
@@ -17,14 +17,12 @@ Get a model's supported parameters and data about which are most popular
|
|
|
17
17
|
```typescript
|
|
18
18
|
import { OpenRouter } from "@openrouter/sdk";
|
|
19
19
|
|
|
20
|
-
const openRouter = new OpenRouter(
|
|
21
|
-
security: {
|
|
22
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
23
|
-
},
|
|
24
|
-
});
|
|
20
|
+
const openRouter = new OpenRouter();
|
|
25
21
|
|
|
26
22
|
async function run() {
|
|
27
|
-
const result = await openRouter.
|
|
23
|
+
const result = await openRouter.model.getParametersAuthorSlug({
|
|
24
|
+
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
25
|
+
}, {
|
|
28
26
|
author: "<value>",
|
|
29
27
|
slug: "<value>",
|
|
30
28
|
});
|
|
@@ -41,18 +39,16 @@ The standalone function version of this method:
|
|
|
41
39
|
|
|
42
40
|
```typescript
|
|
43
41
|
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
44
|
-
import {
|
|
42
|
+
import { modelGetParametersAuthorSlug } from "@openrouter/sdk/funcs/modelGetParametersAuthorSlug.js";
|
|
45
43
|
|
|
46
44
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
47
45
|
// You can create one instance of it to use across an application.
|
|
48
|
-
const openRouter = new OpenRouterCore(
|
|
49
|
-
security: {
|
|
50
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
51
|
-
},
|
|
52
|
-
});
|
|
46
|
+
const openRouter = new OpenRouterCore();
|
|
53
47
|
|
|
54
48
|
async function run() {
|
|
55
|
-
const res = await
|
|
49
|
+
const res = await modelGetParametersAuthorSlug(openRouter, {
|
|
50
|
+
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
51
|
+
}, {
|
|
56
52
|
author: "<value>",
|
|
57
53
|
slug: "<value>",
|
|
58
54
|
});
|
|
@@ -60,7 +56,7 @@ async function run() {
|
|
|
60
56
|
const { value: result } = res;
|
|
61
57
|
console.log(result);
|
|
62
58
|
} else {
|
|
63
|
-
console.log("
|
|
59
|
+
console.log("modelGetParametersAuthorSlug failed:", res.error);
|
|
64
60
|
}
|
|
65
61
|
}
|
|
66
62
|
|
|
@@ -80,19 +76,19 @@ associated utilities.
|
|
|
80
76
|
```tsx
|
|
81
77
|
import {
|
|
82
78
|
// Query hooks for fetching data.
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
useModelGetParametersAuthorSlug,
|
|
80
|
+
useModelGetParametersAuthorSlugSuspense,
|
|
85
81
|
|
|
86
82
|
// Utility for prefetching data during server-side rendering and in React
|
|
87
83
|
// Server Components that will be immediately available to client components
|
|
88
84
|
// using the hooks.
|
|
89
|
-
|
|
85
|
+
prefetchModelGetParametersAuthorSlug,
|
|
90
86
|
|
|
91
87
|
// Utilities to invalidate the query cache for this query in response to
|
|
92
88
|
// mutations and other user actions.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
} from "@openrouter/sdk/react-query/
|
|
89
|
+
invalidateModelGetParametersAuthorSlug,
|
|
90
|
+
invalidateAllModelGetParametersAuthorSlug,
|
|
91
|
+
} from "@openrouter/sdk/react-query/modelGetParametersAuthorSlug.js";
|
|
96
92
|
```
|
|
97
93
|
|
|
98
94
|
### Parameters
|
|
@@ -100,6 +96,7 @@ import {
|
|
|
100
96
|
| Parameter | Type | Required | Description |
|
|
101
97
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
102
98
|
| `request` | [operations.GetParametersAuthorSlugRequest](../../models/operations/getparametersauthorslugrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
99
|
+
| `security` | [operations.GetParametersAuthorSlugSecurity](../../models/operations/getparametersauthorslugsecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
|
|
103
100
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
104
101
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
105
102
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
@@ -20,9 +20,7 @@ Get total count of available models
|
|
|
20
20
|
import { OpenRouter } from "@openrouter/sdk";
|
|
21
21
|
|
|
22
22
|
const openRouter = new OpenRouter({
|
|
23
|
-
|
|
24
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
25
|
-
},
|
|
23
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
26
24
|
});
|
|
27
25
|
|
|
28
26
|
async function run() {
|
|
@@ -45,9 +43,7 @@ import { modelsGetModelsCount } from "@openrouter/sdk/funcs/modelsGetModelsCount
|
|
|
45
43
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
46
44
|
// You can create one instance of it to use across an application.
|
|
47
45
|
const openRouter = new OpenRouterCore({
|
|
48
|
-
|
|
49
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
50
|
-
},
|
|
46
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
51
47
|
});
|
|
52
48
|
|
|
53
49
|
async function run() {
|
|
@@ -119,9 +115,7 @@ List all models and their properties
|
|
|
119
115
|
import { OpenRouter } from "@openrouter/sdk";
|
|
120
116
|
|
|
121
117
|
const openRouter = new OpenRouter({
|
|
122
|
-
|
|
123
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
124
|
-
},
|
|
118
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
125
119
|
});
|
|
126
120
|
|
|
127
121
|
async function run() {
|
|
@@ -144,9 +138,7 @@ import { modelsGetModels } from "@openrouter/sdk/funcs/modelsGetModels.js";
|
|
|
144
138
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
145
139
|
// You can create one instance of it to use across an application.
|
|
146
140
|
const openRouter = new OpenRouterCore({
|
|
147
|
-
|
|
148
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
149
|
-
},
|
|
141
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
150
142
|
});
|
|
151
143
|
|
|
152
144
|
async function run() {
|
|
@@ -219,14 +211,12 @@ List models filtered by user provider preferences
|
|
|
219
211
|
```typescript
|
|
220
212
|
import { OpenRouter } from "@openrouter/sdk";
|
|
221
213
|
|
|
222
|
-
const openRouter = new OpenRouter(
|
|
223
|
-
security: {
|
|
224
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
225
|
-
},
|
|
226
|
-
});
|
|
214
|
+
const openRouter = new OpenRouter();
|
|
227
215
|
|
|
228
216
|
async function run() {
|
|
229
|
-
const result = await openRouter.models.getModelsUser(
|
|
217
|
+
const result = await openRouter.models.getModelsUser({
|
|
218
|
+
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
219
|
+
});
|
|
230
220
|
|
|
231
221
|
console.log(result);
|
|
232
222
|
}
|
|
@@ -244,14 +234,12 @@ import { modelsGetModelsUser } from "@openrouter/sdk/funcs/modelsGetModelsUser.j
|
|
|
244
234
|
|
|
245
235
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
246
236
|
// You can create one instance of it to use across an application.
|
|
247
|
-
const openRouter = new OpenRouterCore(
|
|
248
|
-
security: {
|
|
249
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
250
|
-
},
|
|
251
|
-
});
|
|
237
|
+
const openRouter = new OpenRouterCore();
|
|
252
238
|
|
|
253
239
|
async function run() {
|
|
254
|
-
const res = await modelsGetModelsUser(openRouter
|
|
240
|
+
const res = await modelsGetModelsUser(openRouter, {
|
|
241
|
+
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
242
|
+
});
|
|
255
243
|
if (res.ok) {
|
|
256
244
|
const { value: result } = res;
|
|
257
245
|
console.log(result);
|
|
@@ -294,6 +282,7 @@ import {
|
|
|
294
282
|
|
|
295
283
|
| Parameter | Type | Required | Description |
|
|
296
284
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
285
|
+
| `security` | [operations.GetModelsUserSecurity](../../models/operations/getmodelsusersecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
|
|
297
286
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
298
287
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
299
288
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# OAuth
|
|
2
|
+
(*oAuth*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [postAuthKeys](#postauthkeys) - Exchange authorization code for API key
|
|
9
|
+
* [postAuthKeysCode](#postauthkeyscode) - Create authorization code
|
|
10
|
+
|
|
11
|
+
## postAuthKeys
|
|
12
|
+
|
|
13
|
+
Exchange an authorization code from the PKCE flow for a user-controlled API key
|
|
14
|
+
|
|
15
|
+
### Example Usage
|
|
16
|
+
|
|
17
|
+
<!-- UsageSnippet language="typescript" operationID="post_/auth/keys" method="post" path="/auth/keys" -->
|
|
18
|
+
```typescript
|
|
19
|
+
import { OpenRouter } from "@openrouter/sdk";
|
|
20
|
+
|
|
21
|
+
const openRouter = new OpenRouter({
|
|
22
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
async function run() {
|
|
26
|
+
const result = await openRouter.oAuth.postAuthKeys({
|
|
27
|
+
code: "auth_code_abc123def456",
|
|
28
|
+
codeVerifier: "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
|
|
29
|
+
codeChallengeMethod: "S256",
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
console.log(result);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
run();
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Standalone function
|
|
39
|
+
|
|
40
|
+
The standalone function version of this method:
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
44
|
+
import { oAuthPostAuthKeys } from "@openrouter/sdk/funcs/oAuthPostAuthKeys.js";
|
|
45
|
+
|
|
46
|
+
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
47
|
+
// You can create one instance of it to use across an application.
|
|
48
|
+
const openRouter = new OpenRouterCore({
|
|
49
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
async function run() {
|
|
53
|
+
const res = await oAuthPostAuthKeys(openRouter, {
|
|
54
|
+
code: "auth_code_abc123def456",
|
|
55
|
+
codeVerifier: "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
|
|
56
|
+
codeChallengeMethod: "S256",
|
|
57
|
+
});
|
|
58
|
+
if (res.ok) {
|
|
59
|
+
const { value: result } = res;
|
|
60
|
+
console.log(result);
|
|
61
|
+
} else {
|
|
62
|
+
console.log("oAuthPostAuthKeys failed:", res.error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
run();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### React hooks and utilities
|
|
70
|
+
|
|
71
|
+
This method can be used in React components through the following hooks and
|
|
72
|
+
associated utilities.
|
|
73
|
+
|
|
74
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
75
|
+
> below and how to get started using React hooks.
|
|
76
|
+
|
|
77
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import {
|
|
81
|
+
// Mutation hook for triggering the API call.
|
|
82
|
+
useOAuthPostAuthKeysMutation
|
|
83
|
+
} from "@openrouter/sdk/react-query/oAuthPostAuthKeys.js";
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Parameters
|
|
87
|
+
|
|
88
|
+
| Parameter | Type | Required | Description |
|
|
89
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
90
|
+
| `request` | [operations.PostAuthKeysRequest](../../models/operations/postauthkeysrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
91
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
92
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
93
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
94
|
+
|
|
95
|
+
### Response
|
|
96
|
+
|
|
97
|
+
**Promise\<[operations.PostAuthKeysResponse](../../models/operations/postauthkeysresponse.md)\>**
|
|
98
|
+
|
|
99
|
+
### Errors
|
|
100
|
+
|
|
101
|
+
| Error Type | Status Code | Content Type |
|
|
102
|
+
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
103
|
+
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
104
|
+
|
|
105
|
+
## postAuthKeysCode
|
|
106
|
+
|
|
107
|
+
Create an authorization code for the PKCE flow to generate a user-controlled API key
|
|
108
|
+
|
|
109
|
+
### Example Usage
|
|
110
|
+
|
|
111
|
+
<!-- UsageSnippet language="typescript" operationID="post_/auth/keys/code" method="post" path="/auth/keys/code" -->
|
|
112
|
+
```typescript
|
|
113
|
+
import { OpenRouter } from "@openrouter/sdk";
|
|
114
|
+
|
|
115
|
+
const openRouter = new OpenRouter({
|
|
116
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
async function run() {
|
|
120
|
+
const result = await openRouter.oAuth.postAuthKeysCode({
|
|
121
|
+
callbackUrl: "https://myapp.com/auth/callback",
|
|
122
|
+
codeChallenge: "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
|
|
123
|
+
codeChallengeMethod: "S256",
|
|
124
|
+
limit: "100.0",
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
console.log(result);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
run();
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Standalone function
|
|
134
|
+
|
|
135
|
+
The standalone function version of this method:
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
139
|
+
import { oAuthPostAuthKeysCode } from "@openrouter/sdk/funcs/oAuthPostAuthKeysCode.js";
|
|
140
|
+
|
|
141
|
+
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
142
|
+
// You can create one instance of it to use across an application.
|
|
143
|
+
const openRouter = new OpenRouterCore({
|
|
144
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
async function run() {
|
|
148
|
+
const res = await oAuthPostAuthKeysCode(openRouter, {
|
|
149
|
+
callbackUrl: "https://myapp.com/auth/callback",
|
|
150
|
+
codeChallenge: "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
|
|
151
|
+
codeChallengeMethod: "S256",
|
|
152
|
+
limit: "100.0",
|
|
153
|
+
});
|
|
154
|
+
if (res.ok) {
|
|
155
|
+
const { value: result } = res;
|
|
156
|
+
console.log(result);
|
|
157
|
+
} else {
|
|
158
|
+
console.log("oAuthPostAuthKeysCode failed:", res.error);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
run();
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### React hooks and utilities
|
|
166
|
+
|
|
167
|
+
This method can be used in React components through the following hooks and
|
|
168
|
+
associated utilities.
|
|
169
|
+
|
|
170
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
171
|
+
> below and how to get started using React hooks.
|
|
172
|
+
|
|
173
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
import {
|
|
177
|
+
// Mutation hook for triggering the API call.
|
|
178
|
+
useOAuthPostAuthKeysCodeMutation
|
|
179
|
+
} from "@openrouter/sdk/react-query/oAuthPostAuthKeysCode.js";
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Parameters
|
|
183
|
+
|
|
184
|
+
| Parameter | Type | Required | Description |
|
|
185
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
186
|
+
| `request` | [operations.PostAuthKeysCodeRequest](../../models/operations/postauthkeyscoderequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
187
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
188
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
189
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
190
|
+
|
|
191
|
+
### Response
|
|
192
|
+
|
|
193
|
+
**Promise\<[operations.PostAuthKeysCodeResponse](../../models/operations/postauthkeyscoderesponse.md)\>**
|
|
194
|
+
|
|
195
|
+
### Errors
|
|
196
|
+
|
|
197
|
+
| Error Type | Status Code | Content Type |
|
|
198
|
+
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
199
|
+
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|