@openrouter/sdk 0.0.1-beta.11 → 0.0.1-beta.12
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 +110 -1
- package/REACT_QUERY.md +110 -1
- package/README.md +682 -14
- 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 +36 -12
- 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 +2 -1
- package/esm/funcs/modelsList.js +6 -2
- package/esm/funcs/modelsListForUser.d.ts +3 -1
- package/esm/funcs/modelsListForUser.js +7 -3
- 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/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/createapialpharesponses.d.ts +3 -3
- package/esm/models/operations/createapialpharesponses.js +0 -2
- package/esm/models/operations/getmodels.d.ts +2 -2
- package/esm/models/operations/getmodels.js +2 -10
- package/esm/models/operations/index.d.ts +0 -1
- package/esm/models/operations/index.js +0 -1
- 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/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/modelsCount.d.ts +2 -2
- package/esm/react-query/modelsListForUser.d.ts +2 -1
- package/esm/sdk/models.d.ts +3 -2
- package/esm/sdk/responses.d.ts +7 -0
- package/esm/sdk/responses.js +0 -6
- package/jsr.json +1 -1
- package/package.json +1 -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/listmodelscount.d.ts +0 -26
- package/esm/models/operations/listmodelscount.js +0 -34
package/FUNCTIONS.md
CHANGED
|
@@ -29,7 +29,116 @@ const openRouter = new OpenRouterCore({
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
async function run() {
|
|
32
|
-
const res = await betaResponsesSend(openRouter, {
|
|
32
|
+
const res = await betaResponsesSend(openRouter, {
|
|
33
|
+
input: [
|
|
34
|
+
{
|
|
35
|
+
type: "message",
|
|
36
|
+
role: "user",
|
|
37
|
+
content: "Hello, how are you?",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
instructions: "<value>",
|
|
41
|
+
metadata: {
|
|
42
|
+
"user_id": "123",
|
|
43
|
+
"session_id": "abc-def-ghi",
|
|
44
|
+
},
|
|
45
|
+
tools: [
|
|
46
|
+
{
|
|
47
|
+
type: "function",
|
|
48
|
+
name: "get_current_weather",
|
|
49
|
+
description: "Get the current weather in a given location",
|
|
50
|
+
strict: true,
|
|
51
|
+
parameters: {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"properties": {
|
|
54
|
+
"location": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
toolChoice: {
|
|
62
|
+
type: "function",
|
|
63
|
+
name: "<value>",
|
|
64
|
+
},
|
|
65
|
+
parallelToolCalls: true,
|
|
66
|
+
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
67
|
+
models: [
|
|
68
|
+
"<value 1>",
|
|
69
|
+
"<value 2>",
|
|
70
|
+
],
|
|
71
|
+
text: {
|
|
72
|
+
format: {
|
|
73
|
+
type: "text",
|
|
74
|
+
},
|
|
75
|
+
verbosity: "medium",
|
|
76
|
+
},
|
|
77
|
+
reasoning: {
|
|
78
|
+
effort: "minimal",
|
|
79
|
+
summary: "auto",
|
|
80
|
+
maxTokens: 5632.72,
|
|
81
|
+
enabled: true,
|
|
82
|
+
},
|
|
83
|
+
maxOutputTokens: 5913.88,
|
|
84
|
+
temperature: 0.7,
|
|
85
|
+
topP: 0.9,
|
|
86
|
+
topK: 1770.66,
|
|
87
|
+
promptCacheKey: "<value>",
|
|
88
|
+
previousResponseId: "<id>",
|
|
89
|
+
prompt: {
|
|
90
|
+
id: "<id>",
|
|
91
|
+
variables: {
|
|
92
|
+
"key": {
|
|
93
|
+
type: "input_text",
|
|
94
|
+
text: "Hello, how can I help you?",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
include: [
|
|
99
|
+
"file_search_call.results",
|
|
100
|
+
],
|
|
101
|
+
background: false,
|
|
102
|
+
safetyIdentifier: "<value>",
|
|
103
|
+
store: false,
|
|
104
|
+
serviceTier: "auto",
|
|
105
|
+
truncation: "auto",
|
|
106
|
+
provider: {
|
|
107
|
+
allowFallbacks: false,
|
|
108
|
+
requireParameters: false,
|
|
109
|
+
dataCollection: "deny",
|
|
110
|
+
zdr: true,
|
|
111
|
+
order: [
|
|
112
|
+
"OpenAI",
|
|
113
|
+
],
|
|
114
|
+
only: null,
|
|
115
|
+
ignore: [
|
|
116
|
+
"OpenAI",
|
|
117
|
+
],
|
|
118
|
+
quantizations: [
|
|
119
|
+
"fp16",
|
|
120
|
+
],
|
|
121
|
+
sort: "price",
|
|
122
|
+
maxPrice: {
|
|
123
|
+
prompt: "1000",
|
|
124
|
+
completion: 1000,
|
|
125
|
+
image: 1000,
|
|
126
|
+
audio: 1000,
|
|
127
|
+
request: 1000,
|
|
128
|
+
},
|
|
129
|
+
experimental: {},
|
|
130
|
+
},
|
|
131
|
+
plugins: [
|
|
132
|
+
{
|
|
133
|
+
id: "file-parser",
|
|
134
|
+
maxFiles: 6167.86,
|
|
135
|
+
pdf: {
|
|
136
|
+
engine: "native",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
user: "Minnie.Ratke",
|
|
141
|
+
});
|
|
33
142
|
if (res.ok) {
|
|
34
143
|
const { value: result } = res;
|
|
35
144
|
console.log(result);
|
package/REACT_QUERY.md
CHANGED
|
@@ -124,7 +124,116 @@ export function Example() {
|
|
|
124
124
|
|
|
125
125
|
// Read form data here...
|
|
126
126
|
|
|
127
|
-
mutate({
|
|
127
|
+
mutate({
|
|
128
|
+
input: [
|
|
129
|
+
{
|
|
130
|
+
type: "message",
|
|
131
|
+
role: "user",
|
|
132
|
+
content: "Hello, how are you?",
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
instructions: "<value>",
|
|
136
|
+
metadata: {
|
|
137
|
+
"user_id": "123",
|
|
138
|
+
"session_id": "abc-def-ghi",
|
|
139
|
+
},
|
|
140
|
+
tools: [
|
|
141
|
+
{
|
|
142
|
+
type: "function",
|
|
143
|
+
name: "get_current_weather",
|
|
144
|
+
description: "Get the current weather in a given location",
|
|
145
|
+
strict: true,
|
|
146
|
+
parameters: {
|
|
147
|
+
"type": "object",
|
|
148
|
+
"properties": {
|
|
149
|
+
"location": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
toolChoice: {
|
|
157
|
+
type: "function",
|
|
158
|
+
name: "<value>",
|
|
159
|
+
},
|
|
160
|
+
parallelToolCalls: true,
|
|
161
|
+
model: "anthropic/claude-4.5-sonnet-20250929",
|
|
162
|
+
models: [
|
|
163
|
+
"<value 1>",
|
|
164
|
+
"<value 2>",
|
|
165
|
+
],
|
|
166
|
+
text: {
|
|
167
|
+
format: {
|
|
168
|
+
type: "text",
|
|
169
|
+
},
|
|
170
|
+
verbosity: "medium",
|
|
171
|
+
},
|
|
172
|
+
reasoning: {
|
|
173
|
+
effort: "minimal",
|
|
174
|
+
summary: "auto",
|
|
175
|
+
maxTokens: 5632.72,
|
|
176
|
+
enabled: true,
|
|
177
|
+
},
|
|
178
|
+
maxOutputTokens: 5913.88,
|
|
179
|
+
temperature: 0.7,
|
|
180
|
+
topP: 0.9,
|
|
181
|
+
topK: 1770.66,
|
|
182
|
+
promptCacheKey: "<value>",
|
|
183
|
+
previousResponseId: "<id>",
|
|
184
|
+
prompt: {
|
|
185
|
+
id: "<id>",
|
|
186
|
+
variables: {
|
|
187
|
+
"key": {
|
|
188
|
+
type: "input_text",
|
|
189
|
+
text: "Hello, how can I help you?",
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
include: [
|
|
194
|
+
"file_search_call.results",
|
|
195
|
+
],
|
|
196
|
+
background: false,
|
|
197
|
+
safetyIdentifier: "<value>",
|
|
198
|
+
store: false,
|
|
199
|
+
serviceTier: "auto",
|
|
200
|
+
truncation: "auto",
|
|
201
|
+
provider: {
|
|
202
|
+
allowFallbacks: false,
|
|
203
|
+
requireParameters: false,
|
|
204
|
+
dataCollection: "deny",
|
|
205
|
+
zdr: true,
|
|
206
|
+
order: [
|
|
207
|
+
"OpenAI",
|
|
208
|
+
],
|
|
209
|
+
only: null,
|
|
210
|
+
ignore: [
|
|
211
|
+
"OpenAI",
|
|
212
|
+
],
|
|
213
|
+
quantizations: [
|
|
214
|
+
"fp16",
|
|
215
|
+
],
|
|
216
|
+
sort: "price",
|
|
217
|
+
maxPrice: {
|
|
218
|
+
prompt: "1000",
|
|
219
|
+
completion: 1000,
|
|
220
|
+
image: 1000,
|
|
221
|
+
audio: 1000,
|
|
222
|
+
request: 1000,
|
|
223
|
+
},
|
|
224
|
+
experimental: {},
|
|
225
|
+
},
|
|
226
|
+
plugins: [
|
|
227
|
+
{
|
|
228
|
+
id: "file-parser",
|
|
229
|
+
maxFiles: 6167.86,
|
|
230
|
+
pdf: {
|
|
231
|
+
engine: "native",
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
user: "Minnie.Ratke",
|
|
236
|
+
});
|
|
128
237
|
}}
|
|
129
238
|
>
|
|
130
239
|
{/* Form fields go here... */}
|