@openrouter/sdk 0.0.1-beta.12 → 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 +15 -16
- package/REACT_QUERY.md +15 -16
- package/README.md +113 -110
- package/esm/funcs/betaResponsesSend.d.ts +2 -2
- package/esm/funcs/betaResponsesSend.js +3 -3
- package/esm/funcs/chatSend.d.ts +1 -1
- package/esm/funcs/modelsList.d.ts +2 -1
- package/esm/funcs/modelsList.js +3 -6
- 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/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/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 -30
- package/esm/models/operations/index.d.ts +3 -1
- package/esm/models/operations/index.js +3 -1
- package/esm/models/operations/sendchatcompletionrequest.d.ts +1 -1
- package/esm/models/operations/sendchatcompletionrequest.js +2 -1
- 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/modelsList.d.ts +2 -7
- package/esm/react-query/modelsList.js +0 -2
- 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 +1 -1
- package/esm/sdk/oauth.d.ts +46 -0
- package/esm/sdk/oauth.js +67 -0
- package/esm/sdk/responses.d.ts +2 -2
- 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/operations/createapialpharesponses.d.ts +0 -58
- package/esm/models/operations/createapialpharesponses.js +0 -81
package/README.md
CHANGED
|
@@ -123,7 +123,6 @@ async function run() {
|
|
|
123
123
|
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
124
124
|
models: [
|
|
125
125
|
"<value 1>",
|
|
126
|
-
"<value 2>",
|
|
127
126
|
],
|
|
128
127
|
text: {
|
|
129
128
|
format: {
|
|
@@ -132,15 +131,15 @@ async function run() {
|
|
|
132
131
|
verbosity: "medium",
|
|
133
132
|
},
|
|
134
133
|
reasoning: {
|
|
135
|
-
effort: "
|
|
134
|
+
effort: "high",
|
|
136
135
|
summary: "auto",
|
|
137
|
-
maxTokens:
|
|
136
|
+
maxTokens: 8661.16,
|
|
138
137
|
enabled: true,
|
|
139
138
|
},
|
|
140
|
-
maxOutputTokens:
|
|
139
|
+
maxOutputTokens: null,
|
|
141
140
|
temperature: 0.7,
|
|
142
141
|
topP: 0.9,
|
|
143
|
-
topK:
|
|
142
|
+
topK: 193.77,
|
|
144
143
|
promptCacheKey: "<value>",
|
|
145
144
|
previousResponseId: "<id>",
|
|
146
145
|
prompt: {
|
|
@@ -153,25 +152,25 @@ async function run() {
|
|
|
153
152
|
},
|
|
154
153
|
},
|
|
155
154
|
include: [
|
|
156
|
-
"
|
|
155
|
+
"reasoning.encrypted_content",
|
|
157
156
|
],
|
|
158
|
-
background:
|
|
157
|
+
background: true,
|
|
159
158
|
safetyIdentifier: "<value>",
|
|
160
|
-
store:
|
|
159
|
+
store: true,
|
|
161
160
|
serviceTier: "auto",
|
|
162
161
|
truncation: "auto",
|
|
163
162
|
provider: {
|
|
164
|
-
allowFallbacks:
|
|
165
|
-
requireParameters:
|
|
163
|
+
allowFallbacks: null,
|
|
164
|
+
requireParameters: true,
|
|
166
165
|
dataCollection: "deny",
|
|
167
166
|
zdr: true,
|
|
168
167
|
order: [
|
|
169
168
|
"OpenAI",
|
|
170
169
|
],
|
|
171
|
-
only:
|
|
172
|
-
ignore: [
|
|
170
|
+
only: [
|
|
173
171
|
"OpenAI",
|
|
174
172
|
],
|
|
173
|
+
ignore: null,
|
|
175
174
|
quantizations: [
|
|
176
175
|
"fp16",
|
|
177
176
|
],
|
|
@@ -180,7 +179,7 @@ async function run() {
|
|
|
180
179
|
prompt: "1000",
|
|
181
180
|
completion: 1000,
|
|
182
181
|
image: 1000,
|
|
183
|
-
audio: 1000,
|
|
182
|
+
audio: "1000",
|
|
184
183
|
request: 1000,
|
|
185
184
|
},
|
|
186
185
|
experimental: {},
|
|
@@ -188,13 +187,13 @@ async function run() {
|
|
|
188
187
|
plugins: [
|
|
189
188
|
{
|
|
190
189
|
id: "file-parser",
|
|
191
|
-
maxFiles:
|
|
190
|
+
maxFiles: 4870.55,
|
|
192
191
|
pdf: {
|
|
193
|
-
engine: "
|
|
192
|
+
engine: "mistral-ocr",
|
|
194
193
|
},
|
|
195
194
|
},
|
|
196
195
|
],
|
|
197
|
-
user: "
|
|
196
|
+
user: "Elmer_Yundt72",
|
|
198
197
|
});
|
|
199
198
|
|
|
200
199
|
console.log(result);
|
|
@@ -262,7 +261,6 @@ async function run() {
|
|
|
262
261
|
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
263
262
|
models: [
|
|
264
263
|
"<value 1>",
|
|
265
|
-
"<value 2>",
|
|
266
264
|
],
|
|
267
265
|
text: {
|
|
268
266
|
format: {
|
|
@@ -271,15 +269,15 @@ async function run() {
|
|
|
271
269
|
verbosity: "medium",
|
|
272
270
|
},
|
|
273
271
|
reasoning: {
|
|
274
|
-
effort: "
|
|
272
|
+
effort: "high",
|
|
275
273
|
summary: "auto",
|
|
276
|
-
maxTokens:
|
|
274
|
+
maxTokens: 8661.16,
|
|
277
275
|
enabled: true,
|
|
278
276
|
},
|
|
279
|
-
maxOutputTokens:
|
|
277
|
+
maxOutputTokens: null,
|
|
280
278
|
temperature: 0.7,
|
|
281
279
|
topP: 0.9,
|
|
282
|
-
topK:
|
|
280
|
+
topK: 193.77,
|
|
283
281
|
promptCacheKey: "<value>",
|
|
284
282
|
previousResponseId: "<id>",
|
|
285
283
|
prompt: {
|
|
@@ -292,25 +290,25 @@ async function run() {
|
|
|
292
290
|
},
|
|
293
291
|
},
|
|
294
292
|
include: [
|
|
295
|
-
"
|
|
293
|
+
"reasoning.encrypted_content",
|
|
296
294
|
],
|
|
297
|
-
background:
|
|
295
|
+
background: true,
|
|
298
296
|
safetyIdentifier: "<value>",
|
|
299
|
-
store:
|
|
297
|
+
store: true,
|
|
300
298
|
serviceTier: "auto",
|
|
301
299
|
truncation: "auto",
|
|
302
300
|
provider: {
|
|
303
|
-
allowFallbacks:
|
|
304
|
-
requireParameters:
|
|
301
|
+
allowFallbacks: null,
|
|
302
|
+
requireParameters: true,
|
|
305
303
|
dataCollection: "deny",
|
|
306
304
|
zdr: true,
|
|
307
305
|
order: [
|
|
308
306
|
"OpenAI",
|
|
309
307
|
],
|
|
310
|
-
only:
|
|
311
|
-
ignore: [
|
|
308
|
+
only: [
|
|
312
309
|
"OpenAI",
|
|
313
310
|
],
|
|
311
|
+
ignore: null,
|
|
314
312
|
quantizations: [
|
|
315
313
|
"fp16",
|
|
316
314
|
],
|
|
@@ -319,7 +317,7 @@ async function run() {
|
|
|
319
317
|
prompt: "1000",
|
|
320
318
|
completion: 1000,
|
|
321
319
|
image: 1000,
|
|
322
|
-
audio: 1000,
|
|
320
|
+
audio: "1000",
|
|
323
321
|
request: 1000,
|
|
324
322
|
},
|
|
325
323
|
experimental: {},
|
|
@@ -327,13 +325,13 @@ async function run() {
|
|
|
327
325
|
plugins: [
|
|
328
326
|
{
|
|
329
327
|
id: "file-parser",
|
|
330
|
-
maxFiles:
|
|
328
|
+
maxFiles: 4870.55,
|
|
331
329
|
pdf: {
|
|
332
|
-
engine: "
|
|
330
|
+
engine: "mistral-ocr",
|
|
333
331
|
},
|
|
334
332
|
},
|
|
335
333
|
],
|
|
336
|
-
user: "
|
|
334
|
+
user: "Elmer_Yundt72",
|
|
337
335
|
});
|
|
338
336
|
|
|
339
337
|
console.log(result);
|
|
@@ -419,6 +417,11 @@ run();
|
|
|
419
417
|
* [list](docs/sdks/models/README.md#list) - List all models and their properties
|
|
420
418
|
* [listForUser](docs/sdks/models/README.md#listforuser) - List models filtered by user provider preferences
|
|
421
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
|
+
|
|
422
425
|
### [parameters](docs/sdks/parameters/README.md)
|
|
423
426
|
|
|
424
427
|
* [getParameters](docs/sdks/parameters/README.md#getparameters) - Get a model's supported parameters and data about which are most popular
|
|
@@ -463,6 +466,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
463
466
|
- [`modelsCount`](docs/sdks/models/README.md#count) - Get total count of available models
|
|
464
467
|
- [`modelsList`](docs/sdks/models/README.md#list) - List all models and their properties
|
|
465
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
|
|
466
471
|
- [`parametersGetParameters`](docs/sdks/parameters/README.md#getparameters) - Get a model's supported parameters and data about which are most popular
|
|
467
472
|
- [`providersList`](docs/sdks/providers/README.md#list) - List all providers
|
|
468
473
|
|
|
@@ -509,6 +514,8 @@ To learn about this feature and how to get started, check
|
|
|
509
514
|
- [`useModelsCount`](docs/sdks/models/README.md#count) - Get total count of available models
|
|
510
515
|
- [`useModelsList`](docs/sdks/models/README.md#list) - List all models and their properties
|
|
511
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
|
|
512
519
|
- [`useParametersGetParameters`](docs/sdks/parameters/README.md#getparameters) - Get a model's supported parameters and data about which are most popular
|
|
513
520
|
- [`useProvidersList`](docs/sdks/providers/README.md#list) - List all providers
|
|
514
521
|
|
|
@@ -569,7 +576,6 @@ async function run() {
|
|
|
569
576
|
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
570
577
|
models: [
|
|
571
578
|
"<value 1>",
|
|
572
|
-
"<value 2>",
|
|
573
579
|
],
|
|
574
580
|
text: {
|
|
575
581
|
format: {
|
|
@@ -578,15 +584,15 @@ async function run() {
|
|
|
578
584
|
verbosity: "medium",
|
|
579
585
|
},
|
|
580
586
|
reasoning: {
|
|
581
|
-
effort: "
|
|
587
|
+
effort: "high",
|
|
582
588
|
summary: "auto",
|
|
583
|
-
maxTokens:
|
|
589
|
+
maxTokens: 8661.16,
|
|
584
590
|
enabled: true,
|
|
585
591
|
},
|
|
586
|
-
maxOutputTokens:
|
|
592
|
+
maxOutputTokens: null,
|
|
587
593
|
temperature: 0.7,
|
|
588
594
|
topP: 0.9,
|
|
589
|
-
topK:
|
|
595
|
+
topK: 193.77,
|
|
590
596
|
promptCacheKey: "<value>",
|
|
591
597
|
previousResponseId: "<id>",
|
|
592
598
|
prompt: {
|
|
@@ -599,25 +605,25 @@ async function run() {
|
|
|
599
605
|
},
|
|
600
606
|
},
|
|
601
607
|
include: [
|
|
602
|
-
"
|
|
608
|
+
"reasoning.encrypted_content",
|
|
603
609
|
],
|
|
604
|
-
background:
|
|
610
|
+
background: true,
|
|
605
611
|
safetyIdentifier: "<value>",
|
|
606
|
-
store:
|
|
612
|
+
store: true,
|
|
607
613
|
serviceTier: "auto",
|
|
608
614
|
truncation: "auto",
|
|
609
615
|
provider: {
|
|
610
|
-
allowFallbacks:
|
|
611
|
-
requireParameters:
|
|
616
|
+
allowFallbacks: null,
|
|
617
|
+
requireParameters: true,
|
|
612
618
|
dataCollection: "deny",
|
|
613
619
|
zdr: true,
|
|
614
620
|
order: [
|
|
615
621
|
"OpenAI",
|
|
616
622
|
],
|
|
617
|
-
only:
|
|
618
|
-
ignore: [
|
|
623
|
+
only: [
|
|
619
624
|
"OpenAI",
|
|
620
625
|
],
|
|
626
|
+
ignore: null,
|
|
621
627
|
quantizations: [
|
|
622
628
|
"fp16",
|
|
623
629
|
],
|
|
@@ -626,7 +632,7 @@ async function run() {
|
|
|
626
632
|
prompt: "1000",
|
|
627
633
|
completion: 1000,
|
|
628
634
|
image: 1000,
|
|
629
|
-
audio: 1000,
|
|
635
|
+
audio: "1000",
|
|
630
636
|
request: 1000,
|
|
631
637
|
},
|
|
632
638
|
experimental: {},
|
|
@@ -634,13 +640,13 @@ async function run() {
|
|
|
634
640
|
plugins: [
|
|
635
641
|
{
|
|
636
642
|
id: "file-parser",
|
|
637
|
-
maxFiles:
|
|
643
|
+
maxFiles: 4870.55,
|
|
638
644
|
pdf: {
|
|
639
|
-
engine: "
|
|
645
|
+
engine: "mistral-ocr",
|
|
640
646
|
},
|
|
641
647
|
},
|
|
642
648
|
],
|
|
643
|
-
user: "
|
|
649
|
+
user: "Elmer_Yundt72",
|
|
644
650
|
});
|
|
645
651
|
|
|
646
652
|
console.log(result);
|
|
@@ -705,7 +711,6 @@ async function run() {
|
|
|
705
711
|
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
706
712
|
models: [
|
|
707
713
|
"<value 1>",
|
|
708
|
-
"<value 2>",
|
|
709
714
|
],
|
|
710
715
|
text: {
|
|
711
716
|
format: {
|
|
@@ -714,15 +719,15 @@ async function run() {
|
|
|
714
719
|
verbosity: "medium",
|
|
715
720
|
},
|
|
716
721
|
reasoning: {
|
|
717
|
-
effort: "
|
|
722
|
+
effort: "high",
|
|
718
723
|
summary: "auto",
|
|
719
|
-
maxTokens:
|
|
724
|
+
maxTokens: 8661.16,
|
|
720
725
|
enabled: true,
|
|
721
726
|
},
|
|
722
|
-
maxOutputTokens:
|
|
727
|
+
maxOutputTokens: null,
|
|
723
728
|
temperature: 0.7,
|
|
724
729
|
topP: 0.9,
|
|
725
|
-
topK:
|
|
730
|
+
topK: 193.77,
|
|
726
731
|
promptCacheKey: "<value>",
|
|
727
732
|
previousResponseId: "<id>",
|
|
728
733
|
prompt: {
|
|
@@ -735,25 +740,25 @@ async function run() {
|
|
|
735
740
|
},
|
|
736
741
|
},
|
|
737
742
|
include: [
|
|
738
|
-
"
|
|
743
|
+
"reasoning.encrypted_content",
|
|
739
744
|
],
|
|
740
|
-
background:
|
|
745
|
+
background: true,
|
|
741
746
|
safetyIdentifier: "<value>",
|
|
742
|
-
store:
|
|
747
|
+
store: true,
|
|
743
748
|
serviceTier: "auto",
|
|
744
749
|
truncation: "auto",
|
|
745
750
|
provider: {
|
|
746
|
-
allowFallbacks:
|
|
747
|
-
requireParameters:
|
|
751
|
+
allowFallbacks: null,
|
|
752
|
+
requireParameters: true,
|
|
748
753
|
dataCollection: "deny",
|
|
749
754
|
zdr: true,
|
|
750
755
|
order: [
|
|
751
756
|
"OpenAI",
|
|
752
757
|
],
|
|
753
|
-
only:
|
|
754
|
-
ignore: [
|
|
758
|
+
only: [
|
|
755
759
|
"OpenAI",
|
|
756
760
|
],
|
|
761
|
+
ignore: null,
|
|
757
762
|
quantizations: [
|
|
758
763
|
"fp16",
|
|
759
764
|
],
|
|
@@ -762,7 +767,7 @@ async function run() {
|
|
|
762
767
|
prompt: "1000",
|
|
763
768
|
completion: 1000,
|
|
764
769
|
image: 1000,
|
|
765
|
-
audio: 1000,
|
|
770
|
+
audio: "1000",
|
|
766
771
|
request: 1000,
|
|
767
772
|
},
|
|
768
773
|
experimental: {},
|
|
@@ -770,13 +775,13 @@ async function run() {
|
|
|
770
775
|
plugins: [
|
|
771
776
|
{
|
|
772
777
|
id: "file-parser",
|
|
773
|
-
maxFiles:
|
|
778
|
+
maxFiles: 4870.55,
|
|
774
779
|
pdf: {
|
|
775
|
-
engine: "
|
|
780
|
+
engine: "mistral-ocr",
|
|
776
781
|
},
|
|
777
782
|
},
|
|
778
783
|
],
|
|
779
|
-
user: "
|
|
784
|
+
user: "Elmer_Yundt72",
|
|
780
785
|
}, {
|
|
781
786
|
retries: {
|
|
782
787
|
strategy: "backoff",
|
|
@@ -853,7 +858,6 @@ async function run() {
|
|
|
853
858
|
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
854
859
|
models: [
|
|
855
860
|
"<value 1>",
|
|
856
|
-
"<value 2>",
|
|
857
861
|
],
|
|
858
862
|
text: {
|
|
859
863
|
format: {
|
|
@@ -862,15 +866,15 @@ async function run() {
|
|
|
862
866
|
verbosity: "medium",
|
|
863
867
|
},
|
|
864
868
|
reasoning: {
|
|
865
|
-
effort: "
|
|
869
|
+
effort: "high",
|
|
866
870
|
summary: "auto",
|
|
867
|
-
maxTokens:
|
|
871
|
+
maxTokens: 8661.16,
|
|
868
872
|
enabled: true,
|
|
869
873
|
},
|
|
870
|
-
maxOutputTokens:
|
|
874
|
+
maxOutputTokens: null,
|
|
871
875
|
temperature: 0.7,
|
|
872
876
|
topP: 0.9,
|
|
873
|
-
topK:
|
|
877
|
+
topK: 193.77,
|
|
874
878
|
promptCacheKey: "<value>",
|
|
875
879
|
previousResponseId: "<id>",
|
|
876
880
|
prompt: {
|
|
@@ -883,25 +887,25 @@ async function run() {
|
|
|
883
887
|
},
|
|
884
888
|
},
|
|
885
889
|
include: [
|
|
886
|
-
"
|
|
890
|
+
"reasoning.encrypted_content",
|
|
887
891
|
],
|
|
888
|
-
background:
|
|
892
|
+
background: true,
|
|
889
893
|
safetyIdentifier: "<value>",
|
|
890
|
-
store:
|
|
894
|
+
store: true,
|
|
891
895
|
serviceTier: "auto",
|
|
892
896
|
truncation: "auto",
|
|
893
897
|
provider: {
|
|
894
|
-
allowFallbacks:
|
|
895
|
-
requireParameters:
|
|
898
|
+
allowFallbacks: null,
|
|
899
|
+
requireParameters: true,
|
|
896
900
|
dataCollection: "deny",
|
|
897
901
|
zdr: true,
|
|
898
902
|
order: [
|
|
899
903
|
"OpenAI",
|
|
900
904
|
],
|
|
901
|
-
only:
|
|
902
|
-
ignore: [
|
|
905
|
+
only: [
|
|
903
906
|
"OpenAI",
|
|
904
907
|
],
|
|
908
|
+
ignore: null,
|
|
905
909
|
quantizations: [
|
|
906
910
|
"fp16",
|
|
907
911
|
],
|
|
@@ -910,7 +914,7 @@ async function run() {
|
|
|
910
914
|
prompt: "1000",
|
|
911
915
|
completion: 1000,
|
|
912
916
|
image: 1000,
|
|
913
|
-
audio: 1000,
|
|
917
|
+
audio: "1000",
|
|
914
918
|
request: 1000,
|
|
915
919
|
},
|
|
916
920
|
experimental: {},
|
|
@@ -918,13 +922,13 @@ async function run() {
|
|
|
918
922
|
plugins: [
|
|
919
923
|
{
|
|
920
924
|
id: "file-parser",
|
|
921
|
-
maxFiles:
|
|
925
|
+
maxFiles: 4870.55,
|
|
922
926
|
pdf: {
|
|
923
|
-
engine: "
|
|
927
|
+
engine: "mistral-ocr",
|
|
924
928
|
},
|
|
925
929
|
},
|
|
926
930
|
],
|
|
927
|
-
user: "
|
|
931
|
+
user: "Elmer_Yundt72",
|
|
928
932
|
});
|
|
929
933
|
|
|
930
934
|
console.log(result);
|
|
@@ -997,7 +1001,6 @@ async function run() {
|
|
|
997
1001
|
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
998
1002
|
models: [
|
|
999
1003
|
"<value 1>",
|
|
1000
|
-
"<value 2>",
|
|
1001
1004
|
],
|
|
1002
1005
|
text: {
|
|
1003
1006
|
format: {
|
|
@@ -1006,15 +1009,15 @@ async function run() {
|
|
|
1006
1009
|
verbosity: "medium",
|
|
1007
1010
|
},
|
|
1008
1011
|
reasoning: {
|
|
1009
|
-
effort: "
|
|
1012
|
+
effort: "high",
|
|
1010
1013
|
summary: "auto",
|
|
1011
|
-
maxTokens:
|
|
1014
|
+
maxTokens: 8661.16,
|
|
1012
1015
|
enabled: true,
|
|
1013
1016
|
},
|
|
1014
|
-
maxOutputTokens:
|
|
1017
|
+
maxOutputTokens: null,
|
|
1015
1018
|
temperature: 0.7,
|
|
1016
1019
|
topP: 0.9,
|
|
1017
|
-
topK:
|
|
1020
|
+
topK: 193.77,
|
|
1018
1021
|
promptCacheKey: "<value>",
|
|
1019
1022
|
previousResponseId: "<id>",
|
|
1020
1023
|
prompt: {
|
|
@@ -1027,25 +1030,25 @@ async function run() {
|
|
|
1027
1030
|
},
|
|
1028
1031
|
},
|
|
1029
1032
|
include: [
|
|
1030
|
-
"
|
|
1033
|
+
"reasoning.encrypted_content",
|
|
1031
1034
|
],
|
|
1032
|
-
background:
|
|
1035
|
+
background: true,
|
|
1033
1036
|
safetyIdentifier: "<value>",
|
|
1034
|
-
store:
|
|
1037
|
+
store: true,
|
|
1035
1038
|
serviceTier: "auto",
|
|
1036
1039
|
truncation: "auto",
|
|
1037
1040
|
provider: {
|
|
1038
|
-
allowFallbacks:
|
|
1039
|
-
requireParameters:
|
|
1041
|
+
allowFallbacks: null,
|
|
1042
|
+
requireParameters: true,
|
|
1040
1043
|
dataCollection: "deny",
|
|
1041
1044
|
zdr: true,
|
|
1042
1045
|
order: [
|
|
1043
1046
|
"OpenAI",
|
|
1044
1047
|
],
|
|
1045
|
-
only:
|
|
1046
|
-
ignore: [
|
|
1048
|
+
only: [
|
|
1047
1049
|
"OpenAI",
|
|
1048
1050
|
],
|
|
1051
|
+
ignore: null,
|
|
1049
1052
|
quantizations: [
|
|
1050
1053
|
"fp16",
|
|
1051
1054
|
],
|
|
@@ -1054,7 +1057,7 @@ async function run() {
|
|
|
1054
1057
|
prompt: "1000",
|
|
1055
1058
|
completion: 1000,
|
|
1056
1059
|
image: 1000,
|
|
1057
|
-
audio: 1000,
|
|
1060
|
+
audio: "1000",
|
|
1058
1061
|
request: 1000,
|
|
1059
1062
|
},
|
|
1060
1063
|
experimental: {},
|
|
@@ -1062,13 +1065,13 @@ async function run() {
|
|
|
1062
1065
|
plugins: [
|
|
1063
1066
|
{
|
|
1064
1067
|
id: "file-parser",
|
|
1065
|
-
maxFiles:
|
|
1068
|
+
maxFiles: 4870.55,
|
|
1066
1069
|
pdf: {
|
|
1067
|
-
engine: "
|
|
1070
|
+
engine: "mistral-ocr",
|
|
1068
1071
|
},
|
|
1069
1072
|
},
|
|
1070
1073
|
],
|
|
1071
|
-
user: "
|
|
1074
|
+
user: "Elmer_Yundt72",
|
|
1072
1075
|
});
|
|
1073
1076
|
|
|
1074
1077
|
console.log(result);
|
|
@@ -1111,20 +1114,20 @@ run();
|
|
|
1111
1114
|
|
|
1112
1115
|
|
|
1113
1116
|
**Inherit from [`OpenRouterError`](./src/models/errors/openroutererror.ts)**:
|
|
1114
|
-
* [`UnauthorizedResponseError`](./src/models/errors/unauthorizedresponseerror.ts): Unauthorized - Authentication required or invalid credentials. Status code `401`. Applicable to
|
|
1115
|
-
* [`
|
|
1116
|
-
* [`
|
|
1117
|
-
* [`
|
|
1118
|
-
* [`
|
|
1119
|
-
* [`
|
|
1120
|
-
* [`
|
|
1121
|
-
* [`BadGatewayResponseError`](./src/models/errors/badgatewayresponseerror.ts): Bad Gateway - Provider/upstream API failure. Status code `502`. Applicable to 2 of
|
|
1122
|
-
* [`EdgeNetworkTimeoutResponseError`](./src/models/errors/edgenetworktimeoutresponseerror.ts): Infrastructure Timeout - Provider request timed out at edge network. Status code `524`. Applicable to 2 of
|
|
1123
|
-
* [`ProviderOverloadedResponseError`](./src/models/errors/provideroverloadedresponseerror.ts): Provider Overloaded - Provider is temporarily overloaded. Status code `529`. Applicable to 2 of
|
|
1124
|
-
* [`RequestTimeoutResponseError`](./src/models/errors/requesttimeoutresponseerror.ts): Request Timeout - Operation exceeded time limit. Status code `408`. Applicable to 1 of
|
|
1125
|
-
* [`PayloadTooLargeResponseError`](./src/models/errors/payloadtoolargeresponseerror.ts): Payload Too Large - Request payload exceeds size limits. Status code `413`. Applicable to 1 of
|
|
1126
|
-
* [`UnprocessableEntityResponseError`](./src/models/errors/unprocessableentityresponseerror.ts): Unprocessable Entity - Semantic validation failure. Status code `422`. Applicable to 1 of
|
|
1127
|
-
* [`ServiceUnavailableResponseError`](./src/models/errors/serviceunavailableresponseerror.ts): Service Unavailable - Service temporarily unavailable. Status code `503`. Applicable to 1 of
|
|
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.*
|
|
1128
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.
|
|
1129
1132
|
|
|
1130
1133
|
</details>
|
|
@@ -21,6 +21,6 @@ export declare function betaResponsesSend(client: OpenRouterCore, request: model
|
|
|
21
21
|
}, options?: RequestOptions): APIPromise<Result<models.OpenResponsesNonStreamingResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.NotFoundResponseError | errors.RequestTimeoutResponseError | errors.PayloadTooLargeResponseError | errors.UnprocessableEntityResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
22
22
|
export declare function betaResponsesSend(client: OpenRouterCore, request: models.OpenResponsesRequest & {
|
|
23
23
|
stream: true;
|
|
24
|
-
}, options?: RequestOptions): APIPromise<Result<EventStream<
|
|
25
|
-
export declare function betaResponsesSend(client: OpenRouterCore, request: models.OpenResponsesRequest, options?: RequestOptions): APIPromise<Result<operations.
|
|
24
|
+
}, options?: RequestOptions): APIPromise<Result<EventStream<models.OpenResponsesStreamEvent>, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.NotFoundResponseError | errors.RequestTimeoutResponseError | errors.PayloadTooLargeResponseError | errors.UnprocessableEntityResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
25
|
+
export declare function betaResponsesSend(client: OpenRouterCore, request: models.OpenResponsesRequest, options?: RequestOptions): APIPromise<Result<operations.CreateResponsesResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.NotFoundResponseError | errors.RequestTimeoutResponseError | errors.PayloadTooLargeResponseError | errors.UnprocessableEntityResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
26
26
|
//# sourceMappingURL=betaResponsesSend.d.ts.map
|
|
@@ -21,7 +21,7 @@ async function $do(client, request, options) {
|
|
|
21
21
|
}
|
|
22
22
|
const payload = parsed.value;
|
|
23
23
|
const body = encodeJSON("body", payload, { explode: true });
|
|
24
|
-
const path = pathToFunc("/
|
|
24
|
+
const path = pathToFunc("/responses")();
|
|
25
25
|
const headers = new Headers(compactMap({
|
|
26
26
|
"Content-Type": "application/json",
|
|
27
27
|
Accept: request?.stream ? "text/event-stream" : "application/json",
|
|
@@ -32,7 +32,7 @@ async function $do(client, request, options) {
|
|
|
32
32
|
const context = {
|
|
33
33
|
options: client._options,
|
|
34
34
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
35
|
-
operationID: "
|
|
35
|
+
operationID: "createResponses",
|
|
36
36
|
oAuth2Scopes: null,
|
|
37
37
|
resolvedSecurity: requestSecurity,
|
|
38
38
|
securitySource: client._options.apiKey,
|
|
@@ -84,7 +84,7 @@ async function $do(client, request, options) {
|
|
|
84
84
|
const responseFields = {
|
|
85
85
|
HttpMeta: { Response: response, Request: req },
|
|
86
86
|
};
|
|
87
|
-
const [result] = await M.match(M.json(200, operations.
|
|
87
|
+
const [result] = await M.match(M.json(200, operations.CreateResponsesResponse$inboundSchema), M.sse(200, operations.CreateResponsesResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(408, errors.RequestTimeoutResponseError$inboundSchema), M.jsonErr(413, errors.PayloadTooLargeResponseError$inboundSchema), M.jsonErr(422, errors.UnprocessableEntityResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(524, errors.EdgeNetworkTimeoutResponseError$inboundSchema), M.jsonErr(529, errors.ProviderOverloadedResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
88
88
|
if (!result.ok) {
|
|
89
89
|
return [result, { status: "complete", request: req, response }];
|
|
90
90
|
}
|
package/esm/funcs/chatSend.d.ts
CHANGED
|
@@ -21,6 +21,6 @@ export declare function chatSend(client: OpenRouterCore, request: models.ChatGen
|
|
|
21
21
|
}, options?: RequestOptions): APIPromise<Result<models.ChatResponse, errors.ChatError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
22
22
|
export declare function chatSend(client: OpenRouterCore, request: models.ChatGenerationParams & {
|
|
23
23
|
stream: true;
|
|
24
|
-
}, options?: RequestOptions): APIPromise<Result<EventStream<models.
|
|
24
|
+
}, options?: RequestOptions): APIPromise<Result<EventStream<models.ChatStreamingResponseChunkData>, errors.ChatError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
25
25
|
export declare function chatSend(client: OpenRouterCore, request: models.ChatGenerationParams, options?: RequestOptions): APIPromise<Result<operations.SendChatCompletionRequestResponse, errors.ChatError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
26
26
|
//# sourceMappingURL=chatSend.d.ts.map
|
|
@@ -5,11 +5,12 @@ import * as errors from "../models/errors/index.js";
|
|
|
5
5
|
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
6
|
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
7
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
8
9
|
import * as operations from "../models/operations/index.js";
|
|
9
10
|
import { APIPromise } from "../types/async.js";
|
|
10
11
|
import { Result } from "../types/fp.js";
|
|
11
12
|
/**
|
|
12
13
|
* List all models and their properties
|
|
13
14
|
*/
|
|
14
|
-
export declare function modelsList(client: OpenRouterCore, request?: operations.GetModelsRequest | undefined, options?: RequestOptions): APIPromise<Result<
|
|
15
|
+
export declare function modelsList(client: OpenRouterCore, request?: operations.GetModelsRequest | undefined, options?: RequestOptions): APIPromise<Result<models.ModelsListResponse, errors.BadRequestResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
15
16
|
//# sourceMappingURL=modelsList.d.ts.map
|