@openrouter/sdk 0.0.0-beta.5 → 0.0.0-beta.7
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 +3 -1
- package/REACT_QUERY.md +14 -10
- package/README.md +44 -66
- package/dist/commonjs/funcs/analyticsGetActivity.js +2 -3
- package/dist/commonjs/funcs/analyticsGetActivity.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js +2 -3
- package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetAuthKey.js +2 -3
- package/dist/commonjs/funcs/apiKeysGetAuthKey.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKey.js +2 -3
- package/dist/commonjs/funcs/apiKeysGetKey.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKeys.js +2 -3
- package/dist/commonjs/funcs/apiKeysGetKeys.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKeysHash.js +2 -3
- package/dist/commonjs/funcs/apiKeysGetKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysPatchKeysHash.js +2 -3
- package/dist/commonjs/funcs/apiKeysPatchKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysPostKeys.js +2 -3
- package/dist/commonjs/funcs/apiKeysPostKeys.js.map +1 -1
- package/dist/commonjs/funcs/{chatSend.d.ts → chatGenerateResponse.d.ts} +6 -6
- package/dist/commonjs/funcs/chatGenerateResponse.d.ts.map +1 -0
- package/dist/commonjs/funcs/{chatSend.js → chatGenerateResponse.js} +13 -14
- package/dist/commonjs/funcs/chatGenerateResponse.js.map +1 -0
- package/dist/{esm/funcs/embeddingsGenerate.d.ts → commonjs/funcs/embeddingsPostEmbeddings.d.ts} +2 -2
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.d.ts.map +1 -0
- package/dist/commonjs/funcs/{embeddingsGenerate.js → embeddingsPostEmbeddings.js} +5 -6
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.js.map +1 -0
- package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js +2 -3
- package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js.map +1 -1
- package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js +2 -3
- package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
- package/dist/commonjs/funcs/generationsGetGeneration.js +2 -3
- package/dist/commonjs/funcs/generationsGetGeneration.js.map +1 -1
- package/dist/commonjs/funcs/getCredits.js +2 -3
- package/dist/commonjs/funcs/getCredits.js.map +1 -1
- package/dist/{esm/funcs/providersGetProviders.d.ts → commonjs/funcs/getProviders.d.ts} +2 -5
- package/dist/commonjs/funcs/getProviders.d.ts.map +1 -0
- package/dist/commonjs/funcs/{providersGetProviders.js → getProviders.js} +5 -9
- package/dist/commonjs/funcs/getProviders.js.map +1 -0
- package/dist/commonjs/funcs/modelsGetModels.js +2 -3
- package/dist/commonjs/funcs/modelsGetModels.js.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsCount.js +2 -3
- 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 +7 -12
- package/dist/commonjs/funcs/modelsGetModelsUser.js.map +1 -1
- package/dist/{esm/funcs/modelGetParametersAuthorSlug.d.ts → commonjs/funcs/parametersGetParametersAuthorSlug.d.ts} +2 -2
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/commonjs/funcs/{modelGetParametersAuthorSlug.js → parametersGetParametersAuthorSlug.js} +9 -14
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.js.map +1 -0
- package/dist/{esm/funcs/creditsPostCreditsCoinbase.d.ts → commonjs/funcs/postCreditsCoinbase.d.ts} +2 -2
- package/dist/commonjs/funcs/postCreditsCoinbase.d.ts.map +1 -0
- package/dist/commonjs/funcs/{creditsPostCreditsCoinbase.js → postCreditsCoinbase.js} +9 -14
- package/dist/commonjs/funcs/postCreditsCoinbase.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +8 -4
- 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 +2 -1
- package/dist/commonjs/lib/env.d.ts.map +1 -1
- package/dist/commonjs/lib/env.js +2 -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 +7 -1
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/chatcompletion.d.ts +43 -0
- package/dist/commonjs/models/chatcompletion.d.ts.map +1 -0
- package/dist/commonjs/models/{chatresponse.js → chatcompletion.js} +22 -22
- package/dist/commonjs/models/chatcompletion.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchoice.d.ts +72 -0
- package/dist/commonjs/models/chatcompletionchoice.d.ts.map +1 -0
- package/dist/commonjs/models/{chatstreamingchoice.js → chatcompletionchoice.js} +32 -32
- package/dist/commonjs/models/chatcompletionchoice.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchunk.d.ts +68 -0
- package/dist/commonjs/models/chatcompletionchunk.d.ts.map +1 -0
- package/dist/commonjs/models/{chatstreamingresponsechunk.js → chatcompletionchunk.js} +22 -55
- package/dist/commonjs/models/chatcompletionchunk.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoice.d.ts +72 -0
- package/dist/commonjs/models/chatcompletionchunkchoice.d.ts.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoice.js +108 -0
- package/dist/commonjs/models/chatcompletionchunkchoice.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedelta.d.ts +61 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedelta.d.ts.map +1 -0
- package/dist/commonjs/models/{chatstreamingmessagechunk.js → chatcompletionchunkchoicedelta.js} +22 -20
- package/dist/commonjs/models/chatcompletionchunkchoicedelta.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedeltatoolcall.d.ts +62 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedeltatoolcall.d.ts.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedeltatoolcall.js +104 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedeltatoolcall.js.map +1 -0
- package/dist/commonjs/models/chatcompletionerror.d.ts +35 -0
- package/dist/commonjs/models/chatcompletionerror.d.ts.map +1 -0
- package/dist/commonjs/models/chatcompletionerror.js +75 -0
- package/dist/commonjs/models/chatcompletionerror.js.map +1 -0
- package/dist/commonjs/models/chatcompletionmessage.d.ts +62 -0
- package/dist/commonjs/models/chatcompletionmessage.d.ts.map +1 -0
- package/dist/commonjs/models/chatcompletionmessage.js +113 -0
- package/dist/commonjs/models/chatcompletionmessage.js.map +1 -0
- 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 +13 -14
- package/dist/commonjs/models/errorresponse.js.map +1 -1
- package/dist/commonjs/models/errors/chatcompletionerror.d.ts +37 -0
- package/dist/commonjs/models/errors/chatcompletionerror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/{chaterror.js → chatcompletionerror.js} +17 -17
- package/dist/commonjs/models/errors/chatcompletionerror.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +1 -1
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -1
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +9 -8
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +9 -8
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/message.d.ts +19 -54
- package/dist/commonjs/models/message.d.ts.map +1 -1
- package/dist/commonjs/models/message.js +22 -73
- package/dist/commonjs/models/message.js.map +1 -1
- package/dist/commonjs/models/operations/getmodelsuser.d.ts +0 -25
- package/dist/commonjs/models/operations/getmodelsuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getmodelsuser.js +2 -29
- package/dist/commonjs/models/operations/getmodelsuser.js.map +1 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.d.ts +0 -25
- package/dist/commonjs/models/operations/getparametersauthorslug.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.js +1 -28
- package/dist/commonjs/models/operations/getparametersauthorslug.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +0 -2
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +0 -2
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/postchatcompletions.d.ts +3 -3
- package/dist/commonjs/models/operations/postchatcompletions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postchatcompletions.js +3 -3
- package/dist/commonjs/models/operations/postchatcompletions.js.map +1 -1
- package/dist/commonjs/models/operations/postcreditscoinbase.d.ts +0 -25
- package/dist/commonjs/models/operations/postcreditscoinbase.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postcreditscoinbase.js +1 -28
- package/dist/commonjs/models/operations/postcreditscoinbase.js.map +1 -1
- package/dist/commonjs/models/security.d.ts +4 -2
- package/dist/commonjs/models/security.d.ts.map +1 -1
- package/dist/commonjs/models/security.js +4 -2
- package/dist/commonjs/models/security.js.map +1 -1
- package/dist/commonjs/models/toolmessage.d.ts +55 -0
- package/dist/commonjs/models/toolmessage.d.ts.map +1 -0
- package/dist/commonjs/models/{toolresponsemessage.js → toolmessage.js} +32 -32
- package/dist/commonjs/models/toolmessage.js.map +1 -0
- package/dist/commonjs/react-query/chatGenerateResponse.d.ts +28 -0
- package/dist/commonjs/react-query/chatGenerateResponse.d.ts.map +1 -0
- package/dist/commonjs/react-query/chatGenerateResponse.js +50 -0
- package/dist/commonjs/react-query/chatGenerateResponse.js.map +1 -0
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.d.ts +23 -0
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.d.ts.map +1 -0
- package/dist/commonjs/react-query/{embeddingsGenerate.js → embeddingsPostEmbeddings.js} +13 -13
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.js.map +1 -0
- package/dist/commonjs/react-query/getProviders.d.ts +17 -0
- package/dist/commonjs/react-query/getProviders.d.ts.map +1 -0
- package/dist/commonjs/react-query/getProviders.js +63 -0
- package/dist/commonjs/react-query/getProviders.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +5 -7
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +5 -7
- package/dist/commonjs/react-query/index.js.map +1 -1
- 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/parametersGetParametersAuthorSlug.d.ts +38 -0
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js +88 -0
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js.map +1 -0
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts +20 -0
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts.map +1 -0
- package/dist/commonjs/react-query/postCreditsCoinbase.js +44 -0
- package/dist/commonjs/react-query/postCreditsCoinbase.js.map +1 -0
- package/dist/commonjs/sdk/chat.d.ts +5 -5
- package/dist/commonjs/sdk/chat.d.ts.map +1 -1
- package/dist/commonjs/sdk/chat.js +7 -7
- package/dist/commonjs/sdk/chat.js.map +1 -1
- 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/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/parameters.d.ts +9 -0
- package/dist/commonjs/sdk/parameters.d.ts.map +1 -0
- package/dist/commonjs/sdk/parameters.js +19 -0
- package/dist/commonjs/sdk/parameters.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +8 -12
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +14 -15
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/analyticsGetActivity.js +2 -3
- package/dist/esm/funcs/analyticsGetActivity.js.map +1 -1
- package/dist/esm/funcs/apiKeysDeleteKeysHash.js +2 -3
- package/dist/esm/funcs/apiKeysDeleteKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetAuthKey.js +2 -3
- package/dist/esm/funcs/apiKeysGetAuthKey.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKey.js +2 -3
- package/dist/esm/funcs/apiKeysGetKey.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKeys.js +2 -3
- package/dist/esm/funcs/apiKeysGetKeys.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKeysHash.js +2 -3
- package/dist/esm/funcs/apiKeysGetKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysPatchKeysHash.js +2 -3
- package/dist/esm/funcs/apiKeysPatchKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysPostKeys.js +2 -3
- package/dist/esm/funcs/apiKeysPostKeys.js.map +1 -1
- package/dist/esm/funcs/{chatSend.d.ts → chatGenerateResponse.d.ts} +6 -6
- package/dist/esm/funcs/chatGenerateResponse.d.ts.map +1 -0
- package/dist/esm/funcs/{chatSend.js → chatGenerateResponse.js} +11 -12
- package/dist/esm/funcs/chatGenerateResponse.js.map +1 -0
- package/dist/{commonjs/funcs/embeddingsGenerate.d.ts → esm/funcs/embeddingsPostEmbeddings.d.ts} +2 -2
- package/dist/esm/funcs/embeddingsPostEmbeddings.d.ts.map +1 -0
- package/dist/esm/funcs/{embeddingsGenerate.js → embeddingsPostEmbeddings.js} +4 -5
- package/dist/esm/funcs/embeddingsPostEmbeddings.js.map +1 -0
- package/dist/esm/funcs/endpointsGetEndpointsZdr.js +2 -3
- package/dist/esm/funcs/endpointsGetEndpointsZdr.js.map +1 -1
- package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js +2 -3
- package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
- package/dist/esm/funcs/generationsGetGeneration.js +2 -3
- package/dist/esm/funcs/generationsGetGeneration.js.map +1 -1
- package/dist/esm/funcs/getCredits.js +2 -3
- package/dist/esm/funcs/getCredits.js.map +1 -1
- package/dist/{commonjs/funcs/providersGetProviders.d.ts → esm/funcs/getProviders.d.ts} +2 -5
- package/dist/esm/funcs/getProviders.d.ts.map +1 -0
- package/dist/esm/funcs/{providersGetProviders.js → getProviders.js} +4 -8
- package/dist/esm/funcs/getProviders.js.map +1 -0
- package/dist/esm/funcs/modelsGetModels.js +2 -3
- package/dist/esm/funcs/modelsGetModels.js.map +1 -1
- package/dist/esm/funcs/modelsGetModelsCount.js +2 -3
- 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 +8 -13
- package/dist/esm/funcs/modelsGetModelsUser.js.map +1 -1
- package/dist/{commonjs/funcs/modelGetParametersAuthorSlug.d.ts → esm/funcs/parametersGetParametersAuthorSlug.d.ts} +2 -2
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/esm/funcs/{modelGetParametersAuthorSlug.js → parametersGetParametersAuthorSlug.js} +9 -14
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.js.map +1 -0
- package/dist/{commonjs/funcs/creditsPostCreditsCoinbase.d.ts → esm/funcs/postCreditsCoinbase.d.ts} +2 -2
- package/dist/esm/funcs/postCreditsCoinbase.d.ts.map +1 -0
- package/dist/esm/funcs/{creditsPostCreditsCoinbase.js → postCreditsCoinbase.js} +9 -14
- package/dist/esm/funcs/postCreditsCoinbase.js.map +1 -0
- package/dist/esm/lib/config.d.ts +8 -4
- 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 +2 -1
- package/dist/esm/lib/env.d.ts.map +1 -1
- package/dist/esm/lib/env.js +2 -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 +7 -1
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/chatcompletion.d.ts +43 -0
- package/dist/esm/models/chatcompletion.d.ts.map +1 -0
- package/dist/esm/models/chatcompletion.js +54 -0
- package/dist/esm/models/chatcompletion.js.map +1 -0
- package/dist/esm/models/chatcompletionchoice.d.ts +72 -0
- package/dist/esm/models/chatcompletionchoice.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionchoice.js +70 -0
- package/dist/esm/models/chatcompletionchoice.js.map +1 -0
- package/dist/esm/models/chatcompletionchunk.d.ts +68 -0
- package/dist/esm/models/chatcompletionchunk.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionchunk.js +91 -0
- package/dist/esm/models/chatcompletionchunk.js.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoice.d.ts +72 -0
- package/dist/esm/models/chatcompletionchunkchoice.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoice.js +70 -0
- package/dist/esm/models/chatcompletionchunkchoice.js.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoicedelta.d.ts +61 -0
- package/dist/esm/models/chatcompletionchunkchoicedelta.d.ts.map +1 -0
- package/dist/esm/models/{chatstreamingmessagechunk.js → chatcompletionchunkchoicedelta.js} +19 -17
- package/dist/esm/models/chatcompletionchunkchoicedelta.js.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoicedeltatoolcall.d.ts +62 -0
- package/dist/esm/models/chatcompletionchunkchoicedeltatoolcall.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoicedeltatoolcall.js +64 -0
- package/dist/esm/models/chatcompletionchunkchoicedeltatoolcall.js.map +1 -0
- package/dist/esm/models/chatcompletionerror.d.ts +35 -0
- package/dist/esm/models/chatcompletionerror.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionerror.js +37 -0
- package/dist/esm/models/chatcompletionerror.js.map +1 -0
- package/dist/esm/models/chatcompletionmessage.d.ts +62 -0
- package/dist/esm/models/chatcompletionmessage.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionmessage.js +73 -0
- package/dist/esm/models/chatcompletionmessage.js.map +1 -0
- 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 +12 -13
- package/dist/esm/models/errorresponse.js.map +1 -1
- package/dist/esm/models/errors/chatcompletionerror.d.ts +37 -0
- package/dist/esm/models/errors/chatcompletionerror.d.ts.map +1 -0
- package/dist/esm/models/errors/chatcompletionerror.js +48 -0
- package/dist/esm/models/errors/chatcompletionerror.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +1 -1
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -1
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/index.d.ts +9 -8
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +9 -8
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/message.d.ts +19 -54
- package/dist/esm/models/message.d.ts.map +1 -1
- package/dist/esm/models/message.js +21 -68
- package/dist/esm/models/message.js.map +1 -1
- package/dist/esm/models/operations/getmodelsuser.d.ts +0 -25
- package/dist/esm/models/operations/getmodelsuser.d.ts.map +1 -1
- package/dist/esm/models/operations/getmodelsuser.js +0 -25
- package/dist/esm/models/operations/getmodelsuser.js.map +1 -1
- package/dist/esm/models/operations/getparametersauthorslug.d.ts +0 -25
- package/dist/esm/models/operations/getparametersauthorslug.d.ts.map +1 -1
- package/dist/esm/models/operations/getparametersauthorslug.js +0 -25
- package/dist/esm/models/operations/getparametersauthorslug.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +0 -2
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +0 -2
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/postchatcompletions.d.ts +3 -3
- package/dist/esm/models/operations/postchatcompletions.d.ts.map +1 -1
- package/dist/esm/models/operations/postchatcompletions.js +3 -3
- package/dist/esm/models/operations/postchatcompletions.js.map +1 -1
- package/dist/esm/models/operations/postcreditscoinbase.d.ts +0 -25
- package/dist/esm/models/operations/postcreditscoinbase.d.ts.map +1 -1
- package/dist/esm/models/operations/postcreditscoinbase.js +0 -25
- package/dist/esm/models/operations/postcreditscoinbase.js.map +1 -1
- package/dist/esm/models/security.d.ts +4 -2
- package/dist/esm/models/security.d.ts.map +1 -1
- package/dist/esm/models/security.js +4 -2
- package/dist/esm/models/security.js.map +1 -1
- package/dist/esm/models/toolmessage.d.ts +55 -0
- package/dist/esm/models/toolmessage.d.ts.map +1 -0
- package/dist/esm/models/toolmessage.js +69 -0
- package/dist/esm/models/toolmessage.js.map +1 -0
- package/dist/esm/react-query/chatGenerateResponse.d.ts +28 -0
- package/dist/esm/react-query/chatGenerateResponse.d.ts.map +1 -0
- package/dist/esm/react-query/chatGenerateResponse.js +43 -0
- package/dist/esm/react-query/chatGenerateResponse.js.map +1 -0
- package/dist/esm/react-query/embeddingsPostEmbeddings.d.ts +23 -0
- package/dist/esm/react-query/embeddingsPostEmbeddings.d.ts.map +1 -0
- package/dist/esm/react-query/{embeddingsGenerate.js → embeddingsPostEmbeddings.js} +10 -10
- package/dist/esm/react-query/embeddingsPostEmbeddings.js.map +1 -0
- package/dist/esm/react-query/getProviders.d.ts +17 -0
- package/dist/esm/react-query/getProviders.d.ts.map +1 -0
- package/dist/esm/react-query/getProviders.js +54 -0
- package/dist/esm/react-query/getProviders.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +5 -7
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +5 -7
- package/dist/esm/react-query/index.js.map +1 -1
- 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/parametersGetParametersAuthorSlug.d.ts +38 -0
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js +78 -0
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js.map +1 -0
- package/dist/esm/react-query/postCreditsCoinbase.d.ts +20 -0
- package/dist/esm/react-query/postCreditsCoinbase.d.ts.map +1 -0
- package/dist/esm/react-query/{creditsPostCreditsCoinbase.js → postCreditsCoinbase.js} +10 -10
- package/dist/esm/react-query/postCreditsCoinbase.js.map +1 -0
- package/dist/esm/sdk/chat.d.ts +5 -5
- package/dist/esm/sdk/chat.d.ts.map +1 -1
- package/dist/esm/sdk/chat.js +5 -5
- package/dist/esm/sdk/chat.js.map +1 -1
- 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/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/parameters.d.ts +9 -0
- package/dist/esm/sdk/parameters.d.ts.map +1 -0
- package/dist/esm/sdk/parameters.js +15 -0
- package/dist/esm/sdk/parameters.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +8 -12
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +14 -15
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/analytics/README.md +6 -2
- package/docs/sdks/apikeys/README.md +42 -14
- package/docs/sdks/chat/README.md +17 -13
- package/docs/sdks/embeddings/README.md +14 -10
- package/docs/sdks/endpoints/README.md +12 -4
- package/docs/sdks/generations/README.md +6 -2
- package/docs/sdks/models/README.md +24 -13
- package/docs/sdks/openrouter/README.md +196 -2
- package/docs/sdks/{model → parameters}/README.md +22 -19
- package/examples/getCredits.example.ts +3 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/analyticsGetActivity.ts +2 -3
- package/src/funcs/apiKeysDeleteKeysHash.ts +2 -3
- package/src/funcs/apiKeysGetAuthKey.ts +2 -3
- package/src/funcs/apiKeysGetKey.ts +2 -3
- package/src/funcs/apiKeysGetKeys.ts +2 -3
- package/src/funcs/apiKeysGetKeysHash.ts +2 -3
- package/src/funcs/apiKeysPatchKeysHash.ts +2 -3
- package/src/funcs/apiKeysPostKeys.ts +2 -3
- package/src/funcs/{chatSend.ts → chatGenerateResponse.ts} +16 -13
- package/src/funcs/{embeddingsGenerate.ts → embeddingsPostEmbeddings.ts} +3 -4
- package/src/funcs/endpointsGetEndpointsZdr.ts +2 -3
- package/src/funcs/endpointsGetModelsAuthorSlugEndpoints.ts +2 -3
- package/src/funcs/generationsGetGeneration.ts +2 -3
- package/src/funcs/getCredits.ts +2 -3
- package/src/funcs/{providersGetProviders.ts → getProviders.ts} +3 -7
- package/src/funcs/modelsGetModels.ts +2 -3
- package/src/funcs/modelsGetModelsCount.ts +2 -3
- package/src/funcs/modelsGetModelsUser.ts +5 -15
- package/src/funcs/{modelGetParametersAuthorSlug.ts → parametersGetParametersAuthorSlug.ts} +6 -16
- package/src/funcs/{creditsPostCreditsCoinbase.ts → postCreditsCoinbase.ts} +6 -16
- package/src/lib/config.ts +8 -4
- package/src/lib/env.ts +4 -2
- package/src/lib/security.ts +8 -1
- package/src/models/{chatresponse.ts → chatcompletion.ts} +34 -34
- package/src/models/chatcompletionchoice.ts +132 -0
- package/src/models/chatcompletionchunk.ts +169 -0
- package/src/models/chatcompletionchunkchoice.ts +139 -0
- package/src/models/{chatstreamingmessagechunk.ts → chatcompletionchunkchoicedelta.ts} +36 -30
- package/src/models/chatcompletionchunkchoicedeltatoolcall.ts +166 -0
- package/src/models/chatcompletionerror.ts +78 -0
- package/src/models/chatcompletionmessage.ts +167 -0
- package/src/models/errorresponse.ts +15 -14
- package/src/models/errors/chatcompletionerror.ts +79 -0
- package/src/models/errors/index.ts +1 -1
- package/src/models/index.ts +9 -8
- package/src/models/message.ts +49 -151
- package/src/models/operations/getmodelsuser.ts +0 -58
- package/src/models/operations/getparametersauthorslug.ts +0 -60
- package/src/models/operations/index.ts +0 -2
- package/src/models/operations/postchatcompletions.ts +6 -8
- package/src/models/operations/postcreditscoinbase.ts +0 -60
- package/src/models/security.ts +8 -4
- package/src/models/toolmessage.ts +140 -0
- package/src/react-query/{chatSend.ts → chatGenerateResponse.ts} +30 -20
- package/src/react-query/{embeddingsGenerate.ts → embeddingsPostEmbeddings.ts} +19 -18
- package/src/react-query/{providersGetProviders.ts → getProviders.ts} +27 -35
- package/src/react-query/index.ts +5 -7
- package/src/react-query/modelsGetModelsUser.ts +0 -8
- package/src/react-query/{modelGetParametersAuthorSlug.ts → parametersGetParametersAuthorSlug.ts} +34 -37
- package/src/react-query/{creditsPostCreditsCoinbase.ts → postCreditsCoinbase.ts} +18 -21
- package/src/sdk/chat.ts +11 -6
- package/src/sdk/embeddings.ts +3 -3
- package/src/sdk/models.ts +0 -2
- package/src/sdk/{model.ts → parameters.ts} +3 -5
- package/src/sdk/sdk.ts +29 -22
- package/dist/commonjs/funcs/chatSend.d.ts.map +0 -1
- package/dist/commonjs/funcs/chatSend.js.map +0 -1
- package/dist/commonjs/funcs/creditsPostCreditsCoinbase.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditsPostCreditsCoinbase.js.map +0 -1
- package/dist/commonjs/funcs/embeddingsGenerate.d.ts.map +0 -1
- package/dist/commonjs/funcs/embeddingsGenerate.js.map +0 -1
- package/dist/commonjs/funcs/modelGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/commonjs/funcs/modelGetParametersAuthorSlug.js.map +0 -1
- package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts +0 -17
- package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts.map +0 -1
- package/dist/commonjs/funcs/oAuthPostAuthKeys.js +0 -116
- package/dist/commonjs/funcs/oAuthPostAuthKeys.js.map +0 -1
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts +0 -17
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts.map +0 -1
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js +0 -116
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js.map +0 -1
- package/dist/commonjs/funcs/providersGetProviders.d.ts.map +0 -1
- package/dist/commonjs/funcs/providersGetProviders.js.map +0 -1
- package/dist/commonjs/models/chaterror.d.ts +0 -56
- package/dist/commonjs/models/chaterror.d.ts.map +0 -1
- package/dist/commonjs/models/chaterror.js +0 -99
- package/dist/commonjs/models/chaterror.js.map +0 -1
- package/dist/commonjs/models/chatresponse.d.ts +0 -43
- package/dist/commonjs/models/chatresponse.d.ts.map +0 -1
- package/dist/commonjs/models/chatresponse.js.map +0 -1
- package/dist/commonjs/models/chatresponsechoice.d.ts +0 -72
- package/dist/commonjs/models/chatresponsechoice.d.ts.map +0 -1
- package/dist/commonjs/models/chatresponsechoice.js +0 -108
- package/dist/commonjs/models/chatresponsechoice.js.map +0 -1
- package/dist/commonjs/models/chatstreamingchoice.d.ts +0 -72
- package/dist/commonjs/models/chatstreamingchoice.d.ts.map +0 -1
- package/dist/commonjs/models/chatstreamingchoice.js.map +0 -1
- package/dist/commonjs/models/chatstreamingmessagechunk.d.ts +0 -61
- package/dist/commonjs/models/chatstreamingmessagechunk.d.ts.map +0 -1
- package/dist/commonjs/models/chatstreamingmessagechunk.js.map +0 -1
- package/dist/commonjs/models/chatstreamingmessagetoolcall.d.ts +0 -62
- package/dist/commonjs/models/chatstreamingmessagetoolcall.d.ts.map +0 -1
- package/dist/commonjs/models/chatstreamingmessagetoolcall.js +0 -106
- package/dist/commonjs/models/chatstreamingmessagetoolcall.js.map +0 -1
- package/dist/commonjs/models/chatstreamingresponsechunk.d.ts +0 -97
- package/dist/commonjs/models/chatstreamingresponsechunk.d.ts.map +0 -1
- package/dist/commonjs/models/chatstreamingresponsechunk.js.map +0 -1
- package/dist/commonjs/models/errors/chaterror.d.ts +0 -37
- package/dist/commonjs/models/errors/chaterror.d.ts.map +0 -1
- package/dist/commonjs/models/errors/chaterror.js.map +0 -1
- package/dist/commonjs/models/operations/postauthkeys.d.ts +0 -132
- package/dist/commonjs/models/operations/postauthkeys.d.ts.map +0 -1
- package/dist/commonjs/models/operations/postauthkeys.js +0 -175
- package/dist/commonjs/models/operations/postauthkeys.js.map +0 -1
- package/dist/commonjs/models/operations/postauthkeyscode.d.ts +0 -167
- package/dist/commonjs/models/operations/postauthkeyscode.d.ts.map +0 -1
- package/dist/commonjs/models/operations/postauthkeyscode.js +0 -210
- package/dist/commonjs/models/operations/postauthkeyscode.js.map +0 -1
- package/dist/commonjs/models/toolresponsemessage.d.ts +0 -55
- package/dist/commonjs/models/toolresponsemessage.d.ts.map +0 -1
- package/dist/commonjs/models/toolresponsemessage.js.map +0 -1
- package/dist/commonjs/react-query/chatSend.d.ts +0 -28
- package/dist/commonjs/react-query/chatSend.d.ts.map +0 -1
- package/dist/commonjs/react-query/chatSend.js +0 -50
- package/dist/commonjs/react-query/chatSend.js.map +0 -1
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.d.ts +0 -21
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.d.ts.map +0 -1
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js +0 -44
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js.map +0 -1
- package/dist/commonjs/react-query/embeddingsGenerate.d.ts +0 -23
- package/dist/commonjs/react-query/embeddingsGenerate.d.ts.map +0 -1
- package/dist/commonjs/react-query/embeddingsGenerate.js.map +0 -1
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts +0 -38
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js +0 -88
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js.map +0 -1
- package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts +0 -23
- package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts.map +0 -1
- package/dist/commonjs/react-query/oAuthPostAuthKeys.js +0 -47
- package/dist/commonjs/react-query/oAuthPostAuthKeys.js.map +0 -1
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts +0 -23
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts.map +0 -1
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js +0 -47
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js.map +0 -1
- package/dist/commonjs/react-query/providersGetProviders.d.ts +0 -23
- package/dist/commonjs/react-query/providersGetProviders.d.ts.map +0 -1
- package/dist/commonjs/react-query/providersGetProviders.js +0 -69
- package/dist/commonjs/react-query/providersGetProviders.js.map +0 -1
- package/dist/commonjs/sdk/credits.d.ts +0 -9
- package/dist/commonjs/sdk/credits.d.ts.map +0 -1
- package/dist/commonjs/sdk/credits.js +0 -19
- package/dist/commonjs/sdk/credits.js.map +0 -1
- package/dist/commonjs/sdk/model.d.ts +0 -9
- package/dist/commonjs/sdk/model.d.ts.map +0 -1
- package/dist/commonjs/sdk/model.js +0 -19
- package/dist/commonjs/sdk/model.js.map +0 -1
- package/dist/commonjs/sdk/oauth.d.ts +0 -19
- package/dist/commonjs/sdk/oauth.d.ts.map +0 -1
- package/dist/commonjs/sdk/oauth.js +0 -32
- package/dist/commonjs/sdk/oauth.js.map +0 -1
- package/dist/commonjs/sdk/providers.d.ts +0 -9
- package/dist/commonjs/sdk/providers.d.ts.map +0 -1
- package/dist/commonjs/sdk/providers.js +0 -19
- package/dist/commonjs/sdk/providers.js.map +0 -1
- package/dist/esm/funcs/chatSend.d.ts.map +0 -1
- package/dist/esm/funcs/chatSend.js.map +0 -1
- package/dist/esm/funcs/creditsPostCreditsCoinbase.d.ts.map +0 -1
- package/dist/esm/funcs/creditsPostCreditsCoinbase.js.map +0 -1
- package/dist/esm/funcs/embeddingsGenerate.d.ts.map +0 -1
- package/dist/esm/funcs/embeddingsGenerate.js.map +0 -1
- package/dist/esm/funcs/modelGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/esm/funcs/modelGetParametersAuthorSlug.js.map +0 -1
- package/dist/esm/funcs/oAuthPostAuthKeys.d.ts +0 -17
- package/dist/esm/funcs/oAuthPostAuthKeys.d.ts.map +0 -1
- package/dist/esm/funcs/oAuthPostAuthKeys.js +0 -80
- package/dist/esm/funcs/oAuthPostAuthKeys.js.map +0 -1
- package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts +0 -17
- package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts.map +0 -1
- package/dist/esm/funcs/oAuthPostAuthKeysCode.js +0 -80
- package/dist/esm/funcs/oAuthPostAuthKeysCode.js.map +0 -1
- package/dist/esm/funcs/providersGetProviders.d.ts.map +0 -1
- package/dist/esm/funcs/providersGetProviders.js.map +0 -1
- package/dist/esm/models/chaterror.d.ts +0 -56
- package/dist/esm/models/chaterror.d.ts.map +0 -1
- package/dist/esm/models/chaterror.js +0 -59
- package/dist/esm/models/chaterror.js.map +0 -1
- package/dist/esm/models/chatresponse.d.ts +0 -43
- package/dist/esm/models/chatresponse.d.ts.map +0 -1
- package/dist/esm/models/chatresponse.js +0 -54
- package/dist/esm/models/chatresponse.js.map +0 -1
- package/dist/esm/models/chatresponsechoice.d.ts +0 -72
- package/dist/esm/models/chatresponsechoice.d.ts.map +0 -1
- package/dist/esm/models/chatresponsechoice.js +0 -70
- package/dist/esm/models/chatresponsechoice.js.map +0 -1
- package/dist/esm/models/chatstreamingchoice.d.ts +0 -72
- package/dist/esm/models/chatstreamingchoice.d.ts.map +0 -1
- package/dist/esm/models/chatstreamingchoice.js +0 -70
- package/dist/esm/models/chatstreamingchoice.js.map +0 -1
- package/dist/esm/models/chatstreamingmessagechunk.d.ts +0 -61
- package/dist/esm/models/chatstreamingmessagechunk.d.ts.map +0 -1
- package/dist/esm/models/chatstreamingmessagechunk.js.map +0 -1
- package/dist/esm/models/chatstreamingmessagetoolcall.d.ts +0 -62
- package/dist/esm/models/chatstreamingmessagetoolcall.d.ts.map +0 -1
- package/dist/esm/models/chatstreamingmessagetoolcall.js +0 -66
- package/dist/esm/models/chatstreamingmessagetoolcall.js.map +0 -1
- package/dist/esm/models/chatstreamingresponsechunk.d.ts +0 -97
- package/dist/esm/models/chatstreamingresponsechunk.d.ts.map +0 -1
- package/dist/esm/models/chatstreamingresponsechunk.js +0 -122
- package/dist/esm/models/chatstreamingresponsechunk.js.map +0 -1
- package/dist/esm/models/errors/chaterror.d.ts +0 -37
- package/dist/esm/models/errors/chaterror.d.ts.map +0 -1
- package/dist/esm/models/errors/chaterror.js +0 -48
- package/dist/esm/models/errors/chaterror.js.map +0 -1
- package/dist/esm/models/operations/postauthkeys.d.ts +0 -132
- package/dist/esm/models/operations/postauthkeys.d.ts.map +0 -1
- package/dist/esm/models/operations/postauthkeys.js +0 -133
- package/dist/esm/models/operations/postauthkeys.js.map +0 -1
- package/dist/esm/models/operations/postauthkeyscode.d.ts +0 -167
- package/dist/esm/models/operations/postauthkeyscode.d.ts.map +0 -1
- package/dist/esm/models/operations/postauthkeyscode.js +0 -166
- package/dist/esm/models/operations/postauthkeyscode.js.map +0 -1
- package/dist/esm/models/toolresponsemessage.d.ts +0 -55
- package/dist/esm/models/toolresponsemessage.d.ts.map +0 -1
- package/dist/esm/models/toolresponsemessage.js +0 -69
- package/dist/esm/models/toolresponsemessage.js.map +0 -1
- package/dist/esm/react-query/chatSend.d.ts +0 -28
- package/dist/esm/react-query/chatSend.d.ts.map +0 -1
- package/dist/esm/react-query/chatSend.js +0 -43
- package/dist/esm/react-query/chatSend.js.map +0 -1
- package/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts +0 -21
- package/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts.map +0 -1
- package/dist/esm/react-query/creditsPostCreditsCoinbase.js.map +0 -1
- package/dist/esm/react-query/embeddingsGenerate.d.ts +0 -23
- package/dist/esm/react-query/embeddingsGenerate.d.ts.map +0 -1
- package/dist/esm/react-query/embeddingsGenerate.js.map +0 -1
- package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts +0 -38
- package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/esm/react-query/modelGetParametersAuthorSlug.js +0 -78
- package/dist/esm/react-query/modelGetParametersAuthorSlug.js.map +0 -1
- package/dist/esm/react-query/oAuthPostAuthKeys.d.ts +0 -23
- package/dist/esm/react-query/oAuthPostAuthKeys.d.ts.map +0 -1
- package/dist/esm/react-query/oAuthPostAuthKeys.js +0 -42
- package/dist/esm/react-query/oAuthPostAuthKeys.js.map +0 -1
- package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts +0 -23
- package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts.map +0 -1
- package/dist/esm/react-query/oAuthPostAuthKeysCode.js +0 -42
- package/dist/esm/react-query/oAuthPostAuthKeysCode.js.map +0 -1
- package/dist/esm/react-query/providersGetProviders.d.ts +0 -23
- package/dist/esm/react-query/providersGetProviders.d.ts.map +0 -1
- package/dist/esm/react-query/providersGetProviders.js +0 -60
- package/dist/esm/react-query/providersGetProviders.js.map +0 -1
- package/dist/esm/sdk/credits.d.ts +0 -9
- package/dist/esm/sdk/credits.d.ts.map +0 -1
- package/dist/esm/sdk/credits.js +0 -15
- package/dist/esm/sdk/credits.js.map +0 -1
- package/dist/esm/sdk/model.d.ts +0 -9
- package/dist/esm/sdk/model.d.ts.map +0 -1
- package/dist/esm/sdk/model.js +0 -15
- package/dist/esm/sdk/model.js.map +0 -1
- package/dist/esm/sdk/oauth.d.ts +0 -19
- package/dist/esm/sdk/oauth.d.ts.map +0 -1
- package/dist/esm/sdk/oauth.js +0 -28
- package/dist/esm/sdk/oauth.js.map +0 -1
- package/dist/esm/sdk/providers.d.ts +0 -9
- package/dist/esm/sdk/providers.d.ts.map +0 -1
- package/dist/esm/sdk/providers.js +0 -15
- package/dist/esm/sdk/providers.js.map +0 -1
- package/docs/sdks/credits/README.md +0 -95
- package/docs/sdks/oauth/README.md +0 -199
- package/docs/sdks/providers/README.md +0 -104
- package/src/funcs/oAuthPostAuthKeys.ts +0 -164
- package/src/funcs/oAuthPostAuthKeysCode.ts +0 -164
- package/src/models/chaterror.ts +0 -114
- package/src/models/chatresponsechoice.ts +0 -132
- package/src/models/chatstreamingchoice.ts +0 -132
- package/src/models/chatstreamingmessagetoolcall.ts +0 -149
- package/src/models/chatstreamingresponsechunk.ts +0 -239
- package/src/models/errors/chaterror.ts +0 -79
- package/src/models/operations/postauthkeys.ts +0 -272
- package/src/models/operations/postauthkeyscode.ts +0 -352
- package/src/models/toolresponsemessage.ts +0 -144
- package/src/react-query/oAuthPostAuthKeys.ts +0 -88
- package/src/react-query/oAuthPostAuthKeysCode.ts +0 -89
- package/src/sdk/credits.ts +0 -26
- package/src/sdk/oauth.ts +0 -45
- package/src/sdk/providers.ts +0 -22
|
@@ -1,95 +0,0 @@
|
|
|
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 | \*/\* |
|
|
@@ -1,199 +0,0 @@
|
|
|
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 | \*/\* |
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# Providers
|
|
2
|
-
(*providers*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [getProviders](#getproviders) - List all available model providers
|
|
9
|
-
|
|
10
|
-
## getProviders
|
|
11
|
-
|
|
12
|
-
List all available model providers
|
|
13
|
-
|
|
14
|
-
### Example Usage
|
|
15
|
-
|
|
16
|
-
<!-- UsageSnippet language="typescript" operationID="get_/providers" method="get" path="/providers" -->
|
|
17
|
-
```typescript
|
|
18
|
-
import { OpenRouter } from "@openrouter/sdk";
|
|
19
|
-
|
|
20
|
-
const openRouter = new OpenRouter({
|
|
21
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
async function run() {
|
|
25
|
-
const result = await openRouter.providers.getProviders();
|
|
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 { providersGetProviders } from "@openrouter/sdk/funcs/providersGetProviders.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
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
async function run() {
|
|
48
|
-
const res = await providersGetProviders(openRouter);
|
|
49
|
-
if (res.ok) {
|
|
50
|
-
const { value: result } = res;
|
|
51
|
-
console.log(result);
|
|
52
|
-
} else {
|
|
53
|
-
console.log("providersGetProviders 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
|
-
// Query hooks for fetching data.
|
|
73
|
-
useProvidersGetProviders,
|
|
74
|
-
useProvidersGetProvidersSuspense,
|
|
75
|
-
|
|
76
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
77
|
-
// Server Components that will be immediately available to client components
|
|
78
|
-
// using the hooks.
|
|
79
|
-
prefetchProvidersGetProviders,
|
|
80
|
-
|
|
81
|
-
// Utility to invalidate the query cache for this query in response to
|
|
82
|
-
// mutations and other user actions.
|
|
83
|
-
invalidateAllProvidersGetProviders,
|
|
84
|
-
} from "@openrouter/sdk/react-query/providersGetProviders.js";
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Parameters
|
|
88
|
-
|
|
89
|
-
| Parameter | Type | Required | Description |
|
|
90
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
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.GetProvidersResponse](../../models/operations/getprovidersresponse.md)\>**
|
|
98
|
-
|
|
99
|
-
### Errors
|
|
100
|
-
|
|
101
|
-
| Error Type | Status Code | Content Type |
|
|
102
|
-
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
103
|
-
| errors.InternalServerError | 500 | application/json |
|
|
104
|
-
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
@@ -1,164 +0,0 @@
|
|
|
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
|
-
}
|