@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: b1465ff3b43c
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
export const AnthropicWebSearchToolResultErrorErrorCode = {
|
|
10
|
+
InvalidToolInput: "invalid_tool_input",
|
|
11
|
+
Unavailable: "unavailable",
|
|
12
|
+
MaxUsesExceeded: "max_uses_exceeded",
|
|
13
|
+
TooManyRequests: "too_many_requests",
|
|
14
|
+
QueryTooLong: "query_too_long",
|
|
15
|
+
RequestTooLarge: "request_too_large",
|
|
16
|
+
};
|
|
17
|
+
export const AnthropicWebSearchToolResultErrorType = {
|
|
18
|
+
WebSearchToolResultError: "web_search_tool_result_error",
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const AnthropicWebSearchToolResultErrorErrorCode$inboundSchema = openEnums
|
|
22
|
+
.inboundSchema(AnthropicWebSearchToolResultErrorErrorCode);
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const AnthropicWebSearchToolResultErrorType$inboundSchema = z.enum(AnthropicWebSearchToolResultErrorType);
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const AnthropicWebSearchToolResultError$inboundSchema = z.object({
|
|
27
|
+
error_code: AnthropicWebSearchToolResultErrorErrorCode$inboundSchema,
|
|
28
|
+
type: AnthropicWebSearchToolResultErrorType$inboundSchema,
|
|
29
|
+
}).transform((v) => {
|
|
30
|
+
return remap$(v, {
|
|
31
|
+
"error_code": "errorCode",
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
export function anthropicWebSearchToolResultErrorFromJSON(jsonString) {
|
|
35
|
+
return safeParse(jsonString, (x) => AnthropicWebSearchToolResultError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AnthropicWebSearchToolResultError' from JSON`);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=anthropicwebsearchtoolresulterror.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { BatchDeletionTargets } from "./batchdeletiontargets.js";
|
|
5
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
|
+
export declare const BatchDeletedObjectObject: {
|
|
7
|
+
readonly Batch: "batch";
|
|
8
|
+
};
|
|
9
|
+
export type BatchDeletedObjectObject = ClosedEnum<typeof BatchDeletedObjectObject>;
|
|
10
|
+
/**
|
|
11
|
+
* Confirms a terminal batch was removed from the API and its OpenRouter-held artifacts purged. Deletion is not cancellation and does not erase billing or audit records.
|
|
12
|
+
*/
|
|
13
|
+
export type BatchDeletedObject = {
|
|
14
|
+
/**
|
|
15
|
+
* OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome.
|
|
16
|
+
*/
|
|
17
|
+
deletion: BatchDeletionTargets;
|
|
18
|
+
id: string;
|
|
19
|
+
object: BatchDeletedObjectObject;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const BatchDeletedObjectObject$inboundSchema: z.ZodEnum<typeof BatchDeletedObjectObject>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const BatchDeletedObject$inboundSchema: z.ZodType<BatchDeletedObject, unknown>;
|
|
25
|
+
export declare function batchDeletedObjectFromJSON(jsonString: string): SafeParseResult<BatchDeletedObject, SDKValidationError>;
|
|
26
|
+
//# sourceMappingURL=batchdeletedobject.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 142fca04702c
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { BatchDeletionTargets$inboundSchema, } from "./batchdeletiontargets.js";
|
|
8
|
+
export const BatchDeletedObjectObject = {
|
|
9
|
+
Batch: "batch",
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const BatchDeletedObjectObject$inboundSchema = z.enum(BatchDeletedObjectObject);
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const BatchDeletedObject$inboundSchema = z.object({
|
|
15
|
+
deletion: BatchDeletionTargets$inboundSchema,
|
|
16
|
+
id: z.string(),
|
|
17
|
+
object: BatchDeletedObjectObject$inboundSchema,
|
|
18
|
+
});
|
|
19
|
+
export function batchDeletedObjectFromJSON(jsonString) {
|
|
20
|
+
return safeParse(jsonString, (x) => BatchDeletedObject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchDeletedObject' from JSON`);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=batchdeletedobject.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target).
|
|
5
|
+
*/
|
|
6
|
+
export declare const BatchDeletionOutcome: {
|
|
7
|
+
readonly Deleted: "deleted";
|
|
8
|
+
readonly Unsupported: "unsupported";
|
|
9
|
+
readonly NotApplicable: "not_applicable";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target).
|
|
13
|
+
*/
|
|
14
|
+
export type BatchDeletionOutcome = OpenEnum<typeof BatchDeletionOutcome>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const BatchDeletionOutcome$inboundSchema: z.ZodType<BatchDeletionOutcome, unknown>;
|
|
17
|
+
//# sourceMappingURL=batchdeletionoutcome.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: d8b27b19149c
|
|
4
|
+
*/
|
|
5
|
+
import * as openEnums from "../types/enums.js";
|
|
6
|
+
/**
|
|
7
|
+
* Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target).
|
|
8
|
+
*/
|
|
9
|
+
export const BatchDeletionOutcome = {
|
|
10
|
+
Deleted: "deleted",
|
|
11
|
+
Unsupported: "unsupported",
|
|
12
|
+
NotApplicable: "not_applicable",
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const BatchDeletionOutcome$inboundSchema = openEnums.inboundSchema(BatchDeletionOutcome);
|
|
16
|
+
//# sourceMappingURL=batchdeletionoutcome.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { BatchDeletionOutcome } from "./batchdeletionoutcome.js";
|
|
5
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
|
+
/**
|
|
7
|
+
* OpenRouter-held request and result artifacts were purged.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Openrouter: {
|
|
10
|
+
readonly Deleted: "deleted";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* OpenRouter-held request and result artifacts were purged.
|
|
14
|
+
*/
|
|
15
|
+
export type Openrouter = ClosedEnum<typeof Openrouter>;
|
|
16
|
+
/**
|
|
17
|
+
* The upstream batch deletion outcome; omitted when no provider was assigned.
|
|
18
|
+
*/
|
|
19
|
+
export type Upstream = {
|
|
20
|
+
/**
|
|
21
|
+
* The provider name stored on the batch.
|
|
22
|
+
*/
|
|
23
|
+
provider: string;
|
|
24
|
+
/**
|
|
25
|
+
* Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target).
|
|
26
|
+
*/
|
|
27
|
+
status: BatchDeletionOutcome;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome.
|
|
31
|
+
*/
|
|
32
|
+
export type BatchDeletionTargets = {
|
|
33
|
+
/**
|
|
34
|
+
* OpenRouter-held request and result artifacts were purged.
|
|
35
|
+
*/
|
|
36
|
+
openrouter: Openrouter;
|
|
37
|
+
/**
|
|
38
|
+
* The upstream batch deletion outcome; omitted when no provider was assigned.
|
|
39
|
+
*/
|
|
40
|
+
upstream?: Upstream | undefined;
|
|
41
|
+
};
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare const Openrouter$inboundSchema: z.ZodEnum<typeof Openrouter>;
|
|
44
|
+
/** @internal */
|
|
45
|
+
export declare const Upstream$inboundSchema: z.ZodType<Upstream, unknown>;
|
|
46
|
+
export declare function upstreamFromJSON(jsonString: string): SafeParseResult<Upstream, SDKValidationError>;
|
|
47
|
+
/** @internal */
|
|
48
|
+
export declare const BatchDeletionTargets$inboundSchema: z.ZodType<BatchDeletionTargets, unknown>;
|
|
49
|
+
export declare function batchDeletionTargetsFromJSON(jsonString: string): SafeParseResult<BatchDeletionTargets, SDKValidationError>;
|
|
50
|
+
//# sourceMappingURL=batchdeletiontargets.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 031cd7aaeaa3
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { BatchDeletionOutcome$inboundSchema, } from "./batchdeletionoutcome.js";
|
|
8
|
+
/**
|
|
9
|
+
* OpenRouter-held request and result artifacts were purged.
|
|
10
|
+
*/
|
|
11
|
+
export const Openrouter = {
|
|
12
|
+
Deleted: "deleted",
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const Openrouter$inboundSchema = z.enum(Openrouter);
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const Upstream$inboundSchema = z.object({
|
|
18
|
+
provider: z.string(),
|
|
19
|
+
status: BatchDeletionOutcome$inboundSchema,
|
|
20
|
+
});
|
|
21
|
+
export function upstreamFromJSON(jsonString) {
|
|
22
|
+
return safeParse(jsonString, (x) => Upstream$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Upstream' from JSON`);
|
|
23
|
+
}
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const BatchDeletionTargets$inboundSchema = z.object({
|
|
26
|
+
openrouter: Openrouter$inboundSchema,
|
|
27
|
+
upstream: z.lazy(() => Upstream$inboundSchema).optional(),
|
|
28
|
+
});
|
|
29
|
+
export function batchDeletionTargetsFromJSON(jsonString) {
|
|
30
|
+
return safeParse(jsonString, (x) => BatchDeletionTargets$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchDeletionTargets' from JSON`);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=batchdeletiontargets.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type BatchErrorResponseError = {
|
|
5
|
+
code: number;
|
|
6
|
+
message: string;
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const BatchErrorResponseError$inboundSchema: z.ZodType<BatchErrorResponseError, unknown>;
|
|
10
|
+
export declare function batchErrorResponseErrorFromJSON(jsonString: string): SafeParseResult<BatchErrorResponseError, SDKValidationError>;
|
|
11
|
+
//# sourceMappingURL=batcherrorresponse.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 61c415402d74
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const BatchErrorResponseError$inboundSchema = z.object({
|
|
9
|
+
code: z.int(),
|
|
10
|
+
message: z.string(),
|
|
11
|
+
});
|
|
12
|
+
export function batchErrorResponseErrorFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => BatchErrorResponseError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchErrorResponseError' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=batcherrorresponse.js.map
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { AnthropicCacheCreation } from "./anthropiccachecreation.js";
|
|
5
|
+
import { AnthropicSpeed } from "./anthropicspeed.js";
|
|
6
|
+
import { AnthropicUsageIteration } from "./anthropicusageiteration.js";
|
|
7
|
+
import { CostDetails } from "./costdetails.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
export declare const BatchListItemCompletionWindow: {
|
|
10
|
+
readonly TwentyFourh: "24h";
|
|
11
|
+
};
|
|
12
|
+
export type BatchListItemCompletionWindow = ClosedEnum<typeof BatchListItemCompletionWindow>;
|
|
13
|
+
export type BatchListItemError = {
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const BatchListItemObject: {
|
|
17
|
+
readonly Batch: "batch";
|
|
18
|
+
};
|
|
19
|
+
export type BatchListItemObject = ClosedEnum<typeof BatchListItemObject>;
|
|
20
|
+
export type BatchListItemRequestCounts = {
|
|
21
|
+
completed: number;
|
|
22
|
+
failed: number;
|
|
23
|
+
total: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const BatchListItemStatus: {
|
|
26
|
+
readonly Validating: "validating";
|
|
27
|
+
readonly InProgress: "in_progress";
|
|
28
|
+
readonly Finalizing: "finalizing";
|
|
29
|
+
readonly Completed: "completed";
|
|
30
|
+
readonly Failed: "failed";
|
|
31
|
+
readonly Expired: "expired";
|
|
32
|
+
readonly Cancelling: "cancelling";
|
|
33
|
+
readonly Cancelled: "cancelled";
|
|
34
|
+
};
|
|
35
|
+
export type BatchListItemStatus = OpenEnum<typeof BatchListItemStatus>;
|
|
36
|
+
export type BatchListItemCompletionTokensDetails = {
|
|
37
|
+
/**
|
|
38
|
+
* Tokens generated by the model for audio output.
|
|
39
|
+
*/
|
|
40
|
+
audioTokens?: number | null | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Tokens generated by the model for image output.
|
|
43
|
+
*/
|
|
44
|
+
imageTokens?: number | null | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Tokens generated by the model for reasoning.
|
|
47
|
+
*/
|
|
48
|
+
reasoningTokens?: number | null | undefined;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Breakdown of tokens used in the prompt.
|
|
52
|
+
*/
|
|
53
|
+
export type BatchListItemPromptTokensDetails = {
|
|
54
|
+
/**
|
|
55
|
+
* Tokens used for input audio.
|
|
56
|
+
*/
|
|
57
|
+
audioTokens?: number | null | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Tokens written to cache. Only returned for models with explicit caching and cache write pricing.
|
|
60
|
+
*/
|
|
61
|
+
cacheWriteTokens?: number | null | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Tokens cached by the endpoint.
|
|
64
|
+
*/
|
|
65
|
+
cachedTokens?: number | null | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Tokens used for input files/documents.
|
|
68
|
+
*/
|
|
69
|
+
fileTokens?: number | null | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Tokens used for input video.
|
|
72
|
+
*/
|
|
73
|
+
videoTokens?: number | null | undefined;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Usage for server-side tool execution (e.g., web search)
|
|
77
|
+
*/
|
|
78
|
+
export type BatchListItemServerToolUse = {
|
|
79
|
+
/**
|
|
80
|
+
* Number of OpenRouter server tool calls that executed and produced a result.
|
|
81
|
+
*/
|
|
82
|
+
toolCallsExecuted?: number | null | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.
|
|
85
|
+
*/
|
|
86
|
+
toolCallsRequested?: number | null | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.
|
|
89
|
+
*/
|
|
90
|
+
webSearchRequests?: number | null | undefined;
|
|
91
|
+
};
|
|
92
|
+
export type BatchListItemUsage = {
|
|
93
|
+
cacheCreation?: AnthropicCacheCreation | null | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* The tokens generated
|
|
96
|
+
*/
|
|
97
|
+
completionTokens: number;
|
|
98
|
+
completionTokensDetails?: BatchListItemCompletionTokensDetails | null | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Cost of the completion
|
|
101
|
+
*/
|
|
102
|
+
cost?: number | null | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Breakdown of upstream inference costs
|
|
105
|
+
*/
|
|
106
|
+
costDetails?: CostDetails | null | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Whether a request was made using a Bring Your Own Key configuration
|
|
109
|
+
*/
|
|
110
|
+
isByok?: boolean | undefined;
|
|
111
|
+
iterations?: Array<AnthropicUsageIteration> | null | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Including images, input audio, and tools if any
|
|
114
|
+
*/
|
|
115
|
+
promptTokens: number;
|
|
116
|
+
/**
|
|
117
|
+
* Breakdown of tokens used in the prompt.
|
|
118
|
+
*/
|
|
119
|
+
promptTokensDetails?: BatchListItemPromptTokensDetails | null | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Usage for server-side tool execution (e.g., web search)
|
|
122
|
+
*/
|
|
123
|
+
serverToolUse?: BatchListItemServerToolUse | null | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* The service tier used by the upstream provider for this request
|
|
126
|
+
*/
|
|
127
|
+
serviceTier?: string | null | undefined;
|
|
128
|
+
speed?: AnthropicSpeed | null | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Sum of the above two fields
|
|
131
|
+
*/
|
|
132
|
+
totalTokens: number;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Metadata-only batch object. `results` is always `null` in list responses.
|
|
136
|
+
*/
|
|
137
|
+
export type BatchListItem = {
|
|
138
|
+
completionWindow: BatchListItemCompletionWindow;
|
|
139
|
+
createdAt: number;
|
|
140
|
+
endpoint: string;
|
|
141
|
+
error: BatchListItemError | null;
|
|
142
|
+
finalizedAt: number | null;
|
|
143
|
+
id: string;
|
|
144
|
+
model: string;
|
|
145
|
+
object: BatchListItemObject;
|
|
146
|
+
requestCounts: BatchListItemRequestCounts;
|
|
147
|
+
/**
|
|
148
|
+
* Always null: retrieve the batch with `GET /batches/{id}` to access its results.
|
|
149
|
+
*/
|
|
150
|
+
results: any | null;
|
|
151
|
+
status: BatchListItemStatus;
|
|
152
|
+
usage: BatchListItemUsage | null;
|
|
153
|
+
};
|
|
154
|
+
/** @internal */
|
|
155
|
+
export declare const BatchListItemCompletionWindow$inboundSchema: z.ZodEnum<typeof BatchListItemCompletionWindow>;
|
|
156
|
+
/** @internal */
|
|
157
|
+
export declare const BatchListItemError$inboundSchema: z.ZodType<BatchListItemError, unknown>;
|
|
158
|
+
export declare function batchListItemErrorFromJSON(jsonString: string): SafeParseResult<BatchListItemError, SDKValidationError>;
|
|
159
|
+
/** @internal */
|
|
160
|
+
export declare const BatchListItemObject$inboundSchema: z.ZodEnum<typeof BatchListItemObject>;
|
|
161
|
+
/** @internal */
|
|
162
|
+
export declare const BatchListItemRequestCounts$inboundSchema: z.ZodType<BatchListItemRequestCounts, unknown>;
|
|
163
|
+
export declare function batchListItemRequestCountsFromJSON(jsonString: string): SafeParseResult<BatchListItemRequestCounts, SDKValidationError>;
|
|
164
|
+
/** @internal */
|
|
165
|
+
export declare const BatchListItemStatus$inboundSchema: z.ZodType<BatchListItemStatus, unknown>;
|
|
166
|
+
/** @internal */
|
|
167
|
+
export declare const BatchListItemCompletionTokensDetails$inboundSchema: z.ZodType<BatchListItemCompletionTokensDetails, unknown>;
|
|
168
|
+
export declare function batchListItemCompletionTokensDetailsFromJSON(jsonString: string): SafeParseResult<BatchListItemCompletionTokensDetails, SDKValidationError>;
|
|
169
|
+
/** @internal */
|
|
170
|
+
export declare const BatchListItemPromptTokensDetails$inboundSchema: z.ZodType<BatchListItemPromptTokensDetails, unknown>;
|
|
171
|
+
export declare function batchListItemPromptTokensDetailsFromJSON(jsonString: string): SafeParseResult<BatchListItemPromptTokensDetails, SDKValidationError>;
|
|
172
|
+
/** @internal */
|
|
173
|
+
export declare const BatchListItemServerToolUse$inboundSchema: z.ZodType<BatchListItemServerToolUse, unknown>;
|
|
174
|
+
export declare function batchListItemServerToolUseFromJSON(jsonString: string): SafeParseResult<BatchListItemServerToolUse, SDKValidationError>;
|
|
175
|
+
/** @internal */
|
|
176
|
+
export declare const BatchListItemUsage$inboundSchema: z.ZodType<BatchListItemUsage, unknown>;
|
|
177
|
+
export declare function batchListItemUsageFromJSON(jsonString: string): SafeParseResult<BatchListItemUsage, SDKValidationError>;
|
|
178
|
+
/** @internal */
|
|
179
|
+
export declare const BatchListItem$inboundSchema: z.ZodType<BatchListItem, unknown>;
|
|
180
|
+
export declare function batchListItemFromJSON(jsonString: string): SafeParseResult<BatchListItem, SDKValidationError>;
|
|
181
|
+
//# sourceMappingURL=batchlistitem.d.ts.map
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7032c65d52eb
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
import { AnthropicCacheCreation$inboundSchema, } from "./anthropiccachecreation.js";
|
|
10
|
+
import { AnthropicSpeed$inboundSchema, } from "./anthropicspeed.js";
|
|
11
|
+
import { AnthropicUsageIteration$inboundSchema, } from "./anthropicusageiteration.js";
|
|
12
|
+
import { CostDetails$inboundSchema } from "./costdetails.js";
|
|
13
|
+
export const BatchListItemCompletionWindow = {
|
|
14
|
+
TwentyFourh: "24h",
|
|
15
|
+
};
|
|
16
|
+
export const BatchListItemObject = {
|
|
17
|
+
Batch: "batch",
|
|
18
|
+
};
|
|
19
|
+
export const BatchListItemStatus = {
|
|
20
|
+
Validating: "validating",
|
|
21
|
+
InProgress: "in_progress",
|
|
22
|
+
Finalizing: "finalizing",
|
|
23
|
+
Completed: "completed",
|
|
24
|
+
Failed: "failed",
|
|
25
|
+
Expired: "expired",
|
|
26
|
+
Cancelling: "cancelling",
|
|
27
|
+
Cancelled: "cancelled",
|
|
28
|
+
};
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const BatchListItemCompletionWindow$inboundSchema = z.enum(BatchListItemCompletionWindow);
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const BatchListItemError$inboundSchema = z.object({
|
|
33
|
+
message: z.string(),
|
|
34
|
+
});
|
|
35
|
+
export function batchListItemErrorFromJSON(jsonString) {
|
|
36
|
+
return safeParse(jsonString, (x) => BatchListItemError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchListItemError' from JSON`);
|
|
37
|
+
}
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const BatchListItemObject$inboundSchema = z.enum(BatchListItemObject);
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const BatchListItemRequestCounts$inboundSchema = z.object({
|
|
42
|
+
completed: z.int(),
|
|
43
|
+
failed: z.int(),
|
|
44
|
+
total: z.int(),
|
|
45
|
+
});
|
|
46
|
+
export function batchListItemRequestCountsFromJSON(jsonString) {
|
|
47
|
+
return safeParse(jsonString, (x) => BatchListItemRequestCounts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchListItemRequestCounts' from JSON`);
|
|
48
|
+
}
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const BatchListItemStatus$inboundSchema = openEnums.inboundSchema(BatchListItemStatus);
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const BatchListItemCompletionTokensDetails$inboundSchema = z.object({
|
|
53
|
+
audio_tokens: z.nullable(z.int()).optional(),
|
|
54
|
+
image_tokens: z.nullable(z.int()).optional(),
|
|
55
|
+
reasoning_tokens: z.nullable(z.int()).optional(),
|
|
56
|
+
}).transform((v) => {
|
|
57
|
+
return remap$(v, {
|
|
58
|
+
"audio_tokens": "audioTokens",
|
|
59
|
+
"image_tokens": "imageTokens",
|
|
60
|
+
"reasoning_tokens": "reasoningTokens",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
export function batchListItemCompletionTokensDetailsFromJSON(jsonString) {
|
|
64
|
+
return safeParse(jsonString, (x) => BatchListItemCompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchListItemCompletionTokensDetails' from JSON`);
|
|
65
|
+
}
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const BatchListItemPromptTokensDetails$inboundSchema = z.object({
|
|
68
|
+
audio_tokens: z.nullable(z.int()).optional(),
|
|
69
|
+
cache_write_tokens: z.nullable(z.int()).optional(),
|
|
70
|
+
cached_tokens: z.nullable(z.int()).optional(),
|
|
71
|
+
file_tokens: z.nullable(z.int()).optional(),
|
|
72
|
+
video_tokens: z.nullable(z.int()).optional(),
|
|
73
|
+
}).transform((v) => {
|
|
74
|
+
return remap$(v, {
|
|
75
|
+
"audio_tokens": "audioTokens",
|
|
76
|
+
"cache_write_tokens": "cacheWriteTokens",
|
|
77
|
+
"cached_tokens": "cachedTokens",
|
|
78
|
+
"file_tokens": "fileTokens",
|
|
79
|
+
"video_tokens": "videoTokens",
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
export function batchListItemPromptTokensDetailsFromJSON(jsonString) {
|
|
83
|
+
return safeParse(jsonString, (x) => BatchListItemPromptTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchListItemPromptTokensDetails' from JSON`);
|
|
84
|
+
}
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const BatchListItemServerToolUse$inboundSchema = z.object({
|
|
87
|
+
tool_calls_executed: z.nullable(z.int()).optional(),
|
|
88
|
+
tool_calls_requested: z.nullable(z.int()).optional(),
|
|
89
|
+
web_search_requests: z.nullable(z.int()).optional(),
|
|
90
|
+
}).transform((v) => {
|
|
91
|
+
return remap$(v, {
|
|
92
|
+
"tool_calls_executed": "toolCallsExecuted",
|
|
93
|
+
"tool_calls_requested": "toolCallsRequested",
|
|
94
|
+
"web_search_requests": "webSearchRequests",
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
export function batchListItemServerToolUseFromJSON(jsonString) {
|
|
98
|
+
return safeParse(jsonString, (x) => BatchListItemServerToolUse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchListItemServerToolUse' from JSON`);
|
|
99
|
+
}
|
|
100
|
+
/** @internal */
|
|
101
|
+
export const BatchListItemUsage$inboundSchema = z.object({
|
|
102
|
+
cache_creation: z.nullable(AnthropicCacheCreation$inboundSchema).optional(),
|
|
103
|
+
completion_tokens: z.int(),
|
|
104
|
+
completion_tokens_details: z.nullable(z.lazy(() => BatchListItemCompletionTokensDetails$inboundSchema)).optional(),
|
|
105
|
+
cost: z.nullable(z.number()).optional(),
|
|
106
|
+
cost_details: z.nullable(CostDetails$inboundSchema).optional(),
|
|
107
|
+
is_byok: z.boolean().optional(),
|
|
108
|
+
iterations: z.nullable(z.array(AnthropicUsageIteration$inboundSchema))
|
|
109
|
+
.optional(),
|
|
110
|
+
prompt_tokens: z.int(),
|
|
111
|
+
prompt_tokens_details: z.nullable(z.lazy(() => BatchListItemPromptTokensDetails$inboundSchema)).optional(),
|
|
112
|
+
server_tool_use: z.nullable(z.lazy(() => BatchListItemServerToolUse$inboundSchema)).optional(),
|
|
113
|
+
service_tier: z.nullable(z.string()).optional(),
|
|
114
|
+
speed: z.nullable(AnthropicSpeed$inboundSchema).optional(),
|
|
115
|
+
total_tokens: z.int(),
|
|
116
|
+
}).transform((v) => {
|
|
117
|
+
return remap$(v, {
|
|
118
|
+
"cache_creation": "cacheCreation",
|
|
119
|
+
"completion_tokens": "completionTokens",
|
|
120
|
+
"completion_tokens_details": "completionTokensDetails",
|
|
121
|
+
"cost_details": "costDetails",
|
|
122
|
+
"is_byok": "isByok",
|
|
123
|
+
"prompt_tokens": "promptTokens",
|
|
124
|
+
"prompt_tokens_details": "promptTokensDetails",
|
|
125
|
+
"server_tool_use": "serverToolUse",
|
|
126
|
+
"service_tier": "serviceTier",
|
|
127
|
+
"total_tokens": "totalTokens",
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
export function batchListItemUsageFromJSON(jsonString) {
|
|
131
|
+
return safeParse(jsonString, (x) => BatchListItemUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchListItemUsage' from JSON`);
|
|
132
|
+
}
|
|
133
|
+
/** @internal */
|
|
134
|
+
export const BatchListItem$inboundSchema = z
|
|
135
|
+
.object({
|
|
136
|
+
completion_window: BatchListItemCompletionWindow$inboundSchema,
|
|
137
|
+
created_at: z.int(),
|
|
138
|
+
endpoint: z.string(),
|
|
139
|
+
error: z.nullable(z.lazy(() => BatchListItemError$inboundSchema)),
|
|
140
|
+
finalized_at: z.nullable(z.int()),
|
|
141
|
+
id: z.string(),
|
|
142
|
+
model: z.string(),
|
|
143
|
+
object: BatchListItemObject$inboundSchema,
|
|
144
|
+
request_counts: z.lazy(() => BatchListItemRequestCounts$inboundSchema),
|
|
145
|
+
results: z.nullable(z.any()),
|
|
146
|
+
status: BatchListItemStatus$inboundSchema,
|
|
147
|
+
usage: z.nullable(z.lazy(() => BatchListItemUsage$inboundSchema)),
|
|
148
|
+
}).transform((v) => {
|
|
149
|
+
return remap$(v, {
|
|
150
|
+
"completion_window": "completionWindow",
|
|
151
|
+
"created_at": "createdAt",
|
|
152
|
+
"finalized_at": "finalizedAt",
|
|
153
|
+
"request_counts": "requestCounts",
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
export function batchListItemFromJSON(jsonString) {
|
|
157
|
+
return safeParse(jsonString, (x) => BatchListItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchListItem' from JSON`);
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=batchlistitem.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { BatchListItem } from "./batchlistitem.js";
|
|
5
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
|
+
export declare const BatchListResponseObject: {
|
|
7
|
+
readonly List: "list";
|
|
8
|
+
};
|
|
9
|
+
export type BatchListResponseObject = ClosedEnum<typeof BatchListResponseObject>;
|
|
10
|
+
/**
|
|
11
|
+
* A newest-first page of metadata-only batch objects.
|
|
12
|
+
*/
|
|
13
|
+
export type BatchListResponse = {
|
|
14
|
+
data: Array<BatchListItem>;
|
|
15
|
+
firstId: string | null;
|
|
16
|
+
hasMore: boolean;
|
|
17
|
+
lastId: string | null;
|
|
18
|
+
object: BatchListResponseObject;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const BatchListResponseObject$inboundSchema: z.ZodEnum<typeof BatchListResponseObject>;
|
|
22
|
+
/** @internal */
|
|
23
|
+
export declare const BatchListResponse$inboundSchema: z.ZodType<BatchListResponse, unknown>;
|
|
24
|
+
export declare function batchListResponseFromJSON(jsonString: string): SafeParseResult<BatchListResponse, SDKValidationError>;
|
|
25
|
+
//# sourceMappingURL=batchlistresponse.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 951626e2dafe
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { BatchListItem$inboundSchema } from "./batchlistitem.js";
|
|
9
|
+
export const BatchListResponseObject = {
|
|
10
|
+
List: "list",
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const BatchListResponseObject$inboundSchema = z.enum(BatchListResponseObject);
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const BatchListResponse$inboundSchema = z.object({
|
|
16
|
+
data: z.array(BatchListItem$inboundSchema),
|
|
17
|
+
first_id: z.nullable(z.string()),
|
|
18
|
+
has_more: z.boolean(),
|
|
19
|
+
last_id: z.nullable(z.string()),
|
|
20
|
+
object: BatchListResponseObject$inboundSchema,
|
|
21
|
+
}).transform((v) => {
|
|
22
|
+
return remap$(v, {
|
|
23
|
+
"first_id": "firstId",
|
|
24
|
+
"has_more": "hasMore",
|
|
25
|
+
"last_id": "lastId",
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
export function batchListResponseFromJSON(jsonString) {
|
|
29
|
+
return safeParse(jsonString, (x) => BatchListResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchListResponse' from JSON`);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=batchlistresponse.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* A batch status that is durably represented by the list data source. `finalizing` and `cancelling` are not accepted because stored jobs collapse those phases into `in_progress`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BatchListStatus: {
|
|
7
|
+
readonly Validating: "validating";
|
|
8
|
+
readonly InProgress: "in_progress";
|
|
9
|
+
readonly Completed: "completed";
|
|
10
|
+
readonly Failed: "failed";
|
|
11
|
+
readonly Expired: "expired";
|
|
12
|
+
readonly Cancelled: "cancelled";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A batch status that is durably represented by the list data source. `finalizing` and `cancelling` are not accepted because stored jobs collapse those phases into `in_progress`.
|
|
16
|
+
*/
|
|
17
|
+
export type BatchListStatus = OpenEnum<typeof BatchListStatus>;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const BatchListStatus$outboundSchema: z.ZodType<string, BatchListStatus>;
|
|
20
|
+
//# sourceMappingURL=batchliststatus.d.ts.map
|