@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
|
@@ -10,6 +10,8 @@ OpenRouter Documentation
|
|
|
10
10
|
### Available Operations
|
|
11
11
|
|
|
12
12
|
* [getCredits](#getcredits) - Get total credits purchased and used for the authenticated user
|
|
13
|
+
* [postCreditsCoinbase](#postcreditscoinbase) - Create a Coinbase charge for crypto payment
|
|
14
|
+
* [getProviders](#getproviders)
|
|
13
15
|
|
|
14
16
|
## getCredits
|
|
15
17
|
|
|
@@ -22,7 +24,9 @@ Get total credits purchased and used for the authenticated user
|
|
|
22
24
|
import { OpenRouter } from "@openrouter/sdk";
|
|
23
25
|
|
|
24
26
|
const openRouter = new OpenRouter({
|
|
25
|
-
|
|
27
|
+
security: {
|
|
28
|
+
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
|
|
29
|
+
},
|
|
26
30
|
});
|
|
27
31
|
|
|
28
32
|
async function run() {
|
|
@@ -45,7 +49,9 @@ import { getCredits } from "@openrouter/sdk/funcs/getCredits.js";
|
|
|
45
49
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
46
50
|
// You can create one instance of it to use across an application.
|
|
47
51
|
const openRouter = new OpenRouterCore({
|
|
48
|
-
|
|
52
|
+
security: {
|
|
53
|
+
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
|
|
54
|
+
},
|
|
49
55
|
});
|
|
50
56
|
|
|
51
57
|
async function run() {
|
|
@@ -104,4 +110,192 @@ import {
|
|
|
104
110
|
|
|
105
111
|
| Error Type | Status Code | Content Type |
|
|
106
112
|
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
113
|
+
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
114
|
+
|
|
115
|
+
## postCreditsCoinbase
|
|
116
|
+
|
|
117
|
+
Create a Coinbase charge for crypto payment
|
|
118
|
+
|
|
119
|
+
### Example Usage
|
|
120
|
+
|
|
121
|
+
<!-- UsageSnippet language="typescript" operationID="post_/credits/coinbase" method="post" path="/credits/coinbase" -->
|
|
122
|
+
```typescript
|
|
123
|
+
import { OpenRouter } from "@openrouter/sdk";
|
|
124
|
+
|
|
125
|
+
const openRouter = new OpenRouter({
|
|
126
|
+
security: {
|
|
127
|
+
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
async function run() {
|
|
132
|
+
const result = await openRouter.postCreditsCoinbase();
|
|
133
|
+
|
|
134
|
+
console.log(result);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
run();
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Standalone function
|
|
141
|
+
|
|
142
|
+
The standalone function version of this method:
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
146
|
+
import { postCreditsCoinbase } from "@openrouter/sdk/funcs/postCreditsCoinbase.js";
|
|
147
|
+
|
|
148
|
+
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
149
|
+
// You can create one instance of it to use across an application.
|
|
150
|
+
const openRouter = new OpenRouterCore({
|
|
151
|
+
security: {
|
|
152
|
+
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
async function run() {
|
|
157
|
+
const res = await postCreditsCoinbase(openRouter);
|
|
158
|
+
if (res.ok) {
|
|
159
|
+
const { value: result } = res;
|
|
160
|
+
console.log(result);
|
|
161
|
+
} else {
|
|
162
|
+
console.log("postCreditsCoinbase failed:", res.error);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
run();
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### React hooks and utilities
|
|
170
|
+
|
|
171
|
+
This method can be used in React components through the following hooks and
|
|
172
|
+
associated utilities.
|
|
173
|
+
|
|
174
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
175
|
+
> below and how to get started using React hooks.
|
|
176
|
+
|
|
177
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
import {
|
|
181
|
+
// Mutation hook for triggering the API call.
|
|
182
|
+
usePostCreditsCoinbaseMutation
|
|
183
|
+
} from "@openrouter/sdk/react-query/postCreditsCoinbase.js";
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Parameters
|
|
187
|
+
|
|
188
|
+
| Parameter | Type | Required | Description |
|
|
189
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
190
|
+
| `request` | [operations.PostCreditsCoinbaseRequest](../../models/operations/postcreditscoinbaserequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
191
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
192
|
+
| `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. |
|
|
193
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
194
|
+
|
|
195
|
+
### Response
|
|
196
|
+
|
|
197
|
+
**Promise\<[operations.PostCreditsCoinbaseResponse](../../models/operations/postcreditscoinbaseresponse.md)\>**
|
|
198
|
+
|
|
199
|
+
### Errors
|
|
200
|
+
|
|
201
|
+
| Error Type | Status Code | Content Type |
|
|
202
|
+
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
203
|
+
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
204
|
+
|
|
205
|
+
## getProviders
|
|
206
|
+
|
|
207
|
+
### Example Usage
|
|
208
|
+
|
|
209
|
+
<!-- UsageSnippet language="typescript" operationID="get_/providers" method="get" path="/providers" -->
|
|
210
|
+
```typescript
|
|
211
|
+
import { OpenRouter } from "@openrouter/sdk";
|
|
212
|
+
|
|
213
|
+
const openRouter = new OpenRouter({
|
|
214
|
+
security: {
|
|
215
|
+
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
async function run() {
|
|
220
|
+
const result = await openRouter.getProviders();
|
|
221
|
+
|
|
222
|
+
console.log(result);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
run();
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Standalone function
|
|
229
|
+
|
|
230
|
+
The standalone function version of this method:
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
234
|
+
import { getProviders } from "@openrouter/sdk/funcs/getProviders.js";
|
|
235
|
+
|
|
236
|
+
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
237
|
+
// You can create one instance of it to use across an application.
|
|
238
|
+
const openRouter = new OpenRouterCore({
|
|
239
|
+
security: {
|
|
240
|
+
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
async function run() {
|
|
245
|
+
const res = await getProviders(openRouter);
|
|
246
|
+
if (res.ok) {
|
|
247
|
+
const { value: result } = res;
|
|
248
|
+
console.log(result);
|
|
249
|
+
} else {
|
|
250
|
+
console.log("getProviders failed:", res.error);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
run();
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### React hooks and utilities
|
|
258
|
+
|
|
259
|
+
This method can be used in React components through the following hooks and
|
|
260
|
+
associated utilities.
|
|
261
|
+
|
|
262
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
263
|
+
> below and how to get started using React hooks.
|
|
264
|
+
|
|
265
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
266
|
+
|
|
267
|
+
```tsx
|
|
268
|
+
import {
|
|
269
|
+
// Query hooks for fetching data.
|
|
270
|
+
useGetProviders,
|
|
271
|
+
useGetProvidersSuspense,
|
|
272
|
+
|
|
273
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
274
|
+
// Server Components that will be immediately available to client components
|
|
275
|
+
// using the hooks.
|
|
276
|
+
prefetchGetProviders,
|
|
277
|
+
|
|
278
|
+
// Utility to invalidate the query cache for this query in response to
|
|
279
|
+
// mutations and other user actions.
|
|
280
|
+
invalidateAllGetProviders,
|
|
281
|
+
} from "@openrouter/sdk/react-query/getProviders.js";
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Parameters
|
|
285
|
+
|
|
286
|
+
| Parameter | Type | Required | Description |
|
|
287
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
288
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
289
|
+
| `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. |
|
|
290
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
291
|
+
|
|
292
|
+
### Response
|
|
293
|
+
|
|
294
|
+
**Promise\<[operations.GetProvidersResponse](../../models/operations/getprovidersresponse.md)\>**
|
|
295
|
+
|
|
296
|
+
### Errors
|
|
297
|
+
|
|
298
|
+
| Error Type | Status Code | Content Type |
|
|
299
|
+
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
300
|
+
| errors.InternalServerError | 500 | application/json |
|
|
107
301
|
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
(*
|
|
1
|
+
# ParametersT
|
|
2
|
+
(*parameters*)
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
5
|
|
|
@@ -17,12 +17,14 @@ Get a model's supported parameters and data about which are most popular
|
|
|
17
17
|
```typescript
|
|
18
18
|
import { OpenRouter } from "@openrouter/sdk";
|
|
19
19
|
|
|
20
|
-
const openRouter = new OpenRouter(
|
|
20
|
+
const openRouter = new OpenRouter({
|
|
21
|
+
security: {
|
|
22
|
+
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
21
25
|
|
|
22
26
|
async function run() {
|
|
23
|
-
const result = await openRouter.
|
|
24
|
-
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
25
|
-
}, {
|
|
27
|
+
const result = await openRouter.parameters.getParametersAuthorSlug({
|
|
26
28
|
author: "<value>",
|
|
27
29
|
slug: "<value>",
|
|
28
30
|
});
|
|
@@ -39,16 +41,18 @@ The standalone function version of this method:
|
|
|
39
41
|
|
|
40
42
|
```typescript
|
|
41
43
|
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
42
|
-
import {
|
|
44
|
+
import { parametersGetParametersAuthorSlug } from "@openrouter/sdk/funcs/parametersGetParametersAuthorSlug.js";
|
|
43
45
|
|
|
44
46
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
45
47
|
// You can create one instance of it to use across an application.
|
|
46
|
-
const openRouter = new OpenRouterCore(
|
|
48
|
+
const openRouter = new OpenRouterCore({
|
|
49
|
+
security: {
|
|
50
|
+
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
|
|
51
|
+
},
|
|
52
|
+
});
|
|
47
53
|
|
|
48
54
|
async function run() {
|
|
49
|
-
const res = await
|
|
50
|
-
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
51
|
-
}, {
|
|
55
|
+
const res = await parametersGetParametersAuthorSlug(openRouter, {
|
|
52
56
|
author: "<value>",
|
|
53
57
|
slug: "<value>",
|
|
54
58
|
});
|
|
@@ -56,7 +60,7 @@ async function run() {
|
|
|
56
60
|
const { value: result } = res;
|
|
57
61
|
console.log(result);
|
|
58
62
|
} else {
|
|
59
|
-
console.log("
|
|
63
|
+
console.log("parametersGetParametersAuthorSlug failed:", res.error);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
|
|
@@ -76,19 +80,19 @@ associated utilities.
|
|
|
76
80
|
```tsx
|
|
77
81
|
import {
|
|
78
82
|
// Query hooks for fetching data.
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
useParametersGetParametersAuthorSlug,
|
|
84
|
+
useParametersGetParametersAuthorSlugSuspense,
|
|
81
85
|
|
|
82
86
|
// Utility for prefetching data during server-side rendering and in React
|
|
83
87
|
// Server Components that will be immediately available to client components
|
|
84
88
|
// using the hooks.
|
|
85
|
-
|
|
89
|
+
prefetchParametersGetParametersAuthorSlug,
|
|
86
90
|
|
|
87
91
|
// Utilities to invalidate the query cache for this query in response to
|
|
88
92
|
// mutations and other user actions.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
} from "@openrouter/sdk/react-query/
|
|
93
|
+
invalidateParametersGetParametersAuthorSlug,
|
|
94
|
+
invalidateAllParametersGetParametersAuthorSlug,
|
|
95
|
+
} from "@openrouter/sdk/react-query/parametersGetParametersAuthorSlug.js";
|
|
92
96
|
```
|
|
93
97
|
|
|
94
98
|
### Parameters
|
|
@@ -96,7 +100,6 @@ import {
|
|
|
96
100
|
| Parameter | Type | Required | Description |
|
|
97
101
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
98
102
|
| `request` | [operations.GetParametersAuthorSlugRequest](../../models/operations/getparametersauthorslugrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
99
|
-
| `security` | [operations.GetParametersAuthorSlugSecurity](../../models/operations/getparametersauthorslugsecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
|
|
100
103
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
101
104
|
| `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. |
|
|
102
105
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
@@ -14,7 +14,9 @@ dotenv.config();
|
|
|
14
14
|
import { OpenRouter } from "@openrouter/sdk";
|
|
15
15
|
|
|
16
16
|
const openRouter = new OpenRouter({
|
|
17
|
-
|
|
17
|
+
security: {
|
|
18
|
+
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
|
|
19
|
+
},
|
|
18
20
|
});
|
|
19
21
|
|
|
20
22
|
async function main() {
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -96,8 +96,7 @@ async function $do(
|
|
|
96
96
|
Accept: "application/json",
|
|
97
97
|
}));
|
|
98
98
|
|
|
99
|
-
const
|
|
100
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
99
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
101
100
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
102
101
|
|
|
103
102
|
const context = {
|
|
@@ -108,7 +107,7 @@ async function $do(
|
|
|
108
107
|
|
|
109
108
|
resolvedSecurity: requestSecurity,
|
|
110
109
|
|
|
111
|
-
securitySource: client._options.
|
|
110
|
+
securitySource: client._options.security,
|
|
112
111
|
retryConfig: options?.retries
|
|
113
112
|
|| client._options.retryConfig
|
|
114
113
|
|| { strategy: "none" },
|
|
@@ -95,8 +95,7 @@ async function $do(
|
|
|
95
95
|
Accept: "application/json",
|
|
96
96
|
}));
|
|
97
97
|
|
|
98
|
-
const
|
|
99
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
98
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
100
99
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
101
100
|
|
|
102
101
|
const context = {
|
|
@@ -107,7 +106,7 @@ async function $do(
|
|
|
107
106
|
|
|
108
107
|
resolvedSecurity: requestSecurity,
|
|
109
108
|
|
|
110
|
-
securitySource: client._options.
|
|
109
|
+
securitySource: client._options.security,
|
|
111
110
|
retryConfig: options?.retries
|
|
112
111
|
|| client._options.retryConfig
|
|
113
112
|
|| { strategy: "none" },
|
|
@@ -75,8 +75,7 @@ async function $do(
|
|
|
75
75
|
Accept: "application/json",
|
|
76
76
|
}));
|
|
77
77
|
|
|
78
|
-
const
|
|
79
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
78
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
80
79
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
81
80
|
|
|
82
81
|
const context = {
|
|
@@ -87,7 +86,7 @@ async function $do(
|
|
|
87
86
|
|
|
88
87
|
resolvedSecurity: requestSecurity,
|
|
89
88
|
|
|
90
|
-
securitySource: client._options.
|
|
89
|
+
securitySource: client._options.security,
|
|
91
90
|
retryConfig: options?.retries
|
|
92
91
|
|| client._options.retryConfig
|
|
93
92
|
|| { strategy: "none" },
|
|
@@ -75,8 +75,7 @@ async function $do(
|
|
|
75
75
|
Accept: "application/json",
|
|
76
76
|
}));
|
|
77
77
|
|
|
78
|
-
const
|
|
79
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
78
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
80
79
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
81
80
|
|
|
82
81
|
const context = {
|
|
@@ -87,7 +86,7 @@ async function $do(
|
|
|
87
86
|
|
|
88
87
|
resolvedSecurity: requestSecurity,
|
|
89
88
|
|
|
90
|
-
securitySource: client._options.
|
|
89
|
+
securitySource: client._options.security,
|
|
91
90
|
retryConfig: options?.retries
|
|
92
91
|
|| client._options.retryConfig
|
|
93
92
|
|| { strategy: "none" },
|
|
@@ -93,8 +93,7 @@ async function $do(
|
|
|
93
93
|
Accept: "application/json",
|
|
94
94
|
}));
|
|
95
95
|
|
|
96
|
-
const
|
|
97
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
96
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
98
97
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
99
98
|
|
|
100
99
|
const context = {
|
|
@@ -105,7 +104,7 @@ async function $do(
|
|
|
105
104
|
|
|
106
105
|
resolvedSecurity: requestSecurity,
|
|
107
106
|
|
|
108
|
-
securitySource: client._options.
|
|
107
|
+
securitySource: client._options.security,
|
|
109
108
|
retryConfig: options?.retries
|
|
110
109
|
|| client._options.retryConfig
|
|
111
110
|
|| { strategy: "none" },
|
|
@@ -95,8 +95,7 @@ async function $do(
|
|
|
95
95
|
Accept: "application/json",
|
|
96
96
|
}));
|
|
97
97
|
|
|
98
|
-
const
|
|
99
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
98
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
100
99
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
101
100
|
|
|
102
101
|
const context = {
|
|
@@ -107,7 +106,7 @@ async function $do(
|
|
|
107
106
|
|
|
108
107
|
resolvedSecurity: requestSecurity,
|
|
109
108
|
|
|
110
|
-
securitySource: client._options.
|
|
109
|
+
securitySource: client._options.security,
|
|
111
110
|
retryConfig: options?.retries
|
|
112
111
|
|| client._options.retryConfig
|
|
113
112
|
|| { strategy: "none" },
|
|
@@ -96,8 +96,7 @@ async function $do(
|
|
|
96
96
|
Accept: "application/json",
|
|
97
97
|
}));
|
|
98
98
|
|
|
99
|
-
const
|
|
100
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
99
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
101
100
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
102
101
|
|
|
103
102
|
const context = {
|
|
@@ -108,7 +107,7 @@ async function $do(
|
|
|
108
107
|
|
|
109
108
|
resolvedSecurity: requestSecurity,
|
|
110
109
|
|
|
111
|
-
securitySource: client._options.
|
|
110
|
+
securitySource: client._options.security,
|
|
112
111
|
retryConfig: options?.retries
|
|
113
112
|
|| client._options.retryConfig
|
|
114
113
|
|| { strategy: "none" },
|
|
@@ -92,8 +92,7 @@ async function $do(
|
|
|
92
92
|
Accept: "application/json",
|
|
93
93
|
}));
|
|
94
94
|
|
|
95
|
-
const
|
|
96
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
95
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
97
96
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
97
|
|
|
99
98
|
const context = {
|
|
@@ -104,7 +103,7 @@ async function $do(
|
|
|
104
103
|
|
|
105
104
|
resolvedSecurity: requestSecurity,
|
|
106
105
|
|
|
107
|
-
securitySource: client._options.
|
|
106
|
+
securitySource: client._options.security,
|
|
108
107
|
retryConfig: options?.retries
|
|
109
108
|
|| client._options.retryConfig
|
|
110
109
|
|| { strategy: "none" },
|
|
@@ -26,7 +26,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
26
26
|
import { APICall, APIPromise } from "../types/async.js";
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
28
|
|
|
29
|
-
export enum
|
|
29
|
+
export enum GenerateResponseAcceptEnum {
|
|
30
30
|
applicationJson = "application/json",
|
|
31
31
|
textEventStream = "text/event-stream",
|
|
32
32
|
}
|
|
@@ -35,16 +35,18 @@ export enum SendAcceptEnum {
|
|
|
35
35
|
* Create a chat completion
|
|
36
36
|
*
|
|
37
37
|
* @remarks
|
|
38
|
-
*
|
|
38
|
+
* Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
|
39
39
|
*/
|
|
40
|
-
export function
|
|
40
|
+
export function chatGenerateResponse(
|
|
41
41
|
client: OpenRouterCore,
|
|
42
42
|
request?: models.ChatGenerationParams | undefined,
|
|
43
|
-
options?: RequestOptions & {
|
|
43
|
+
options?: RequestOptions & {
|
|
44
|
+
acceptHeaderOverride?: GenerateResponseAcceptEnum;
|
|
45
|
+
},
|
|
44
46
|
): APIPromise<
|
|
45
47
|
Result<
|
|
46
48
|
operations.PostChatCompletionsResponse,
|
|
47
|
-
| errors.
|
|
49
|
+
| errors.ChatCompletionError
|
|
48
50
|
| OpenRouterError
|
|
49
51
|
| ResponseValidationError
|
|
50
52
|
| ConnectionError
|
|
@@ -65,12 +67,14 @@ export function chatSend(
|
|
|
65
67
|
async function $do(
|
|
66
68
|
client: OpenRouterCore,
|
|
67
69
|
request?: models.ChatGenerationParams | undefined,
|
|
68
|
-
options?: RequestOptions & {
|
|
70
|
+
options?: RequestOptions & {
|
|
71
|
+
acceptHeaderOverride?: GenerateResponseAcceptEnum;
|
|
72
|
+
},
|
|
69
73
|
): Promise<
|
|
70
74
|
[
|
|
71
75
|
Result<
|
|
72
76
|
operations.PostChatCompletionsResponse,
|
|
73
|
-
| errors.
|
|
77
|
+
| errors.ChatCompletionError
|
|
74
78
|
| OpenRouterError
|
|
75
79
|
| ResponseValidationError
|
|
76
80
|
| ConnectionError
|
|
@@ -105,8 +109,7 @@ async function $do(
|
|
|
105
109
|
|| "application/json;q=1, text/event-stream;q=0",
|
|
106
110
|
}));
|
|
107
111
|
|
|
108
|
-
const
|
|
109
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
112
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
110
113
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
111
114
|
|
|
112
115
|
const context = {
|
|
@@ -117,7 +120,7 @@ async function $do(
|
|
|
117
120
|
|
|
118
121
|
resolvedSecurity: requestSecurity,
|
|
119
122
|
|
|
120
|
-
securitySource: client._options.
|
|
123
|
+
securitySource: client._options.security,
|
|
121
124
|
retryConfig: options?.retries
|
|
122
125
|
|| client._options.retryConfig
|
|
123
126
|
|| { strategy: "none" },
|
|
@@ -156,7 +159,7 @@ async function $do(
|
|
|
156
159
|
|
|
157
160
|
const [result] = await M.match<
|
|
158
161
|
operations.PostChatCompletionsResponse,
|
|
159
|
-
| errors.
|
|
162
|
+
| errors.ChatCompletionError
|
|
160
163
|
| OpenRouterError
|
|
161
164
|
| ResponseValidationError
|
|
162
165
|
| ConnectionError
|
|
@@ -168,8 +171,8 @@ async function $do(
|
|
|
168
171
|
>(
|
|
169
172
|
M.json(200, operations.PostChatCompletionsResponse$inboundSchema),
|
|
170
173
|
M.sse(200, operations.PostChatCompletionsResponse$inboundSchema),
|
|
171
|
-
M.jsonErr([400, 401, 429], errors.
|
|
172
|
-
M.jsonErr(500, errors.
|
|
174
|
+
M.jsonErr([400, 401, 429], errors.ChatCompletionError$inboundSchema),
|
|
175
|
+
M.jsonErr(500, errors.ChatCompletionError$inboundSchema),
|
|
173
176
|
M.fail("4XX"),
|
|
174
177
|
M.fail("5XX"),
|
|
175
178
|
)(response, req, { extraFields: responseFields });
|
|
@@ -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 embeddingsPostEmbeddings(
|
|
34
34
|
client: OpenRouterCore,
|
|
35
35
|
request?: operations.PostEmbeddingsRequest | undefined,
|
|
36
36
|
options?: RequestOptions,
|
|
@@ -95,8 +95,7 @@ async function $do(
|
|
|
95
95
|
Accept: "application/json",
|
|
96
96
|
}));
|
|
97
97
|
|
|
98
|
-
const
|
|
99
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
98
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
100
99
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
101
100
|
|
|
102
101
|
const context = {
|
|
@@ -107,7 +106,7 @@ async function $do(
|
|
|
107
106
|
|
|
108
107
|
resolvedSecurity: requestSecurity,
|
|
109
108
|
|
|
110
|
-
securitySource: client._options.
|
|
109
|
+
securitySource: client._options.security,
|
|
111
110
|
retryConfig: options?.retries
|
|
112
111
|
|| client._options.retryConfig
|
|
113
112
|
|| { strategy: "none" },
|
|
@@ -72,8 +72,7 @@ async function $do(
|
|
|
72
72
|
Accept: "application/json",
|
|
73
73
|
}));
|
|
74
74
|
|
|
75
|
-
const
|
|
76
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
75
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
77
76
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
78
77
|
|
|
79
78
|
const context = {
|
|
@@ -84,7 +83,7 @@ async function $do(
|
|
|
84
83
|
|
|
85
84
|
resolvedSecurity: requestSecurity,
|
|
86
85
|
|
|
87
|
-
securitySource: client._options.
|
|
86
|
+
securitySource: client._options.security,
|
|
88
87
|
retryConfig: options?.retries
|
|
89
88
|
|| client._options.retryConfig
|
|
90
89
|
|| { strategy: "none" },
|