@openrouter/sdk 0.0.0-beta.33 → 0.0.0-beta.38
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 -3
- package/REACT_QUERY.md +4 -4
- package/README.md +9 -9
- package/dist/commonjs/funcs/betaResponsesSend.d.ts +26 -0
- package/dist/commonjs/funcs/betaResponsesSend.d.ts.map +1 -0
- package/dist/commonjs/funcs/{betaResponsesSendRequest.js → betaResponsesSend.js} +5 -13
- package/dist/commonjs/funcs/betaResponsesSend.js.map +1 -0
- package/dist/commonjs/funcs/chatSend.d.ts +3 -13
- package/dist/commonjs/funcs/chatSend.d.ts.map +1 -1
- package/dist/commonjs/funcs/chatSend.js +1 -8
- package/dist/commonjs/funcs/chatSend.js.map +1 -1
- package/dist/commonjs/funcs/modelsList.d.ts +1 -7
- package/dist/commonjs/funcs/modelsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/modelsList.js +1 -8
- package/dist/commonjs/funcs/modelsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/createapikeydata.d.ts +120 -0
- package/dist/commonjs/models/createapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/createapikeydata.js +134 -0
- package/dist/commonjs/models/createapikeydata.js.map +1 -0
- package/dist/commonjs/models/endpointslist.d.ts +8 -8
- package/dist/commonjs/models/endpointslist.d.ts.map +1 -1
- package/dist/commonjs/models/endpointslist.js +13 -13
- package/dist/commonjs/models/endpointslist.js.map +1 -1
- package/dist/commonjs/models/getapikeydata.d.ts +120 -0
- package/dist/commonjs/models/getapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/getapikeydata.js +134 -0
- package/dist/commonjs/models/getapikeydata.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +5 -4
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +5 -4
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/keyinfo.d.ts +8 -8
- package/dist/commonjs/models/listapikeysdata.d.ts +117 -0
- package/dist/commonjs/models/listapikeysdata.d.ts.map +1 -0
- package/dist/commonjs/models/listapikeysdata.js +134 -0
- package/dist/commonjs/models/listapikeysdata.js.map +1 -0
- package/dist/commonjs/models/operations/create.d.ts +43 -68
- package/dist/commonjs/models/operations/create.d.ts.map +1 -1
- package/dist/commonjs/models/operations/create.js +31 -54
- package/dist/commonjs/models/operations/create.js.map +1 -1
- package/dist/commonjs/models/operations/generate.d.ts +103 -103
- package/dist/commonjs/models/operations/generate.d.ts.map +1 -1
- package/dist/commonjs/models/operations/generate.js +142 -153
- package/dist/commonjs/models/operations/generate.js.map +1 -1
- package/dist/commonjs/models/operations/getapikey.d.ts +3 -68
- package/dist/commonjs/models/operations/getapikey.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getapikey.js +4 -55
- package/dist/commonjs/models/operations/getapikey.js.map +1 -1
- package/dist/commonjs/models/operations/listapikeys.d.ts +3 -65
- package/dist/commonjs/models/operations/listapikeys.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listapikeys.js +4 -54
- package/dist/commonjs/models/operations/listapikeys.js.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts +1693 -0
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.js +1156 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/commonjs/models/operations/update.d.ts +43 -68
- package/dist/commonjs/models/operations/update.d.ts.map +1 -1
- package/dist/commonjs/models/operations/update.js +31 -54
- package/dist/commonjs/models/operations/update.js.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts +19 -19
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.js +30 -32
- package/dist/commonjs/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts +3 -0
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.js +1 -0
- package/dist/commonjs/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/commonjs/models/{toolchoice.d.ts → toolchoiceunion.d.ts} +95 -16
- package/dist/commonjs/models/toolchoiceunion.d.ts.map +1 -0
- package/dist/commonjs/models/{toolchoice.js → toolchoiceunion.js} +94 -21
- package/dist/commonjs/models/toolchoiceunion.js.map +1 -0
- package/dist/commonjs/models/updateapikeydata.d.ts +120 -0
- package/dist/commonjs/models/updateapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/updateapikeydata.js +134 -0
- package/dist/commonjs/models/updateapikeydata.js.map +1 -0
- package/dist/commonjs/react-query/betaResponsesSend.d.ts +23 -0
- package/dist/commonjs/react-query/betaResponsesSend.d.ts.map +1 -0
- package/dist/commonjs/react-query/betaResponsesSend.js +47 -0
- package/dist/commonjs/react-query/betaResponsesSend.js.map +1 -0
- package/dist/commonjs/react-query/chatSend.d.ts +1 -5
- package/dist/commonjs/react-query/chatSend.d.ts.map +1 -1
- package/dist/commonjs/react-query/chatSend.js +0 -3
- package/dist/commonjs/react-query/chatSend.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -1
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -1
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/modelsList.d.ts +1 -5
- package/dist/commonjs/react-query/modelsList.d.ts.map +1 -1
- package/dist/commonjs/react-query/modelsList.js +0 -3
- package/dist/commonjs/react-query/modelsList.js.map +1 -1
- package/dist/commonjs/sdk/chat.d.ts +3 -11
- package/dist/commonjs/sdk/chat.d.ts.map +1 -1
- package/dist/commonjs/sdk/chat.js +1 -3
- package/dist/commonjs/sdk/chat.js.map +1 -1
- package/dist/commonjs/sdk/models.d.ts +1 -5
- package/dist/commonjs/sdk/models.d.ts.map +1 -1
- package/dist/commonjs/sdk/models.js +1 -3
- package/dist/commonjs/sdk/models.js.map +1 -1
- package/dist/commonjs/sdk/responses.d.ts +5 -13
- package/dist/commonjs/sdk/responses.d.ts.map +1 -1
- package/dist/commonjs/sdk/responses.js +4 -6
- package/dist/commonjs/sdk/responses.js.map +1 -1
- package/dist/esm/funcs/betaResponsesSend.d.ts +26 -0
- package/dist/esm/funcs/betaResponsesSend.d.ts.map +1 -0
- package/dist/esm/funcs/{betaResponsesSendRequest.js → betaResponsesSend.js} +4 -11
- package/dist/esm/funcs/betaResponsesSend.js.map +1 -0
- package/dist/esm/funcs/chatSend.d.ts +3 -13
- package/dist/esm/funcs/chatSend.d.ts.map +1 -1
- package/dist/esm/funcs/chatSend.js +1 -7
- package/dist/esm/funcs/chatSend.js.map +1 -1
- package/dist/esm/funcs/modelsList.d.ts +1 -7
- package/dist/esm/funcs/modelsList.d.ts.map +1 -1
- package/dist/esm/funcs/modelsList.js +1 -7
- package/dist/esm/funcs/modelsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/createapikeydata.d.ts +120 -0
- package/dist/esm/models/createapikeydata.d.ts.map +1 -0
- package/dist/esm/models/createapikeydata.js +96 -0
- package/dist/esm/models/createapikeydata.js.map +1 -0
- package/dist/esm/models/endpointslist.d.ts +8 -8
- package/dist/esm/models/endpointslist.d.ts.map +1 -1
- package/dist/esm/models/endpointslist.js +12 -12
- package/dist/esm/models/endpointslist.js.map +1 -1
- package/dist/esm/models/getapikeydata.d.ts +120 -0
- package/dist/esm/models/getapikeydata.d.ts.map +1 -0
- package/dist/esm/models/getapikeydata.js +96 -0
- package/dist/esm/models/getapikeydata.js.map +1 -0
- package/dist/esm/models/index.d.ts +5 -4
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +5 -4
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/keyinfo.d.ts +8 -8
- package/dist/esm/models/listapikeysdata.d.ts +117 -0
- package/dist/esm/models/listapikeysdata.d.ts.map +1 -0
- package/dist/esm/models/listapikeysdata.js +96 -0
- package/dist/esm/models/listapikeysdata.js.map +1 -0
- package/dist/esm/models/operations/create.d.ts +43 -68
- package/dist/esm/models/operations/create.d.ts.map +1 -1
- package/dist/esm/models/operations/create.js +30 -51
- package/dist/esm/models/operations/create.js.map +1 -1
- package/dist/esm/models/operations/generate.d.ts +103 -103
- package/dist/esm/models/operations/generate.d.ts.map +1 -1
- package/dist/esm/models/operations/generate.js +138 -149
- package/dist/esm/models/operations/generate.js.map +1 -1
- package/dist/esm/models/operations/getapikey.d.ts +3 -68
- package/dist/esm/models/operations/getapikey.d.ts.map +1 -1
- package/dist/esm/models/operations/getapikey.js +3 -52
- package/dist/esm/models/operations/getapikey.js.map +1 -1
- package/dist/esm/models/operations/listapikeys.d.ts +3 -65
- package/dist/esm/models/operations/listapikeys.d.ts.map +1 -1
- package/dist/esm/models/operations/listapikeys.js +3 -51
- package/dist/esm/models/operations/listapikeys.js.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.d.ts +1693 -0
- package/dist/esm/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.js +1117 -0
- package/dist/esm/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/esm/models/operations/update.d.ts +43 -68
- package/dist/esm/models/operations/update.d.ts.map +1 -1
- package/dist/esm/models/operations/update.js +30 -51
- package/dist/esm/models/operations/update.js.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.d.ts +19 -19
- package/dist/esm/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.js +29 -31
- package/dist/esm/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.d.ts +3 -0
- package/dist/esm/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.js +1 -0
- package/dist/esm/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/esm/models/{toolchoice.d.ts → toolchoiceunion.d.ts} +95 -16
- package/dist/esm/models/toolchoiceunion.d.ts.map +1 -0
- package/dist/esm/models/toolchoiceunion.js +164 -0
- package/dist/esm/models/toolchoiceunion.js.map +1 -0
- package/dist/esm/models/updateapikeydata.d.ts +120 -0
- package/dist/esm/models/updateapikeydata.d.ts.map +1 -0
- package/dist/esm/models/updateapikeydata.js +96 -0
- package/dist/esm/models/updateapikeydata.js.map +1 -0
- package/dist/esm/react-query/betaResponsesSend.d.ts +23 -0
- package/dist/esm/react-query/betaResponsesSend.d.ts.map +1 -0
- package/dist/esm/react-query/{betaResponsesSendRequest.js → betaResponsesSend.js} +10 -11
- package/dist/esm/react-query/betaResponsesSend.js.map +1 -0
- package/dist/esm/react-query/chatSend.d.ts +1 -5
- package/dist/esm/react-query/chatSend.d.ts.map +1 -1
- package/dist/esm/react-query/chatSend.js +0 -1
- package/dist/esm/react-query/chatSend.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -1
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -1
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/modelsList.d.ts +1 -5
- package/dist/esm/react-query/modelsList.d.ts.map +1 -1
- package/dist/esm/react-query/modelsList.js +0 -1
- package/dist/esm/react-query/modelsList.js.map +1 -1
- package/dist/esm/sdk/chat.d.ts +3 -11
- package/dist/esm/sdk/chat.d.ts.map +1 -1
- package/dist/esm/sdk/chat.js +0 -1
- package/dist/esm/sdk/chat.js.map +1 -1
- package/dist/esm/sdk/models.d.ts +1 -5
- package/dist/esm/sdk/models.d.ts.map +1 -1
- package/dist/esm/sdk/models.js +0 -1
- package/dist/esm/sdk/models.js.map +1 -1
- package/dist/esm/sdk/responses.d.ts +5 -13
- package/dist/esm/sdk/responses.d.ts.map +1 -1
- package/dist/esm/sdk/responses.js +3 -4
- package/dist/esm/sdk/responses.js.map +1 -1
- package/docs/sdks/apikeys/README.md +4 -0
- package/docs/sdks/responses/README.md +9 -9
- package/examples/{betaResponsesSendRequest.example.ts → betaResponsesSend.example.ts} +2 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/{betaResponsesSendRequest.ts → betaResponsesSend.ts} +17 -22
- package/src/funcs/chatSend.ts +6 -12
- package/src/funcs/modelsList.ts +3 -9
- package/src/lib/config.ts +3 -3
- package/src/models/createapikeydata.ts +222 -0
- package/src/models/endpointslist.ts +14 -18
- package/src/models/getapikeydata.ts +218 -0
- package/src/models/index.ts +5 -4
- package/src/models/keyinfo.ts +8 -8
- package/src/models/listapikeysdata.ts +217 -0
- package/src/models/operations/create.ts +49 -123
- package/src/models/operations/generate.ts +232 -188
- package/src/models/operations/getapikey.ts +5 -124
- package/src/models/operations/listapikeys.ts +5 -122
- package/src/models/operations/sendresponsesrequest.ts +2005 -0
- package/src/models/operations/update.ts +49 -123
- package/src/models/responsesnonstreamingresponse.ts +37 -55
- package/src/models/responsesoutputitemreasoning.ts +1 -0
- package/src/models/{toolchoice.ts → toolchoiceunion.ts} +181 -37
- package/src/models/updateapikeydata.ts +222 -0
- package/src/react-query/{betaResponsesSendRequest.ts → betaResponsesSend.ts} +20 -26
- package/src/react-query/chatSend.ts +2 -4
- package/src/react-query/index.ts +1 -1
- package/src/react-query/modelsList.ts +2 -4
- package/src/sdk/chat.ts +5 -7
- package/src/sdk/models.ts +2 -4
- package/src/sdk/responses.ts +16 -19
- package/dist/commonjs/funcs/betaResponsesSendRequest.d.ts +0 -36
- package/dist/commonjs/funcs/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/commonjs/funcs/betaResponsesSendRequest.js.map +0 -1
- package/dist/commonjs/models/openairesponsesrequest.d.ts +0 -1704
- package/dist/commonjs/models/openairesponsesrequest.d.ts.map +0 -1
- package/dist/commonjs/models/openairesponsesrequest.js +0 -1210
- package/dist/commonjs/models/openairesponsesrequest.js.map +0 -1
- package/dist/commonjs/models/toolchoice.d.ts.map +0 -1
- package/dist/commonjs/models/toolchoice.js.map +0 -1
- package/dist/commonjs/models/toolchoicefunction.d.ts +0 -57
- package/dist/commonjs/models/toolchoicefunction.d.ts.map +0 -1
- package/dist/commonjs/models/toolchoicefunction.js +0 -89
- package/dist/commonjs/models/toolchoicefunction.js.map +0 -1
- package/dist/commonjs/models/toolchoicetypes.d.ts +0 -33
- package/dist/commonjs/models/toolchoicetypes.d.ts.map +0 -1
- package/dist/commonjs/models/toolchoicetypes.js +0 -70
- package/dist/commonjs/models/toolchoicetypes.js.map +0 -1
- package/dist/commonjs/react-query/betaResponsesSendRequest.d.ts +0 -28
- package/dist/commonjs/react-query/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/commonjs/react-query/betaResponsesSendRequest.js +0 -50
- package/dist/commonjs/react-query/betaResponsesSendRequest.js.map +0 -1
- package/dist/esm/funcs/betaResponsesSendRequest.d.ts +0 -36
- package/dist/esm/funcs/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/esm/funcs/betaResponsesSendRequest.js.map +0 -1
- package/dist/esm/models/openairesponsesrequest.d.ts +0 -1704
- package/dist/esm/models/openairesponsesrequest.d.ts.map +0 -1
- package/dist/esm/models/openairesponsesrequest.js +0 -1136
- package/dist/esm/models/openairesponsesrequest.js.map +0 -1
- package/dist/esm/models/toolchoice.d.ts.map +0 -1
- package/dist/esm/models/toolchoice.js +0 -95
- package/dist/esm/models/toolchoice.js.map +0 -1
- package/dist/esm/models/toolchoicefunction.d.ts +0 -57
- package/dist/esm/models/toolchoicefunction.d.ts.map +0 -1
- package/dist/esm/models/toolchoicefunction.js +0 -51
- package/dist/esm/models/toolchoicefunction.js.map +0 -1
- package/dist/esm/models/toolchoicetypes.d.ts +0 -33
- package/dist/esm/models/toolchoicetypes.d.ts.map +0 -1
- package/dist/esm/models/toolchoicetypes.js +0 -32
- package/dist/esm/models/toolchoicetypes.js.map +0 -1
- package/dist/esm/react-query/betaResponsesSendRequest.d.ts +0 -28
- package/dist/esm/react-query/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/esm/react-query/betaResponsesSendRequest.js.map +0 -1
- package/src/models/openairesponsesrequest.ts +0 -1974
- package/src/models/toolchoicefunction.ts +0 -100
- package/src/models/toolchoicetypes.ts +0 -73
|
@@ -136,6 +136,7 @@ async function run() {
|
|
|
136
136
|
const result = await openRouter.apiKeys.create({
|
|
137
137
|
name: "My New API Key",
|
|
138
138
|
limit: 50,
|
|
139
|
+
limitReset: "monthly",
|
|
139
140
|
includeByokInLimit: true,
|
|
140
141
|
});
|
|
141
142
|
|
|
@@ -163,6 +164,7 @@ async function run() {
|
|
|
163
164
|
const res = await apiKeysCreate(openRouter, {
|
|
164
165
|
name: "My New API Key",
|
|
165
166
|
limit: 50,
|
|
167
|
+
limitReset: "monthly",
|
|
166
168
|
includeByokInLimit: true,
|
|
167
169
|
});
|
|
168
170
|
if (res.ok) {
|
|
@@ -234,6 +236,7 @@ async function run() {
|
|
|
234
236
|
name: "Updated API Key Name",
|
|
235
237
|
disabled: false,
|
|
236
238
|
limit: 75,
|
|
239
|
+
limitReset: "daily",
|
|
237
240
|
includeByokInLimit: true,
|
|
238
241
|
},
|
|
239
242
|
});
|
|
@@ -265,6 +268,7 @@ async function run() {
|
|
|
265
268
|
name: "Updated API Key Name",
|
|
266
269
|
disabled: false,
|
|
267
270
|
limit: 75,
|
|
271
|
+
limitReset: "daily",
|
|
268
272
|
includeByokInLimit: true,
|
|
269
273
|
},
|
|
270
274
|
});
|
|
@@ -7,9 +7,9 @@ beta.responses endpoints
|
|
|
7
7
|
|
|
8
8
|
### Available Operations
|
|
9
9
|
|
|
10
|
-
* [
|
|
10
|
+
* [send](#send) - Submit a response request
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## send
|
|
13
13
|
|
|
14
14
|
Submits a request to the Responses API (beta)
|
|
15
15
|
|
|
@@ -24,7 +24,7 @@ const openRouter = new OpenRouter({
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
async function run() {
|
|
27
|
-
const result = await openRouter.beta.responses.
|
|
27
|
+
const result = await openRouter.beta.responses.send({
|
|
28
28
|
input: "Hello, how can I help you today?",
|
|
29
29
|
instructions: "<value>",
|
|
30
30
|
metadata: {
|
|
@@ -108,7 +108,7 @@ The standalone function version of this method:
|
|
|
108
108
|
|
|
109
109
|
```typescript
|
|
110
110
|
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
111
|
-
import {
|
|
111
|
+
import { betaResponsesSend } from "@openrouter/sdk/funcs/betaResponsesSend.js";
|
|
112
112
|
|
|
113
113
|
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
114
114
|
// You can create one instance of it to use across an application.
|
|
@@ -117,7 +117,7 @@ const openRouter = new OpenRouterCore({
|
|
|
117
117
|
});
|
|
118
118
|
|
|
119
119
|
async function run() {
|
|
120
|
-
const res = await
|
|
120
|
+
const res = await betaResponsesSend(openRouter, {
|
|
121
121
|
input: "Hello, how can I help you today?",
|
|
122
122
|
instructions: "<value>",
|
|
123
123
|
metadata: {
|
|
@@ -192,7 +192,7 @@ async function run() {
|
|
|
192
192
|
const { value: result } = res;
|
|
193
193
|
console.log(result);
|
|
194
194
|
} else {
|
|
195
|
-
console.log("
|
|
195
|
+
console.log("betaResponsesSend failed:", res.error);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
@@ -212,15 +212,15 @@ associated utilities.
|
|
|
212
212
|
```tsx
|
|
213
213
|
import {
|
|
214
214
|
// Mutation hook for triggering the API call.
|
|
215
|
-
|
|
216
|
-
} from "@openrouter/sdk/react-query/
|
|
215
|
+
useBetaResponsesSendMutation
|
|
216
|
+
} from "@openrouter/sdk/react-query/betaResponsesSend.js";
|
|
217
217
|
```
|
|
218
218
|
|
|
219
219
|
### Parameters
|
|
220
220
|
|
|
221
221
|
| Parameter | Type | Required | Description |
|
|
222
222
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
223
|
-
| `request` | [
|
|
223
|
+
| `request` | [operations.SendResponsesRequestRequest](../../models/operations/sendresponsesrequestrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
224
224
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
225
225
|
| `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. |
|
|
226
226
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
@@ -8,7 +8,7 @@ dotenv.config();
|
|
|
8
8
|
* Example usage of the @openrouter/sdk SDK
|
|
9
9
|
*
|
|
10
10
|
* To run this example from the examples directory:
|
|
11
|
-
* npm run build && npx tsx
|
|
11
|
+
* npm run build && npx tsx betaResponsesSend.example.ts
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { OpenRouter } from "@openrouter/sdk";
|
|
@@ -18,7 +18,7 @@ const openRouter = new OpenRouter({
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
async function main() {
|
|
21
|
-
const result = await openRouter.beta.responses.
|
|
21
|
+
const result = await openRouter.beta.responses.send({
|
|
22
22
|
input: "Hello, how can I help you today?",
|
|
23
23
|
instructions: "<value>",
|
|
24
24
|
metadata: {
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -27,21 +27,16 @@ import * as operations from "../models/operations/index.js";
|
|
|
27
27
|
import { APICall, APIPromise } from "../types/async.js";
|
|
28
28
|
import { Result } from "../types/fp.js";
|
|
29
29
|
|
|
30
|
-
export enum SendRequestAcceptEnum {
|
|
31
|
-
applicationJson = "application/json",
|
|
32
|
-
textEventStream = "text/event-stream",
|
|
33
|
-
}
|
|
34
|
-
|
|
35
30
|
/**
|
|
36
31
|
* Submit a response request
|
|
37
32
|
*
|
|
38
33
|
* @remarks
|
|
39
34
|
* Submits a request to the Responses API (beta)
|
|
40
35
|
*/
|
|
41
|
-
export function
|
|
36
|
+
export function betaResponsesSend(
|
|
42
37
|
client: OpenRouterCore,
|
|
43
|
-
request:
|
|
44
|
-
options?: RequestOptions
|
|
38
|
+
request: operations.SendResponsesRequestRequest & { stream?: false },
|
|
39
|
+
options?: RequestOptions,
|
|
45
40
|
): APIPromise<
|
|
46
41
|
Result<
|
|
47
42
|
models.ResponsesNonStreamingResponse,
|
|
@@ -56,10 +51,10 @@ export function betaResponsesSendRequest(
|
|
|
56
51
|
| SDKValidationError
|
|
57
52
|
>
|
|
58
53
|
>;
|
|
59
|
-
export function
|
|
54
|
+
export function betaResponsesSend(
|
|
60
55
|
client: OpenRouterCore,
|
|
61
|
-
request:
|
|
62
|
-
options?: RequestOptions
|
|
56
|
+
request: operations.SendResponsesRequestRequest & { stream: true },
|
|
57
|
+
options?: RequestOptions,
|
|
63
58
|
): APIPromise<
|
|
64
59
|
Result<
|
|
65
60
|
EventStream<operations.SendResponsesRequestResponseBody>,
|
|
@@ -74,10 +69,10 @@ export function betaResponsesSendRequest(
|
|
|
74
69
|
| SDKValidationError
|
|
75
70
|
>
|
|
76
71
|
>;
|
|
77
|
-
export function
|
|
72
|
+
export function betaResponsesSend(
|
|
78
73
|
client: OpenRouterCore,
|
|
79
|
-
request:
|
|
80
|
-
options?: RequestOptions
|
|
74
|
+
request: operations.SendResponsesRequestRequest,
|
|
75
|
+
options?: RequestOptions,
|
|
81
76
|
): APIPromise<
|
|
82
77
|
Result<
|
|
83
78
|
operations.SendResponsesRequestResponse,
|
|
@@ -92,10 +87,10 @@ export function betaResponsesSendRequest(
|
|
|
92
87
|
| SDKValidationError
|
|
93
88
|
>
|
|
94
89
|
>;
|
|
95
|
-
export function
|
|
90
|
+
export function betaResponsesSend(
|
|
96
91
|
client: OpenRouterCore,
|
|
97
|
-
request:
|
|
98
|
-
options?: RequestOptions
|
|
92
|
+
request: operations.SendResponsesRequestRequest,
|
|
93
|
+
options?: RequestOptions,
|
|
99
94
|
): APIPromise<
|
|
100
95
|
Result<
|
|
101
96
|
operations.SendResponsesRequestResponse,
|
|
@@ -119,8 +114,8 @@ export function betaResponsesSendRequest(
|
|
|
119
114
|
|
|
120
115
|
async function $do(
|
|
121
116
|
client: OpenRouterCore,
|
|
122
|
-
request:
|
|
123
|
-
options?: RequestOptions
|
|
117
|
+
request: operations.SendResponsesRequestRequest,
|
|
118
|
+
options?: RequestOptions,
|
|
124
119
|
): Promise<
|
|
125
120
|
[
|
|
126
121
|
Result<
|
|
@@ -140,7 +135,8 @@ async function $do(
|
|
|
140
135
|
> {
|
|
141
136
|
const parsed = safeParse(
|
|
142
137
|
request,
|
|
143
|
-
(value) =>
|
|
138
|
+
(value) =>
|
|
139
|
+
operations.SendResponsesRequestRequest$outboundSchema.parse(value),
|
|
144
140
|
"Input validation failed",
|
|
145
141
|
);
|
|
146
142
|
if (!parsed.ok) {
|
|
@@ -153,8 +149,7 @@ async function $do(
|
|
|
153
149
|
|
|
154
150
|
const headers = new Headers(compactMap({
|
|
155
151
|
"Content-Type": "application/json",
|
|
156
|
-
Accept:
|
|
157
|
-
|| "application/json;q=1, text/event-stream;q=0",
|
|
152
|
+
Accept: "application/json;q=1",
|
|
158
153
|
}));
|
|
159
154
|
|
|
160
155
|
const secConfig = await extractSecurity(client._options.apiKey);
|
package/src/funcs/chatSend.ts
CHANGED
|
@@ -27,11 +27,6 @@ import * as operations from "../models/operations/index.js";
|
|
|
27
27
|
import { APICall, APIPromise } from "../types/async.js";
|
|
28
28
|
import { Result } from "../types/fp.js";
|
|
29
29
|
|
|
30
|
-
export enum SendAcceptEnum {
|
|
31
|
-
applicationJson = "application/json",
|
|
32
|
-
textEventStream = "text/event-stream",
|
|
33
|
-
}
|
|
34
|
-
|
|
35
30
|
/**
|
|
36
31
|
* Create a chat completion
|
|
37
32
|
*
|
|
@@ -41,7 +36,7 @@ export enum SendAcceptEnum {
|
|
|
41
36
|
export function chatSend(
|
|
42
37
|
client: OpenRouterCore,
|
|
43
38
|
request: models.ChatGenerationParams & { stream?: false },
|
|
44
|
-
options?: RequestOptions
|
|
39
|
+
options?: RequestOptions,
|
|
45
40
|
): APIPromise<
|
|
46
41
|
Result<
|
|
47
42
|
models.ChatResponse,
|
|
@@ -59,7 +54,7 @@ export function chatSend(
|
|
|
59
54
|
export function chatSend(
|
|
60
55
|
client: OpenRouterCore,
|
|
61
56
|
request: models.ChatGenerationParams & { stream: true },
|
|
62
|
-
options?: RequestOptions
|
|
57
|
+
options?: RequestOptions,
|
|
63
58
|
): APIPromise<
|
|
64
59
|
Result<
|
|
65
60
|
EventStream<models.ChatStreamingResponseChunk>,
|
|
@@ -77,7 +72,7 @@ export function chatSend(
|
|
|
77
72
|
export function chatSend(
|
|
78
73
|
client: OpenRouterCore,
|
|
79
74
|
request: models.ChatGenerationParams,
|
|
80
|
-
options?: RequestOptions
|
|
75
|
+
options?: RequestOptions,
|
|
81
76
|
): APIPromise<
|
|
82
77
|
Result<
|
|
83
78
|
operations.SendChatCompletionRequestResponse,
|
|
@@ -95,7 +90,7 @@ export function chatSend(
|
|
|
95
90
|
export function chatSend(
|
|
96
91
|
client: OpenRouterCore,
|
|
97
92
|
request: models.ChatGenerationParams,
|
|
98
|
-
options?: RequestOptions
|
|
93
|
+
options?: RequestOptions,
|
|
99
94
|
): APIPromise<
|
|
100
95
|
Result<
|
|
101
96
|
operations.SendChatCompletionRequestResponse,
|
|
@@ -120,7 +115,7 @@ export function chatSend(
|
|
|
120
115
|
async function $do(
|
|
121
116
|
client: OpenRouterCore,
|
|
122
117
|
request: models.ChatGenerationParams,
|
|
123
|
-
options?: RequestOptions
|
|
118
|
+
options?: RequestOptions,
|
|
124
119
|
): Promise<
|
|
125
120
|
[
|
|
126
121
|
Result<
|
|
@@ -153,8 +148,7 @@ async function $do(
|
|
|
153
148
|
|
|
154
149
|
const headers = new Headers(compactMap({
|
|
155
150
|
"Content-Type": "application/json",
|
|
156
|
-
Accept:
|
|
157
|
-
|| "application/json;q=1, text/event-stream;q=0",
|
|
151
|
+
Accept: "application/json;q=1",
|
|
158
152
|
}));
|
|
159
153
|
|
|
160
154
|
const secConfig = await extractSecurity(client._options.apiKey);
|
package/src/funcs/modelsList.ts
CHANGED
|
@@ -25,18 +25,13 @@ import * as operations from "../models/operations/index.js";
|
|
|
25
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
28
|
-
export enum ListAcceptEnum {
|
|
29
|
-
applicationJson = "application/json",
|
|
30
|
-
applicationRssPlusXml = "application/rss+xml",
|
|
31
|
-
}
|
|
32
|
-
|
|
33
28
|
/**
|
|
34
29
|
* List all models and their properties
|
|
35
30
|
*/
|
|
36
31
|
export function modelsList(
|
|
37
32
|
client: OpenRouterCore,
|
|
38
33
|
request?: operations.ListModelsRequest | undefined,
|
|
39
|
-
options?: RequestOptions
|
|
34
|
+
options?: RequestOptions,
|
|
40
35
|
): APIPromise<
|
|
41
36
|
Result<
|
|
42
37
|
operations.ListModelsResponse,
|
|
@@ -61,7 +56,7 @@ export function modelsList(
|
|
|
61
56
|
async function $do(
|
|
62
57
|
client: OpenRouterCore,
|
|
63
58
|
request?: operations.ListModelsRequest | undefined,
|
|
64
|
-
options?: RequestOptions
|
|
59
|
+
options?: RequestOptions,
|
|
65
60
|
): Promise<
|
|
66
61
|
[
|
|
67
62
|
Result<
|
|
@@ -101,8 +96,7 @@ async function $do(
|
|
|
101
96
|
});
|
|
102
97
|
|
|
103
98
|
const headers = new Headers(compactMap({
|
|
104
|
-
Accept:
|
|
105
|
-
|| "application/json;q=1, application/rss+xml;q=0",
|
|
99
|
+
Accept: "application/json;q=1",
|
|
106
100
|
}));
|
|
107
101
|
|
|
108
102
|
const secConfig = await extractSecurity(client._options.apiKey);
|
package/src/lib/config.ts
CHANGED
|
@@ -59,8 +59,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
59
59
|
export const SDK_METADATA = {
|
|
60
60
|
language: "typescript",
|
|
61
61
|
openapiDocVersion: "1.0.0",
|
|
62
|
-
sdkVersion: "0.0.0-beta.
|
|
63
|
-
genVersion: "2.723.
|
|
62
|
+
sdkVersion: "0.0.0-beta.38",
|
|
63
|
+
genVersion: "2.723.8",
|
|
64
64
|
userAgent:
|
|
65
|
-
"speakeasy-sdk/typescript 0.0.0-beta.
|
|
65
|
+
"speakeasy-sdk/typescript 0.0.0-beta.38 2.723.8 1.0.0 @openrouter/sdk",
|
|
66
66
|
} as const;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The created API key information
|
|
13
|
+
*/
|
|
14
|
+
export type CreateAPIKeyData = {
|
|
15
|
+
/**
|
|
16
|
+
* Unique hash identifier for the API key
|
|
17
|
+
*/
|
|
18
|
+
hash: string;
|
|
19
|
+
/**
|
|
20
|
+
* Name of the API key
|
|
21
|
+
*/
|
|
22
|
+
name: string;
|
|
23
|
+
/**
|
|
24
|
+
* Human-readable label for the API key
|
|
25
|
+
*/
|
|
26
|
+
label: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the API key is disabled
|
|
29
|
+
*/
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Spending limit for the API key in USD
|
|
33
|
+
*/
|
|
34
|
+
limit: number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Remaining spending limit in USD
|
|
37
|
+
*/
|
|
38
|
+
limitRemaining: number | null;
|
|
39
|
+
/**
|
|
40
|
+
* Type of limit reset for the API key
|
|
41
|
+
*/
|
|
42
|
+
limitReset: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to include external BYOK usage in the credit limit
|
|
45
|
+
*/
|
|
46
|
+
includeByokInLimit: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Total OpenRouter credit usage (in USD) for the API key
|
|
49
|
+
*/
|
|
50
|
+
usage: number;
|
|
51
|
+
/**
|
|
52
|
+
* OpenRouter credit usage (in USD) for the current UTC day
|
|
53
|
+
*/
|
|
54
|
+
usageDaily: number;
|
|
55
|
+
/**
|
|
56
|
+
* OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
57
|
+
*/
|
|
58
|
+
usageWeekly: number;
|
|
59
|
+
/**
|
|
60
|
+
* OpenRouter credit usage (in USD) for the current UTC month
|
|
61
|
+
*/
|
|
62
|
+
usageMonthly: number;
|
|
63
|
+
/**
|
|
64
|
+
* Total external BYOK usage (in USD) for the API key
|
|
65
|
+
*/
|
|
66
|
+
byokUsage: number;
|
|
67
|
+
/**
|
|
68
|
+
* External BYOK usage (in USD) for the current UTC day
|
|
69
|
+
*/
|
|
70
|
+
byokUsageDaily: number;
|
|
71
|
+
/**
|
|
72
|
+
* External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
73
|
+
*/
|
|
74
|
+
byokUsageWeekly: number;
|
|
75
|
+
/**
|
|
76
|
+
* External BYOK usage (in USD) for current UTC month
|
|
77
|
+
*/
|
|
78
|
+
byokUsageMonthly: number;
|
|
79
|
+
/**
|
|
80
|
+
* ISO 8601 timestamp of when the API key was created
|
|
81
|
+
*/
|
|
82
|
+
createdAt: string;
|
|
83
|
+
/**
|
|
84
|
+
* ISO 8601 timestamp of when the API key was last updated
|
|
85
|
+
*/
|
|
86
|
+
updatedAt: string | null;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
export const CreateAPIKeyData$inboundSchema: z.ZodType<
|
|
91
|
+
CreateAPIKeyData,
|
|
92
|
+
z.ZodTypeDef,
|
|
93
|
+
unknown
|
|
94
|
+
> = z.object({
|
|
95
|
+
hash: z.string(),
|
|
96
|
+
name: z.string(),
|
|
97
|
+
label: z.string(),
|
|
98
|
+
disabled: z.boolean(),
|
|
99
|
+
limit: z.nullable(z.number()),
|
|
100
|
+
limit_remaining: z.nullable(z.number()),
|
|
101
|
+
limit_reset: z.nullable(z.string()),
|
|
102
|
+
include_byok_in_limit: z.boolean(),
|
|
103
|
+
usage: z.number(),
|
|
104
|
+
usage_daily: z.number(),
|
|
105
|
+
usage_weekly: z.number(),
|
|
106
|
+
usage_monthly: z.number(),
|
|
107
|
+
byok_usage: z.number(),
|
|
108
|
+
byok_usage_daily: z.number(),
|
|
109
|
+
byok_usage_weekly: z.number(),
|
|
110
|
+
byok_usage_monthly: z.number(),
|
|
111
|
+
created_at: z.string(),
|
|
112
|
+
updated_at: z.nullable(z.string()),
|
|
113
|
+
}).transform((v) => {
|
|
114
|
+
return remap$(v, {
|
|
115
|
+
"limit_remaining": "limitRemaining",
|
|
116
|
+
"limit_reset": "limitReset",
|
|
117
|
+
"include_byok_in_limit": "includeByokInLimit",
|
|
118
|
+
"usage_daily": "usageDaily",
|
|
119
|
+
"usage_weekly": "usageWeekly",
|
|
120
|
+
"usage_monthly": "usageMonthly",
|
|
121
|
+
"byok_usage": "byokUsage",
|
|
122
|
+
"byok_usage_daily": "byokUsageDaily",
|
|
123
|
+
"byok_usage_weekly": "byokUsageWeekly",
|
|
124
|
+
"byok_usage_monthly": "byokUsageMonthly",
|
|
125
|
+
"created_at": "createdAt",
|
|
126
|
+
"updated_at": "updatedAt",
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/** @internal */
|
|
131
|
+
export type CreateAPIKeyData$Outbound = {
|
|
132
|
+
hash: string;
|
|
133
|
+
name: string;
|
|
134
|
+
label: string;
|
|
135
|
+
disabled: boolean;
|
|
136
|
+
limit: number | null;
|
|
137
|
+
limit_remaining: number | null;
|
|
138
|
+
limit_reset: string | null;
|
|
139
|
+
include_byok_in_limit: boolean;
|
|
140
|
+
usage: number;
|
|
141
|
+
usage_daily: number;
|
|
142
|
+
usage_weekly: number;
|
|
143
|
+
usage_monthly: number;
|
|
144
|
+
byok_usage: number;
|
|
145
|
+
byok_usage_daily: number;
|
|
146
|
+
byok_usage_weekly: number;
|
|
147
|
+
byok_usage_monthly: number;
|
|
148
|
+
created_at: string;
|
|
149
|
+
updated_at: string | null;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/** @internal */
|
|
153
|
+
export const CreateAPIKeyData$outboundSchema: z.ZodType<
|
|
154
|
+
CreateAPIKeyData$Outbound,
|
|
155
|
+
z.ZodTypeDef,
|
|
156
|
+
CreateAPIKeyData
|
|
157
|
+
> = z.object({
|
|
158
|
+
hash: z.string(),
|
|
159
|
+
name: z.string(),
|
|
160
|
+
label: z.string(),
|
|
161
|
+
disabled: z.boolean(),
|
|
162
|
+
limit: z.nullable(z.number()),
|
|
163
|
+
limitRemaining: z.nullable(z.number()),
|
|
164
|
+
limitReset: z.nullable(z.string()),
|
|
165
|
+
includeByokInLimit: z.boolean(),
|
|
166
|
+
usage: z.number(),
|
|
167
|
+
usageDaily: z.number(),
|
|
168
|
+
usageWeekly: z.number(),
|
|
169
|
+
usageMonthly: z.number(),
|
|
170
|
+
byokUsage: z.number(),
|
|
171
|
+
byokUsageDaily: z.number(),
|
|
172
|
+
byokUsageWeekly: z.number(),
|
|
173
|
+
byokUsageMonthly: z.number(),
|
|
174
|
+
createdAt: z.string(),
|
|
175
|
+
updatedAt: z.nullable(z.string()),
|
|
176
|
+
}).transform((v) => {
|
|
177
|
+
return remap$(v, {
|
|
178
|
+
limitRemaining: "limit_remaining",
|
|
179
|
+
limitReset: "limit_reset",
|
|
180
|
+
includeByokInLimit: "include_byok_in_limit",
|
|
181
|
+
usageDaily: "usage_daily",
|
|
182
|
+
usageWeekly: "usage_weekly",
|
|
183
|
+
usageMonthly: "usage_monthly",
|
|
184
|
+
byokUsage: "byok_usage",
|
|
185
|
+
byokUsageDaily: "byok_usage_daily",
|
|
186
|
+
byokUsageWeekly: "byok_usage_weekly",
|
|
187
|
+
byokUsageMonthly: "byok_usage_monthly",
|
|
188
|
+
createdAt: "created_at",
|
|
189
|
+
updatedAt: "updated_at",
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @internal
|
|
195
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
196
|
+
*/
|
|
197
|
+
export namespace CreateAPIKeyData$ {
|
|
198
|
+
/** @deprecated use `CreateAPIKeyData$inboundSchema` instead. */
|
|
199
|
+
export const inboundSchema = CreateAPIKeyData$inboundSchema;
|
|
200
|
+
/** @deprecated use `CreateAPIKeyData$outboundSchema` instead. */
|
|
201
|
+
export const outboundSchema = CreateAPIKeyData$outboundSchema;
|
|
202
|
+
/** @deprecated use `CreateAPIKeyData$Outbound` instead. */
|
|
203
|
+
export type Outbound = CreateAPIKeyData$Outbound;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function createAPIKeyDataToJSON(
|
|
207
|
+
createAPIKeyData: CreateAPIKeyData,
|
|
208
|
+
): string {
|
|
209
|
+
return JSON.stringify(
|
|
210
|
+
CreateAPIKeyData$outboundSchema.parse(createAPIKeyData),
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function createAPIKeyDataFromJSON(
|
|
215
|
+
jsonString: string,
|
|
216
|
+
): SafeParseResult<CreateAPIKeyData, SDKValidationError> {
|
|
217
|
+
return safeParse(
|
|
218
|
+
jsonString,
|
|
219
|
+
(x) => CreateAPIKeyData$inboundSchema.parse(JSON.parse(x)),
|
|
220
|
+
`Failed to parse 'CreateAPIKeyData' from JSON`,
|
|
221
|
+
);
|
|
222
|
+
}
|
|
@@ -132,7 +132,7 @@ export const ProviderName = {
|
|
|
132
132
|
} as const;
|
|
133
133
|
export type ProviderName = ClosedEnum<typeof ProviderName>;
|
|
134
134
|
|
|
135
|
-
export const
|
|
135
|
+
export const Quantization = {
|
|
136
136
|
Int4: "int4",
|
|
137
137
|
Int8: "int8",
|
|
138
138
|
Fp4: "fp4",
|
|
@@ -143,9 +143,7 @@ export const EndpointsListQuantization = {
|
|
|
143
143
|
Fp32: "fp32",
|
|
144
144
|
Unknown: "unknown",
|
|
145
145
|
} as const;
|
|
146
|
-
export type
|
|
147
|
-
typeof EndpointsListQuantization
|
|
148
|
-
>;
|
|
146
|
+
export type Quantization = ClosedEnum<typeof Quantization>;
|
|
149
147
|
|
|
150
148
|
export const EndpointsListSupportedParameter = {
|
|
151
149
|
Temperature: "temperature",
|
|
@@ -193,7 +191,7 @@ export type EndpointsList = {
|
|
|
193
191
|
pricing: EndpointsListPricing;
|
|
194
192
|
providerName: ProviderName;
|
|
195
193
|
tag: string;
|
|
196
|
-
quantization:
|
|
194
|
+
quantization: Quantization | null;
|
|
197
195
|
maxCompletionTokens: number | null;
|
|
198
196
|
maxPromptTokens: number | null;
|
|
199
197
|
supportedParameters: Array<EndpointsListSupportedParameter>;
|
|
@@ -863,24 +861,22 @@ export namespace ProviderName$ {
|
|
|
863
861
|
}
|
|
864
862
|
|
|
865
863
|
/** @internal */
|
|
866
|
-
export const
|
|
867
|
-
|
|
868
|
-
> = z.nativeEnum(EndpointsListQuantization);
|
|
864
|
+
export const Quantization$inboundSchema: z.ZodNativeEnum<typeof Quantization> =
|
|
865
|
+
z.nativeEnum(Quantization);
|
|
869
866
|
|
|
870
867
|
/** @internal */
|
|
871
|
-
export const
|
|
872
|
-
|
|
873
|
-
> = EndpointsListQuantization$inboundSchema;
|
|
868
|
+
export const Quantization$outboundSchema: z.ZodNativeEnum<typeof Quantization> =
|
|
869
|
+
Quantization$inboundSchema;
|
|
874
870
|
|
|
875
871
|
/**
|
|
876
872
|
* @internal
|
|
877
873
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
878
874
|
*/
|
|
879
|
-
export namespace
|
|
880
|
-
/** @deprecated use `
|
|
881
|
-
export const inboundSchema =
|
|
882
|
-
/** @deprecated use `
|
|
883
|
-
export const outboundSchema =
|
|
875
|
+
export namespace Quantization$ {
|
|
876
|
+
/** @deprecated use `Quantization$inboundSchema` instead. */
|
|
877
|
+
export const inboundSchema = Quantization$inboundSchema;
|
|
878
|
+
/** @deprecated use `Quantization$outboundSchema` instead. */
|
|
879
|
+
export const outboundSchema = Quantization$outboundSchema;
|
|
884
880
|
}
|
|
885
881
|
|
|
886
882
|
/** @internal */
|
|
@@ -937,7 +933,7 @@ export const EndpointsList$inboundSchema: z.ZodType<
|
|
|
937
933
|
pricing: z.lazy(() => EndpointsListPricing$inboundSchema),
|
|
938
934
|
provider_name: ProviderName$inboundSchema,
|
|
939
935
|
tag: z.string(),
|
|
940
|
-
quantization: z.nullable(
|
|
936
|
+
quantization: z.nullable(Quantization$inboundSchema),
|
|
941
937
|
max_completion_tokens: z.nullable(z.number()),
|
|
942
938
|
max_prompt_tokens: z.nullable(z.number()),
|
|
943
939
|
supported_parameters: z.array(EndpointsListSupportedParameter$inboundSchema),
|
|
@@ -986,7 +982,7 @@ export const EndpointsList$outboundSchema: z.ZodType<
|
|
|
986
982
|
pricing: z.lazy(() => EndpointsListPricing$outboundSchema),
|
|
987
983
|
providerName: ProviderName$outboundSchema,
|
|
988
984
|
tag: z.string(),
|
|
989
|
-
quantization: z.nullable(
|
|
985
|
+
quantization: z.nullable(Quantization$outboundSchema),
|
|
990
986
|
maxCompletionTokens: z.nullable(z.number()),
|
|
991
987
|
maxPromptTokens: z.nullable(z.number()),
|
|
992
988
|
supportedParameters: z.array(EndpointsListSupportedParameter$outboundSchema),
|