@openrouter/sdk 0.0.1-beta.11 → 0.0.1-beta.14
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 +109 -1
- package/REACT_QUERY.md +109 -1
- package/README.md +686 -15
- package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
- package/esm/funcs/analyticsGetUserActivity.js +2 -2
- package/esm/funcs/apiKeysCreate.d.ts +1 -1
- package/esm/funcs/apiKeysCreate.js +2 -2
- package/esm/funcs/apiKeysDelete.d.ts +1 -1
- package/esm/funcs/apiKeysDelete.js +2 -2
- package/esm/funcs/apiKeysGet.d.ts +1 -1
- package/esm/funcs/apiKeysGet.js +2 -2
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.d.ts +1 -1
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +2 -2
- package/esm/funcs/apiKeysList.d.ts +1 -1
- package/esm/funcs/apiKeysList.js +2 -2
- package/esm/funcs/apiKeysUpdate.d.ts +1 -1
- package/esm/funcs/apiKeysUpdate.js +2 -2
- package/esm/funcs/betaResponsesSend.d.ts +9 -1
- package/esm/funcs/betaResponsesSend.js +38 -14
- package/esm/funcs/chatSend.d.ts +1 -1
- package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +1 -1
- package/esm/funcs/creditsCreateCoinbaseCharge.js +15 -5
- package/esm/funcs/creditsGetCredits.d.ts +1 -1
- package/esm/funcs/creditsGetCredits.js +2 -2
- package/esm/funcs/endpointsList.d.ts +1 -1
- package/esm/funcs/endpointsList.js +2 -2
- package/esm/funcs/endpointsListZdrEndpoints.d.ts +2 -1
- package/esm/funcs/endpointsListZdrEndpoints.js +6 -2
- package/esm/funcs/generationsGetGeneration.d.ts +1 -1
- package/esm/funcs/generationsGetGeneration.js +13 -2
- package/esm/funcs/modelsCount.d.ts +3 -2
- package/esm/funcs/modelsCount.js +7 -3
- package/esm/funcs/modelsList.d.ts +3 -1
- package/esm/funcs/modelsList.js +8 -7
- package/esm/funcs/modelsListForUser.d.ts +3 -1
- package/esm/funcs/modelsListForUser.js +7 -3
- package/esm/funcs/oAuthCreateAuthCode.d.ts +18 -0
- package/esm/funcs/oAuthCreateAuthCode.js +82 -0
- package/esm/funcs/oAuthCreateAuthorizationUrl.d.ts +2 -2
- package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.d.ts +18 -0
- package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +82 -0
- package/esm/funcs/parametersGetParameters.d.ts +1 -1
- package/esm/funcs/parametersGetParameters.js +2 -2
- package/esm/funcs/providersList.d.ts +1 -1
- package/esm/funcs/providersList.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/event-streams.d.ts +1 -1
- package/esm/models/badgatewayresponseerrordata.d.ts +40 -0
- package/esm/models/badgatewayresponseerrordata.js +35 -0
- package/esm/models/badrequestresponseerrordata.d.ts +40 -0
- package/esm/models/badrequestresponseerrordata.js +35 -0
- package/esm/models/chatmessagecontentitemaudio.d.ts +10 -10
- package/esm/models/chatmessagecontentitemaudio.js +14 -14
- package/esm/models/chatstreamingresponsechunk.d.ts +15 -15
- package/esm/models/chatstreamingresponsechunk.js +15 -15
- package/esm/models/createchargerequest.d.ts +31 -2
- package/esm/models/createchargerequest.js +47 -2
- package/esm/models/defaultparameters.d.ts +36 -0
- package/esm/models/defaultparameters.js +46 -0
- package/esm/models/edgenetworktimeoutresponseerrordata.d.ts +40 -0
- package/esm/models/edgenetworktimeoutresponseerrordata.js +35 -0
- package/esm/models/endpointstatus.d.ts +26 -0
- package/esm/models/endpointstatus.js +36 -0
- package/esm/models/errors/badgatewayresponseerror.d.ts +52 -0
- package/esm/models/errors/badgatewayresponseerror.js +63 -0
- package/esm/models/errors/badrequestresponseerror.d.ts +52 -0
- package/esm/models/errors/badrequestresponseerror.js +63 -0
- package/esm/models/errors/edgenetworktimeoutresponseerror.d.ts +52 -0
- package/esm/models/errors/edgenetworktimeoutresponseerror.js +63 -0
- package/esm/models/errors/forbiddenresponseerror.d.ts +52 -0
- package/esm/models/errors/forbiddenresponseerror.js +63 -0
- package/esm/models/errors/index.d.ts +14 -2
- package/esm/models/errors/index.js +14 -2
- package/esm/models/errors/internalserverresponseerror.d.ts +52 -0
- package/esm/models/errors/internalserverresponseerror.js +63 -0
- package/esm/models/errors/notfoundresponseerror.d.ts +52 -0
- package/esm/models/errors/{errorresponse.js → notfoundresponseerror.js} +16 -17
- package/esm/models/errors/payloadtoolargeresponseerror.d.ts +52 -0
- package/esm/models/errors/payloadtoolargeresponseerror.js +63 -0
- package/esm/models/errors/paymentrequiredresponseerror.d.ts +52 -0
- package/esm/models/errors/paymentrequiredresponseerror.js +63 -0
- package/esm/models/errors/provideroverloadedresponseerror.d.ts +52 -0
- package/esm/models/errors/provideroverloadedresponseerror.js +63 -0
- package/esm/models/errors/requesttimeoutresponseerror.d.ts +52 -0
- package/esm/models/errors/requesttimeoutresponseerror.js +63 -0
- package/esm/models/errors/serviceunavailableresponseerror.d.ts +52 -0
- package/esm/models/errors/serviceunavailableresponseerror.js +63 -0
- package/esm/models/errors/toomanyrequestsresponseerror.d.ts +52 -0
- package/esm/models/errors/toomanyrequestsresponseerror.js +63 -0
- package/esm/models/errors/unauthorizedresponseerror.d.ts +52 -0
- package/esm/models/errors/unauthorizedresponseerror.js +63 -0
- package/esm/models/errors/unprocessableentityresponseerror.d.ts +52 -0
- package/esm/models/errors/unprocessableentityresponseerror.js +63 -0
- package/esm/models/forbiddenresponseerrordata.d.ts +40 -0
- package/esm/models/forbiddenresponseerrordata.js +35 -0
- package/esm/models/index.d.ts +37 -1
- package/esm/models/index.js +37 -1
- package/esm/models/inputmodality.d.ts +24 -0
- package/esm/models/inputmodality.js +34 -0
- package/esm/models/instructtype.d.ts +48 -0
- package/esm/models/instructtype.js +55 -0
- package/esm/models/internalserverresponseerrordata.d.ts +40 -0
- package/esm/models/internalserverresponseerrordata.js +35 -0
- package/esm/models/listendpointsresponse.d.ts +126 -2
- package/esm/models/listendpointsresponse.js +115 -2
- package/esm/models/model.d.ts +101 -0
- package/esm/models/model.js +82 -0
- package/esm/models/modelarchitecture.d.ts +104 -0
- package/esm/models/modelarchitecture.js +107 -0
- package/esm/models/modelgroup.d.ts +45 -0
- package/esm/models/modelgroup.js +53 -0
- package/esm/models/modelscountresponse.d.ts +40 -2
- package/esm/models/modelscountresponse.js +31 -2
- package/esm/models/modelslistresponse.d.ts +10 -2
- package/esm/models/modelslistresponse.js +7 -2
- package/esm/models/notfoundresponseerrordata.d.ts +40 -0
- package/esm/models/notfoundresponseerrordata.js +35 -0
- package/esm/models/openairesponsesincludable.d.ts +25 -0
- package/esm/models/openairesponsesincludable.js +35 -0
- package/esm/models/openairesponsesinputunion.d.ts +78 -78
- package/esm/models/openairesponsesinputunion.js +124 -126
- package/esm/models/openresponseseasyinputmessage.d.ts +246 -0
- package/esm/models/openresponseseasyinputmessage.js +283 -0
- package/esm/models/openresponsesfunctioncalloutput.d.ts +64 -0
- package/esm/models/openresponsesfunctioncalloutput.js +67 -0
- package/esm/models/openresponsesfunctiontoolcall.d.ts +66 -0
- package/esm/models/openresponsesfunctiontoolcall.js +69 -0
- package/esm/models/openresponsesinput.d.ts +60 -0
- package/esm/models/openresponsesinput.js +113 -0
- package/esm/models/openresponsesinputmessageitem.d.ts +193 -0
- package/esm/models/openresponsesinputmessageitem.js +210 -0
- package/esm/models/openresponsesnonstreamingresponse.d.ts +13 -13
- package/esm/models/openresponsesnonstreamingresponse.js +13 -13
- package/esm/models/openresponsesreasoning.d.ts +179 -0
- package/esm/models/openresponsesreasoning.js +194 -0
- package/esm/models/openresponsesreasoningconfig.d.ts +40 -0
- package/esm/models/openresponsesreasoningconfig.js +48 -0
- package/esm/models/openresponsesrequest.d.ts +736 -2
- package/esm/models/openresponsesrequest.js +789 -2
- package/esm/models/openresponsesresponsetext.d.ts +59 -0
- package/esm/models/openresponsesresponsetext.js +64 -0
- package/esm/models/operations/createauthkeyscode.d.ts +145 -0
- package/esm/models/operations/createauthkeyscode.js +146 -0
- package/esm/models/operations/createresponses.d.ts +58 -0
- package/esm/models/operations/createresponses.js +80 -0
- package/esm/models/operations/exchangeauthcodeforapikey.d.ts +104 -0
- package/esm/models/operations/exchangeauthcodeforapikey.js +111 -0
- package/esm/models/operations/getmodels.d.ts +0 -26
- package/esm/models/operations/getmodels.js +0 -38
- package/esm/models/operations/index.d.ts +3 -2
- package/esm/models/operations/index.js +3 -2
- package/esm/models/operations/listendpointszdr.d.ts +3 -24
- package/esm/models/operations/listendpointszdr.js +2 -29
- package/esm/models/operations/listmodelsuser.d.ts +0 -22
- package/esm/models/operations/listmodelsuser.js +0 -28
- package/esm/models/operations/listproviders.d.ts +0 -36
- package/esm/models/operations/listproviders.js +0 -28
- package/esm/models/operations/sendchatcompletionrequest.d.ts +1 -1
- package/esm/models/operations/sendchatcompletionrequest.js +2 -1
- package/esm/models/outputmodality.d.ts +23 -0
- package/esm/models/outputmodality.js +33 -0
- package/esm/models/parameter.d.ts +43 -0
- package/esm/models/parameter.js +54 -0
- package/esm/models/payloadtoolargeresponseerrordata.d.ts +40 -0
- package/esm/models/payloadtoolargeresponseerrordata.js +35 -0
- package/esm/models/paymentrequiredresponseerrordata.d.ts +40 -0
- package/esm/models/paymentrequiredresponseerrordata.js +35 -0
- package/esm/models/perrequestlimits.d.ts +40 -0
- package/esm/models/perrequestlimits.js +44 -0
- package/esm/models/providername.d.ts +106 -0
- package/esm/models/providername.js +116 -0
- package/esm/models/provideroverloadedresponseerrordata.d.ts +40 -0
- package/esm/models/provideroverloadedresponseerrordata.js +35 -0
- package/esm/models/publicendpoint.d.ts +140 -2
- package/esm/models/publicendpoint.js +156 -2
- package/esm/models/publicpricing.d.ts +87 -0
- package/esm/models/publicpricing.js +73 -0
- package/esm/models/quantization.d.ts +29 -0
- package/esm/models/quantization.js +39 -0
- package/esm/models/requesttimeoutresponseerrordata.d.ts +40 -0
- package/esm/models/requesttimeoutresponseerrordata.js +35 -0
- package/esm/models/responseserrorfield.d.ts +10 -10
- package/esm/models/responseserrorfield.js +14 -14
- package/esm/models/responsetextconfig.d.ts +10 -10
- package/esm/models/responsetextconfig.js +14 -15
- package/esm/models/serviceunavailableresponseerrordata.d.ts +40 -0
- package/esm/models/serviceunavailableresponseerrordata.js +35 -0
- package/esm/models/toomanyrequestsresponseerrordata.d.ts +40 -0
- package/esm/models/toomanyrequestsresponseerrordata.js +35 -0
- package/esm/models/topproviderinfo.d.ts +45 -0
- package/esm/models/topproviderinfo.js +48 -0
- package/esm/models/unauthorizedresponseerrordata.d.ts +40 -0
- package/esm/models/unauthorizedresponseerrordata.js +35 -0
- package/esm/models/unprocessableentityresponseerrordata.d.ts +40 -0
- package/esm/models/unprocessableentityresponseerrordata.js +35 -0
- package/esm/react-query/betaResponsesSend.d.ts +1 -1
- package/esm/react-query/index.d.ts +2 -0
- package/esm/react-query/index.js +2 -0
- package/esm/react-query/modelsCount.d.ts +2 -2
- package/esm/react-query/modelsList.d.ts +2 -7
- package/esm/react-query/modelsList.js +0 -2
- package/esm/react-query/modelsListForUser.d.ts +2 -1
- package/esm/react-query/oAuthCreateAuthCode.d.ts +23 -0
- package/esm/react-query/oAuthCreateAuthCode.js +42 -0
- package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.d.ts +23 -0
- package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.js +42 -0
- package/esm/sdk/chat.d.ts +1 -1
- package/esm/sdk/models.d.ts +4 -3
- package/esm/sdk/oauth.d.ts +46 -0
- package/esm/sdk/oauth.js +67 -0
- package/esm/sdk/responses.d.ts +8 -1
- package/esm/sdk/responses.js +0 -6
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +3 -1
- package/vitest.config.ts +8 -1
- package/esm/models/errorresponse.d.ts +0 -155
- package/esm/models/errorresponse.js +0 -167
- package/esm/models/errors/errorresponse.d.ts +0 -46
- package/esm/models/errors/listproviders.d.ts +0 -49
- package/esm/models/errors/listproviders.js +0 -51
- package/esm/models/operations/createapialpharesponses.d.ts +0 -58
- package/esm/models/operations/createapialpharesponses.js +0 -83
- package/esm/models/operations/listmodelscount.d.ts +0 -26
- package/esm/models/operations/listmodelscount.js +0 -34
package/README.md
CHANGED
|
@@ -86,7 +86,115 @@ const openRouter = new OpenRouter({
|
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
async function run() {
|
|
89
|
-
const result = await openRouter.beta.responses.send({
|
|
89
|
+
const result = await openRouter.beta.responses.send({
|
|
90
|
+
input: [
|
|
91
|
+
{
|
|
92
|
+
type: "message",
|
|
93
|
+
role: "user",
|
|
94
|
+
content: "Hello, how are you?",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
instructions: "<value>",
|
|
98
|
+
metadata: {
|
|
99
|
+
"user_id": "123",
|
|
100
|
+
"session_id": "abc-def-ghi",
|
|
101
|
+
},
|
|
102
|
+
tools: [
|
|
103
|
+
{
|
|
104
|
+
type: "function",
|
|
105
|
+
name: "get_current_weather",
|
|
106
|
+
description: "Get the current weather in a given location",
|
|
107
|
+
strict: true,
|
|
108
|
+
parameters: {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"properties": {
|
|
111
|
+
"location": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
toolChoice: {
|
|
119
|
+
type: "function",
|
|
120
|
+
name: "<value>",
|
|
121
|
+
},
|
|
122
|
+
parallelToolCalls: true,
|
|
123
|
+
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
124
|
+
models: [
|
|
125
|
+
"<value 1>",
|
|
126
|
+
],
|
|
127
|
+
text: {
|
|
128
|
+
format: {
|
|
129
|
+
type: "text",
|
|
130
|
+
},
|
|
131
|
+
verbosity: "medium",
|
|
132
|
+
},
|
|
133
|
+
reasoning: {
|
|
134
|
+
effort: "high",
|
|
135
|
+
summary: "auto",
|
|
136
|
+
maxTokens: 8661.16,
|
|
137
|
+
enabled: true,
|
|
138
|
+
},
|
|
139
|
+
maxOutputTokens: null,
|
|
140
|
+
temperature: 0.7,
|
|
141
|
+
topP: 0.9,
|
|
142
|
+
topK: 193.77,
|
|
143
|
+
promptCacheKey: "<value>",
|
|
144
|
+
previousResponseId: "<id>",
|
|
145
|
+
prompt: {
|
|
146
|
+
id: "<id>",
|
|
147
|
+
variables: {
|
|
148
|
+
"key": {
|
|
149
|
+
type: "input_text",
|
|
150
|
+
text: "Hello, how can I help you?",
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
include: [
|
|
155
|
+
"reasoning.encrypted_content",
|
|
156
|
+
],
|
|
157
|
+
background: true,
|
|
158
|
+
safetyIdentifier: "<value>",
|
|
159
|
+
store: true,
|
|
160
|
+
serviceTier: "auto",
|
|
161
|
+
truncation: "auto",
|
|
162
|
+
provider: {
|
|
163
|
+
allowFallbacks: null,
|
|
164
|
+
requireParameters: true,
|
|
165
|
+
dataCollection: "deny",
|
|
166
|
+
zdr: true,
|
|
167
|
+
order: [
|
|
168
|
+
"OpenAI",
|
|
169
|
+
],
|
|
170
|
+
only: [
|
|
171
|
+
"OpenAI",
|
|
172
|
+
],
|
|
173
|
+
ignore: null,
|
|
174
|
+
quantizations: [
|
|
175
|
+
"fp16",
|
|
176
|
+
],
|
|
177
|
+
sort: "price",
|
|
178
|
+
maxPrice: {
|
|
179
|
+
prompt: "1000",
|
|
180
|
+
completion: 1000,
|
|
181
|
+
image: 1000,
|
|
182
|
+
audio: "1000",
|
|
183
|
+
request: 1000,
|
|
184
|
+
},
|
|
185
|
+
experimental: {},
|
|
186
|
+
},
|
|
187
|
+
plugins: [
|
|
188
|
+
{
|
|
189
|
+
id: "file-parser",
|
|
190
|
+
maxFiles: 4870.55,
|
|
191
|
+
pdf: {
|
|
192
|
+
engine: "mistral-ocr",
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
user: "Elmer_Yundt72",
|
|
197
|
+
});
|
|
90
198
|
|
|
91
199
|
console.log(result);
|
|
92
200
|
}
|
|
@@ -116,7 +224,115 @@ const openRouter = new OpenRouter({
|
|
|
116
224
|
});
|
|
117
225
|
|
|
118
226
|
async function run() {
|
|
119
|
-
const result = await openRouter.beta.responses.send({
|
|
227
|
+
const result = await openRouter.beta.responses.send({
|
|
228
|
+
input: [
|
|
229
|
+
{
|
|
230
|
+
type: "message",
|
|
231
|
+
role: "user",
|
|
232
|
+
content: "Hello, how are you?",
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
instructions: "<value>",
|
|
236
|
+
metadata: {
|
|
237
|
+
"user_id": "123",
|
|
238
|
+
"session_id": "abc-def-ghi",
|
|
239
|
+
},
|
|
240
|
+
tools: [
|
|
241
|
+
{
|
|
242
|
+
type: "function",
|
|
243
|
+
name: "get_current_weather",
|
|
244
|
+
description: "Get the current weather in a given location",
|
|
245
|
+
strict: true,
|
|
246
|
+
parameters: {
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": {
|
|
249
|
+
"location": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
],
|
|
256
|
+
toolChoice: {
|
|
257
|
+
type: "function",
|
|
258
|
+
name: "<value>",
|
|
259
|
+
},
|
|
260
|
+
parallelToolCalls: true,
|
|
261
|
+
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
262
|
+
models: [
|
|
263
|
+
"<value 1>",
|
|
264
|
+
],
|
|
265
|
+
text: {
|
|
266
|
+
format: {
|
|
267
|
+
type: "text",
|
|
268
|
+
},
|
|
269
|
+
verbosity: "medium",
|
|
270
|
+
},
|
|
271
|
+
reasoning: {
|
|
272
|
+
effort: "high",
|
|
273
|
+
summary: "auto",
|
|
274
|
+
maxTokens: 8661.16,
|
|
275
|
+
enabled: true,
|
|
276
|
+
},
|
|
277
|
+
maxOutputTokens: null,
|
|
278
|
+
temperature: 0.7,
|
|
279
|
+
topP: 0.9,
|
|
280
|
+
topK: 193.77,
|
|
281
|
+
promptCacheKey: "<value>",
|
|
282
|
+
previousResponseId: "<id>",
|
|
283
|
+
prompt: {
|
|
284
|
+
id: "<id>",
|
|
285
|
+
variables: {
|
|
286
|
+
"key": {
|
|
287
|
+
type: "input_text",
|
|
288
|
+
text: "Hello, how can I help you?",
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
include: [
|
|
293
|
+
"reasoning.encrypted_content",
|
|
294
|
+
],
|
|
295
|
+
background: true,
|
|
296
|
+
safetyIdentifier: "<value>",
|
|
297
|
+
store: true,
|
|
298
|
+
serviceTier: "auto",
|
|
299
|
+
truncation: "auto",
|
|
300
|
+
provider: {
|
|
301
|
+
allowFallbacks: null,
|
|
302
|
+
requireParameters: true,
|
|
303
|
+
dataCollection: "deny",
|
|
304
|
+
zdr: true,
|
|
305
|
+
order: [
|
|
306
|
+
"OpenAI",
|
|
307
|
+
],
|
|
308
|
+
only: [
|
|
309
|
+
"OpenAI",
|
|
310
|
+
],
|
|
311
|
+
ignore: null,
|
|
312
|
+
quantizations: [
|
|
313
|
+
"fp16",
|
|
314
|
+
],
|
|
315
|
+
sort: "price",
|
|
316
|
+
maxPrice: {
|
|
317
|
+
prompt: "1000",
|
|
318
|
+
completion: 1000,
|
|
319
|
+
image: 1000,
|
|
320
|
+
audio: "1000",
|
|
321
|
+
request: 1000,
|
|
322
|
+
},
|
|
323
|
+
experimental: {},
|
|
324
|
+
},
|
|
325
|
+
plugins: [
|
|
326
|
+
{
|
|
327
|
+
id: "file-parser",
|
|
328
|
+
maxFiles: 4870.55,
|
|
329
|
+
pdf: {
|
|
330
|
+
engine: "mistral-ocr",
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
user: "Elmer_Yundt72",
|
|
335
|
+
});
|
|
120
336
|
|
|
121
337
|
console.log(result);
|
|
122
338
|
}
|
|
@@ -136,7 +352,11 @@ const openRouter = new OpenRouter();
|
|
|
136
352
|
async function run() {
|
|
137
353
|
const result = await openRouter.credits.createCoinbaseCharge({
|
|
138
354
|
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
139
|
-
}, {
|
|
355
|
+
}, {
|
|
356
|
+
amount: 100,
|
|
357
|
+
sender: "0x1234567890123456789012345678901234567890",
|
|
358
|
+
chainId: 1,
|
|
359
|
+
});
|
|
140
360
|
|
|
141
361
|
console.log(result);
|
|
142
362
|
}
|
|
@@ -197,6 +417,11 @@ run();
|
|
|
197
417
|
* [list](docs/sdks/models/README.md#list) - List all models and their properties
|
|
198
418
|
* [listForUser](docs/sdks/models/README.md#listforuser) - List models filtered by user provider preferences
|
|
199
419
|
|
|
420
|
+
### [oAuth](docs/sdks/oauth/README.md)
|
|
421
|
+
|
|
422
|
+
* [exchangeAuthCodeForAPIKey](docs/sdks/oauth/README.md#exchangeauthcodeforapikey) - Exchange authorization code for API key
|
|
423
|
+
* [createAuthCode](docs/sdks/oauth/README.md#createauthcode) - Create authorization code
|
|
424
|
+
|
|
200
425
|
### [parameters](docs/sdks/parameters/README.md)
|
|
201
426
|
|
|
202
427
|
* [getParameters](docs/sdks/parameters/README.md#getparameters) - Get a model's supported parameters and data about which are most popular
|
|
@@ -241,6 +466,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
241
466
|
- [`modelsCount`](docs/sdks/models/README.md#count) - Get total count of available models
|
|
242
467
|
- [`modelsList`](docs/sdks/models/README.md#list) - List all models and their properties
|
|
243
468
|
- [`modelsListForUser`](docs/sdks/models/README.md#listforuser) - List models filtered by user provider preferences
|
|
469
|
+
- [`oAuthCreateAuthCode`](docs/sdks/oauth/README.md#createauthcode) - Create authorization code
|
|
470
|
+
- [`oAuthExchangeAuthCodeForAPIKey`](docs/sdks/oauth/README.md#exchangeauthcodeforapikey) - Exchange authorization code for API key
|
|
244
471
|
- [`parametersGetParameters`](docs/sdks/parameters/README.md#getparameters) - Get a model's supported parameters and data about which are most popular
|
|
245
472
|
- [`providersList`](docs/sdks/providers/README.md#list) - List all providers
|
|
246
473
|
|
|
@@ -287,6 +514,8 @@ To learn about this feature and how to get started, check
|
|
|
287
514
|
- [`useModelsCount`](docs/sdks/models/README.md#count) - Get total count of available models
|
|
288
515
|
- [`useModelsList`](docs/sdks/models/README.md#list) - List all models and their properties
|
|
289
516
|
- [`useModelsListForUser`](docs/sdks/models/README.md#listforuser) - List models filtered by user provider preferences
|
|
517
|
+
- [`useOAuthCreateAuthCodeMutation`](docs/sdks/oauth/README.md#createauthcode) - Create authorization code
|
|
518
|
+
- [`useOAuthExchangeAuthCodeForAPIKeyMutation`](docs/sdks/oauth/README.md#exchangeauthcodeforapikey) - Exchange authorization code for API key
|
|
290
519
|
- [`useParametersGetParameters`](docs/sdks/parameters/README.md#getparameters) - Get a model's supported parameters and data about which are most popular
|
|
291
520
|
- [`useProvidersList`](docs/sdks/providers/README.md#list) - List all providers
|
|
292
521
|
|
|
@@ -310,7 +539,115 @@ const openRouter = new OpenRouter({
|
|
|
310
539
|
});
|
|
311
540
|
|
|
312
541
|
async function run() {
|
|
313
|
-
const result = await openRouter.beta.responses.send({
|
|
542
|
+
const result = await openRouter.beta.responses.send({
|
|
543
|
+
input: [
|
|
544
|
+
{
|
|
545
|
+
type: "message",
|
|
546
|
+
role: "user",
|
|
547
|
+
content: "Hello, how are you?",
|
|
548
|
+
},
|
|
549
|
+
],
|
|
550
|
+
instructions: "<value>",
|
|
551
|
+
metadata: {
|
|
552
|
+
"user_id": "123",
|
|
553
|
+
"session_id": "abc-def-ghi",
|
|
554
|
+
},
|
|
555
|
+
tools: [
|
|
556
|
+
{
|
|
557
|
+
type: "function",
|
|
558
|
+
name: "get_current_weather",
|
|
559
|
+
description: "Get the current weather in a given location",
|
|
560
|
+
strict: true,
|
|
561
|
+
parameters: {
|
|
562
|
+
"type": "object",
|
|
563
|
+
"properties": {
|
|
564
|
+
"location": {
|
|
565
|
+
"type": "string",
|
|
566
|
+
},
|
|
567
|
+
},
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
],
|
|
571
|
+
toolChoice: {
|
|
572
|
+
type: "function",
|
|
573
|
+
name: "<value>",
|
|
574
|
+
},
|
|
575
|
+
parallelToolCalls: true,
|
|
576
|
+
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
577
|
+
models: [
|
|
578
|
+
"<value 1>",
|
|
579
|
+
],
|
|
580
|
+
text: {
|
|
581
|
+
format: {
|
|
582
|
+
type: "text",
|
|
583
|
+
},
|
|
584
|
+
verbosity: "medium",
|
|
585
|
+
},
|
|
586
|
+
reasoning: {
|
|
587
|
+
effort: "high",
|
|
588
|
+
summary: "auto",
|
|
589
|
+
maxTokens: 8661.16,
|
|
590
|
+
enabled: true,
|
|
591
|
+
},
|
|
592
|
+
maxOutputTokens: null,
|
|
593
|
+
temperature: 0.7,
|
|
594
|
+
topP: 0.9,
|
|
595
|
+
topK: 193.77,
|
|
596
|
+
promptCacheKey: "<value>",
|
|
597
|
+
previousResponseId: "<id>",
|
|
598
|
+
prompt: {
|
|
599
|
+
id: "<id>",
|
|
600
|
+
variables: {
|
|
601
|
+
"key": {
|
|
602
|
+
type: "input_text",
|
|
603
|
+
text: "Hello, how can I help you?",
|
|
604
|
+
},
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
include: [
|
|
608
|
+
"reasoning.encrypted_content",
|
|
609
|
+
],
|
|
610
|
+
background: true,
|
|
611
|
+
safetyIdentifier: "<value>",
|
|
612
|
+
store: true,
|
|
613
|
+
serviceTier: "auto",
|
|
614
|
+
truncation: "auto",
|
|
615
|
+
provider: {
|
|
616
|
+
allowFallbacks: null,
|
|
617
|
+
requireParameters: true,
|
|
618
|
+
dataCollection: "deny",
|
|
619
|
+
zdr: true,
|
|
620
|
+
order: [
|
|
621
|
+
"OpenAI",
|
|
622
|
+
],
|
|
623
|
+
only: [
|
|
624
|
+
"OpenAI",
|
|
625
|
+
],
|
|
626
|
+
ignore: null,
|
|
627
|
+
quantizations: [
|
|
628
|
+
"fp16",
|
|
629
|
+
],
|
|
630
|
+
sort: "price",
|
|
631
|
+
maxPrice: {
|
|
632
|
+
prompt: "1000",
|
|
633
|
+
completion: 1000,
|
|
634
|
+
image: 1000,
|
|
635
|
+
audio: "1000",
|
|
636
|
+
request: 1000,
|
|
637
|
+
},
|
|
638
|
+
experimental: {},
|
|
639
|
+
},
|
|
640
|
+
plugins: [
|
|
641
|
+
{
|
|
642
|
+
id: "file-parser",
|
|
643
|
+
maxFiles: 4870.55,
|
|
644
|
+
pdf: {
|
|
645
|
+
engine: "mistral-ocr",
|
|
646
|
+
},
|
|
647
|
+
},
|
|
648
|
+
],
|
|
649
|
+
user: "Elmer_Yundt72",
|
|
650
|
+
});
|
|
314
651
|
|
|
315
652
|
console.log(result);
|
|
316
653
|
}
|
|
@@ -337,7 +674,115 @@ const openRouter = new OpenRouter({
|
|
|
337
674
|
});
|
|
338
675
|
|
|
339
676
|
async function run() {
|
|
340
|
-
const result = await openRouter.beta.responses.send({
|
|
677
|
+
const result = await openRouter.beta.responses.send({
|
|
678
|
+
input: [
|
|
679
|
+
{
|
|
680
|
+
type: "message",
|
|
681
|
+
role: "user",
|
|
682
|
+
content: "Hello, how are you?",
|
|
683
|
+
},
|
|
684
|
+
],
|
|
685
|
+
instructions: "<value>",
|
|
686
|
+
metadata: {
|
|
687
|
+
"user_id": "123",
|
|
688
|
+
"session_id": "abc-def-ghi",
|
|
689
|
+
},
|
|
690
|
+
tools: [
|
|
691
|
+
{
|
|
692
|
+
type: "function",
|
|
693
|
+
name: "get_current_weather",
|
|
694
|
+
description: "Get the current weather in a given location",
|
|
695
|
+
strict: true,
|
|
696
|
+
parameters: {
|
|
697
|
+
"type": "object",
|
|
698
|
+
"properties": {
|
|
699
|
+
"location": {
|
|
700
|
+
"type": "string",
|
|
701
|
+
},
|
|
702
|
+
},
|
|
703
|
+
},
|
|
704
|
+
},
|
|
705
|
+
],
|
|
706
|
+
toolChoice: {
|
|
707
|
+
type: "function",
|
|
708
|
+
name: "<value>",
|
|
709
|
+
},
|
|
710
|
+
parallelToolCalls: true,
|
|
711
|
+
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
712
|
+
models: [
|
|
713
|
+
"<value 1>",
|
|
714
|
+
],
|
|
715
|
+
text: {
|
|
716
|
+
format: {
|
|
717
|
+
type: "text",
|
|
718
|
+
},
|
|
719
|
+
verbosity: "medium",
|
|
720
|
+
},
|
|
721
|
+
reasoning: {
|
|
722
|
+
effort: "high",
|
|
723
|
+
summary: "auto",
|
|
724
|
+
maxTokens: 8661.16,
|
|
725
|
+
enabled: true,
|
|
726
|
+
},
|
|
727
|
+
maxOutputTokens: null,
|
|
728
|
+
temperature: 0.7,
|
|
729
|
+
topP: 0.9,
|
|
730
|
+
topK: 193.77,
|
|
731
|
+
promptCacheKey: "<value>",
|
|
732
|
+
previousResponseId: "<id>",
|
|
733
|
+
prompt: {
|
|
734
|
+
id: "<id>",
|
|
735
|
+
variables: {
|
|
736
|
+
"key": {
|
|
737
|
+
type: "input_text",
|
|
738
|
+
text: "Hello, how can I help you?",
|
|
739
|
+
},
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
|
+
include: [
|
|
743
|
+
"reasoning.encrypted_content",
|
|
744
|
+
],
|
|
745
|
+
background: true,
|
|
746
|
+
safetyIdentifier: "<value>",
|
|
747
|
+
store: true,
|
|
748
|
+
serviceTier: "auto",
|
|
749
|
+
truncation: "auto",
|
|
750
|
+
provider: {
|
|
751
|
+
allowFallbacks: null,
|
|
752
|
+
requireParameters: true,
|
|
753
|
+
dataCollection: "deny",
|
|
754
|
+
zdr: true,
|
|
755
|
+
order: [
|
|
756
|
+
"OpenAI",
|
|
757
|
+
],
|
|
758
|
+
only: [
|
|
759
|
+
"OpenAI",
|
|
760
|
+
],
|
|
761
|
+
ignore: null,
|
|
762
|
+
quantizations: [
|
|
763
|
+
"fp16",
|
|
764
|
+
],
|
|
765
|
+
sort: "price",
|
|
766
|
+
maxPrice: {
|
|
767
|
+
prompt: "1000",
|
|
768
|
+
completion: 1000,
|
|
769
|
+
image: 1000,
|
|
770
|
+
audio: "1000",
|
|
771
|
+
request: 1000,
|
|
772
|
+
},
|
|
773
|
+
experimental: {},
|
|
774
|
+
},
|
|
775
|
+
plugins: [
|
|
776
|
+
{
|
|
777
|
+
id: "file-parser",
|
|
778
|
+
maxFiles: 4870.55,
|
|
779
|
+
pdf: {
|
|
780
|
+
engine: "mistral-ocr",
|
|
781
|
+
},
|
|
782
|
+
},
|
|
783
|
+
],
|
|
784
|
+
user: "Elmer_Yundt72",
|
|
785
|
+
}, {
|
|
341
786
|
retries: {
|
|
342
787
|
strategy: "backoff",
|
|
343
788
|
backoff: {
|
|
@@ -376,7 +821,115 @@ const openRouter = new OpenRouter({
|
|
|
376
821
|
});
|
|
377
822
|
|
|
378
823
|
async function run() {
|
|
379
|
-
const result = await openRouter.beta.responses.send({
|
|
824
|
+
const result = await openRouter.beta.responses.send({
|
|
825
|
+
input: [
|
|
826
|
+
{
|
|
827
|
+
type: "message",
|
|
828
|
+
role: "user",
|
|
829
|
+
content: "Hello, how are you?",
|
|
830
|
+
},
|
|
831
|
+
],
|
|
832
|
+
instructions: "<value>",
|
|
833
|
+
metadata: {
|
|
834
|
+
"user_id": "123",
|
|
835
|
+
"session_id": "abc-def-ghi",
|
|
836
|
+
},
|
|
837
|
+
tools: [
|
|
838
|
+
{
|
|
839
|
+
type: "function",
|
|
840
|
+
name: "get_current_weather",
|
|
841
|
+
description: "Get the current weather in a given location",
|
|
842
|
+
strict: true,
|
|
843
|
+
parameters: {
|
|
844
|
+
"type": "object",
|
|
845
|
+
"properties": {
|
|
846
|
+
"location": {
|
|
847
|
+
"type": "string",
|
|
848
|
+
},
|
|
849
|
+
},
|
|
850
|
+
},
|
|
851
|
+
},
|
|
852
|
+
],
|
|
853
|
+
toolChoice: {
|
|
854
|
+
type: "function",
|
|
855
|
+
name: "<value>",
|
|
856
|
+
},
|
|
857
|
+
parallelToolCalls: true,
|
|
858
|
+
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
859
|
+
models: [
|
|
860
|
+
"<value 1>",
|
|
861
|
+
],
|
|
862
|
+
text: {
|
|
863
|
+
format: {
|
|
864
|
+
type: "text",
|
|
865
|
+
},
|
|
866
|
+
verbosity: "medium",
|
|
867
|
+
},
|
|
868
|
+
reasoning: {
|
|
869
|
+
effort: "high",
|
|
870
|
+
summary: "auto",
|
|
871
|
+
maxTokens: 8661.16,
|
|
872
|
+
enabled: true,
|
|
873
|
+
},
|
|
874
|
+
maxOutputTokens: null,
|
|
875
|
+
temperature: 0.7,
|
|
876
|
+
topP: 0.9,
|
|
877
|
+
topK: 193.77,
|
|
878
|
+
promptCacheKey: "<value>",
|
|
879
|
+
previousResponseId: "<id>",
|
|
880
|
+
prompt: {
|
|
881
|
+
id: "<id>",
|
|
882
|
+
variables: {
|
|
883
|
+
"key": {
|
|
884
|
+
type: "input_text",
|
|
885
|
+
text: "Hello, how can I help you?",
|
|
886
|
+
},
|
|
887
|
+
},
|
|
888
|
+
},
|
|
889
|
+
include: [
|
|
890
|
+
"reasoning.encrypted_content",
|
|
891
|
+
],
|
|
892
|
+
background: true,
|
|
893
|
+
safetyIdentifier: "<value>",
|
|
894
|
+
store: true,
|
|
895
|
+
serviceTier: "auto",
|
|
896
|
+
truncation: "auto",
|
|
897
|
+
provider: {
|
|
898
|
+
allowFallbacks: null,
|
|
899
|
+
requireParameters: true,
|
|
900
|
+
dataCollection: "deny",
|
|
901
|
+
zdr: true,
|
|
902
|
+
order: [
|
|
903
|
+
"OpenAI",
|
|
904
|
+
],
|
|
905
|
+
only: [
|
|
906
|
+
"OpenAI",
|
|
907
|
+
],
|
|
908
|
+
ignore: null,
|
|
909
|
+
quantizations: [
|
|
910
|
+
"fp16",
|
|
911
|
+
],
|
|
912
|
+
sort: "price",
|
|
913
|
+
maxPrice: {
|
|
914
|
+
prompt: "1000",
|
|
915
|
+
completion: 1000,
|
|
916
|
+
image: 1000,
|
|
917
|
+
audio: "1000",
|
|
918
|
+
request: 1000,
|
|
919
|
+
},
|
|
920
|
+
experimental: {},
|
|
921
|
+
},
|
|
922
|
+
plugins: [
|
|
923
|
+
{
|
|
924
|
+
id: "file-parser",
|
|
925
|
+
maxFiles: 4870.55,
|
|
926
|
+
pdf: {
|
|
927
|
+
engine: "mistral-ocr",
|
|
928
|
+
},
|
|
929
|
+
},
|
|
930
|
+
],
|
|
931
|
+
user: "Elmer_Yundt72",
|
|
932
|
+
});
|
|
380
933
|
|
|
381
934
|
console.log(result);
|
|
382
935
|
}
|
|
@@ -411,8 +964,114 @@ const openRouter = new OpenRouter({
|
|
|
411
964
|
|
|
412
965
|
async function run() {
|
|
413
966
|
try {
|
|
414
|
-
const result = await openRouter.
|
|
415
|
-
|
|
967
|
+
const result = await openRouter.beta.responses.send({
|
|
968
|
+
input: [
|
|
969
|
+
{
|
|
970
|
+
type: "message",
|
|
971
|
+
role: "user",
|
|
972
|
+
content: "Hello, how are you?",
|
|
973
|
+
},
|
|
974
|
+
],
|
|
975
|
+
instructions: "<value>",
|
|
976
|
+
metadata: {
|
|
977
|
+
"user_id": "123",
|
|
978
|
+
"session_id": "abc-def-ghi",
|
|
979
|
+
},
|
|
980
|
+
tools: [
|
|
981
|
+
{
|
|
982
|
+
type: "function",
|
|
983
|
+
name: "get_current_weather",
|
|
984
|
+
description: "Get the current weather in a given location",
|
|
985
|
+
strict: true,
|
|
986
|
+
parameters: {
|
|
987
|
+
"type": "object",
|
|
988
|
+
"properties": {
|
|
989
|
+
"location": {
|
|
990
|
+
"type": "string",
|
|
991
|
+
},
|
|
992
|
+
},
|
|
993
|
+
},
|
|
994
|
+
},
|
|
995
|
+
],
|
|
996
|
+
toolChoice: {
|
|
997
|
+
type: "function",
|
|
998
|
+
name: "<value>",
|
|
999
|
+
},
|
|
1000
|
+
parallelToolCalls: true,
|
|
1001
|
+
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
1002
|
+
models: [
|
|
1003
|
+
"<value 1>",
|
|
1004
|
+
],
|
|
1005
|
+
text: {
|
|
1006
|
+
format: {
|
|
1007
|
+
type: "text",
|
|
1008
|
+
},
|
|
1009
|
+
verbosity: "medium",
|
|
1010
|
+
},
|
|
1011
|
+
reasoning: {
|
|
1012
|
+
effort: "high",
|
|
1013
|
+
summary: "auto",
|
|
1014
|
+
maxTokens: 8661.16,
|
|
1015
|
+
enabled: true,
|
|
1016
|
+
},
|
|
1017
|
+
maxOutputTokens: null,
|
|
1018
|
+
temperature: 0.7,
|
|
1019
|
+
topP: 0.9,
|
|
1020
|
+
topK: 193.77,
|
|
1021
|
+
promptCacheKey: "<value>",
|
|
1022
|
+
previousResponseId: "<id>",
|
|
1023
|
+
prompt: {
|
|
1024
|
+
id: "<id>",
|
|
1025
|
+
variables: {
|
|
1026
|
+
"key": {
|
|
1027
|
+
type: "input_text",
|
|
1028
|
+
text: "Hello, how can I help you?",
|
|
1029
|
+
},
|
|
1030
|
+
},
|
|
1031
|
+
},
|
|
1032
|
+
include: [
|
|
1033
|
+
"reasoning.encrypted_content",
|
|
1034
|
+
],
|
|
1035
|
+
background: true,
|
|
1036
|
+
safetyIdentifier: "<value>",
|
|
1037
|
+
store: true,
|
|
1038
|
+
serviceTier: "auto",
|
|
1039
|
+
truncation: "auto",
|
|
1040
|
+
provider: {
|
|
1041
|
+
allowFallbacks: null,
|
|
1042
|
+
requireParameters: true,
|
|
1043
|
+
dataCollection: "deny",
|
|
1044
|
+
zdr: true,
|
|
1045
|
+
order: [
|
|
1046
|
+
"OpenAI",
|
|
1047
|
+
],
|
|
1048
|
+
only: [
|
|
1049
|
+
"OpenAI",
|
|
1050
|
+
],
|
|
1051
|
+
ignore: null,
|
|
1052
|
+
quantizations: [
|
|
1053
|
+
"fp16",
|
|
1054
|
+
],
|
|
1055
|
+
sort: "price",
|
|
1056
|
+
maxPrice: {
|
|
1057
|
+
prompt: "1000",
|
|
1058
|
+
completion: 1000,
|
|
1059
|
+
image: 1000,
|
|
1060
|
+
audio: "1000",
|
|
1061
|
+
request: 1000,
|
|
1062
|
+
},
|
|
1063
|
+
experimental: {},
|
|
1064
|
+
},
|
|
1065
|
+
plugins: [
|
|
1066
|
+
{
|
|
1067
|
+
id: "file-parser",
|
|
1068
|
+
maxFiles: 4870.55,
|
|
1069
|
+
pdf: {
|
|
1070
|
+
engine: "mistral-ocr",
|
|
1071
|
+
},
|
|
1072
|
+
},
|
|
1073
|
+
],
|
|
1074
|
+
user: "Elmer_Yundt72",
|
|
416
1075
|
});
|
|
417
1076
|
|
|
418
1077
|
console.log(result);
|
|
@@ -425,8 +1084,8 @@ async function run() {
|
|
|
425
1084
|
console.log(error.headers);
|
|
426
1085
|
|
|
427
1086
|
// Depending on the method different errors may be thrown
|
|
428
|
-
if (error instanceof errors.
|
|
429
|
-
console.log(error.data$.error); // models.
|
|
1087
|
+
if (error instanceof errors.BadRequestResponseError) {
|
|
1088
|
+
console.log(error.data$.error); // models.BadRequestResponseErrorData
|
|
430
1089
|
console.log(error.data$.userId); // string
|
|
431
1090
|
}
|
|
432
1091
|
}
|
|
@@ -438,10 +1097,11 @@ run();
|
|
|
438
1097
|
```
|
|
439
1098
|
|
|
440
1099
|
### Error Classes
|
|
441
|
-
**Primary
|
|
1100
|
+
**Primary errors:**
|
|
442
1101
|
* [`OpenRouterError`](./src/models/errors/openroutererror.ts): The base class for HTTP error responses.
|
|
1102
|
+
* [`InternalServerResponseError`](./src/models/errors/internalserverresponseerror.ts): Internal Server Error - Unexpected server error. Status code `500`. *
|
|
443
1103
|
|
|
444
|
-
<details><summary>Less common errors (
|
|
1104
|
+
<details><summary>Less common errors (20)</summary>
|
|
445
1105
|
|
|
446
1106
|
<br />
|
|
447
1107
|
|
|
@@ -454,9 +1114,20 @@ run();
|
|
|
454
1114
|
|
|
455
1115
|
|
|
456
1116
|
**Inherit from [`OpenRouterError`](./src/models/errors/openroutererror.ts)**:
|
|
457
|
-
* [`
|
|
458
|
-
* [`
|
|
459
|
-
* [`
|
|
1117
|
+
* [`UnauthorizedResponseError`](./src/models/errors/unauthorizedresponseerror.ts): Unauthorized - Authentication required or invalid credentials. Status code `401`. Applicable to 14 of 22 methods.*
|
|
1118
|
+
* [`BadRequestResponseError`](./src/models/errors/badrequestresponseerror.ts): Bad Request - Invalid request parameters or malformed input. Status code `400`. Applicable to 8 of 22 methods.*
|
|
1119
|
+
* [`TooManyRequestsResponseError`](./src/models/errors/toomanyrequestsresponseerror.ts): Too Many Requests - Rate limit exceeded. Status code `429`. Applicable to 8 of 22 methods.*
|
|
1120
|
+
* [`NotFoundResponseError`](./src/models/errors/notfoundresponseerror.ts): Not Found - Resource does not exist. Status code `404`. Applicable to 7 of 22 methods.*
|
|
1121
|
+
* [`ForbiddenResponseError`](./src/models/errors/forbiddenresponseerror.ts): Forbidden - Authentication successful but insufficient permissions. Status code `403`. Applicable to 3 of 22 methods.*
|
|
1122
|
+
* [`ChatError`](./src/models/errors/chaterror.ts): Bad request - invalid parameters. Applicable to 2 of 22 methods.*
|
|
1123
|
+
* [`PaymentRequiredResponseError`](./src/models/errors/paymentrequiredresponseerror.ts): Payment Required - Insufficient credits or quota to complete request. Status code `402`. Applicable to 2 of 22 methods.*
|
|
1124
|
+
* [`BadGatewayResponseError`](./src/models/errors/badgatewayresponseerror.ts): Bad Gateway - Provider/upstream API failure. Status code `502`. Applicable to 2 of 22 methods.*
|
|
1125
|
+
* [`EdgeNetworkTimeoutResponseError`](./src/models/errors/edgenetworktimeoutresponseerror.ts): Infrastructure Timeout - Provider request timed out at edge network. Status code `524`. Applicable to 2 of 22 methods.*
|
|
1126
|
+
* [`ProviderOverloadedResponseError`](./src/models/errors/provideroverloadedresponseerror.ts): Provider Overloaded - Provider is temporarily overloaded. Status code `529`. Applicable to 2 of 22 methods.*
|
|
1127
|
+
* [`RequestTimeoutResponseError`](./src/models/errors/requesttimeoutresponseerror.ts): Request Timeout - Operation exceeded time limit. Status code `408`. Applicable to 1 of 22 methods.*
|
|
1128
|
+
* [`PayloadTooLargeResponseError`](./src/models/errors/payloadtoolargeresponseerror.ts): Payload Too Large - Request payload exceeds size limits. Status code `413`. Applicable to 1 of 22 methods.*
|
|
1129
|
+
* [`UnprocessableEntityResponseError`](./src/models/errors/unprocessableentityresponseerror.ts): Unprocessable Entity - Semantic validation failure. Status code `422`. Applicable to 1 of 22 methods.*
|
|
1130
|
+
* [`ServiceUnavailableResponseError`](./src/models/errors/serviceunavailableresponseerror.ts): Service Unavailable - Service temporarily unavailable. Status code `503`. Applicable to 1 of 22 methods.*
|
|
460
1131
|
* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
461
1132
|
|
|
462
1133
|
</details>
|