@openrouter/sdk 0.0.0-beta.1 → 0.0.0-beta.4
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/.devcontainer/README.md +5 -0
- package/FUNCTIONS.md +1 -3
- package/REACT_QUERY.md +6 -10
- package/README.md +31 -24
- package/dist/commonjs/funcs/analyticsGetActivity.js +3 -2
- package/dist/commonjs/funcs/analyticsGetActivity.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js +3 -2
- package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetAuthKey.js +3 -2
- package/dist/commonjs/funcs/apiKeysGetAuthKey.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKey.js +3 -2
- package/dist/commonjs/funcs/apiKeysGetKey.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKeys.js +3 -2
- package/dist/commonjs/funcs/apiKeysGetKeys.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKeysHash.js +3 -2
- package/dist/commonjs/funcs/apiKeysGetKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysPatchKeysHash.js +3 -2
- package/dist/commonjs/funcs/apiKeysPatchKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysPostKeys.js +3 -2
- package/dist/commonjs/funcs/apiKeysPostKeys.js.map +1 -1
- package/dist/commonjs/funcs/chatSend.js +3 -2
- package/dist/commonjs/funcs/chatSend.js.map +1 -1
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.js +3 -2
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.js.map +1 -1
- package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js +3 -2
- package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js.map +1 -1
- package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js +3 -2
- package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
- package/dist/commonjs/funcs/generationsGetGeneration.js +3 -2
- package/dist/commonjs/funcs/generationsGetGeneration.js.map +1 -1
- package/dist/commonjs/funcs/getCredits.js +3 -2
- package/dist/commonjs/funcs/getCredits.js.map +1 -1
- package/dist/commonjs/funcs/getProviders.js +3 -2
- package/dist/commonjs/funcs/getProviders.js.map +1 -1
- package/dist/commonjs/funcs/modelsGetModels.js +3 -2
- package/dist/commonjs/funcs/modelsGetModels.js.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsCount.js +3 -2
- package/dist/commonjs/funcs/modelsGetModelsCount.js.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsUser.d.ts +1 -1
- package/dist/commonjs/funcs/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsUser.js +12 -7
- package/dist/commonjs/funcs/modelsGetModelsUser.js.map +1 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.d.ts +1 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.d.ts.map +1 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.js +12 -7
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.js.map +1 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.d.ts +1 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.d.ts.map +1 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.js +12 -7
- package/dist/commonjs/funcs/postCreditsCoinbase.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -7
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/env.d.ts +0 -1
- package/dist/commonjs/lib/env.d.ts.map +1 -1
- package/dist/commonjs/lib/env.js +0 -1
- package/dist/commonjs/lib/env.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +1 -7
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/chaterror.d.ts +23 -2
- package/dist/commonjs/models/chaterror.d.ts.map +1 -1
- package/dist/commonjs/models/chaterror.js +27 -3
- package/dist/commonjs/models/chaterror.js.map +1 -1
- package/dist/commonjs/models/chatresponse.d.ts +2 -2
- package/dist/commonjs/models/chatresponse.d.ts.map +1 -1
- package/dist/commonjs/models/chatresponse.js +2 -2
- package/dist/commonjs/models/chatresponse.js.map +1 -1
- package/dist/commonjs/models/chatstreamingresponsechunk.d.ts +2 -2
- package/dist/commonjs/models/chatstreamingresponsechunk.d.ts.map +1 -1
- package/dist/commonjs/models/chatstreamingresponsechunk.js +2 -2
- package/dist/commonjs/models/chatstreamingresponsechunk.js.map +1 -1
- package/dist/commonjs/models/errorresponse.d.ts +8 -8
- package/dist/commonjs/models/errorresponse.d.ts.map +1 -1
- package/dist/commonjs/models/errorresponse.js +14 -13
- package/dist/commonjs/models/errorresponse.js.map +1 -1
- package/dist/commonjs/models/operations/getmodelsuser.d.ts +25 -0
- package/dist/commonjs/models/operations/getmodelsuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getmodelsuser.js +29 -2
- package/dist/commonjs/models/operations/getmodelsuser.js.map +1 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.d.ts +25 -0
- package/dist/commonjs/models/operations/getparametersauthorslug.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.js +28 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.js.map +1 -1
- package/dist/commonjs/models/operations/postcreditscoinbase.d.ts +25 -0
- package/dist/commonjs/models/operations/postcreditscoinbase.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postcreditscoinbase.js +28 -1
- package/dist/commonjs/models/operations/postcreditscoinbase.js.map +1 -1
- package/dist/commonjs/models/security.d.ts +0 -2
- package/dist/commonjs/models/security.d.ts.map +1 -1
- package/dist/commonjs/models/security.js +0 -2
- package/dist/commonjs/models/security.js.map +1 -1
- package/dist/commonjs/react-query/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 +4 -4
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts.map +1 -1
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js +8 -8
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js.map +1 -1
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts +1 -0
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts.map +1 -1
- package/dist/commonjs/react-query/postCreditsCoinbase.js +2 -2
- package/dist/commonjs/react-query/postCreditsCoinbase.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 +1 -1
- package/dist/commonjs/sdk/parameters.d.ts.map +1 -1
- package/dist/commonjs/sdk/parameters.js +2 -2
- package/dist/commonjs/sdk/parameters.js.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +1 -1
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +2 -2
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/analyticsGetActivity.js +3 -2
- package/dist/esm/funcs/analyticsGetActivity.js.map +1 -1
- package/dist/esm/funcs/apiKeysDeleteKeysHash.js +3 -2
- package/dist/esm/funcs/apiKeysDeleteKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetAuthKey.js +3 -2
- package/dist/esm/funcs/apiKeysGetAuthKey.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKey.js +3 -2
- package/dist/esm/funcs/apiKeysGetKey.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKeys.js +3 -2
- package/dist/esm/funcs/apiKeysGetKeys.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKeysHash.js +3 -2
- package/dist/esm/funcs/apiKeysGetKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysPatchKeysHash.js +3 -2
- package/dist/esm/funcs/apiKeysPatchKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysPostKeys.js +3 -2
- package/dist/esm/funcs/apiKeysPostKeys.js.map +1 -1
- package/dist/esm/funcs/chatSend.js +3 -2
- package/dist/esm/funcs/chatSend.js.map +1 -1
- package/dist/esm/funcs/embeddingsPostEmbeddings.js +3 -2
- package/dist/esm/funcs/embeddingsPostEmbeddings.js.map +1 -1
- package/dist/esm/funcs/endpointsGetEndpointsZdr.js +3 -2
- package/dist/esm/funcs/endpointsGetEndpointsZdr.js.map +1 -1
- package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js +3 -2
- package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
- package/dist/esm/funcs/generationsGetGeneration.js +3 -2
- package/dist/esm/funcs/generationsGetGeneration.js.map +1 -1
- package/dist/esm/funcs/getCredits.js +3 -2
- package/dist/esm/funcs/getCredits.js.map +1 -1
- package/dist/esm/funcs/getProviders.js +3 -2
- package/dist/esm/funcs/getProviders.js.map +1 -1
- package/dist/esm/funcs/modelsGetModels.js +3 -2
- package/dist/esm/funcs/modelsGetModels.js.map +1 -1
- package/dist/esm/funcs/modelsGetModelsCount.js +3 -2
- package/dist/esm/funcs/modelsGetModelsCount.js.map +1 -1
- package/dist/esm/funcs/modelsGetModelsUser.d.ts +1 -1
- package/dist/esm/funcs/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/esm/funcs/modelsGetModelsUser.js +13 -8
- package/dist/esm/funcs/modelsGetModelsUser.js.map +1 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.d.ts +1 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.d.ts.map +1 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.js +13 -8
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.js.map +1 -1
- package/dist/esm/funcs/postCreditsCoinbase.d.ts +1 -1
- package/dist/esm/funcs/postCreditsCoinbase.d.ts.map +1 -1
- package/dist/esm/funcs/postCreditsCoinbase.js +13 -8
- package/dist/esm/funcs/postCreditsCoinbase.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -7
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/env.d.ts +0 -1
- package/dist/esm/lib/env.d.ts.map +1 -1
- package/dist/esm/lib/env.js +0 -1
- package/dist/esm/lib/env.js.map +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +1 -7
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/chaterror.d.ts +23 -2
- package/dist/esm/models/chaterror.d.ts.map +1 -1
- package/dist/esm/models/chaterror.js +24 -2
- package/dist/esm/models/chaterror.js.map +1 -1
- package/dist/esm/models/chatresponse.d.ts +2 -2
- package/dist/esm/models/chatresponse.d.ts.map +1 -1
- package/dist/esm/models/chatresponse.js +2 -2
- package/dist/esm/models/chatresponse.js.map +1 -1
- package/dist/esm/models/chatstreamingresponsechunk.d.ts +2 -2
- package/dist/esm/models/chatstreamingresponsechunk.d.ts.map +1 -1
- package/dist/esm/models/chatstreamingresponsechunk.js +2 -2
- package/dist/esm/models/chatstreamingresponsechunk.js.map +1 -1
- package/dist/esm/models/errorresponse.d.ts +8 -8
- package/dist/esm/models/errorresponse.d.ts.map +1 -1
- package/dist/esm/models/errorresponse.js +13 -12
- package/dist/esm/models/errorresponse.js.map +1 -1
- package/dist/esm/models/operations/getmodelsuser.d.ts +25 -0
- package/dist/esm/models/operations/getmodelsuser.d.ts.map +1 -1
- package/dist/esm/models/operations/getmodelsuser.js +25 -0
- package/dist/esm/models/operations/getmodelsuser.js.map +1 -1
- package/dist/esm/models/operations/getparametersauthorslug.d.ts +25 -0
- package/dist/esm/models/operations/getparametersauthorslug.d.ts.map +1 -1
- package/dist/esm/models/operations/getparametersauthorslug.js +25 -0
- package/dist/esm/models/operations/getparametersauthorslug.js.map +1 -1
- package/dist/esm/models/operations/postcreditscoinbase.d.ts +25 -0
- package/dist/esm/models/operations/postcreditscoinbase.d.ts.map +1 -1
- package/dist/esm/models/operations/postcreditscoinbase.js +25 -0
- package/dist/esm/models/operations/postcreditscoinbase.js.map +1 -1
- package/dist/esm/models/security.d.ts +0 -2
- package/dist/esm/models/security.d.ts.map +1 -1
- package/dist/esm/models/security.js +0 -2
- package/dist/esm/models/security.js.map +1 -1
- package/dist/esm/react-query/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 +4 -4
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts.map +1 -1
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js +8 -8
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js.map +1 -1
- package/dist/esm/react-query/postCreditsCoinbase.d.ts +1 -0
- package/dist/esm/react-query/postCreditsCoinbase.d.ts.map +1 -1
- package/dist/esm/react-query/postCreditsCoinbase.js +2 -2
- package/dist/esm/react-query/postCreditsCoinbase.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 +1 -1
- package/dist/esm/sdk/parameters.d.ts.map +1 -1
- package/dist/esm/sdk/parameters.js +2 -2
- package/dist/esm/sdk/parameters.js.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +1 -1
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +2 -2
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/analytics/README.md +2 -6
- package/docs/sdks/apikeys/README.md +14 -42
- package/docs/sdks/chat/README.md +2 -6
- package/docs/sdks/embeddings/README.md +2 -6
- package/docs/sdks/endpoints/README.md +4 -12
- package/docs/sdks/generations/README.md +2 -6
- package/docs/sdks/models/README.md +13 -24
- package/docs/sdks/openrouter/README.md +13 -24
- package/docs/sdks/parameters/README.md +7 -10
- package/examples/chatCompletions.example.ts +95 -0
- package/examples/getCredits.example.ts +1 -3
- package/jsr.json +1 -1
- package/package.json +5 -1
- package/src/funcs/analyticsGetActivity.ts +3 -2
- package/src/funcs/apiKeysDeleteKeysHash.ts +3 -2
- package/src/funcs/apiKeysGetAuthKey.ts +3 -2
- package/src/funcs/apiKeysGetKey.ts +3 -2
- package/src/funcs/apiKeysGetKeys.ts +3 -2
- package/src/funcs/apiKeysGetKeysHash.ts +3 -2
- package/src/funcs/apiKeysPatchKeysHash.ts +3 -2
- package/src/funcs/apiKeysPostKeys.ts +3 -2
- package/src/funcs/chatSend.ts +3 -2
- package/src/funcs/embeddingsPostEmbeddings.ts +3 -2
- package/src/funcs/endpointsGetEndpointsZdr.ts +3 -2
- package/src/funcs/endpointsGetModelsAuthorSlugEndpoints.ts +3 -2
- package/src/funcs/generationsGetGeneration.ts +3 -2
- package/src/funcs/getCredits.ts +3 -2
- package/src/funcs/getProviders.ts +3 -2
- package/src/funcs/modelsGetModels.ts +3 -2
- package/src/funcs/modelsGetModelsCount.ts +3 -2
- package/src/funcs/modelsGetModelsUser.ts +15 -5
- package/src/funcs/parametersGetParametersAuthorSlug.ts +15 -5
- package/src/funcs/postCreditsCoinbase.ts +15 -5
- package/src/lib/config.ts +3 -7
- package/src/lib/env.ts +0 -2
- package/src/lib/security.ts +1 -8
- package/src/models/chaterror.ts +44 -4
- package/src/models/chatresponse.ts +4 -4
- package/src/models/chatstreamingresponsechunk.ts +4 -4
- package/src/models/errorresponse.ts +14 -15
- package/src/models/operations/getmodelsuser.ts +58 -0
- package/src/models/operations/getparametersauthorslug.ts +60 -0
- package/src/models/operations/postcreditscoinbase.ts +60 -0
- package/src/models/security.ts +0 -4
- package/src/react-query/modelsGetModelsUser.ts +8 -0
- package/src/react-query/parametersGetParametersAuthorSlug.ts +8 -0
- package/src/react-query/postCreditsCoinbase.ts +3 -0
- package/src/sdk/models.ts +2 -0
- package/src/sdk/parameters.ts +2 -0
- package/src/sdk/sdk.ts +2 -0
- package/examples/chatCompletion.example.ts +0 -19
- package/examples/chatCompletionStream.example.ts +0 -30
- package/examples/unauthorized.example.ts +0 -19
|
@@ -72,7 +72,8 @@ async function $do(
|
|
|
72
72
|
Accept: "application/json",
|
|
73
73
|
}));
|
|
74
74
|
|
|
75
|
-
const
|
|
75
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
76
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
76
77
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
77
78
|
|
|
78
79
|
const context = {
|
|
@@ -83,7 +84,7 @@ async function $do(
|
|
|
83
84
|
|
|
84
85
|
resolvedSecurity: requestSecurity,
|
|
85
86
|
|
|
86
|
-
securitySource: client._options.
|
|
87
|
+
securitySource: client._options.apiKey,
|
|
87
88
|
retryConfig: options?.retries
|
|
88
89
|
|| client._options.retryConfig
|
|
89
90
|
|| { strategy: "none" },
|
|
@@ -102,7 +102,8 @@ async function $do(
|
|
|
102
102
|
|| "application/json;q=1, application/rss+xml;q=0",
|
|
103
103
|
}));
|
|
104
104
|
|
|
105
|
-
const
|
|
105
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
106
107
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
108
|
|
|
108
109
|
const context = {
|
|
@@ -113,7 +114,7 @@ async function $do(
|
|
|
113
114
|
|
|
114
115
|
resolvedSecurity: requestSecurity,
|
|
115
116
|
|
|
116
|
-
securitySource: client._options.
|
|
117
|
+
securitySource: client._options.apiKey,
|
|
117
118
|
retryConfig: options?.retries
|
|
118
119
|
|| client._options.retryConfig
|
|
119
120
|
|| { strategy: "none" },
|
|
@@ -72,7 +72,8 @@ async function $do(
|
|
|
72
72
|
Accept: "application/json",
|
|
73
73
|
}));
|
|
74
74
|
|
|
75
|
-
const
|
|
75
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
76
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
76
77
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
77
78
|
|
|
78
79
|
const context = {
|
|
@@ -83,7 +84,7 @@ async function $do(
|
|
|
83
84
|
|
|
84
85
|
resolvedSecurity: requestSecurity,
|
|
85
86
|
|
|
86
|
-
securitySource: client._options.
|
|
87
|
+
securitySource: client._options.apiKey,
|
|
87
88
|
retryConfig: options?.retries
|
|
88
89
|
|| client._options.retryConfig
|
|
89
90
|
|| { strategy: "none" },
|
|
@@ -6,7 +6,7 @@ import { OpenRouterCore } from "../core.js";
|
|
|
6
6
|
import * as M from "../lib/matchers.js";
|
|
7
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
8
|
import { RequestOptions } from "../lib/sdks.js";
|
|
9
|
-
import {
|
|
9
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
10
10
|
import { pathToFunc } from "../lib/url.js";
|
|
11
11
|
import {
|
|
12
12
|
ConnectionError,
|
|
@@ -27,6 +27,7 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
*/
|
|
28
28
|
export function modelsGetModelsUser(
|
|
29
29
|
client: OpenRouterCore,
|
|
30
|
+
security: operations.GetModelsUserSecurity,
|
|
30
31
|
options?: RequestOptions,
|
|
31
32
|
): APIPromise<
|
|
32
33
|
Result<
|
|
@@ -43,12 +44,14 @@ export function modelsGetModelsUser(
|
|
|
43
44
|
> {
|
|
44
45
|
return new APIPromise($do(
|
|
45
46
|
client,
|
|
47
|
+
security,
|
|
46
48
|
options,
|
|
47
49
|
));
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
async function $do(
|
|
51
53
|
client: OpenRouterCore,
|
|
54
|
+
security: operations.GetModelsUserSecurity,
|
|
52
55
|
options?: RequestOptions,
|
|
53
56
|
): Promise<
|
|
54
57
|
[
|
|
@@ -72,18 +75,25 @@ async function $do(
|
|
|
72
75
|
Accept: "application/json",
|
|
73
76
|
}));
|
|
74
77
|
|
|
75
|
-
const
|
|
76
|
-
|
|
78
|
+
const requestSecurity = resolveSecurity(
|
|
79
|
+
[
|
|
80
|
+
{
|
|
81
|
+
fieldName: "Authorization",
|
|
82
|
+
type: "apiKey:header",
|
|
83
|
+
value: security?.bearer,
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
);
|
|
77
87
|
|
|
78
88
|
const context = {
|
|
79
89
|
options: client._options,
|
|
80
90
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
81
91
|
operationID: "get_/models/user",
|
|
82
|
-
oAuth2Scopes:
|
|
92
|
+
oAuth2Scopes: null,
|
|
83
93
|
|
|
84
94
|
resolvedSecurity: requestSecurity,
|
|
85
95
|
|
|
86
|
-
securitySource:
|
|
96
|
+
securitySource: security,
|
|
87
97
|
retryConfig: options?.retries
|
|
88
98
|
|| client._options.retryConfig
|
|
89
99
|
|| { strategy: "none" },
|
|
@@ -8,7 +8,7 @@ import * as M from "../lib/matchers.js";
|
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import {
|
|
11
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
13
13
|
import {
|
|
14
14
|
ConnectionError,
|
|
@@ -29,6 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
*/
|
|
30
30
|
export function parametersGetParametersAuthorSlug(
|
|
31
31
|
client: OpenRouterCore,
|
|
32
|
+
security: operations.GetParametersAuthorSlugSecurity,
|
|
32
33
|
request: operations.GetParametersAuthorSlugRequest,
|
|
33
34
|
options?: RequestOptions,
|
|
34
35
|
): APIPromise<
|
|
@@ -46,6 +47,7 @@ export function parametersGetParametersAuthorSlug(
|
|
|
46
47
|
> {
|
|
47
48
|
return new APIPromise($do(
|
|
48
49
|
client,
|
|
50
|
+
security,
|
|
49
51
|
request,
|
|
50
52
|
options,
|
|
51
53
|
));
|
|
@@ -53,6 +55,7 @@ export function parametersGetParametersAuthorSlug(
|
|
|
53
55
|
|
|
54
56
|
async function $do(
|
|
55
57
|
client: OpenRouterCore,
|
|
58
|
+
security: operations.GetParametersAuthorSlugSecurity,
|
|
56
59
|
request: operations.GetParametersAuthorSlugRequest,
|
|
57
60
|
options?: RequestOptions,
|
|
58
61
|
): Promise<
|
|
@@ -104,18 +107,25 @@ async function $do(
|
|
|
104
107
|
Accept: "application/json",
|
|
105
108
|
}));
|
|
106
109
|
|
|
107
|
-
const
|
|
108
|
-
|
|
110
|
+
const requestSecurity = resolveSecurity(
|
|
111
|
+
[
|
|
112
|
+
{
|
|
113
|
+
fieldName: "Authorization",
|
|
114
|
+
type: "apiKey:header",
|
|
115
|
+
value: security?.bearer,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
);
|
|
109
119
|
|
|
110
120
|
const context = {
|
|
111
121
|
options: client._options,
|
|
112
122
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
123
|
operationID: "get_/parameters/{author}/{slug}",
|
|
114
|
-
oAuth2Scopes:
|
|
124
|
+
oAuth2Scopes: null,
|
|
115
125
|
|
|
116
126
|
resolvedSecurity: requestSecurity,
|
|
117
127
|
|
|
118
|
-
securitySource:
|
|
128
|
+
securitySource: security,
|
|
119
129
|
retryConfig: options?.retries
|
|
120
130
|
|| client._options.retryConfig
|
|
121
131
|
|| { strategy: "none" },
|
|
@@ -8,7 +8,7 @@ import * as M from "../lib/matchers.js";
|
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import {
|
|
11
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
13
13
|
import {
|
|
14
14
|
ConnectionError,
|
|
@@ -29,6 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
*/
|
|
30
30
|
export function postCreditsCoinbase(
|
|
31
31
|
client: OpenRouterCore,
|
|
32
|
+
security: operations.PostCreditsCoinbaseSecurity,
|
|
32
33
|
request?: operations.PostCreditsCoinbaseRequest | undefined,
|
|
33
34
|
options?: RequestOptions,
|
|
34
35
|
): APIPromise<
|
|
@@ -46,6 +47,7 @@ export function postCreditsCoinbase(
|
|
|
46
47
|
> {
|
|
47
48
|
return new APIPromise($do(
|
|
48
49
|
client,
|
|
50
|
+
security,
|
|
49
51
|
request,
|
|
50
52
|
options,
|
|
51
53
|
));
|
|
@@ -53,6 +55,7 @@ export function postCreditsCoinbase(
|
|
|
53
55
|
|
|
54
56
|
async function $do(
|
|
55
57
|
client: OpenRouterCore,
|
|
58
|
+
security: operations.PostCreditsCoinbaseSecurity,
|
|
56
59
|
request?: operations.PostCreditsCoinbaseRequest | undefined,
|
|
57
60
|
options?: RequestOptions,
|
|
58
61
|
): Promise<
|
|
@@ -94,18 +97,25 @@ async function $do(
|
|
|
94
97
|
Accept: "application/json",
|
|
95
98
|
}));
|
|
96
99
|
|
|
97
|
-
const
|
|
98
|
-
|
|
100
|
+
const requestSecurity = resolveSecurity(
|
|
101
|
+
[
|
|
102
|
+
{
|
|
103
|
+
fieldName: "Authorization",
|
|
104
|
+
type: "apiKey:header",
|
|
105
|
+
value: security?.bearer,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
);
|
|
99
109
|
|
|
100
110
|
const context = {
|
|
101
111
|
options: client._options,
|
|
102
112
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
103
113
|
operationID: "post_/credits/coinbase",
|
|
104
|
-
oAuth2Scopes:
|
|
114
|
+
oAuth2Scopes: null,
|
|
105
115
|
|
|
106
116
|
resolvedSecurity: requestSecurity,
|
|
107
117
|
|
|
108
|
-
securitySource:
|
|
118
|
+
securitySource: security,
|
|
109
119
|
retryConfig: options?.retries
|
|
110
120
|
|| client._options.retryConfig
|
|
111
121
|
|| { strategy: "none" },
|
package/src/lib/config.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as models from "../models/index.js";
|
|
6
5
|
import { HTTPClient } from "./http.js";
|
|
7
6
|
import { Logger } from "./logger.js";
|
|
8
7
|
import { RetryConfig } from "./retries.js";
|
|
@@ -20,10 +19,7 @@ export const ServerList = {
|
|
|
20
19
|
} as const;
|
|
21
20
|
|
|
22
21
|
export type SDKOptions = {
|
|
23
|
-
|
|
24
|
-
* The security details required to authenticate the SDK
|
|
25
|
-
*/
|
|
26
|
-
security?: models.Security | (() => Promise<models.Security>) | undefined;
|
|
22
|
+
apiKey?: string | (() => Promise<string>) | undefined;
|
|
27
23
|
|
|
28
24
|
httpClient?: HTTPClient;
|
|
29
25
|
/**
|
|
@@ -63,8 +59,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
63
59
|
export const SDK_METADATA = {
|
|
64
60
|
language: "typescript",
|
|
65
61
|
openapiDocVersion: "1.0.0",
|
|
66
|
-
sdkVersion: "0.0.0-beta.
|
|
62
|
+
sdkVersion: "0.0.0-beta.4",
|
|
67
63
|
genVersion: "2.711.4",
|
|
68
64
|
userAgent:
|
|
69
|
-
"speakeasy-sdk/typescript 0.0.0-beta.
|
|
65
|
+
"speakeasy-sdk/typescript 0.0.0-beta.4 2.711.4 1.0.0 @openrouter/sdk",
|
|
70
66
|
} as const;
|
package/src/lib/env.ts
CHANGED
|
@@ -8,14 +8,12 @@ import * as z from "zod";
|
|
|
8
8
|
|
|
9
9
|
export interface Env {
|
|
10
10
|
OPENROUTER_API_KEY?: string | undefined;
|
|
11
|
-
OPENROUTER_BEARER?: string | undefined;
|
|
12
11
|
|
|
13
12
|
OPENROUTER_DEBUG?: boolean | undefined;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export const envSchema: z.ZodType<Env, z.ZodTypeDef, unknown> = z.object({
|
|
17
16
|
OPENROUTER_API_KEY: z.string().optional(),
|
|
18
|
-
OPENROUTER_BEARER: z.string().optional(),
|
|
19
17
|
|
|
20
18
|
OPENROUTER_DEBUG: z.coerce.boolean().optional(),
|
|
21
19
|
});
|
package/src/lib/security.ts
CHANGED
|
@@ -243,18 +243,11 @@ export function resolveGlobalSecurity(
|
|
|
243
243
|
security: Partial<models.Security> | null | undefined,
|
|
244
244
|
): SecurityState | null {
|
|
245
245
|
return resolveSecurity(
|
|
246
|
-
[
|
|
247
|
-
{
|
|
248
|
-
fieldName: "Authorization",
|
|
249
|
-
type: "apiKey:header",
|
|
250
|
-
value: security?.apiKey ?? env().OPENROUTER_API_KEY,
|
|
251
|
-
},
|
|
252
|
-
],
|
|
253
246
|
[
|
|
254
247
|
{
|
|
255
248
|
fieldName: "Authorization",
|
|
256
249
|
type: "http:bearer",
|
|
257
|
-
value: security?.
|
|
250
|
+
value: security?.apiKey ?? env().OPENROUTER_API_KEY,
|
|
258
251
|
},
|
|
259
252
|
],
|
|
260
253
|
);
|
package/src/models/chaterror.ts
CHANGED
|
@@ -7,20 +7,60 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
7
7
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
9
|
|
|
10
|
+
export type Code = string | number;
|
|
11
|
+
|
|
10
12
|
export type ChatErrorError = {
|
|
11
|
-
code: string | null;
|
|
13
|
+
code: string | number | null;
|
|
12
14
|
message: string;
|
|
13
15
|
param: string | null;
|
|
14
16
|
type: string;
|
|
15
17
|
};
|
|
16
18
|
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const Code$inboundSchema: z.ZodType<Code, z.ZodTypeDef, unknown> = z
|
|
21
|
+
.union([z.string(), z.number()]);
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type Code$Outbound = string | number;
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const Code$outboundSchema: z.ZodType<Code$Outbound, z.ZodTypeDef, Code> =
|
|
28
|
+
z.union([z.string(), z.number()]);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
33
|
+
*/
|
|
34
|
+
export namespace Code$ {
|
|
35
|
+
/** @deprecated use `Code$inboundSchema` instead. */
|
|
36
|
+
export const inboundSchema = Code$inboundSchema;
|
|
37
|
+
/** @deprecated use `Code$outboundSchema` instead. */
|
|
38
|
+
export const outboundSchema = Code$outboundSchema;
|
|
39
|
+
/** @deprecated use `Code$Outbound` instead. */
|
|
40
|
+
export type Outbound = Code$Outbound;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function codeToJSON(code: Code): string {
|
|
44
|
+
return JSON.stringify(Code$outboundSchema.parse(code));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function codeFromJSON(
|
|
48
|
+
jsonString: string,
|
|
49
|
+
): SafeParseResult<Code, SDKValidationError> {
|
|
50
|
+
return safeParse(
|
|
51
|
+
jsonString,
|
|
52
|
+
(x) => Code$inboundSchema.parse(JSON.parse(x)),
|
|
53
|
+
`Failed to parse 'Code' from JSON`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
17
57
|
/** @internal */
|
|
18
58
|
export const ChatErrorError$inboundSchema: z.ZodType<
|
|
19
59
|
ChatErrorError,
|
|
20
60
|
z.ZodTypeDef,
|
|
21
61
|
unknown
|
|
22
62
|
> = z.object({
|
|
23
|
-
code: z.nullable(z.string()),
|
|
63
|
+
code: z.nullable(z.union([z.string(), z.number()])),
|
|
24
64
|
message: z.string(),
|
|
25
65
|
param: z.nullable(z.string()),
|
|
26
66
|
type: z.string(),
|
|
@@ -28,7 +68,7 @@ export const ChatErrorError$inboundSchema: z.ZodType<
|
|
|
28
68
|
|
|
29
69
|
/** @internal */
|
|
30
70
|
export type ChatErrorError$Outbound = {
|
|
31
|
-
code: string | null;
|
|
71
|
+
code: string | number | null;
|
|
32
72
|
message: string;
|
|
33
73
|
param: string | null;
|
|
34
74
|
type: string;
|
|
@@ -40,7 +80,7 @@ export const ChatErrorError$outboundSchema: z.ZodType<
|
|
|
40
80
|
z.ZodTypeDef,
|
|
41
81
|
ChatErrorError
|
|
42
82
|
> = z.object({
|
|
43
|
-
code: z.nullable(z.string()),
|
|
83
|
+
code: z.nullable(z.union([z.string(), z.number()])),
|
|
44
84
|
message: z.string(),
|
|
45
85
|
param: z.nullable(z.string()),
|
|
46
86
|
type: z.string(),
|
|
@@ -26,7 +26,7 @@ export type ChatResponse = {
|
|
|
26
26
|
created: number;
|
|
27
27
|
model: string;
|
|
28
28
|
object: "chat.completion";
|
|
29
|
-
systemFingerprint?: string | undefined;
|
|
29
|
+
systemFingerprint?: string | null | undefined;
|
|
30
30
|
usage?: ChatGenerationTokenUsage | undefined;
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -41,7 +41,7 @@ export const ChatResponse$inboundSchema: z.ZodType<
|
|
|
41
41
|
created: z.number(),
|
|
42
42
|
model: z.string(),
|
|
43
43
|
object: z.literal("chat.completion"),
|
|
44
|
-
system_fingerprint: z.string().optional(),
|
|
44
|
+
system_fingerprint: z.nullable(z.string()).optional(),
|
|
45
45
|
usage: ChatGenerationTokenUsage$inboundSchema.optional(),
|
|
46
46
|
}).transform((v) => {
|
|
47
47
|
return remap$(v, {
|
|
@@ -56,7 +56,7 @@ export type ChatResponse$Outbound = {
|
|
|
56
56
|
created: number;
|
|
57
57
|
model: string;
|
|
58
58
|
object: "chat.completion";
|
|
59
|
-
system_fingerprint?: string | undefined;
|
|
59
|
+
system_fingerprint?: string | null | undefined;
|
|
60
60
|
usage?: ChatGenerationTokenUsage$Outbound | undefined;
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -71,7 +71,7 @@ export const ChatResponse$outboundSchema: z.ZodType<
|
|
|
71
71
|
created: z.number(),
|
|
72
72
|
model: z.string(),
|
|
73
73
|
object: z.literal("chat.completion"),
|
|
74
|
-
systemFingerprint: z.string().optional(),
|
|
74
|
+
systemFingerprint: z.nullable(z.string()).optional(),
|
|
75
75
|
usage: ChatGenerationTokenUsage$outboundSchema.optional(),
|
|
76
76
|
}).transform((v) => {
|
|
77
77
|
return remap$(v, {
|
|
@@ -31,7 +31,7 @@ export type Data = {
|
|
|
31
31
|
created: number;
|
|
32
32
|
model: string;
|
|
33
33
|
object: "chat.completion.chunk";
|
|
34
|
-
systemFingerprint?: string | undefined;
|
|
34
|
+
systemFingerprint?: string | null | undefined;
|
|
35
35
|
error?: ChatStreamingResponseChunkError | undefined;
|
|
36
36
|
usage?: ChatGenerationTokenUsage | undefined;
|
|
37
37
|
};
|
|
@@ -107,7 +107,7 @@ export const Data$inboundSchema: z.ZodType<Data, z.ZodTypeDef, unknown> = z
|
|
|
107
107
|
created: z.number(),
|
|
108
108
|
model: z.string(),
|
|
109
109
|
object: z.literal("chat.completion.chunk"),
|
|
110
|
-
system_fingerprint: z.string().optional(),
|
|
110
|
+
system_fingerprint: z.nullable(z.string()).optional(),
|
|
111
111
|
error: z.lazy(() => ChatStreamingResponseChunkError$inboundSchema)
|
|
112
112
|
.optional(),
|
|
113
113
|
usage: ChatGenerationTokenUsage$inboundSchema.optional(),
|
|
@@ -124,7 +124,7 @@ export type Data$Outbound = {
|
|
|
124
124
|
created: number;
|
|
125
125
|
model: string;
|
|
126
126
|
object: "chat.completion.chunk";
|
|
127
|
-
system_fingerprint?: string | undefined;
|
|
127
|
+
system_fingerprint?: string | null | undefined;
|
|
128
128
|
error?: ChatStreamingResponseChunkError$Outbound | undefined;
|
|
129
129
|
usage?: ChatGenerationTokenUsage$Outbound | undefined;
|
|
130
130
|
};
|
|
@@ -137,7 +137,7 @@ export const Data$outboundSchema: z.ZodType<Data$Outbound, z.ZodTypeDef, Data> =
|
|
|
137
137
|
created: z.number(),
|
|
138
138
|
model: z.string(),
|
|
139
139
|
object: z.literal("chat.completion.chunk"),
|
|
140
|
-
systemFingerprint: z.string().optional(),
|
|
140
|
+
systemFingerprint: z.nullable(z.string()).optional(),
|
|
141
141
|
error: z.lazy(() => ChatStreamingResponseChunkError$outboundSchema)
|
|
142
142
|
.optional(),
|
|
143
143
|
usage: ChatGenerationTokenUsage$outboundSchema.optional(),
|
|
@@ -9,7 +9,7 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
9
9
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
-
export const
|
|
12
|
+
export const CodeEnum = {
|
|
13
13
|
OneHundred: 100,
|
|
14
14
|
OneHundredAndOne: 101,
|
|
15
15
|
OneHundredAndTwo: 102,
|
|
@@ -81,10 +81,10 @@ export const Code = {
|
|
|
81
81
|
FiveHundredAndTwentyNine: 529,
|
|
82
82
|
FiveHundredAndThirty: 530,
|
|
83
83
|
} as const;
|
|
84
|
-
export type
|
|
84
|
+
export type CodeEnum = ClosedEnum<typeof CodeEnum>;
|
|
85
85
|
|
|
86
86
|
export type ErrorResponseError = {
|
|
87
|
-
code:
|
|
87
|
+
code: CodeEnum;
|
|
88
88
|
message: string;
|
|
89
89
|
metadata?: { [k: string]: any | null } | null | undefined;
|
|
90
90
|
};
|
|
@@ -98,23 +98,22 @@ export type ErrorResponse = {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
/** @internal */
|
|
101
|
-
export const
|
|
102
|
-
|
|
103
|
-
);
|
|
101
|
+
export const CodeEnum$inboundSchema: z.ZodNativeEnum<typeof CodeEnum> = z
|
|
102
|
+
.nativeEnum(CodeEnum);
|
|
104
103
|
|
|
105
104
|
/** @internal */
|
|
106
|
-
export const
|
|
107
|
-
|
|
105
|
+
export const CodeEnum$outboundSchema: z.ZodNativeEnum<typeof CodeEnum> =
|
|
106
|
+
CodeEnum$inboundSchema;
|
|
108
107
|
|
|
109
108
|
/**
|
|
110
109
|
* @internal
|
|
111
110
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
112
111
|
*/
|
|
113
|
-
export namespace
|
|
114
|
-
/** @deprecated use `
|
|
115
|
-
export const inboundSchema =
|
|
116
|
-
/** @deprecated use `
|
|
117
|
-
export const outboundSchema =
|
|
112
|
+
export namespace CodeEnum$ {
|
|
113
|
+
/** @deprecated use `CodeEnum$inboundSchema` instead. */
|
|
114
|
+
export const inboundSchema = CodeEnum$inboundSchema;
|
|
115
|
+
/** @deprecated use `CodeEnum$outboundSchema` instead. */
|
|
116
|
+
export const outboundSchema = CodeEnum$outboundSchema;
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
/** @internal */
|
|
@@ -123,7 +122,7 @@ export const ErrorResponseError$inboundSchema: z.ZodType<
|
|
|
123
122
|
z.ZodTypeDef,
|
|
124
123
|
unknown
|
|
125
124
|
> = z.object({
|
|
126
|
-
code:
|
|
125
|
+
code: CodeEnum$inboundSchema,
|
|
127
126
|
message: z.string(),
|
|
128
127
|
metadata: z.nullable(z.record(z.nullable(z.any()))).optional(),
|
|
129
128
|
});
|
|
@@ -141,7 +140,7 @@ export const ErrorResponseError$outboundSchema: z.ZodType<
|
|
|
141
140
|
z.ZodTypeDef,
|
|
142
141
|
ErrorResponseError
|
|
143
142
|
> = z.object({
|
|
144
|
-
code:
|
|
143
|
+
code: CodeEnum$outboundSchema,
|
|
145
144
|
message: z.string(),
|
|
146
145
|
metadata: z.nullable(z.record(z.nullable(z.any()))).optional(),
|
|
147
146
|
});
|
|
@@ -10,6 +10,10 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
import * as models from "../index.js";
|
|
12
12
|
|
|
13
|
+
export type GetModelsUserSecurity = {
|
|
14
|
+
bearer: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
13
17
|
export type GetModelsUserPrompt = number | string | any;
|
|
14
18
|
|
|
15
19
|
export type GetModelsUserCompletion = number | string | any;
|
|
@@ -284,6 +288,60 @@ export type GetModelsUserResponse =
|
|
|
284
288
|
| GetModelsUserResponseBody
|
|
285
289
|
| models.ErrorResponse;
|
|
286
290
|
|
|
291
|
+
/** @internal */
|
|
292
|
+
export const GetModelsUserSecurity$inboundSchema: z.ZodType<
|
|
293
|
+
GetModelsUserSecurity,
|
|
294
|
+
z.ZodTypeDef,
|
|
295
|
+
unknown
|
|
296
|
+
> = z.object({
|
|
297
|
+
bearer: z.string(),
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
/** @internal */
|
|
301
|
+
export type GetModelsUserSecurity$Outbound = {
|
|
302
|
+
bearer: string;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
/** @internal */
|
|
306
|
+
export const GetModelsUserSecurity$outboundSchema: z.ZodType<
|
|
307
|
+
GetModelsUserSecurity$Outbound,
|
|
308
|
+
z.ZodTypeDef,
|
|
309
|
+
GetModelsUserSecurity
|
|
310
|
+
> = z.object({
|
|
311
|
+
bearer: z.string(),
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* @internal
|
|
316
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
317
|
+
*/
|
|
318
|
+
export namespace GetModelsUserSecurity$ {
|
|
319
|
+
/** @deprecated use `GetModelsUserSecurity$inboundSchema` instead. */
|
|
320
|
+
export const inboundSchema = GetModelsUserSecurity$inboundSchema;
|
|
321
|
+
/** @deprecated use `GetModelsUserSecurity$outboundSchema` instead. */
|
|
322
|
+
export const outboundSchema = GetModelsUserSecurity$outboundSchema;
|
|
323
|
+
/** @deprecated use `GetModelsUserSecurity$Outbound` instead. */
|
|
324
|
+
export type Outbound = GetModelsUserSecurity$Outbound;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export function getModelsUserSecurityToJSON(
|
|
328
|
+
getModelsUserSecurity: GetModelsUserSecurity,
|
|
329
|
+
): string {
|
|
330
|
+
return JSON.stringify(
|
|
331
|
+
GetModelsUserSecurity$outboundSchema.parse(getModelsUserSecurity),
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export function getModelsUserSecurityFromJSON(
|
|
336
|
+
jsonString: string,
|
|
337
|
+
): SafeParseResult<GetModelsUserSecurity, SDKValidationError> {
|
|
338
|
+
return safeParse(
|
|
339
|
+
jsonString,
|
|
340
|
+
(x) => GetModelsUserSecurity$inboundSchema.parse(JSON.parse(x)),
|
|
341
|
+
`Failed to parse 'GetModelsUserSecurity' from JSON`,
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
|
|
287
345
|
/** @internal */
|
|
288
346
|
export const GetModelsUserPrompt$inboundSchema: z.ZodType<
|
|
289
347
|
GetModelsUserPrompt,
|
|
@@ -10,6 +10,10 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
import * as models from "../index.js";
|
|
12
12
|
|
|
13
|
+
export type GetParametersAuthorSlugSecurity = {
|
|
14
|
+
bearer: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
13
17
|
export const GetParametersAuthorSlugProvider = {
|
|
14
18
|
Ai21: "AI21",
|
|
15
19
|
AionLabs: "AionLabs",
|
|
@@ -142,6 +146,62 @@ export type GetParametersAuthorSlugResponse =
|
|
|
142
146
|
| GetParametersAuthorSlugResponseBody
|
|
143
147
|
| models.ErrorResponse;
|
|
144
148
|
|
|
149
|
+
/** @internal */
|
|
150
|
+
export const GetParametersAuthorSlugSecurity$inboundSchema: z.ZodType<
|
|
151
|
+
GetParametersAuthorSlugSecurity,
|
|
152
|
+
z.ZodTypeDef,
|
|
153
|
+
unknown
|
|
154
|
+
> = z.object({
|
|
155
|
+
bearer: z.string(),
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
/** @internal */
|
|
159
|
+
export type GetParametersAuthorSlugSecurity$Outbound = {
|
|
160
|
+
bearer: string;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/** @internal */
|
|
164
|
+
export const GetParametersAuthorSlugSecurity$outboundSchema: z.ZodType<
|
|
165
|
+
GetParametersAuthorSlugSecurity$Outbound,
|
|
166
|
+
z.ZodTypeDef,
|
|
167
|
+
GetParametersAuthorSlugSecurity
|
|
168
|
+
> = z.object({
|
|
169
|
+
bearer: z.string(),
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @internal
|
|
174
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
175
|
+
*/
|
|
176
|
+
export namespace GetParametersAuthorSlugSecurity$ {
|
|
177
|
+
/** @deprecated use `GetParametersAuthorSlugSecurity$inboundSchema` instead. */
|
|
178
|
+
export const inboundSchema = GetParametersAuthorSlugSecurity$inboundSchema;
|
|
179
|
+
/** @deprecated use `GetParametersAuthorSlugSecurity$outboundSchema` instead. */
|
|
180
|
+
export const outboundSchema = GetParametersAuthorSlugSecurity$outboundSchema;
|
|
181
|
+
/** @deprecated use `GetParametersAuthorSlugSecurity$Outbound` instead. */
|
|
182
|
+
export type Outbound = GetParametersAuthorSlugSecurity$Outbound;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function getParametersAuthorSlugSecurityToJSON(
|
|
186
|
+
getParametersAuthorSlugSecurity: GetParametersAuthorSlugSecurity,
|
|
187
|
+
): string {
|
|
188
|
+
return JSON.stringify(
|
|
189
|
+
GetParametersAuthorSlugSecurity$outboundSchema.parse(
|
|
190
|
+
getParametersAuthorSlugSecurity,
|
|
191
|
+
),
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function getParametersAuthorSlugSecurityFromJSON(
|
|
196
|
+
jsonString: string,
|
|
197
|
+
): SafeParseResult<GetParametersAuthorSlugSecurity, SDKValidationError> {
|
|
198
|
+
return safeParse(
|
|
199
|
+
jsonString,
|
|
200
|
+
(x) => GetParametersAuthorSlugSecurity$inboundSchema.parse(JSON.parse(x)),
|
|
201
|
+
`Failed to parse 'GetParametersAuthorSlugSecurity' from JSON`,
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
145
205
|
/** @internal */
|
|
146
206
|
export const GetParametersAuthorSlugProvider$inboundSchema: z.ZodNativeEnum<
|
|
147
207
|
typeof GetParametersAuthorSlugProvider
|