@openrouter/sdk 1.1.18 → 1.1.20
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/esm/funcs/filesDelete.d.ts +1 -1
- package/esm/funcs/filesDelete.js +2 -1
- package/esm/funcs/filesDownload.d.ts +1 -1
- package/esm/funcs/filesDownload.js +2 -1
- package/esm/funcs/filesList.d.ts +1 -1
- package/esm/funcs/filesList.js +10 -3
- package/esm/funcs/filesRetrieve.d.ts +1 -1
- package/esm/funcs/filesRetrieve.js +2 -1
- package/esm/funcs/filesUpload.d.ts +1 -1
- package/esm/funcs/filesUpload.js +2 -1
- package/esm/funcs/workspacesSetBudget.d.ts +1 -1
- package/esm/funcs/workspacesSetBudget.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/anthropicfile.d.ts +33 -0
- package/esm/models/anthropicfile.js +40 -0
- package/esm/models/anthropicfiledeleted.d.ts +22 -0
- package/esm/models/anthropicfiledeleted.js +26 -0
- package/esm/models/anthropicfilelist.d.ts +18 -0
- package/esm/models/anthropicfilelist.js +27 -0
- package/esm/models/filedeleteresponse.d.ts +6 -12
- package/esm/models/filedeleteresponse.js +9 -10
- package/esm/models/filelistresponse.d.ts +6 -12
- package/esm/models/filelistresponse.js +9 -16
- package/esm/models/fileprovider.d.ts +16 -0
- package/esm/models/fileprovider.js +15 -0
- package/esm/models/fileresponse.d.ts +21 -0
- package/esm/models/fileresponse.js +26 -0
- package/esm/models/index.d.ts +12 -1
- package/esm/models/index.js +12 -1
- package/esm/models/listworkspacebudgetsresponse.d.ts +4 -0
- package/esm/models/listworkspacebudgetsresponse.js +6 -0
- package/esm/models/model.d.ts +5 -0
- package/esm/models/model.js +3 -0
- package/esm/models/modelaliastarget.d.ts +20 -0
- package/esm/models/modelaliastarget.js +15 -0
- package/esm/models/openaifile.d.ts +53 -0
- package/esm/models/openaifile.js +58 -0
- package/esm/models/openaifiledeleted.d.ts +23 -0
- package/esm/models/openaifiledeleted.js +27 -0
- package/esm/models/openaifilelist.d.ts +26 -0
- package/esm/models/openaifilelist.js +33 -0
- package/esm/models/openrouterfile.d.ts +33 -0
- package/esm/models/openrouterfile.js +39 -0
- package/esm/models/openrouterfiledeleted.d.ts +22 -0
- package/esm/models/openrouterfiledeleted.js +26 -0
- package/esm/models/openrouterfilelist.d.ts +22 -0
- package/esm/models/openrouterfilelist.js +28 -0
- package/esm/models/operations/deletefile.d.ts +6 -0
- package/esm/models/operations/deletefile.js +2 -0
- package/esm/models/operations/downloadfilecontent.d.ts +6 -0
- package/esm/models/operations/downloadfilecontent.js +2 -0
- package/esm/models/operations/getfilemetadata.d.ts +6 -0
- package/esm/models/operations/getfilemetadata.js +2 -0
- package/esm/models/operations/listfiles.d.ts +39 -0
- package/esm/models/operations/listfiles.js +18 -0
- package/esm/models/operations/uploadfile.d.ts +6 -0
- package/esm/models/operations/uploadfile.js +2 -0
- package/esm/models/upsertworkspacebudgetrequest.d.ts +5 -0
- package/esm/models/upsertworkspacebudgetrequest.js +2 -0
- package/esm/models/upsertworkspacebudgetresponse.d.ts +4 -0
- package/esm/models/upsertworkspacebudgetresponse.js +6 -0
- package/esm/models/workspace.d.ts +4 -0
- package/esm/models/workspace.js +2 -0
- package/esm/sdk/files.d.ts +2 -2
- package/esm/sdk/workspaces.d.ts +1 -1
- package/esm/sdk/workspaces.js +1 -1
- package/jsr.json +1 -1
- package/package.json +6 -6
- package/esm/models/filemetadata.d.ts +0 -26
- package/esm/models/filemetadata.js +0 -33
package/esm/models/index.d.ts
CHANGED
|
@@ -22,7 +22,10 @@ export * from "./anthropiccitationsearchresultlocationparam.js";
|
|
|
22
22
|
export * from "./anthropiccitationwebsearchresultlocationparam.js";
|
|
23
23
|
export * from "./anthropiccompactionusageiteration.js";
|
|
24
24
|
export * from "./anthropicdocumentblockparam.js";
|
|
25
|
+
export * from "./anthropicfile.js";
|
|
26
|
+
export * from "./anthropicfiledeleted.js";
|
|
25
27
|
export * from "./anthropicfiledocumentsource.js";
|
|
28
|
+
export * from "./anthropicfilelist.js";
|
|
26
29
|
export * from "./anthropicimageblockparam.js";
|
|
27
30
|
export * from "./anthropicimagemimetype.js";
|
|
28
31
|
export * from "./anthropicinputtokensclearatleast.js";
|
|
@@ -191,9 +194,10 @@ export * from "./errorevent.js";
|
|
|
191
194
|
export * from "./filecitation.js";
|
|
192
195
|
export * from "./filedeleteresponse.js";
|
|
193
196
|
export * from "./filelistresponse.js";
|
|
194
|
-
export * from "./filemetadata.js";
|
|
195
197
|
export * from "./fileparserplugin.js";
|
|
196
198
|
export * from "./filepath.js";
|
|
199
|
+
export * from "./fileprovider.js";
|
|
200
|
+
export * from "./fileresponse.js";
|
|
197
201
|
export * from "./filesearchservertool.js";
|
|
198
202
|
export * from "./filesservertool.js";
|
|
199
203
|
export * from "./filesservertoolconfig.js";
|
|
@@ -305,6 +309,7 @@ export * from "./messagestooladditionblock.js";
|
|
|
305
309
|
export * from "./messagestoolremovalblock.js";
|
|
306
310
|
export * from "./metadatalevel.js";
|
|
307
311
|
export * from "./model.js";
|
|
312
|
+
export * from "./modelaliastarget.js";
|
|
308
313
|
export * from "./modelarchitecture.js";
|
|
309
314
|
export * from "./modelbenchmarks.js";
|
|
310
315
|
export * from "./modelgroup.js";
|
|
@@ -339,6 +344,9 @@ export * from "./observabilitysentrydestination.js";
|
|
|
339
344
|
export * from "./observabilitysnowflakedestination.js";
|
|
340
345
|
export * from "./observabilityweavedestination.js";
|
|
341
346
|
export * from "./observabilitywebhookdestination.js";
|
|
347
|
+
export * from "./openaifile.js";
|
|
348
|
+
export * from "./openaifiledeleted.js";
|
|
349
|
+
export * from "./openaifilelist.js";
|
|
342
350
|
export * from "./openairesponsecustomtoolcall.js";
|
|
343
351
|
export * from "./openairesponsecustomtoolcalloutput.js";
|
|
344
352
|
export * from "./openairesponsefunctiontoolcall.js";
|
|
@@ -352,6 +360,9 @@ export * from "./openairesponsestruncation.js";
|
|
|
352
360
|
export * from "./openresponsescreatedevent.js";
|
|
353
361
|
export * from "./openresponsesinprogressevent.js";
|
|
354
362
|
export * from "./openresponsesresult.js";
|
|
363
|
+
export * from "./openrouterfile.js";
|
|
364
|
+
export * from "./openrouterfiledeleted.js";
|
|
365
|
+
export * from "./openrouterfilelist.js";
|
|
355
366
|
export * from "./openroutermetadata.js";
|
|
356
367
|
export * from "./openrouterwebsearchservertool.js";
|
|
357
368
|
export * from "./outputadvisorservertoolitem.js";
|
package/esm/models/index.js
CHANGED
|
@@ -26,7 +26,10 @@ export * from "./anthropiccitationsearchresultlocationparam.js";
|
|
|
26
26
|
export * from "./anthropiccitationwebsearchresultlocationparam.js";
|
|
27
27
|
export * from "./anthropiccompactionusageiteration.js";
|
|
28
28
|
export * from "./anthropicdocumentblockparam.js";
|
|
29
|
+
export * from "./anthropicfile.js";
|
|
30
|
+
export * from "./anthropicfiledeleted.js";
|
|
29
31
|
export * from "./anthropicfiledocumentsource.js";
|
|
32
|
+
export * from "./anthropicfilelist.js";
|
|
30
33
|
export * from "./anthropicimageblockparam.js";
|
|
31
34
|
export * from "./anthropicimagemimetype.js";
|
|
32
35
|
export * from "./anthropicinputtokensclearatleast.js";
|
|
@@ -195,9 +198,10 @@ export * from "./errorevent.js";
|
|
|
195
198
|
export * from "./filecitation.js";
|
|
196
199
|
export * from "./filedeleteresponse.js";
|
|
197
200
|
export * from "./filelistresponse.js";
|
|
198
|
-
export * from "./filemetadata.js";
|
|
199
201
|
export * from "./fileparserplugin.js";
|
|
200
202
|
export * from "./filepath.js";
|
|
203
|
+
export * from "./fileprovider.js";
|
|
204
|
+
export * from "./fileresponse.js";
|
|
201
205
|
export * from "./filesearchservertool.js";
|
|
202
206
|
export * from "./filesservertool.js";
|
|
203
207
|
export * from "./filesservertoolconfig.js";
|
|
@@ -309,6 +313,7 @@ export * from "./messagestooladditionblock.js";
|
|
|
309
313
|
export * from "./messagestoolremovalblock.js";
|
|
310
314
|
export * from "./metadatalevel.js";
|
|
311
315
|
export * from "./model.js";
|
|
316
|
+
export * from "./modelaliastarget.js";
|
|
312
317
|
export * from "./modelarchitecture.js";
|
|
313
318
|
export * from "./modelbenchmarks.js";
|
|
314
319
|
export * from "./modelgroup.js";
|
|
@@ -343,6 +348,9 @@ export * from "./observabilitysentrydestination.js";
|
|
|
343
348
|
export * from "./observabilitysnowflakedestination.js";
|
|
344
349
|
export * from "./observabilityweavedestination.js";
|
|
345
350
|
export * from "./observabilitywebhookdestination.js";
|
|
351
|
+
export * from "./openaifile.js";
|
|
352
|
+
export * from "./openaifiledeleted.js";
|
|
353
|
+
export * from "./openaifilelist.js";
|
|
346
354
|
export * from "./openairesponsecustomtoolcall.js";
|
|
347
355
|
export * from "./openairesponsecustomtoolcalloutput.js";
|
|
348
356
|
export * from "./openairesponsefunctiontoolcall.js";
|
|
@@ -356,6 +364,9 @@ export * from "./openairesponsestruncation.js";
|
|
|
356
364
|
export * from "./openresponsescreatedevent.js";
|
|
357
365
|
export * from "./openresponsesinprogressevent.js";
|
|
358
366
|
export * from "./openresponsesresult.js";
|
|
367
|
+
export * from "./openrouterfile.js";
|
|
368
|
+
export * from "./openrouterfiledeleted.js";
|
|
369
|
+
export * from "./openrouterfilelist.js";
|
|
359
370
|
export * from "./openroutermetadata.js";
|
|
360
371
|
export * from "./openrouterwebsearchservertool.js";
|
|
361
372
|
export * from "./outputadvisorservertoolitem.js";
|
|
@@ -7,6 +7,10 @@ export type ListWorkspaceBudgetsResponse = {
|
|
|
7
7
|
* List of budgets configured for the workspace
|
|
8
8
|
*/
|
|
9
9
|
data: Array<WorkspaceBudget>;
|
|
10
|
+
/**
|
|
11
|
+
* Whether BYOK (bring-your-own-key) spend is included when enforcing the workspace's budgets. This is a workspace-wide setting that applies to all budget intervals (daily, weekly, monthly, and lifetime).
|
|
12
|
+
*/
|
|
13
|
+
includeByokInBudgets?: boolean | undefined;
|
|
10
14
|
};
|
|
11
15
|
/** @internal */
|
|
12
16
|
export declare const ListWorkspaceBudgetsResponse$inboundSchema: z.ZodType<ListWorkspaceBudgetsResponse, unknown>;
|
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
* @generated-id: 2573f31846b9
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../lib/schemas.js";
|
|
7
8
|
import { WorkspaceBudget$inboundSchema, } from "./workspacebudget.js";
|
|
8
9
|
/** @internal */
|
|
9
10
|
export const ListWorkspaceBudgetsResponse$inboundSchema = z.object({
|
|
10
11
|
data: z.array(WorkspaceBudget$inboundSchema),
|
|
12
|
+
include_byok_in_budgets: z.boolean().optional(),
|
|
13
|
+
}).transform((v) => {
|
|
14
|
+
return remap$(v, {
|
|
15
|
+
"include_byok_in_budgets": "includeByokInBudgets",
|
|
16
|
+
});
|
|
11
17
|
});
|
|
12
18
|
export function listWorkspaceBudgetsResponseFromJSON(jsonString) {
|
|
13
19
|
return safeParse(jsonString, (x) => ListWorkspaceBudgetsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListWorkspaceBudgetsResponse' from JSON`);
|
package/esm/models/model.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { DefaultParameters } from "./defaultparameters.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ModelAliasTarget } from "./modelaliastarget.js";
|
|
5
6
|
import { ModelArchitecture } from "./modelarchitecture.js";
|
|
6
7
|
import { ModelBenchmarks } from "./modelbenchmarks.js";
|
|
7
8
|
import { ModelLinks } from "./modellinks.js";
|
|
@@ -14,6 +15,10 @@ import { TopProviderInfo } from "./topproviderinfo.js";
|
|
|
14
15
|
* Information about an AI model available on OpenRouter
|
|
15
16
|
*/
|
|
16
17
|
export type Model = {
|
|
18
|
+
/**
|
|
19
|
+
* Concrete model targeted by this tilde-latest alias, when applicable
|
|
20
|
+
*/
|
|
21
|
+
aliasTarget?: ModelAliasTarget | undefined;
|
|
17
22
|
/**
|
|
18
23
|
* Model architecture information
|
|
19
24
|
*/
|
package/esm/models/model.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { DefaultParameters$inboundSchema, } from "./defaultparameters.js";
|
|
9
|
+
import { ModelAliasTarget$inboundSchema, } from "./modelaliastarget.js";
|
|
9
10
|
import { ModelArchitecture$inboundSchema, } from "./modelarchitecture.js";
|
|
10
11
|
import { ModelBenchmarks$inboundSchema, } from "./modelbenchmarks.js";
|
|
11
12
|
import { ModelLinks$inboundSchema } from "./modellinks.js";
|
|
@@ -16,6 +17,7 @@ import { PublicPricing$inboundSchema } from "./publicpricing.js";
|
|
|
16
17
|
import { TopProviderInfo$inboundSchema, } from "./topproviderinfo.js";
|
|
17
18
|
/** @internal */
|
|
18
19
|
export const Model$inboundSchema = z.object({
|
|
20
|
+
alias_target: ModelAliasTarget$inboundSchema.optional(),
|
|
19
21
|
architecture: ModelArchitecture$inboundSchema,
|
|
20
22
|
benchmarks: ModelBenchmarks$inboundSchema.optional(),
|
|
21
23
|
canonical_slug: z.string(),
|
|
@@ -37,6 +39,7 @@ export const Model$inboundSchema = z.object({
|
|
|
37
39
|
top_provider: TopProviderInfo$inboundSchema,
|
|
38
40
|
}).transform((v) => {
|
|
39
41
|
return remap$(v, {
|
|
42
|
+
"alias_target": "aliasTarget",
|
|
40
43
|
"canonical_slug": "canonicalSlug",
|
|
41
44
|
"context_length": "contextLength",
|
|
42
45
|
"default_parameters": "defaultParameters",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Concrete model targeted by this tilde-latest alias, when applicable
|
|
6
|
+
*/
|
|
7
|
+
export type ModelAliasTarget = {
|
|
8
|
+
/**
|
|
9
|
+
* Human-readable name of the concrete model targeted by this alias
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Routable model ID of the concrete target, matching that model row's id
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const ModelAliasTarget$inboundSchema: z.ZodType<ModelAliasTarget, unknown>;
|
|
19
|
+
export declare function modelAliasTargetFromJSON(jsonString: string): SafeParseResult<ModelAliasTarget, SDKValidationError>;
|
|
20
|
+
//# sourceMappingURL=modelaliastarget.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 19d90882812d
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ModelAliasTarget$inboundSchema = z.object({
|
|
9
|
+
name: z.string(),
|
|
10
|
+
slug: z.string(),
|
|
11
|
+
});
|
|
12
|
+
export function modelAliasTargetFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => ModelAliasTarget$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ModelAliasTarget' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=modelaliastarget.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const OpenAIFileShape: {
|
|
6
|
+
readonly Openai: "openai";
|
|
7
|
+
};
|
|
8
|
+
export type OpenAIFileShape = ClosedEnum<typeof OpenAIFileShape>;
|
|
9
|
+
export declare const OpenAIFileObject: {
|
|
10
|
+
readonly File: "file";
|
|
11
|
+
};
|
|
12
|
+
export type OpenAIFileObject = ClosedEnum<typeof OpenAIFileObject>;
|
|
13
|
+
export declare const Purpose: {
|
|
14
|
+
readonly Assistants: "assistants";
|
|
15
|
+
readonly Batch: "batch";
|
|
16
|
+
readonly FineTune: "fine-tune";
|
|
17
|
+
readonly Vision: "vision";
|
|
18
|
+
readonly UserData: "user_data";
|
|
19
|
+
readonly Evals: "evals";
|
|
20
|
+
readonly AssistantsOutput: "assistants_output";
|
|
21
|
+
readonly BatchOutput: "batch_output";
|
|
22
|
+
readonly FineTuneResults: "fine-tune-results";
|
|
23
|
+
};
|
|
24
|
+
export type Purpose = OpenEnum<typeof Purpose>;
|
|
25
|
+
export declare const OpenAIFileStatus: {
|
|
26
|
+
readonly Processed: "processed";
|
|
27
|
+
};
|
|
28
|
+
export type OpenAIFileStatus = ClosedEnum<typeof OpenAIFileStatus>;
|
|
29
|
+
/**
|
|
30
|
+
* A stored file in OpenAI's Files API shape.
|
|
31
|
+
*/
|
|
32
|
+
export type OpenAIFile = {
|
|
33
|
+
shape: OpenAIFileShape;
|
|
34
|
+
bytes: number;
|
|
35
|
+
createdAt: number;
|
|
36
|
+
filename: string;
|
|
37
|
+
id: string;
|
|
38
|
+
object: OpenAIFileObject;
|
|
39
|
+
purpose: Purpose;
|
|
40
|
+
status: OpenAIFileStatus;
|
|
41
|
+
};
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare const OpenAIFileShape$inboundSchema: z.ZodEnum<typeof OpenAIFileShape>;
|
|
44
|
+
/** @internal */
|
|
45
|
+
export declare const OpenAIFileObject$inboundSchema: z.ZodEnum<typeof OpenAIFileObject>;
|
|
46
|
+
/** @internal */
|
|
47
|
+
export declare const Purpose$inboundSchema: z.ZodType<Purpose, unknown>;
|
|
48
|
+
/** @internal */
|
|
49
|
+
export declare const OpenAIFileStatus$inboundSchema: z.ZodEnum<typeof OpenAIFileStatus>;
|
|
50
|
+
/** @internal */
|
|
51
|
+
export declare const OpenAIFile$inboundSchema: z.ZodType<OpenAIFile, unknown>;
|
|
52
|
+
export declare function openAIFileFromJSON(jsonString: string): SafeParseResult<OpenAIFile, SDKValidationError>;
|
|
53
|
+
//# sourceMappingURL=openaifile.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 63e8910c7eb7
|
|
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 OpenAIFileShape = {
|
|
10
|
+
Openai: "openai",
|
|
11
|
+
};
|
|
12
|
+
export const OpenAIFileObject = {
|
|
13
|
+
File: "file",
|
|
14
|
+
};
|
|
15
|
+
export const Purpose = {
|
|
16
|
+
Assistants: "assistants",
|
|
17
|
+
Batch: "batch",
|
|
18
|
+
FineTune: "fine-tune",
|
|
19
|
+
Vision: "vision",
|
|
20
|
+
UserData: "user_data",
|
|
21
|
+
Evals: "evals",
|
|
22
|
+
AssistantsOutput: "assistants_output",
|
|
23
|
+
BatchOutput: "batch_output",
|
|
24
|
+
FineTuneResults: "fine-tune-results",
|
|
25
|
+
};
|
|
26
|
+
export const OpenAIFileStatus = {
|
|
27
|
+
Processed: "processed",
|
|
28
|
+
};
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const OpenAIFileShape$inboundSchema = z.enum(OpenAIFileShape);
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const OpenAIFileObject$inboundSchema = z.enum(OpenAIFileObject);
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const Purpose$inboundSchema = openEnums
|
|
35
|
+
.inboundSchema(Purpose);
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const OpenAIFileStatus$inboundSchema = z.enum(OpenAIFileStatus);
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const OpenAIFile$inboundSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
_shape: OpenAIFileShape$inboundSchema,
|
|
42
|
+
bytes: z.int(),
|
|
43
|
+
created_at: z.int(),
|
|
44
|
+
filename: z.string(),
|
|
45
|
+
id: z.string(),
|
|
46
|
+
object: OpenAIFileObject$inboundSchema,
|
|
47
|
+
purpose: Purpose$inboundSchema,
|
|
48
|
+
status: OpenAIFileStatus$inboundSchema,
|
|
49
|
+
}).transform((v) => {
|
|
50
|
+
return remap$(v, {
|
|
51
|
+
"_shape": "shape",
|
|
52
|
+
"created_at": "createdAt",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
export function openAIFileFromJSON(jsonString) {
|
|
56
|
+
return safeParse(jsonString, (x) => OpenAIFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIFile' from JSON`);
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=openaifile.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const OpenAIFileDeletedObject: {
|
|
6
|
+
readonly File: "file";
|
|
7
|
+
};
|
|
8
|
+
export type OpenAIFileDeletedObject = ClosedEnum<typeof OpenAIFileDeletedObject>;
|
|
9
|
+
/**
|
|
10
|
+
* Deletion result in OpenAI's shape.
|
|
11
|
+
*/
|
|
12
|
+
export type OpenAIFileDeleted = {
|
|
13
|
+
shape: "openai";
|
|
14
|
+
deleted: true;
|
|
15
|
+
id: string;
|
|
16
|
+
object: OpenAIFileDeletedObject;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const OpenAIFileDeletedObject$inboundSchema: z.ZodEnum<typeof OpenAIFileDeletedObject>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const OpenAIFileDeleted$inboundSchema: z.ZodType<OpenAIFileDeleted, unknown>;
|
|
22
|
+
export declare function openAIFileDeletedFromJSON(jsonString: string): SafeParseResult<OpenAIFileDeleted, SDKValidationError>;
|
|
23
|
+
//# sourceMappingURL=openaifiledeleted.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 78cdbf4c6848
|
|
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
|
+
export const OpenAIFileDeletedObject = {
|
|
9
|
+
File: "file",
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const OpenAIFileDeletedObject$inboundSchema = z.enum(OpenAIFileDeletedObject);
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const OpenAIFileDeleted$inboundSchema = z.object({
|
|
15
|
+
_shape: z.literal("openai"),
|
|
16
|
+
deleted: z.literal(true),
|
|
17
|
+
id: z.string(),
|
|
18
|
+
object: OpenAIFileDeletedObject$inboundSchema,
|
|
19
|
+
}).transform((v) => {
|
|
20
|
+
return remap$(v, {
|
|
21
|
+
"_shape": "shape",
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
export function openAIFileDeletedFromJSON(jsonString) {
|
|
25
|
+
return safeParse(jsonString, (x) => OpenAIFileDeleted$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIFileDeleted' from JSON`);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=openaifiledeleted.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 { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { OpenAIFile } from "./openaifile.js";
|
|
6
|
+
export declare const OpenAIFileListObject: {
|
|
7
|
+
readonly List: "list";
|
|
8
|
+
};
|
|
9
|
+
export type OpenAIFileListObject = ClosedEnum<typeof OpenAIFileListObject>;
|
|
10
|
+
/**
|
|
11
|
+
* A page of files in OpenAI's shape.
|
|
12
|
+
*/
|
|
13
|
+
export type OpenAIFileList = {
|
|
14
|
+
shape: "openai";
|
|
15
|
+
data: Array<OpenAIFile>;
|
|
16
|
+
firstId: string | null;
|
|
17
|
+
hasMore: boolean;
|
|
18
|
+
lastId: string | null;
|
|
19
|
+
object: OpenAIFileListObject;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const OpenAIFileListObject$inboundSchema: z.ZodEnum<typeof OpenAIFileListObject>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const OpenAIFileList$inboundSchema: z.ZodType<OpenAIFileList, unknown>;
|
|
25
|
+
export declare function openAIFileListFromJSON(jsonString: string): SafeParseResult<OpenAIFileList, SDKValidationError>;
|
|
26
|
+
//# sourceMappingURL=openaifilelist.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 6d79794dae8e
|
|
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 { OpenAIFile$inboundSchema } from "./openaifile.js";
|
|
9
|
+
export const OpenAIFileListObject = {
|
|
10
|
+
List: "list",
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const OpenAIFileListObject$inboundSchema = z.enum(OpenAIFileListObject);
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const OpenAIFileList$inboundSchema = z.object({
|
|
16
|
+
_shape: z.literal("openai"),
|
|
17
|
+
data: z.array(OpenAIFile$inboundSchema),
|
|
18
|
+
first_id: z.nullable(z.string()),
|
|
19
|
+
has_more: z.boolean(),
|
|
20
|
+
last_id: z.nullable(z.string()),
|
|
21
|
+
object: OpenAIFileListObject$inboundSchema,
|
|
22
|
+
}).transform((v) => {
|
|
23
|
+
return remap$(v, {
|
|
24
|
+
"_shape": "shape",
|
|
25
|
+
"first_id": "firstId",
|
|
26
|
+
"has_more": "hasMore",
|
|
27
|
+
"last_id": "lastId",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
export function openAIFileListFromJSON(jsonString) {
|
|
31
|
+
return safeParse(jsonString, (x) => OpenAIFileList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIFileList' from JSON`);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=openaifilelist.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const OpenRouterFileShape: {
|
|
6
|
+
readonly Openrouter: "openrouter";
|
|
7
|
+
};
|
|
8
|
+
export type OpenRouterFileShape = ClosedEnum<typeof OpenRouterFileShape>;
|
|
9
|
+
export declare const OpenRouterFileType: {
|
|
10
|
+
readonly File: "file";
|
|
11
|
+
};
|
|
12
|
+
export type OpenRouterFileType = ClosedEnum<typeof OpenRouterFileType>;
|
|
13
|
+
/**
|
|
14
|
+
* A stored file in the OpenRouter superset shape: Anthropic-shaped, plus OpenRouter-only fields.
|
|
15
|
+
*/
|
|
16
|
+
export type OpenRouterFile = {
|
|
17
|
+
shape: OpenRouterFileShape;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
downloadable: boolean;
|
|
20
|
+
filename: string;
|
|
21
|
+
id: string;
|
|
22
|
+
mimeType: string;
|
|
23
|
+
sizeBytes: number;
|
|
24
|
+
type: OpenRouterFileType;
|
|
25
|
+
};
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const OpenRouterFileShape$inboundSchema: z.ZodEnum<typeof OpenRouterFileShape>;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const OpenRouterFileType$inboundSchema: z.ZodEnum<typeof OpenRouterFileType>;
|
|
30
|
+
/** @internal */
|
|
31
|
+
export declare const OpenRouterFile$inboundSchema: z.ZodType<OpenRouterFile, unknown>;
|
|
32
|
+
export declare function openRouterFileFromJSON(jsonString: string): SafeParseResult<OpenRouterFile, SDKValidationError>;
|
|
33
|
+
//# sourceMappingURL=openrouterfile.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: acb151305aa2
|
|
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
|
+
export const OpenRouterFileShape = {
|
|
9
|
+
Openrouter: "openrouter",
|
|
10
|
+
};
|
|
11
|
+
export const OpenRouterFileType = {
|
|
12
|
+
File: "file",
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const OpenRouterFileShape$inboundSchema = z.enum(OpenRouterFileShape);
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const OpenRouterFileType$inboundSchema = z.enum(OpenRouterFileType);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const OpenRouterFile$inboundSchema = z.object({
|
|
20
|
+
_shape: OpenRouterFileShape$inboundSchema,
|
|
21
|
+
created_at: z.string(),
|
|
22
|
+
downloadable: z.boolean(),
|
|
23
|
+
filename: z.string(),
|
|
24
|
+
id: z.string(),
|
|
25
|
+
mime_type: z.string(),
|
|
26
|
+
size_bytes: z.int(),
|
|
27
|
+
type: OpenRouterFileType$inboundSchema,
|
|
28
|
+
}).transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"_shape": "shape",
|
|
31
|
+
"created_at": "createdAt",
|
|
32
|
+
"mime_type": "mimeType",
|
|
33
|
+
"size_bytes": "sizeBytes",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
export function openRouterFileFromJSON(jsonString) {
|
|
37
|
+
return safeParse(jsonString, (x) => OpenRouterFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenRouterFile' from JSON`);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=openrouterfile.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const OpenRouterFileDeletedType: {
|
|
6
|
+
readonly FileDeleted: "file_deleted";
|
|
7
|
+
};
|
|
8
|
+
export type OpenRouterFileDeletedType = ClosedEnum<typeof OpenRouterFileDeletedType>;
|
|
9
|
+
/**
|
|
10
|
+
* Deletion result in the OpenRouter shape.
|
|
11
|
+
*/
|
|
12
|
+
export type OpenRouterFileDeleted = {
|
|
13
|
+
shape: "openrouter";
|
|
14
|
+
id: string;
|
|
15
|
+
type: OpenRouterFileDeletedType;
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const OpenRouterFileDeletedType$inboundSchema: z.ZodEnum<typeof OpenRouterFileDeletedType>;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const OpenRouterFileDeleted$inboundSchema: z.ZodType<OpenRouterFileDeleted, unknown>;
|
|
21
|
+
export declare function openRouterFileDeletedFromJSON(jsonString: string): SafeParseResult<OpenRouterFileDeleted, SDKValidationError>;
|
|
22
|
+
//# sourceMappingURL=openrouterfiledeleted.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: a03c20a453cd
|
|
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
|
+
export const OpenRouterFileDeletedType = {
|
|
9
|
+
FileDeleted: "file_deleted",
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const OpenRouterFileDeletedType$inboundSchema = z.enum(OpenRouterFileDeletedType);
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const OpenRouterFileDeleted$inboundSchema = z.object({
|
|
15
|
+
_shape: z.literal("openrouter"),
|
|
16
|
+
id: z.string(),
|
|
17
|
+
type: OpenRouterFileDeletedType$inboundSchema,
|
|
18
|
+
}).transform((v) => {
|
|
19
|
+
return remap$(v, {
|
|
20
|
+
"_shape": "shape",
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export function openRouterFileDeletedFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => OpenRouterFileDeleted$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenRouterFileDeleted' from JSON`);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=openrouterfiledeleted.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { OpenRouterFile } from "./openrouterfile.js";
|
|
5
|
+
/**
|
|
6
|
+
* A page of files in the OpenRouter shape.
|
|
7
|
+
*/
|
|
8
|
+
export type OpenRouterFileList = {
|
|
9
|
+
shape: "openrouter";
|
|
10
|
+
/**
|
|
11
|
+
* Opaque cursor for the next page; null when there are no more results.
|
|
12
|
+
*/
|
|
13
|
+
cursor: string | null;
|
|
14
|
+
data: Array<OpenRouterFile>;
|
|
15
|
+
firstId: string | null;
|
|
16
|
+
hasMore: boolean;
|
|
17
|
+
lastId: string | null;
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const OpenRouterFileList$inboundSchema: z.ZodType<OpenRouterFileList, unknown>;
|
|
21
|
+
export declare function openRouterFileListFromJSON(jsonString: string): SafeParseResult<OpenRouterFileList, SDKValidationError>;
|
|
22
|
+
//# sourceMappingURL=openrouterfilelist.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ff3c776b9f81
|
|
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 { OpenRouterFile$inboundSchema, } from "./openrouterfile.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const OpenRouterFileList$inboundSchema = z.object({
|
|
11
|
+
_shape: z.literal("openrouter"),
|
|
12
|
+
cursor: z.nullable(z.string()),
|
|
13
|
+
data: z.array(OpenRouterFile$inboundSchema),
|
|
14
|
+
first_id: z.nullable(z.string()),
|
|
15
|
+
has_more: z.boolean(),
|
|
16
|
+
last_id: z.nullable(z.string()),
|
|
17
|
+
}).transform((v) => {
|
|
18
|
+
return remap$(v, {
|
|
19
|
+
"_shape": "shape",
|
|
20
|
+
"first_id": "firstId",
|
|
21
|
+
"has_more": "hasMore",
|
|
22
|
+
"last_id": "lastId",
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
export function openRouterFileListFromJSON(jsonString) {
|
|
26
|
+
return safeParse(jsonString, (x) => OpenRouterFileList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenRouterFileList' from JSON`);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=openrouterfilelist.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
2
3
|
export type DeleteFileGlobals = {
|
|
3
4
|
/**
|
|
4
5
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -45,6 +46,10 @@ export type DeleteFileRequest = {
|
|
|
45
46
|
* Workspace to scope the request to. Defaults to the caller’s default workspace.
|
|
46
47
|
*/
|
|
47
48
|
workspaceId?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
|
|
51
|
+
*/
|
|
52
|
+
provider?: models.FileProvider | undefined;
|
|
48
53
|
};
|
|
49
54
|
/** @internal */
|
|
50
55
|
export type DeleteFileRequest$Outbound = {
|
|
@@ -53,6 +58,7 @@ export type DeleteFileRequest$Outbound = {
|
|
|
53
58
|
appCategories?: string | undefined;
|
|
54
59
|
file_id: string;
|
|
55
60
|
workspace_id?: string | undefined;
|
|
61
|
+
provider?: string | undefined;
|
|
56
62
|
};
|
|
57
63
|
/** @internal */
|
|
58
64
|
export declare const DeleteFileRequest$outboundSchema: z.ZodType<DeleteFileRequest$Outbound, DeleteFileRequest>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
7
8
|
/** @internal */
|
|
8
9
|
export const DeleteFileRequest$outboundSchema = z.object({
|
|
9
10
|
httpReferer: z.string().optional(),
|
|
@@ -11,6 +12,7 @@ export const DeleteFileRequest$outboundSchema = z.object({
|
|
|
11
12
|
appCategories: z.string().optional(),
|
|
12
13
|
fileId: z.string(),
|
|
13
14
|
workspaceId: z.string().optional(),
|
|
15
|
+
provider: models.FileProvider$outboundSchema.optional(),
|
|
14
16
|
}).transform((v) => {
|
|
15
17
|
return remap$(v, {
|
|
16
18
|
httpReferer: "HTTP-Referer",
|