@openrouter/sdk 1.3.28 → 1.3.30
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/README.md +1 -1
- package/esm/funcs/batchCreateBatches.d.ts +19 -0
- package/esm/funcs/batchCreateBatches.js +98 -0
- package/esm/funcs/batchDelete.d.ts +19 -0
- package/esm/funcs/batchDelete.js +103 -0
- package/esm/funcs/batchGetBatches.d.ts +19 -0
- package/esm/funcs/batchGetBatches.js +103 -0
- package/esm/funcs/batchList.d.ts +21 -0
- package/esm/funcs/batchList.js +134 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/anthropicadvisortoolresult.d.ts +14 -0
- package/esm/models/anthropicadvisortoolresult.js +21 -0
- package/esm/models/anthropicbase64pdfsource.d.ts +17 -2
- package/esm/models/anthropicbase64pdfsource.js +25 -2
- package/esm/models/anthropicbashcodeexecutioncontent.d.ts +11 -0
- package/esm/models/anthropicbashcodeexecutioncontent.js +17 -0
- package/esm/models/anthropicbashcodeexecutionoutput.d.ts +18 -0
- package/esm/models/anthropicbashcodeexecutionoutput.js +25 -0
- package/esm/models/anthropicbashcodeexecutionresult.d.ts +15 -0
- package/esm/models/anthropicbashcodeexecutionresult.js +24 -0
- package/esm/models/anthropicbashcodeexecutiontoolresult.d.ts +13 -0
- package/esm/models/anthropicbashcodeexecutiontoolresult.js +22 -0
- package/esm/models/anthropicbashcodeexecutiontoolresulterror.d.ts +22 -0
- package/esm/models/anthropicbashcodeexecutiontoolresulterror.js +30 -0
- package/esm/models/anthropiccaller.d.ts +12 -0
- package/esm/models/anthropiccaller.js +19 -0
- package/esm/models/anthropiccitationcharlocation.d.ts +16 -0
- package/esm/models/anthropiccitationcharlocation.js +30 -0
- package/esm/models/anthropiccitationcontentblocklocation.d.ts +16 -0
- package/esm/models/anthropiccitationcontentblocklocation.js +30 -0
- package/esm/models/anthropiccitationpagelocation.d.ts +16 -0
- package/esm/models/anthropiccitationpagelocation.js +30 -0
- package/esm/models/anthropiccitationsconfig.d.ts +10 -0
- package/esm/models/anthropiccitationsconfig.js +14 -0
- package/esm/models/anthropiccitationsearchresultlocation.d.ts +16 -0
- package/esm/models/anthropiccitationsearchresultlocation.js +28 -0
- package/esm/models/anthropiccitationwebsearchresultlocation.d.ts +14 -0
- package/esm/models/anthropiccitationwebsearchresultlocation.js +24 -0
- package/esm/models/anthropiccodeexecution20250825caller.d.ts +11 -0
- package/esm/models/anthropiccodeexecution20250825caller.js +20 -0
- package/esm/models/anthropiccodeexecution20260120caller.d.ts +11 -0
- package/esm/models/anthropiccodeexecution20260120caller.js +20 -0
- package/esm/models/anthropiccodeexecutioncontent.d.ts +12 -0
- package/esm/models/anthropiccodeexecutioncontent.js +19 -0
- package/esm/models/anthropiccodeexecutionoutput.d.ts +18 -0
- package/esm/models/anthropiccodeexecutionoutput.js +25 -0
- package/esm/models/anthropiccodeexecutionresult.d.ts +15 -0
- package/esm/models/anthropiccodeexecutionresult.js +24 -0
- package/esm/models/anthropiccodeexecutiontoolresult.d.ts +13 -0
- package/esm/models/anthropiccodeexecutiontoolresult.js +22 -0
- package/esm/models/anthropiccodeexecutiontoolresulterror.d.ts +12 -0
- package/esm/models/anthropiccodeexecutiontoolresulterror.js +21 -0
- package/esm/models/anthropiccompactionblock.d.ts +12 -0
- package/esm/models/anthropiccompactionblock.js +21 -0
- package/esm/models/anthropiccontainer.d.ts +13 -0
- package/esm/models/anthropiccontainer.js +22 -0
- package/esm/models/anthropiccontainerskill.d.ts +20 -0
- package/esm/models/anthropiccontainerskill.js +28 -0
- package/esm/models/anthropiccontainerupload.d.ts +11 -0
- package/esm/models/anthropiccontainerupload.js +20 -0
- package/esm/models/anthropicdirectcaller.d.ts +10 -0
- package/esm/models/anthropicdirectcaller.js +14 -0
- package/esm/models/anthropicdocumentblock.d.ts +36 -0
- package/esm/models/anthropicdocumentblock.js +45 -0
- package/esm/models/anthropicdocumentblockparam.d.ts +20 -4
- package/esm/models/anthropicdocumentblockparam.js +4 -4
- package/esm/models/anthropicencryptedcodeexecutionresult.d.ts +15 -0
- package/esm/models/anthropicencryptedcodeexecutionresult.js +25 -0
- package/esm/models/anthropicinputtransformation.d.ts +18 -0
- package/esm/models/anthropicinputtransformation.js +16 -0
- package/esm/models/anthropicoutputtokensdetails.d.ts +10 -0
- package/esm/models/anthropicoutputtokensdetails.js +19 -0
- package/esm/models/anthropicplaintextsource.d.ts +17 -2
- package/esm/models/anthropicplaintextsource.js +25 -2
- package/esm/models/anthropicredactedthinkingblock.d.ts +11 -0
- package/esm/models/anthropicredactedthinkingblock.js +15 -0
- package/esm/models/anthropicrefusalstopdetails.d.ts +32 -0
- package/esm/models/anthropicrefusalstopdetails.js +31 -0
- package/esm/models/anthropicservertoolerrorcode.d.ts +12 -0
- package/esm/models/anthropicservertoolerrorcode.js +14 -0
- package/esm/models/anthropicservertoolusage.d.ts +11 -0
- package/esm/models/anthropicservertoolusage.js +21 -0
- package/esm/models/anthropicservicetier.d.ts +11 -0
- package/esm/models/anthropicservicetier.js +13 -0
- package/esm/models/anthropictextblock.d.ts +13 -0
- package/esm/models/anthropictextblock.js +17 -0
- package/esm/models/anthropictextcitation.d.ts +14 -0
- package/esm/models/anthropictextcitation.js +23 -0
- package/esm/models/anthropictexteditorcodeexecutioncontent.d.ts +13 -0
- package/esm/models/anthropictexteditorcodeexecutioncontent.js +21 -0
- package/esm/models/anthropictexteditorcodeexecutioncreateresult.d.ts +11 -0
- package/esm/models/anthropictexteditorcodeexecutioncreateresult.js +20 -0
- package/esm/models/anthropictexteditorcodeexecutionstrreplaceresult.d.ts +15 -0
- package/esm/models/anthropictexteditorcodeexecutionstrreplaceresult.js +28 -0
- package/esm/models/anthropictexteditorcodeexecutiontoolresult.d.ts +13 -0
- package/esm/models/anthropictexteditorcodeexecutiontoolresult.js +22 -0
- package/esm/models/anthropictexteditorcodeexecutiontoolresulterror.d.ts +23 -0
- package/esm/models/anthropictexteditorcodeexecutiontoolresulterror.js +33 -0
- package/esm/models/anthropictexteditorcodeexecutionviewresult.d.ts +24 -0
- package/esm/models/anthropictexteditorcodeexecutionviewresult.js +36 -0
- package/esm/models/anthropicthinkingblock.d.ts +12 -0
- package/esm/models/anthropicthinkingblock.js +16 -0
- package/esm/models/anthropictoolreference.d.ts +18 -0
- package/esm/models/anthropictoolreference.js +25 -0
- package/esm/models/anthropictoolsearchcontent.d.ts +11 -0
- package/esm/models/anthropictoolsearchcontent.js +17 -0
- package/esm/models/anthropictoolsearchresult.d.ts +12 -0
- package/esm/models/anthropictoolsearchresult.js +21 -0
- package/esm/models/anthropictoolsearchresulterror.d.ts +13 -0
- package/esm/models/anthropictoolsearchresulterror.js +23 -0
- package/esm/models/anthropictoolsearchtoolresult.d.ts +13 -0
- package/esm/models/anthropictoolsearchtoolresult.js +22 -0
- package/esm/models/anthropictooluseblock.d.ts +15 -0
- package/esm/models/anthropictooluseblock.js +19 -0
- package/esm/models/anthropicwebfetchblock.d.ts +14 -0
- package/esm/models/anthropicwebfetchblock.js +23 -0
- package/esm/models/anthropicwebfetchcontent.d.ts +11 -0
- package/esm/models/anthropicwebfetchcontent.js +17 -0
- package/esm/models/anthropicwebfetchtoolresult.d.ts +15 -0
- package/esm/models/anthropicwebfetchtoolresult.js +24 -0
- package/esm/models/anthropicwebfetchtoolresulterror.d.ts +25 -0
- package/esm/models/anthropicwebfetchtoolresulterror.js +33 -0
- package/esm/models/anthropicwebsearchresult.d.ts +21 -0
- package/esm/models/anthropicwebsearchresult.js +29 -0
- package/esm/models/anthropicwebsearchtoolresult.d.ts +20 -0
- package/esm/models/anthropicwebsearchtoolresult.js +36 -0
- package/esm/models/anthropicwebsearchtoolresulterror.d.ts +29 -0
- package/esm/models/anthropicwebsearchtoolresulterror.js +37 -0
- package/esm/models/batchdeletedobject.d.ts +26 -0
- package/esm/models/batchdeletedobject.js +22 -0
- package/esm/models/batchdeletionoutcome.d.ts +17 -0
- package/esm/models/batchdeletionoutcome.js +16 -0
- package/esm/models/batchdeletiontargets.d.ts +50 -0
- package/esm/models/batchdeletiontargets.js +32 -0
- package/esm/models/batcherrorresponse.d.ts +11 -0
- package/esm/models/batcherrorresponse.js +15 -0
- package/esm/models/batchlistitem.d.ts +181 -0
- package/esm/models/batchlistitem.js +159 -0
- package/esm/models/batchlistresponse.d.ts +25 -0
- package/esm/models/batchlistresponse.js +31 -0
- package/esm/models/batchliststatus.d.ts +20 -0
- package/esm/models/batchliststatus.js +19 -0
- package/esm/models/batchlisttimestamp.d.ts +12 -0
- package/esm/models/batchlisttimestamp.js +15 -0
- package/esm/models/batchobject.d.ts +750 -0
- package/esm/models/batchobject.js +810 -0
- package/esm/models/batchpaymentrequiredresponseerror.d.ts +159 -0
- package/esm/models/batchpaymentrequiredresponseerror.js +136 -0
- package/esm/models/batchproviderpreferences.d.ts +25 -0
- package/esm/models/batchproviderpreferences.js +20 -0
- package/esm/models/batchsubmitbody.d.ts +62 -0
- package/esm/models/batchsubmitbody.js +51 -0
- package/esm/models/debugevent.d.ts +12 -12
- package/esm/models/debugevent.js +11 -12
- package/esm/models/errors/batcherrorresponse.d.ts +19 -0
- package/esm/models/errors/batcherrorresponse.js +32 -0
- package/esm/models/errors/batchpaymentrequiredresponseerror.d.ts +53 -0
- package/esm/models/errors/batchpaymentrequiredresponseerror.js +64 -0
- package/esm/models/errors/index.d.ts +2 -0
- package/esm/models/errors/index.js +2 -0
- package/esm/models/finishreason.d.ts +13 -0
- package/esm/models/finishreason.js +15 -0
- package/esm/models/imagegenerationusage.d.ts +4 -4
- package/esm/models/imagegenerationusage.js +4 -6
- package/esm/models/index.d.ts +77 -0
- package/esm/models/index.js +77 -0
- package/esm/models/internchatchoice.d.ts +4 -4
- package/esm/models/internchatchoice.js +3 -3
- package/esm/models/messagesmessageparam.d.ts +8 -8
- package/esm/models/messagesmessageparam.js +6 -7
- package/esm/models/operations/createbatches.d.ts +59 -0
- package/esm/models/operations/createbatches.js +23 -0
- package/esm/models/operations/deletebatch.d.ts +58 -0
- package/esm/models/operations/deletebatch.js +21 -0
- package/esm/models/operations/getbatches.d.ts +58 -0
- package/esm/models/operations/getbatches.js +21 -0
- package/esm/models/operations/index.d.ts +4 -0
- package/esm/models/operations/index.js +4 -0
- package/esm/models/operations/listbatches.d.ts +87 -0
- package/esm/models/operations/listbatches.js +40 -0
- package/esm/models/oranthropicbashtoolresult.d.ts +43 -0
- package/esm/models/oranthropicbashtoolresult.js +49 -0
- package/esm/models/oranthropiccontentblock.d.ts +25 -0
- package/esm/models/oranthropiccontentblock.js +45 -0
- package/esm/models/oranthropicnullablecaller.d.ts +12 -0
- package/esm/models/oranthropicnullablecaller.js +19 -0
- package/esm/models/oranthropicservertooluseblock.d.ts +15 -0
- package/esm/models/oranthropicservertooluseblock.js +19 -0
- package/esm/models/oranthropicshelltoolresult.d.ts +43 -0
- package/esm/models/oranthropicshelltoolresult.js +50 -0
- package/esm/models/oranthropicstopreason.d.ts +16 -0
- package/esm/models/oranthropicstopreason.js +18 -0
- package/esm/models/outputfusionservertoolitem.d.ts +8 -8
- package/esm/models/outputfusionservertoolitem.js +8 -8
- package/esm/models/publicendpoint.d.ts +8 -0
- package/esm/models/publicendpoint.js +4 -0
- package/esm/models/speechinputreference.d.ts +4 -3
- package/esm/models/speechinputreference.js +2 -0
- package/esm/models/speechinputreferenceaudio.d.ts +1 -1
- package/esm/models/speechinputreferenceaudioinput.d.ts +8 -3
- package/esm/models/speechinputreferenceaudioinput.js +2 -1
- package/esm/models/speechinputreferenceimage.d.ts +21 -0
- package/esm/models/speechinputreferenceimage.js +20 -0
- package/esm/models/speechinputreferenceimageinput.d.ts +18 -0
- package/esm/models/speechinputreferenceimageinput.js +13 -0
- package/esm/models/speechinputreferencetext.d.ts +2 -2
- package/esm/models/speechrequest.d.ts +1 -1
- package/esm/models/submitgenerationfeedbackrequest.d.ts +4 -4
- package/esm/models/submitgenerationfeedbackrequest.js +3 -4
- package/esm/sdk/batch.d.ts +37 -0
- package/esm/sdk/batch.js +50 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
package/esm/sdk/batch.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 254a218f7d6b
|
|
4
|
+
*/
|
|
5
|
+
import { batchCreateBatches } from "../funcs/batchCreateBatches.js";
|
|
6
|
+
import { batchDelete } from "../funcs/batchDelete.js";
|
|
7
|
+
import { batchGetBatches } from "../funcs/batchGetBatches.js";
|
|
8
|
+
import { batchList } from "../funcs/batchList.js";
|
|
9
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
10
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
11
|
+
import { unwrapResultIterator } from "../types/operations.js";
|
|
12
|
+
export class Batch extends ClientSDK {
|
|
13
|
+
/**
|
|
14
|
+
* List batches
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page's `last_id` as `after`. List items omit `results`. Use `GET /batches/{id}` to get them. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
|
|
18
|
+
*/
|
|
19
|
+
async list(request, options) {
|
|
20
|
+
return unwrapResultIterator(batchList(this, request, options));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a batch
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Creates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`). Returns `202` with `status: "validating"`. Poll `GET /batches/{id}` for progress and results. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
|
|
27
|
+
*/
|
|
28
|
+
async createBatches(request, options) {
|
|
29
|
+
return unwrapAsync(batchCreateBatches(this, request, options));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Delete a batch
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Deletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results. Batches still in progress return `409`. Billing and usage records are kept. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
|
|
36
|
+
*/
|
|
37
|
+
async delete(request, options) {
|
|
38
|
+
return unwrapAsync(batchDelete(this, request, options));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get a batch
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* Returns a batch with its status and request counts. Batches in a terminal status include `results`. Failed batches report the reason in `error.message`. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
|
|
45
|
+
*/
|
|
46
|
+
async getBatches(request, options) {
|
|
47
|
+
return unwrapAsync(batchGetBatches(this, request, options));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=batch.js.map
|
package/esm/sdk/sdk.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ClientSDK } from "../lib/sdks.js";
|
|
|
2
2
|
import { Alpha } from "./alpha.js";
|
|
3
3
|
import { Analytics } from "./analytics.js";
|
|
4
4
|
import { APIKeys } from "./apikeys.js";
|
|
5
|
+
import { Batch } from "./batch.js";
|
|
5
6
|
import { Benchmarks } from "./benchmarks.js";
|
|
6
7
|
import { Beta } from "./beta.js";
|
|
7
8
|
import { BYOK } from "./byok.js";
|
|
@@ -49,6 +50,8 @@ export declare class OpenRouter extends ClientSDK {
|
|
|
49
50
|
get stt(): STT;
|
|
50
51
|
private _oAuth?;
|
|
51
52
|
get oAuth(): OAuth;
|
|
53
|
+
private _batch?;
|
|
54
|
+
get batch(): Batch;
|
|
52
55
|
private _benchmarks?;
|
|
53
56
|
get benchmarks(): Benchmarks;
|
|
54
57
|
private _byok?;
|
package/esm/sdk/sdk.js
CHANGED
|
@@ -6,6 +6,7 @@ import { ClientSDK } from "../lib/sdks.js";
|
|
|
6
6
|
import { Alpha } from "./alpha.js";
|
|
7
7
|
import { Analytics } from "./analytics.js";
|
|
8
8
|
import { APIKeys } from "./apikeys.js";
|
|
9
|
+
import { Batch } from "./batch.js";
|
|
9
10
|
import { Benchmarks } from "./benchmarks.js";
|
|
10
11
|
import { Beta } from "./beta.js";
|
|
11
12
|
import { BYOK } from "./byok.js";
|
|
@@ -56,6 +57,9 @@ export class OpenRouter extends ClientSDK {
|
|
|
56
57
|
get oAuth() {
|
|
57
58
|
return (this._oAuth ?? (this._oAuth = new OAuth(this._options)));
|
|
58
59
|
}
|
|
60
|
+
get batch() {
|
|
61
|
+
return (this._batch ?? (this._batch = new Batch(this._options)));
|
|
62
|
+
}
|
|
59
63
|
get benchmarks() {
|
|
60
64
|
return (this._benchmarks ?? (this._benchmarks = new Benchmarks(this._options)));
|
|
61
65
|
}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.30",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"prepare": "npm run build",
|
|
77
|
-
"test": "vitest --run --project unit",
|
|
78
|
-
"test:e2e": "vitest --run --project e2e",
|
|
79
76
|
"typecheck:transit": "exit 0",
|
|
80
77
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
81
78
|
"postinstall": "node scripts/check-types.js || true",
|
|
79
|
+
"test:e2e": "vitest --run --project e2e",
|
|
82
80
|
"test:transit": "exit 0",
|
|
83
81
|
"test:watch": "vitest --watch --project unit",
|
|
84
|
-
"typecheck": "tsc --noEmit"
|
|
82
|
+
"typecheck": "tsc --noEmit",
|
|
83
|
+
"prepare": "npm run build",
|
|
84
|
+
"test": "vitest --run --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|