@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
|
@@ -8,7 +8,7 @@ import * as M from "../lib/matchers.js";
|
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import {
|
|
11
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
13
13
|
import {
|
|
14
14
|
ConnectionError,
|
|
@@ -27,8 +27,9 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
/**
|
|
28
28
|
* Create a Coinbase charge for crypto payment
|
|
29
29
|
*/
|
|
30
|
-
export function
|
|
30
|
+
export function creditsPostCreditsCoinbase(
|
|
31
31
|
client: OpenRouterCore,
|
|
32
|
+
security: operations.PostCreditsCoinbaseSecurity,
|
|
32
33
|
request?: operations.PostCreditsCoinbaseRequest | undefined,
|
|
33
34
|
options?: RequestOptions,
|
|
34
35
|
): APIPromise<
|
|
@@ -46,6 +47,7 @@ export function postCreditsCoinbase(
|
|
|
46
47
|
> {
|
|
47
48
|
return new APIPromise($do(
|
|
48
49
|
client,
|
|
50
|
+
security,
|
|
49
51
|
request,
|
|
50
52
|
options,
|
|
51
53
|
));
|
|
@@ -53,6 +55,7 @@ export function postCreditsCoinbase(
|
|
|
53
55
|
|
|
54
56
|
async function $do(
|
|
55
57
|
client: OpenRouterCore,
|
|
58
|
+
security: operations.PostCreditsCoinbaseSecurity,
|
|
56
59
|
request?: operations.PostCreditsCoinbaseRequest | undefined,
|
|
57
60
|
options?: RequestOptions,
|
|
58
61
|
): Promise<
|
|
@@ -94,18 +97,25 @@ async function $do(
|
|
|
94
97
|
Accept: "application/json",
|
|
95
98
|
}));
|
|
96
99
|
|
|
97
|
-
const
|
|
98
|
-
|
|
100
|
+
const requestSecurity = resolveSecurity(
|
|
101
|
+
[
|
|
102
|
+
{
|
|
103
|
+
fieldName: "Authorization",
|
|
104
|
+
type: "apiKey:header",
|
|
105
|
+
value: security?.bearer,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
);
|
|
99
109
|
|
|
100
110
|
const context = {
|
|
101
111
|
options: client._options,
|
|
102
112
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
103
113
|
operationID: "post_/credits/coinbase",
|
|
104
|
-
oAuth2Scopes:
|
|
114
|
+
oAuth2Scopes: null,
|
|
105
115
|
|
|
106
116
|
resolvedSecurity: requestSecurity,
|
|
107
117
|
|
|
108
|
-
securitySource:
|
|
118
|
+
securitySource: security,
|
|
109
119
|
retryConfig: options?.retries
|
|
110
120
|
|| client._options.retryConfig
|
|
111
121
|
|| { strategy: "none" },
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* @remarks
|
|
31
31
|
* Submits an embedding request to the embeddings router
|
|
32
32
|
*/
|
|
33
|
-
export function
|
|
33
|
+
export function embeddingsGenerate(
|
|
34
34
|
client: OpenRouterCore,
|
|
35
35
|
request?: operations.PostEmbeddingsRequest | undefined,
|
|
36
36
|
options?: RequestOptions,
|
|
@@ -95,7 +95,8 @@ async function $do(
|
|
|
95
95
|
Accept: "application/json",
|
|
96
96
|
}));
|
|
97
97
|
|
|
98
|
-
const
|
|
98
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
99
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
99
100
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
100
101
|
|
|
101
102
|
const context = {
|
|
@@ -106,7 +107,7 @@ async function $do(
|
|
|
106
107
|
|
|
107
108
|
resolvedSecurity: requestSecurity,
|
|
108
109
|
|
|
109
|
-
securitySource: client._options.
|
|
110
|
+
securitySource: client._options.apiKey,
|
|
110
111
|
retryConfig: options?.retries
|
|
111
112
|
|| client._options.retryConfig
|
|
112
113
|
|| { strategy: "none" },
|
|
@@ -72,7 +72,8 @@ async function $do(
|
|
|
72
72
|
Accept: "application/json",
|
|
73
73
|
}));
|
|
74
74
|
|
|
75
|
-
const
|
|
75
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
76
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
76
77
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
77
78
|
|
|
78
79
|
const context = {
|
|
@@ -83,7 +84,7 @@ async function $do(
|
|
|
83
84
|
|
|
84
85
|
resolvedSecurity: requestSecurity,
|
|
85
86
|
|
|
86
|
-
securitySource: client._options.
|
|
87
|
+
securitySource: client._options.apiKey,
|
|
87
88
|
retryConfig: options?.retries
|
|
88
89
|
|| client._options.retryConfig
|
|
89
90
|
|| { strategy: "none" },
|
|
@@ -101,7 +101,8 @@ async function $do(
|
|
|
101
101
|
Accept: "application/json",
|
|
102
102
|
}));
|
|
103
103
|
|
|
104
|
-
const
|
|
104
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
105
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
105
106
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
106
107
|
|
|
107
108
|
const context = {
|
|
@@ -112,7 +113,7 @@ async function $do(
|
|
|
112
113
|
|
|
113
114
|
resolvedSecurity: requestSecurity,
|
|
114
115
|
|
|
115
|
-
securitySource: client._options.
|
|
116
|
+
securitySource: client._options.apiKey,
|
|
116
117
|
retryConfig: options?.retries
|
|
117
118
|
|| client._options.retryConfig
|
|
118
119
|
|| { strategy: "none" },
|
|
@@ -92,7 +92,8 @@ async function $do(
|
|
|
92
92
|
Accept: "application/json",
|
|
93
93
|
}));
|
|
94
94
|
|
|
95
|
-
const
|
|
95
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
96
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
96
97
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
97
98
|
|
|
98
99
|
const context = {
|
|
@@ -103,7 +104,7 @@ async function $do(
|
|
|
103
104
|
|
|
104
105
|
resolvedSecurity: requestSecurity,
|
|
105
106
|
|
|
106
|
-
securitySource: client._options.
|
|
107
|
+
securitySource: client._options.apiKey,
|
|
107
108
|
retryConfig: options?.retries
|
|
108
109
|
|| client._options.retryConfig
|
|
109
110
|
|| { strategy: "none" },
|
package/src/funcs/getCredits.ts
CHANGED
|
@@ -72,7 +72,8 @@ async function $do(
|
|
|
72
72
|
Accept: "application/json",
|
|
73
73
|
}));
|
|
74
74
|
|
|
75
|
-
const
|
|
75
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
76
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
76
77
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
77
78
|
|
|
78
79
|
const context = {
|
|
@@ -83,7 +84,7 @@ async function $do(
|
|
|
83
84
|
|
|
84
85
|
resolvedSecurity: requestSecurity,
|
|
85
86
|
|
|
86
|
-
securitySource: client._options.
|
|
87
|
+
securitySource: client._options.apiKey,
|
|
87
88
|
retryConfig: options?.retries
|
|
88
89
|
|| client._options.retryConfig
|
|
89
90
|
|| { strategy: "none" },
|
|
@@ -8,7 +8,7 @@ import * as M from "../lib/matchers.js";
|
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import {
|
|
11
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
13
13
|
import {
|
|
14
14
|
ConnectionError,
|
|
@@ -27,8 +27,9 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
/**
|
|
28
28
|
* Get a model's supported parameters and data about which are most popular
|
|
29
29
|
*/
|
|
30
|
-
export function
|
|
30
|
+
export function modelGetParametersAuthorSlug(
|
|
31
31
|
client: OpenRouterCore,
|
|
32
|
+
security: operations.GetParametersAuthorSlugSecurity,
|
|
32
33
|
request: operations.GetParametersAuthorSlugRequest,
|
|
33
34
|
options?: RequestOptions,
|
|
34
35
|
): APIPromise<
|
|
@@ -46,6 +47,7 @@ export function parametersGetParametersAuthorSlug(
|
|
|
46
47
|
> {
|
|
47
48
|
return new APIPromise($do(
|
|
48
49
|
client,
|
|
50
|
+
security,
|
|
49
51
|
request,
|
|
50
52
|
options,
|
|
51
53
|
));
|
|
@@ -53,6 +55,7 @@ export function parametersGetParametersAuthorSlug(
|
|
|
53
55
|
|
|
54
56
|
async function $do(
|
|
55
57
|
client: OpenRouterCore,
|
|
58
|
+
security: operations.GetParametersAuthorSlugSecurity,
|
|
56
59
|
request: operations.GetParametersAuthorSlugRequest,
|
|
57
60
|
options?: RequestOptions,
|
|
58
61
|
): Promise<
|
|
@@ -104,18 +107,25 @@ async function $do(
|
|
|
104
107
|
Accept: "application/json",
|
|
105
108
|
}));
|
|
106
109
|
|
|
107
|
-
const
|
|
108
|
-
|
|
110
|
+
const requestSecurity = resolveSecurity(
|
|
111
|
+
[
|
|
112
|
+
{
|
|
113
|
+
fieldName: "Authorization",
|
|
114
|
+
type: "apiKey:header",
|
|
115
|
+
value: security?.bearer,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
);
|
|
109
119
|
|
|
110
120
|
const context = {
|
|
111
121
|
options: client._options,
|
|
112
122
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
123
|
operationID: "get_/parameters/{author}/{slug}",
|
|
114
|
-
oAuth2Scopes:
|
|
124
|
+
oAuth2Scopes: null,
|
|
115
125
|
|
|
116
126
|
resolvedSecurity: requestSecurity,
|
|
117
127
|
|
|
118
|
-
securitySource:
|
|
128
|
+
securitySource: security,
|
|
119
129
|
retryConfig: options?.retries
|
|
120
130
|
|| client._options.retryConfig
|
|
121
131
|
|| { strategy: "none" },
|
|
@@ -102,7 +102,8 @@ async function $do(
|
|
|
102
102
|
|| "application/json;q=1, application/rss+xml;q=0",
|
|
103
103
|
}));
|
|
104
104
|
|
|
105
|
-
const
|
|
105
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
106
107
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
108
|
|
|
108
109
|
const context = {
|
|
@@ -113,7 +114,7 @@ async function $do(
|
|
|
113
114
|
|
|
114
115
|
resolvedSecurity: requestSecurity,
|
|
115
116
|
|
|
116
|
-
securitySource: client._options.
|
|
117
|
+
securitySource: client._options.apiKey,
|
|
117
118
|
retryConfig: options?.retries
|
|
118
119
|
|| client._options.retryConfig
|
|
119
120
|
|| { strategy: "none" },
|
|
@@ -72,7 +72,8 @@ async function $do(
|
|
|
72
72
|
Accept: "application/json",
|
|
73
73
|
}));
|
|
74
74
|
|
|
75
|
-
const
|
|
75
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
76
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
76
77
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
77
78
|
|
|
78
79
|
const context = {
|
|
@@ -83,7 +84,7 @@ async function $do(
|
|
|
83
84
|
|
|
84
85
|
resolvedSecurity: requestSecurity,
|
|
85
86
|
|
|
86
|
-
securitySource: client._options.
|
|
87
|
+
securitySource: client._options.apiKey,
|
|
87
88
|
retryConfig: options?.retries
|
|
88
89
|
|| client._options.retryConfig
|
|
89
90
|
|| { strategy: "none" },
|
|
@@ -6,7 +6,7 @@ import { OpenRouterCore } from "../core.js";
|
|
|
6
6
|
import * as M from "../lib/matchers.js";
|
|
7
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
8
|
import { RequestOptions } from "../lib/sdks.js";
|
|
9
|
-
import {
|
|
9
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
10
10
|
import { pathToFunc } from "../lib/url.js";
|
|
11
11
|
import {
|
|
12
12
|
ConnectionError,
|
|
@@ -27,6 +27,7 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
*/
|
|
28
28
|
export function modelsGetModelsUser(
|
|
29
29
|
client: OpenRouterCore,
|
|
30
|
+
security: operations.GetModelsUserSecurity,
|
|
30
31
|
options?: RequestOptions,
|
|
31
32
|
): APIPromise<
|
|
32
33
|
Result<
|
|
@@ -43,12 +44,14 @@ export function modelsGetModelsUser(
|
|
|
43
44
|
> {
|
|
44
45
|
return new APIPromise($do(
|
|
45
46
|
client,
|
|
47
|
+
security,
|
|
46
48
|
options,
|
|
47
49
|
));
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
async function $do(
|
|
51
53
|
client: OpenRouterCore,
|
|
54
|
+
security: operations.GetModelsUserSecurity,
|
|
52
55
|
options?: RequestOptions,
|
|
53
56
|
): Promise<
|
|
54
57
|
[
|
|
@@ -72,18 +75,25 @@ async function $do(
|
|
|
72
75
|
Accept: "application/json",
|
|
73
76
|
}));
|
|
74
77
|
|
|
75
|
-
const
|
|
76
|
-
|
|
78
|
+
const requestSecurity = resolveSecurity(
|
|
79
|
+
[
|
|
80
|
+
{
|
|
81
|
+
fieldName: "Authorization",
|
|
82
|
+
type: "apiKey:header",
|
|
83
|
+
value: security?.bearer,
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
);
|
|
77
87
|
|
|
78
88
|
const context = {
|
|
79
89
|
options: client._options,
|
|
80
90
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
81
91
|
operationID: "get_/models/user",
|
|
82
|
-
oAuth2Scopes:
|
|
92
|
+
oAuth2Scopes: null,
|
|
83
93
|
|
|
84
94
|
resolvedSecurity: requestSecurity,
|
|
85
95
|
|
|
86
|
-
securitySource:
|
|
96
|
+
securitySource: security,
|
|
87
97
|
retryConfig: options?.retries
|
|
88
98
|
|| client._options.retryConfig
|
|
89
99
|
|| { strategy: "none" },
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OpenRouterCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Exchange authorization code for API key
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Exchange an authorization code from the PKCE flow for a user-controlled API key
|
|
32
|
+
*/
|
|
33
|
+
export function oAuthPostAuthKeys(
|
|
34
|
+
client: OpenRouterCore,
|
|
35
|
+
request?: operations.PostAuthKeysRequest | undefined,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.PostAuthKeysResponse,
|
|
40
|
+
| OpenRouterError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OpenRouterCore,
|
|
59
|
+
request?: operations.PostAuthKeysRequest | undefined,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.PostAuthKeysResponse,
|
|
65
|
+
| OpenRouterError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) =>
|
|
80
|
+
operations.PostAuthKeysRequest$outboundSchema.optional().parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = payload === undefined
|
|
88
|
+
? null
|
|
89
|
+
: encodeJSON("body", payload, { explode: true });
|
|
90
|
+
|
|
91
|
+
const path = pathToFunc("/auth/keys")();
|
|
92
|
+
|
|
93
|
+
const headers = new Headers(compactMap({
|
|
94
|
+
"Content-Type": "application/json",
|
|
95
|
+
Accept: "application/json",
|
|
96
|
+
}));
|
|
97
|
+
|
|
98
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
99
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
100
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
101
|
+
|
|
102
|
+
const context = {
|
|
103
|
+
options: client._options,
|
|
104
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
105
|
+
operationID: "post_/auth/keys",
|
|
106
|
+
oAuth2Scopes: [],
|
|
107
|
+
|
|
108
|
+
resolvedSecurity: requestSecurity,
|
|
109
|
+
|
|
110
|
+
securitySource: client._options.apiKey,
|
|
111
|
+
retryConfig: options?.retries
|
|
112
|
+
|| client._options.retryConfig
|
|
113
|
+
|| { strategy: "none" },
|
|
114
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const requestRes = client._createRequest(context, {
|
|
118
|
+
security: requestSecurity,
|
|
119
|
+
method: "POST",
|
|
120
|
+
baseURL: options?.serverURL,
|
|
121
|
+
path: path,
|
|
122
|
+
headers: headers,
|
|
123
|
+
body: body,
|
|
124
|
+
userAgent: client._options.userAgent,
|
|
125
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
126
|
+
}, options);
|
|
127
|
+
if (!requestRes.ok) {
|
|
128
|
+
return [requestRes, { status: "invalid" }];
|
|
129
|
+
}
|
|
130
|
+
const req = requestRes.value;
|
|
131
|
+
|
|
132
|
+
const doResult = await client._do(req, {
|
|
133
|
+
context,
|
|
134
|
+
errorCodes: ["4XX", "5XX"],
|
|
135
|
+
retryConfig: context.retryConfig,
|
|
136
|
+
retryCodes: context.retryCodes,
|
|
137
|
+
});
|
|
138
|
+
if (!doResult.ok) {
|
|
139
|
+
return [doResult, { status: "request-error", request: req }];
|
|
140
|
+
}
|
|
141
|
+
const response = doResult.value;
|
|
142
|
+
|
|
143
|
+
const [result] = await M.match<
|
|
144
|
+
operations.PostAuthKeysResponse,
|
|
145
|
+
| OpenRouterError
|
|
146
|
+
| ResponseValidationError
|
|
147
|
+
| ConnectionError
|
|
148
|
+
| RequestAbortedError
|
|
149
|
+
| RequestTimeoutError
|
|
150
|
+
| InvalidRequestError
|
|
151
|
+
| UnexpectedClientError
|
|
152
|
+
| SDKValidationError
|
|
153
|
+
>(
|
|
154
|
+
M.json(200, operations.PostAuthKeysResponse$inboundSchema),
|
|
155
|
+
M.fail("4XX"),
|
|
156
|
+
M.fail("5XX"),
|
|
157
|
+
M.json("default", operations.PostAuthKeysResponse$inboundSchema),
|
|
158
|
+
)(response, req);
|
|
159
|
+
if (!result.ok) {
|
|
160
|
+
return [result, { status: "complete", request: req, response }];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return [result, { status: "complete", request: req, response }];
|
|
164
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OpenRouterCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
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 oAuthPostAuthKeysCode(
|
|
34
|
+
client: OpenRouterCore,
|
|
35
|
+
request?: operations.PostAuthKeysCodeRequest | undefined,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.PostAuthKeysCodeResponse,
|
|
40
|
+
| OpenRouterError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OpenRouterCore,
|
|
59
|
+
request?: operations.PostAuthKeysCodeRequest | undefined,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.PostAuthKeysCodeResponse,
|
|
65
|
+
| OpenRouterError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) =>
|
|
80
|
+
operations.PostAuthKeysCodeRequest$outboundSchema.optional().parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = payload === undefined
|
|
88
|
+
? null
|
|
89
|
+
: encodeJSON("body", payload, { explode: true });
|
|
90
|
+
|
|
91
|
+
const path = pathToFunc("/auth/keys/code")();
|
|
92
|
+
|
|
93
|
+
const headers = new Headers(compactMap({
|
|
94
|
+
"Content-Type": "application/json",
|
|
95
|
+
Accept: "application/json",
|
|
96
|
+
}));
|
|
97
|
+
|
|
98
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
99
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
100
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
101
|
+
|
|
102
|
+
const context = {
|
|
103
|
+
options: client._options,
|
|
104
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
105
|
+
operationID: "post_/auth/keys/code",
|
|
106
|
+
oAuth2Scopes: [],
|
|
107
|
+
|
|
108
|
+
resolvedSecurity: requestSecurity,
|
|
109
|
+
|
|
110
|
+
securitySource: client._options.apiKey,
|
|
111
|
+
retryConfig: options?.retries
|
|
112
|
+
|| client._options.retryConfig
|
|
113
|
+
|| { strategy: "none" },
|
|
114
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const requestRes = client._createRequest(context, {
|
|
118
|
+
security: requestSecurity,
|
|
119
|
+
method: "POST",
|
|
120
|
+
baseURL: options?.serverURL,
|
|
121
|
+
path: path,
|
|
122
|
+
headers: headers,
|
|
123
|
+
body: body,
|
|
124
|
+
userAgent: client._options.userAgent,
|
|
125
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
126
|
+
}, options);
|
|
127
|
+
if (!requestRes.ok) {
|
|
128
|
+
return [requestRes, { status: "invalid" }];
|
|
129
|
+
}
|
|
130
|
+
const req = requestRes.value;
|
|
131
|
+
|
|
132
|
+
const doResult = await client._do(req, {
|
|
133
|
+
context,
|
|
134
|
+
errorCodes: ["4XX", "5XX"],
|
|
135
|
+
retryConfig: context.retryConfig,
|
|
136
|
+
retryCodes: context.retryCodes,
|
|
137
|
+
});
|
|
138
|
+
if (!doResult.ok) {
|
|
139
|
+
return [doResult, { status: "request-error", request: req }];
|
|
140
|
+
}
|
|
141
|
+
const response = doResult.value;
|
|
142
|
+
|
|
143
|
+
const [result] = await M.match<
|
|
144
|
+
operations.PostAuthKeysCodeResponse,
|
|
145
|
+
| OpenRouterError
|
|
146
|
+
| ResponseValidationError
|
|
147
|
+
| ConnectionError
|
|
148
|
+
| RequestAbortedError
|
|
149
|
+
| RequestTimeoutError
|
|
150
|
+
| InvalidRequestError
|
|
151
|
+
| UnexpectedClientError
|
|
152
|
+
| SDKValidationError
|
|
153
|
+
>(
|
|
154
|
+
M.json(200, operations.PostAuthKeysCodeResponse$inboundSchema),
|
|
155
|
+
M.fail("4XX"),
|
|
156
|
+
M.fail("5XX"),
|
|
157
|
+
M.json("default", operations.PostAuthKeysCodeResponse$inboundSchema),
|
|
158
|
+
)(response, req);
|
|
159
|
+
if (!result.ok) {
|
|
160
|
+
return [result, { status: "complete", request: req, response }];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return [result, { status: "complete", request: req, response }];
|
|
164
|
+
}
|