@oxy.so/contracts 5.8.0 → 6.1.0
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/dist/cjs/accountAccess.js +6 -5
- package/dist/cjs/accountEmail.js +13 -5
- package/dist/cjs/accountGraph.js +10 -9
- package/dist/cjs/accountName.js +3 -2
- package/dist/cjs/agency.js +91 -34
- package/dist/cjs/agentKeys.js +21 -17
- package/dist/cjs/appAssertions.js +14 -13
- package/dist/cjs/applicationRoles.js +19 -12
- package/dist/cjs/campaignAttribution.js +28 -0
- package/dist/cjs/civic.js +10 -9
- package/dist/cjs/client/campaignAttribution.js +14 -0
- package/dist/cjs/client/check.js +61 -53
- package/dist/cjs/client/index.js +7 -1
- package/dist/cjs/client/language.js +7 -0
- package/dist/cjs/consoleOnboarding.js +9 -4
- package/dist/cjs/contentClaims.js +23 -14
- package/dist/cjs/deviceDirectory.js +11 -9
- package/dist/cjs/deviceSession.js +27 -25
- package/dist/cjs/email/messages.js +20 -18
- package/dist/cjs/emailAgentContext.js +11 -9
- package/dist/cjs/externalIdentity.js +15 -11
- package/dist/cjs/federationInstanceFetch.js +12 -7
- package/dist/cjs/identity.js +19 -17
- package/dist/cjs/identityLink.js +6 -4
- package/dist/cjs/identityProof.js +6 -4
- package/dist/cjs/inboxPush.js +5 -4
- package/dist/cjs/index.js +17 -6
- package/dist/cjs/inference/accountBilling.js +35 -33
- package/dist/cjs/inference/aliaModelRelease.js +9 -7
- package/dist/cjs/inference/attribution.js +14 -12
- package/dist/cjs/inference/catalogue.js +35 -29
- package/dist/cjs/inference/economics.js +24 -19
- package/dist/cjs/inference/embeddings.js +9 -7
- package/dist/cjs/inference/entitlement.js +17 -15
- package/dist/cjs/inference/errors.js +15 -8
- package/dist/cjs/inference/identifiers.js +33 -21
- package/dist/cjs/inference/inbox.js +37 -35
- package/dist/cjs/inference/modelDocumentation.js +16 -14
- package/dist/cjs/inference/money.js +5 -4
- package/dist/cjs/inference/priceVersion.js +10 -5
- package/dist/cjs/inference/providerConnection.js +21 -14
- package/dist/cjs/inference/realtime.js +88 -47
- package/dist/cjs/inference/request.js +27 -25
- package/dist/cjs/inference/routingPolicy.js +12 -10
- package/dist/cjs/inference/streamEvents.js +22 -16
- package/dist/cjs/inference/usage.js +32 -15
- package/dist/cjs/keyRecovery.js +8 -6
- package/dist/cjs/keyRotation.js +5 -4
- package/dist/cjs/linkedAccounts.js +22 -18
- package/dist/cjs/moderationReputation.js +29 -27
- package/dist/cjs/notifications.js +25 -9
- package/dist/cjs/numberChecks.js +45 -0
- package/dist/cjs/oauth.js +14 -12
- package/dist/cjs/organizations.js +23 -21
- package/dist/cjs/products/access.js +10 -8
- package/dist/cjs/products/billing.js +10 -8
- package/dist/cjs/products/checkout.js +22 -10
- package/dist/cjs/products/plans.js +15 -10
- package/dist/cjs/protocol.js +6 -5
- package/dist/cjs/recommendations.js +27 -19
- package/dist/cjs/reputation.js +15 -13
- package/dist/cjs/safety.js +43 -27
- package/dist/cjs/serviceToken.js +81 -2
- package/dist/cjs/sessionRevocation.js +8 -6
- package/dist/cjs/signIn.js +50 -24
- package/dist/cjs/stickers.js +19 -15
- package/dist/cjs/stringChecks.js +70 -0
- package/dist/cjs/transparency.js +14 -12
- package/dist/cjs/updates.js +24 -22
- package/dist/cjs/userInvalidation.js +7 -5
- package/dist/cjs/userResponse.js +8 -7
- package/dist/cjs/username.js +7 -6
- package/dist/esm/accountAccess.js +4 -3
- package/dist/esm/accountEmail.js +13 -5
- package/dist/esm/accountGraph.js +8 -7
- package/dist/esm/accountName.js +3 -2
- package/dist/esm/agency.js +90 -33
- package/dist/esm/agentKeys.js +21 -17
- package/dist/esm/appAssertions.js +11 -10
- package/dist/esm/applicationRoles.js +16 -9
- package/dist/esm/campaignAttribution.js +25 -0
- package/dist/esm/civic.js +8 -7
- package/dist/esm/client/campaignAttribution.js +10 -0
- package/dist/esm/client/check.js +61 -53
- package/dist/esm/client/index.js +2 -0
- package/dist/esm/client/language.js +4 -0
- package/dist/esm/consoleOnboarding.js +7 -2
- package/dist/esm/contentClaims.js +23 -14
- package/dist/esm/deviceDirectory.js +11 -9
- package/dist/esm/deviceSession.js +27 -25
- package/dist/esm/email/messages.js +18 -16
- package/dist/esm/emailAgentContext.js +11 -9
- package/dist/esm/externalIdentity.js +15 -11
- package/dist/esm/federationInstanceFetch.js +10 -5
- package/dist/esm/identity.js +17 -15
- package/dist/esm/identityLink.js +6 -4
- package/dist/esm/identityProof.js +6 -4
- package/dist/esm/inboxPush.js +3 -2
- package/dist/esm/index.js +5 -2
- package/dist/esm/inference/accountBilling.js +33 -31
- package/dist/esm/inference/aliaModelRelease.js +7 -5
- package/dist/esm/inference/attribution.js +14 -12
- package/dist/esm/inference/catalogue.js +33 -27
- package/dist/esm/inference/economics.js +22 -17
- package/dist/esm/inference/embeddings.js +9 -7
- package/dist/esm/inference/entitlement.js +15 -13
- package/dist/esm/inference/errors.js +13 -6
- package/dist/esm/inference/identifiers.js +31 -19
- package/dist/esm/inference/inbox.js +37 -35
- package/dist/esm/inference/modelDocumentation.js +14 -12
- package/dist/esm/inference/money.js +3 -2
- package/dist/esm/inference/priceVersion.js +8 -3
- package/dist/esm/inference/providerConnection.js +19 -12
- package/dist/esm/inference/realtime.js +85 -44
- package/dist/esm/inference/request.js +25 -23
- package/dist/esm/inference/routingPolicy.js +9 -7
- package/dist/esm/inference/streamEvents.js +20 -14
- package/dist/esm/inference/usage.js +30 -13
- package/dist/esm/keyRecovery.js +8 -6
- package/dist/esm/keyRotation.js +5 -4
- package/dist/esm/linkedAccounts.js +20 -16
- package/dist/esm/moderationReputation.js +27 -25
- package/dist/esm/notifications.js +23 -7
- package/dist/esm/numberChecks.js +41 -0
- package/dist/esm/oauth.js +14 -12
- package/dist/esm/organizations.js +23 -21
- package/dist/esm/products/access.js +10 -8
- package/dist/esm/products/billing.js +10 -8
- package/dist/esm/products/checkout.js +22 -10
- package/dist/esm/products/plans.js +15 -10
- package/dist/esm/protocol.js +4 -3
- package/dist/esm/recommendations.js +25 -17
- package/dist/esm/reputation.js +13 -11
- package/dist/esm/safety.js +43 -27
- package/dist/esm/serviceToken.js +80 -1
- package/dist/esm/sessionRevocation.js +6 -4
- package/dist/esm/signIn.js +50 -24
- package/dist/esm/stickers.js +17 -13
- package/dist/esm/stringChecks.js +63 -0
- package/dist/esm/transparency.js +14 -12
- package/dist/esm/updates.js +22 -20
- package/dist/esm/userInvalidation.js +4 -2
- package/dist/esm/userResponse.js +4 -3
- package/dist/esm/username.js +3 -2
- package/dist/types/accountAccess.d.ts +29 -70
- package/dist/types/accountEmail.d.ts +2 -14
- package/dist/types/accountGraph.d.ts +179 -171
- package/dist/types/accountName.d.ts +1 -1
- package/dist/types/accountSubject.d.ts +20 -93
- package/dist/types/agency.d.ts +528 -2924
- package/dist/types/agentKeys.d.ts +48 -421
- package/dist/types/appAssertions.d.ts +56 -210
- package/dist/types/applicationRoles.d.ts +30 -276
- package/dist/types/avatarCharacter.d.ts +1 -1
- package/dist/types/campaignAttribution.d.ts +10 -0
- package/dist/types/civic.d.ts +1 -13
- package/dist/types/client/agentKeys.d.ts +18 -18
- package/dist/types/client/appAssertions.d.ts +3 -3
- package/dist/types/client/campaignAttribution.d.ts +12 -0
- package/dist/types/client/check.d.ts +13 -13
- package/dist/types/client/deviceDirectory.d.ts +51 -51
- package/dist/types/client/deviceSession.d.ts +14 -14
- package/dist/types/client/index.d.ts +3 -0
- package/dist/types/client/language.d.ts +2 -0
- package/dist/types/client/organizations.d.ts +25 -25
- package/dist/types/client/products.d.ts +33 -33
- package/dist/types/client/recommendations.d.ts +2 -2
- package/dist/types/client/safety.d.ts +45 -45
- package/dist/types/client/sessionStatus.d.ts +4 -4
- package/dist/types/client/signIn.d.ts +1 -1
- package/dist/types/commonsSignIn.d.ts +4 -1
- package/dist/types/consoleOnboarding.d.ts +24 -44
- package/dist/types/contentClaims.d.ts +24 -180
- package/dist/types/deviceDirectory.d.ts +109 -1040
- package/dist/types/deviceSession.d.ts +36 -298
- package/dist/types/email/messages.d.ts +212 -1793
- package/dist/types/emailAgentContext.d.ts +10 -194
- package/dist/types/externalIdentity.d.ts +121 -615
- package/dist/types/federationInstanceFetch.d.ts +3 -32
- package/dist/types/identity.d.ts +15 -92
- package/dist/types/identityLink.d.ts +6 -84
- package/dist/types/identityProof.d.ts +5 -17
- package/dist/types/inboxPush.d.ts +1 -9
- package/dist/types/index.d.ts +7 -3
- package/dist/types/inference/accountBilling.d.ts +151 -488
- package/dist/types/inference/aliaModelRelease.d.ts +42 -439
- package/dist/types/inference/attribution.d.ts +75 -104
- package/dist/types/inference/catalogue.d.ts +417 -1599
- package/dist/types/inference/economics.d.ts +69 -276
- package/dist/types/inference/embeddings.d.ts +110 -406
- package/dist/types/inference/entitlement.d.ts +80 -335
- package/dist/types/inference/errors.d.ts +90 -102
- package/dist/types/inference/identifiers.d.ts +12 -4
- package/dist/types/inference/inbox.d.ts +105 -420
- package/dist/types/inference/modelDocumentation.d.ts +201 -1390
- package/dist/types/inference/money.d.ts +65 -32
- package/dist/types/inference/priceVersion.d.ts +53 -120
- package/dist/types/inference/providerConnection.d.ts +253 -710
- package/dist/types/inference/realtime.d.ts +954 -6825
- package/dist/types/inference/request.d.ts +300 -2572
- package/dist/types/inference/routingPolicy.d.ts +95 -503
- package/dist/types/inference/streamEvents.d.ts +253 -721
- package/dist/types/inference/usage.d.ts +317 -950
- package/dist/types/keyRecovery.d.ts +3 -51
- package/dist/types/keyRotation.d.ts +3 -38
- package/dist/types/linkedAccounts.d.ts +50 -236
- package/dist/types/moderationReputation.d.ts +81 -14
- package/dist/types/notifications.d.ts +19 -51
- package/dist/types/numberChecks.d.ts +9 -0
- package/dist/types/oauth.d.ts +101 -809
- package/dist/types/organizations.d.ts +268 -921
- package/dist/types/oxyRecordTypes.d.ts +11 -1
- package/dist/types/products/access.d.ts +125 -775
- package/dist/types/products/billing.d.ts +67 -503
- package/dist/types/products/checkout.d.ts +16 -69
- package/dist/types/products/plans.d.ts +33 -366
- package/dist/types/recommendations.d.ts +76 -389
- package/dist/types/reputation.d.ts +37 -5
- package/dist/types/safety.d.ts +408 -2048
- package/dist/types/serviceToken.d.ts +247 -7
- package/dist/types/sessionRevocation.d.ts +2 -17
- package/dist/types/sessionStatus.d.ts +27 -115
- package/dist/types/signIn.d.ts +62 -553
- package/dist/types/stickers.d.ts +67 -819
- package/dist/types/stringChecks.d.ts +16 -0
- package/dist/types/transparency.d.ts +14 -302
- package/dist/types/updates.d.ts +60 -316
- package/dist/types/userInvalidation.d.ts +4 -13
- package/dist/types/userResponse.d.ts +302 -2400
- package/dist/types/username.d.ts +3 -3
- package/package.json +6 -4
|
@@ -30,35 +30,15 @@ import { z } from 'zod';
|
|
|
30
30
|
* upstream cost.
|
|
31
31
|
*/
|
|
32
32
|
export declare const inferenceStreamStartEventSchema: z.ZodObject<{
|
|
33
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
34
33
|
schemaVersion: z.ZodLiteral<1>;
|
|
35
34
|
type: z.ZodLiteral<"start">;
|
|
36
35
|
requestId: z.ZodString;
|
|
37
36
|
sequence: z.ZodNumber;
|
|
38
37
|
generationId: z.ZodOptional<z.ZodString>;
|
|
39
|
-
/** Always revision-pinned, even when the request named only the model. */
|
|
40
38
|
resolvedModelReference: z.ZodString;
|
|
41
39
|
servingProvider: z.ZodString;
|
|
42
40
|
startedAt: z.ZodString;
|
|
43
|
-
},
|
|
44
|
-
type: "start";
|
|
45
|
-
schemaVersion: 1;
|
|
46
|
-
requestId: string;
|
|
47
|
-
resolvedModelReference: string;
|
|
48
|
-
servingProvider: string;
|
|
49
|
-
sequence: number;
|
|
50
|
-
startedAt: string;
|
|
51
|
-
generationId?: string | undefined;
|
|
52
|
-
}, {
|
|
53
|
-
type: "start";
|
|
54
|
-
schemaVersion: 1;
|
|
55
|
-
requestId: string;
|
|
56
|
-
resolvedModelReference: string;
|
|
57
|
-
servingProvider: string;
|
|
58
|
-
sequence: number;
|
|
59
|
-
startedAt: string;
|
|
60
|
-
generationId?: string | undefined;
|
|
61
|
-
}>;
|
|
41
|
+
}, z.core.$strip>;
|
|
62
42
|
/**
|
|
63
43
|
* A chunk of output.
|
|
64
44
|
*
|
|
@@ -67,40 +47,28 @@ export declare const inferenceStreamStartEventSchema: z.ZodObject<{
|
|
|
67
47
|
* preference.
|
|
68
48
|
*/
|
|
69
49
|
export declare const inferenceStreamDeltaEventSchema: z.ZodObject<{
|
|
70
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
71
50
|
schemaVersion: z.ZodLiteral<1>;
|
|
72
51
|
type: z.ZodLiteral<"delta">;
|
|
73
52
|
requestId: z.ZodString;
|
|
74
53
|
sequence: z.ZodNumber;
|
|
75
|
-
/** Which output of a multi-output response this chunk belongs to. */
|
|
76
54
|
outputIndex: z.ZodNumber;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
channel: z.ZodEnum<["output_text", "reasoning", "refusal", "output_audio_transcript"]>;
|
|
55
|
+
channel: z.ZodEnum<{
|
|
56
|
+
reasoning: "reasoning";
|
|
57
|
+
refusal: "refusal";
|
|
58
|
+
output_text: "output_text";
|
|
59
|
+
output_audio_transcript: "output_audio_transcript";
|
|
60
|
+
}>;
|
|
84
61
|
text: z.ZodString;
|
|
85
|
-
},
|
|
86
|
-
type: "delta";
|
|
87
|
-
channel: "reasoning" | "refusal" | "output_text" | "output_audio_transcript";
|
|
88
|
-
schemaVersion: 1;
|
|
89
|
-
requestId: string;
|
|
90
|
-
text: string;
|
|
91
|
-
sequence: number;
|
|
92
|
-
outputIndex: number;
|
|
93
|
-
}, {
|
|
94
|
-
type: "delta";
|
|
95
|
-
channel: "reasoning" | "refusal" | "output_text" | "output_audio_transcript";
|
|
96
|
-
schemaVersion: 1;
|
|
97
|
-
requestId: string;
|
|
98
|
-
text: string;
|
|
99
|
-
sequence: number;
|
|
100
|
-
outputIndex: number;
|
|
101
|
-
}>;
|
|
62
|
+
}, z.core.$strip>;
|
|
102
63
|
/** The encodings an audio output may carry. */
|
|
103
|
-
export declare const inferenceAudioMediaTypeSchema: z.ZodEnum<
|
|
64
|
+
export declare const inferenceAudioMediaTypeSchema: z.ZodEnum<{
|
|
65
|
+
"audio/mpeg": "audio/mpeg";
|
|
66
|
+
"audio/wav": "audio/wav";
|
|
67
|
+
"audio/ogg": "audio/ogg";
|
|
68
|
+
"audio/aac": "audio/aac";
|
|
69
|
+
"audio/flac": "audio/flac";
|
|
70
|
+
"audio/pcm": "audio/pcm";
|
|
71
|
+
}>;
|
|
104
72
|
export type InferenceAudioMediaType = z.infer<typeof inferenceAudioMediaTypeSchema>;
|
|
105
73
|
/** The most bytes one folded audio output may hold, at the edge and in the SDK. */
|
|
106
74
|
export declare const MAX_INFERENCE_AUDIO_BYTES: number;
|
|
@@ -111,25 +79,16 @@ export declare const inferenceStreamAudioEventSchema: z.ZodObject<{
|
|
|
111
79
|
requestId: z.ZodString;
|
|
112
80
|
sequence: z.ZodNumber;
|
|
113
81
|
outputIndex: z.ZodNumber;
|
|
114
|
-
mediaType: z.ZodEnum<
|
|
82
|
+
mediaType: z.ZodEnum<{
|
|
83
|
+
"audio/mpeg": "audio/mpeg";
|
|
84
|
+
"audio/wav": "audio/wav";
|
|
85
|
+
"audio/ogg": "audio/ogg";
|
|
86
|
+
"audio/aac": "audio/aac";
|
|
87
|
+
"audio/flac": "audio/flac";
|
|
88
|
+
"audio/pcm": "audio/pcm";
|
|
89
|
+
}>;
|
|
115
90
|
data: z.ZodString;
|
|
116
|
-
},
|
|
117
|
-
type: "audio";
|
|
118
|
-
schemaVersion: 1;
|
|
119
|
-
data: string;
|
|
120
|
-
requestId: string;
|
|
121
|
-
mediaType: "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "audio/pcm";
|
|
122
|
-
sequence: number;
|
|
123
|
-
outputIndex: number;
|
|
124
|
-
}, {
|
|
125
|
-
type: "audio";
|
|
126
|
-
schemaVersion: 1;
|
|
127
|
-
data: string;
|
|
128
|
-
requestId: string;
|
|
129
|
-
mediaType: "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "audio/pcm";
|
|
130
|
-
sequence: number;
|
|
131
|
-
outputIndex: number;
|
|
132
|
-
}>;
|
|
91
|
+
}, z.core.$strip>;
|
|
133
92
|
/**
|
|
134
93
|
* A tool call being streamed.
|
|
135
94
|
*
|
|
@@ -137,35 +96,15 @@ export declare const inferenceStreamAudioEventSchema: z.ZodObject<{
|
|
|
137
96
|
* knows when the accumulated JSON text is worth parsing.
|
|
138
97
|
*/
|
|
139
98
|
export declare const inferenceStreamToolCallEventSchema: z.ZodObject<{
|
|
140
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
141
99
|
schemaVersion: z.ZodLiteral<1>;
|
|
142
100
|
type: z.ZodLiteral<"tool_call">;
|
|
143
101
|
requestId: z.ZodString;
|
|
144
102
|
sequence: z.ZodNumber;
|
|
145
103
|
toolCallId: z.ZodString;
|
|
146
|
-
/** Present on the first event of a call. */
|
|
147
104
|
name: z.ZodOptional<z.ZodString>;
|
|
148
105
|
argumentsDelta: z.ZodOptional<z.ZodString>;
|
|
149
106
|
complete: z.ZodBoolean;
|
|
150
|
-
},
|
|
151
|
-
type: "tool_call";
|
|
152
|
-
schemaVersion: 1;
|
|
153
|
-
requestId: string;
|
|
154
|
-
toolCallId: string;
|
|
155
|
-
sequence: number;
|
|
156
|
-
complete: boolean;
|
|
157
|
-
name?: string | undefined;
|
|
158
|
-
argumentsDelta?: string | undefined;
|
|
159
|
-
}, {
|
|
160
|
-
type: "tool_call";
|
|
161
|
-
schemaVersion: 1;
|
|
162
|
-
requestId: string;
|
|
163
|
-
toolCallId: string;
|
|
164
|
-
sequence: number;
|
|
165
|
-
complete: boolean;
|
|
166
|
-
name?: string | undefined;
|
|
167
|
-
argumentsDelta?: string | undefined;
|
|
168
|
-
}>;
|
|
107
|
+
}, z.core.$strip>;
|
|
169
108
|
/**
|
|
170
109
|
* Metered units for the request so far.
|
|
171
110
|
*
|
|
@@ -202,47 +141,38 @@ export declare const inferenceStreamToolCallEventSchema: z.ZodObject<{
|
|
|
202
141
|
* evidence at ALL, not for a disconnect that reported some.
|
|
203
142
|
*/
|
|
204
143
|
export declare const inferenceStreamUsageEventSchema: z.ZodObject<{
|
|
205
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
206
144
|
schemaVersion: z.ZodLiteral<2>;
|
|
207
145
|
type: z.ZodLiteral<"usage">;
|
|
208
146
|
requestId: z.ZodString;
|
|
209
147
|
sequence: z.ZodNumber;
|
|
210
|
-
/** Exact deployment whose metering produced these partial units. */
|
|
211
148
|
deploymentId: z.ZodString;
|
|
212
149
|
units: z.ZodArray<z.ZodObject<{
|
|
213
|
-
unit: z.ZodEnum<
|
|
150
|
+
unit: z.ZodEnum<{
|
|
151
|
+
input_tokens: "input_tokens";
|
|
152
|
+
cached_input_tokens: "cached_input_tokens";
|
|
153
|
+
output_tokens: "output_tokens";
|
|
154
|
+
reasoning_tokens: "reasoning_tokens";
|
|
155
|
+
requests: "requests";
|
|
156
|
+
images: "images";
|
|
157
|
+
audio_input_milliseconds: "audio_input_milliseconds";
|
|
158
|
+
audio_output_milliseconds: "audio_output_milliseconds";
|
|
159
|
+
video_milliseconds: "video_milliseconds";
|
|
160
|
+
characters: "characters";
|
|
161
|
+
embeddings: "embeddings";
|
|
162
|
+
audio_input_tokens: "audio_input_tokens";
|
|
163
|
+
cached_audio_input_tokens: "cached_audio_input_tokens";
|
|
164
|
+
audio_output_tokens: "audio_output_tokens";
|
|
165
|
+
session_milliseconds: "session_milliseconds";
|
|
166
|
+
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
167
|
+
}>;
|
|
214
168
|
quantity: z.ZodNumber;
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
usageSource: z.ZodEnum<["provider_reported", "oxy_measured", "estimated"]>;
|
|
223
|
-
}, "strip", z.ZodTypeAny, {
|
|
224
|
-
type: "usage";
|
|
225
|
-
schemaVersion: 2;
|
|
226
|
-
requestId: string;
|
|
227
|
-
deploymentId: string;
|
|
228
|
-
sequence: number;
|
|
229
|
-
units: {
|
|
230
|
-
unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds" | "input_transcription_milliseconds";
|
|
231
|
-
quantity: number;
|
|
232
|
-
}[];
|
|
233
|
-
usageSource: "provider_reported" | "oxy_measured" | "estimated";
|
|
234
|
-
}, {
|
|
235
|
-
type: "usage";
|
|
236
|
-
schemaVersion: 2;
|
|
237
|
-
requestId: string;
|
|
238
|
-
deploymentId: string;
|
|
239
|
-
sequence: number;
|
|
240
|
-
units: {
|
|
241
|
-
unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds" | "input_transcription_milliseconds";
|
|
242
|
-
quantity: number;
|
|
243
|
-
}[];
|
|
244
|
-
usageSource: "provider_reported" | "oxy_measured" | "estimated";
|
|
245
|
-
}>;
|
|
169
|
+
}, z.core.$strict>>;
|
|
170
|
+
usageSource: z.ZodEnum<{
|
|
171
|
+
provider_reported: "provider_reported";
|
|
172
|
+
oxy_measured: "oxy_measured";
|
|
173
|
+
estimated: "estimated";
|
|
174
|
+
}>;
|
|
175
|
+
}, z.core.$strip>;
|
|
246
176
|
/**
|
|
247
177
|
* What kind of re-route happened.
|
|
248
178
|
*
|
|
@@ -252,53 +182,29 @@ export declare const inferenceStreamUsageEventSchema: z.ZodObject<{
|
|
|
252
182
|
* is the only thing that can produce one, so "a concrete model was silently
|
|
253
183
|
* replaced" has no representation in this contract.
|
|
254
184
|
*/
|
|
255
|
-
export declare const inferenceRouteSwitchDetailSchema: z.ZodDiscriminatedUnion<
|
|
185
|
+
export declare const inferenceRouteSwitchDetailSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
256
186
|
scope: z.ZodLiteral<"deployment">;
|
|
257
187
|
modelReference: z.ZodString;
|
|
258
188
|
toProvider: z.ZodString;
|
|
259
189
|
toDeploymentId: z.ZodOptional<z.ZodString>;
|
|
260
|
-
},
|
|
261
|
-
scope: "deployment";
|
|
262
|
-
modelReference: string;
|
|
263
|
-
toProvider: string;
|
|
264
|
-
toDeploymentId?: string | undefined;
|
|
265
|
-
}, {
|
|
266
|
-
scope: "deployment";
|
|
267
|
-
modelReference: string;
|
|
268
|
-
toProvider: string;
|
|
269
|
-
toDeploymentId?: string | undefined;
|
|
270
|
-
}>, z.ZodObject<{
|
|
190
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
271
191
|
scope: z.ZodLiteral<"model">;
|
|
272
|
-
/**
|
|
273
|
-
* The UNPINNED model line the customer asked for (`<publisher>/<model>`,
|
|
274
|
-
* never `@revision`). A request that pinned a revision asked for exactly
|
|
275
|
-
* those weights and is served or refused, never substituted — so for such
|
|
276
|
-
* a request there is no value that satisfies this field, and the event
|
|
277
|
-
* cannot be constructed at all.
|
|
278
|
-
*/
|
|
279
192
|
requestedModelId: z.ZodString;
|
|
280
193
|
fromModelReference: z.ZodString;
|
|
281
194
|
toModelReference: z.ZodString;
|
|
282
195
|
toProvider: z.ZodString;
|
|
283
|
-
/** Literal `true`: an unauthorized cross-model switch cannot be reported. */
|
|
284
196
|
authorizedByPolicy: z.ZodLiteral<true>;
|
|
285
|
-
},
|
|
286
|
-
scope: "model";
|
|
287
|
-
authorizedByPolicy: true;
|
|
288
|
-
toProvider: string;
|
|
289
|
-
requestedModelId: string;
|
|
290
|
-
fromModelReference: string;
|
|
291
|
-
toModelReference: string;
|
|
292
|
-
}, {
|
|
293
|
-
scope: "model";
|
|
294
|
-
authorizedByPolicy: true;
|
|
295
|
-
toProvider: string;
|
|
296
|
-
requestedModelId: string;
|
|
297
|
-
fromModelReference: string;
|
|
298
|
-
toModelReference: string;
|
|
299
|
-
}>]>;
|
|
197
|
+
}, z.core.$strict>], "scope">;
|
|
300
198
|
/** Why a route changed mid-request. */
|
|
301
|
-
export declare const inferenceRouteSwitchReasonSchema: z.ZodEnum<
|
|
199
|
+
export declare const inferenceRouteSwitchReasonSchema: z.ZodEnum<{
|
|
200
|
+
rate_limited: "rate_limited";
|
|
201
|
+
deployment_unavailable: "deployment_unavailable";
|
|
202
|
+
provider_error: "provider_error";
|
|
203
|
+
provider_timeout: "provider_timeout";
|
|
204
|
+
provider_overloaded: "provider_overloaded";
|
|
205
|
+
capacity: "capacity";
|
|
206
|
+
policy_preference: "policy_preference";
|
|
207
|
+
}>;
|
|
302
208
|
/**
|
|
303
209
|
* The customer-visible notice that an allowed route switch occurred.
|
|
304
210
|
*
|
|
@@ -307,239 +213,99 @@ export declare const inferenceRouteSwitchReasonSchema: z.ZodEnum<["deployment_un
|
|
|
307
213
|
* somewhere else while they are reading it.
|
|
308
214
|
*/
|
|
309
215
|
export declare const inferenceStreamRouteSwitchEventSchema: z.ZodObject<{
|
|
310
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
311
216
|
schemaVersion: z.ZodLiteral<1>;
|
|
312
217
|
type: z.ZodLiteral<"route_switch">;
|
|
313
218
|
requestId: z.ZodString;
|
|
314
219
|
sequence: z.ZodNumber;
|
|
315
|
-
reason: z.ZodEnum<
|
|
316
|
-
|
|
220
|
+
reason: z.ZodEnum<{
|
|
221
|
+
rate_limited: "rate_limited";
|
|
222
|
+
deployment_unavailable: "deployment_unavailable";
|
|
223
|
+
provider_error: "provider_error";
|
|
224
|
+
provider_timeout: "provider_timeout";
|
|
225
|
+
provider_overloaded: "provider_overloaded";
|
|
226
|
+
capacity: "capacity";
|
|
227
|
+
policy_preference: "policy_preference";
|
|
228
|
+
}>;
|
|
229
|
+
detail: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
317
230
|
scope: z.ZodLiteral<"deployment">;
|
|
318
231
|
modelReference: z.ZodString;
|
|
319
232
|
toProvider: z.ZodString;
|
|
320
233
|
toDeploymentId: z.ZodOptional<z.ZodString>;
|
|
321
|
-
},
|
|
322
|
-
scope: "deployment";
|
|
323
|
-
modelReference: string;
|
|
324
|
-
toProvider: string;
|
|
325
|
-
toDeploymentId?: string | undefined;
|
|
326
|
-
}, {
|
|
327
|
-
scope: "deployment";
|
|
328
|
-
modelReference: string;
|
|
329
|
-
toProvider: string;
|
|
330
|
-
toDeploymentId?: string | undefined;
|
|
331
|
-
}>, z.ZodObject<{
|
|
234
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
332
235
|
scope: z.ZodLiteral<"model">;
|
|
333
|
-
/**
|
|
334
|
-
* The UNPINNED model line the customer asked for (`<publisher>/<model>`,
|
|
335
|
-
* never `@revision`). A request that pinned a revision asked for exactly
|
|
336
|
-
* those weights and is served or refused, never substituted — so for such
|
|
337
|
-
* a request there is no value that satisfies this field, and the event
|
|
338
|
-
* cannot be constructed at all.
|
|
339
|
-
*/
|
|
340
236
|
requestedModelId: z.ZodString;
|
|
341
237
|
fromModelReference: z.ZodString;
|
|
342
238
|
toModelReference: z.ZodString;
|
|
343
239
|
toProvider: z.ZodString;
|
|
344
|
-
/** Literal `true`: an unauthorized cross-model switch cannot be reported. */
|
|
345
240
|
authorizedByPolicy: z.ZodLiteral<true>;
|
|
346
|
-
},
|
|
347
|
-
scope: "model";
|
|
348
|
-
authorizedByPolicy: true;
|
|
349
|
-
toProvider: string;
|
|
350
|
-
requestedModelId: string;
|
|
351
|
-
fromModelReference: string;
|
|
352
|
-
toModelReference: string;
|
|
353
|
-
}, {
|
|
354
|
-
scope: "model";
|
|
355
|
-
authorizedByPolicy: true;
|
|
356
|
-
toProvider: string;
|
|
357
|
-
requestedModelId: string;
|
|
358
|
-
fromModelReference: string;
|
|
359
|
-
toModelReference: string;
|
|
360
|
-
}>]>;
|
|
241
|
+
}, z.core.$strict>], "scope">;
|
|
361
242
|
occurredAt: z.ZodString;
|
|
362
|
-
},
|
|
363
|
-
type: "route_switch";
|
|
364
|
-
schemaVersion: 1;
|
|
365
|
-
reason: "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "capacity" | "policy_preference";
|
|
366
|
-
occurredAt: string;
|
|
367
|
-
requestId: string;
|
|
368
|
-
detail: {
|
|
369
|
-
scope: "deployment";
|
|
370
|
-
modelReference: string;
|
|
371
|
-
toProvider: string;
|
|
372
|
-
toDeploymentId?: string | undefined;
|
|
373
|
-
} | {
|
|
374
|
-
scope: "model";
|
|
375
|
-
authorizedByPolicy: true;
|
|
376
|
-
toProvider: string;
|
|
377
|
-
requestedModelId: string;
|
|
378
|
-
fromModelReference: string;
|
|
379
|
-
toModelReference: string;
|
|
380
|
-
};
|
|
381
|
-
sequence: number;
|
|
382
|
-
}, {
|
|
383
|
-
type: "route_switch";
|
|
384
|
-
schemaVersion: 1;
|
|
385
|
-
reason: "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "capacity" | "policy_preference";
|
|
386
|
-
occurredAt: string;
|
|
387
|
-
requestId: string;
|
|
388
|
-
detail: {
|
|
389
|
-
scope: "deployment";
|
|
390
|
-
modelReference: string;
|
|
391
|
-
toProvider: string;
|
|
392
|
-
toDeploymentId?: string | undefined;
|
|
393
|
-
} | {
|
|
394
|
-
scope: "model";
|
|
395
|
-
authorizedByPolicy: true;
|
|
396
|
-
toProvider: string;
|
|
397
|
-
requestedModelId: string;
|
|
398
|
-
fromModelReference: string;
|
|
399
|
-
toModelReference: string;
|
|
400
|
-
};
|
|
401
|
-
sequence: number;
|
|
402
|
-
}>;
|
|
243
|
+
}, z.core.$strip>;
|
|
403
244
|
/**
|
|
404
245
|
* A terminal error. The stream ends here; no `done` follows, so a client that
|
|
405
246
|
* saw an error never also has to reconcile a success.
|
|
406
247
|
*/
|
|
407
248
|
export declare const inferenceStreamErrorEventSchema: z.ZodObject<{
|
|
408
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
409
249
|
schemaVersion: z.ZodLiteral<1>;
|
|
410
250
|
type: z.ZodLiteral<"error">;
|
|
411
251
|
requestId: z.ZodString;
|
|
412
252
|
sequence: z.ZodNumber;
|
|
413
|
-
|
|
414
|
-
error: z.ZodEffects<z.ZodObject<{
|
|
253
|
+
error: z.ZodObject<{
|
|
415
254
|
schemaVersion: z.ZodLiteral<1>;
|
|
416
|
-
code: z.ZodEnum<
|
|
417
|
-
|
|
255
|
+
code: z.ZodEnum<{
|
|
256
|
+
rate_limited: "rate_limited";
|
|
257
|
+
internal_error: "internal_error";
|
|
258
|
+
service_unavailable: "service_unavailable";
|
|
259
|
+
cancelled: "cancelled";
|
|
260
|
+
invalid_request: "invalid_request";
|
|
261
|
+
authentication_failed: "authentication_failed";
|
|
262
|
+
permission_denied: "permission_denied";
|
|
263
|
+
insufficient_scope: "insufficient_scope";
|
|
264
|
+
model_not_found: "model_not_found";
|
|
265
|
+
unsupported_modality: "unsupported_modality";
|
|
266
|
+
context_length_exceeded: "context_length_exceeded";
|
|
267
|
+
request_too_large: "request_too_large";
|
|
268
|
+
output_limit_exceeded: "output_limit_exceeded";
|
|
269
|
+
idempotency_conflict: "idempotency_conflict";
|
|
270
|
+
insufficient_balance: "insufficient_balance";
|
|
271
|
+
spending_limit_exceeded: "spending_limit_exceeded";
|
|
272
|
+
quota_exceeded: "quota_exceeded";
|
|
273
|
+
byok_credential_invalid: "byok_credential_invalid";
|
|
274
|
+
policy_violation: "policy_violation";
|
|
275
|
+
commercial_permission_denied: "commercial_permission_denied";
|
|
276
|
+
no_route_available: "no_route_available";
|
|
277
|
+
upstream_content_filtered: "upstream_content_filtered";
|
|
278
|
+
deployment_unavailable: "deployment_unavailable";
|
|
279
|
+
provider_error: "provider_error";
|
|
280
|
+
provider_timeout: "provider_timeout";
|
|
281
|
+
provider_overloaded: "provider_overloaded";
|
|
282
|
+
provider_credential_invalid: "provider_credential_invalid";
|
|
283
|
+
provider_billing_refused: "provider_billing_refused";
|
|
284
|
+
}>;
|
|
285
|
+
message: z.ZodString;
|
|
418
286
|
retryable: z.ZodBoolean;
|
|
419
287
|
requestId: z.ZodString;
|
|
420
288
|
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
421
289
|
param: z.ZodOptional<z.ZodString>;
|
|
422
|
-
upstreamCategory: z.ZodOptional<z.ZodEnum<
|
|
290
|
+
upstreamCategory: z.ZodOptional<z.ZodEnum<{
|
|
291
|
+
unknown: "unknown";
|
|
292
|
+
authentication: "authentication";
|
|
293
|
+
invalid_request: "invalid_request";
|
|
294
|
+
rate_limit: "rate_limit";
|
|
295
|
+
quota: "quota";
|
|
296
|
+
timeout: "timeout";
|
|
297
|
+
overloaded: "overloaded";
|
|
298
|
+
server_error: "server_error";
|
|
299
|
+
content_filter: "content_filter";
|
|
300
|
+
}>>;
|
|
423
301
|
providerError: z.ZodOptional<z.ZodObject<{
|
|
424
302
|
provider: z.ZodString;
|
|
425
303
|
status: z.ZodOptional<z.ZodNumber>;
|
|
426
304
|
code: z.ZodOptional<z.ZodString>;
|
|
427
|
-
message: z.ZodOptional<z.
|
|
428
|
-
},
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
message?: string | undefined;
|
|
432
|
-
status?: number | undefined;
|
|
433
|
-
}, {
|
|
434
|
-
provider: string;
|
|
435
|
-
code?: string | undefined;
|
|
436
|
-
message?: string | undefined;
|
|
437
|
-
status?: number | undefined;
|
|
438
|
-
}>>;
|
|
439
|
-
}, "strip", z.ZodTypeAny, {
|
|
440
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
441
|
-
message: string;
|
|
442
|
-
schemaVersion: 1;
|
|
443
|
-
requestId: string;
|
|
444
|
-
retryable: boolean;
|
|
445
|
-
retryAfterMs?: number | undefined;
|
|
446
|
-
param?: string | undefined;
|
|
447
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
448
|
-
providerError?: {
|
|
449
|
-
provider: string;
|
|
450
|
-
code?: string | undefined;
|
|
451
|
-
message?: string | undefined;
|
|
452
|
-
status?: number | undefined;
|
|
453
|
-
} | undefined;
|
|
454
|
-
}, {
|
|
455
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
456
|
-
message: string;
|
|
457
|
-
schemaVersion: 1;
|
|
458
|
-
requestId: string;
|
|
459
|
-
retryable: boolean;
|
|
460
|
-
retryAfterMs?: number | undefined;
|
|
461
|
-
param?: string | undefined;
|
|
462
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
463
|
-
providerError?: {
|
|
464
|
-
provider: string;
|
|
465
|
-
code?: string | undefined;
|
|
466
|
-
message?: string | undefined;
|
|
467
|
-
status?: number | undefined;
|
|
468
|
-
} | undefined;
|
|
469
|
-
}>, {
|
|
470
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
471
|
-
message: string;
|
|
472
|
-
schemaVersion: 1;
|
|
473
|
-
requestId: string;
|
|
474
|
-
retryable: boolean;
|
|
475
|
-
retryAfterMs?: number | undefined;
|
|
476
|
-
param?: string | undefined;
|
|
477
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
478
|
-
providerError?: {
|
|
479
|
-
provider: string;
|
|
480
|
-
code?: string | undefined;
|
|
481
|
-
message?: string | undefined;
|
|
482
|
-
status?: number | undefined;
|
|
483
|
-
} | undefined;
|
|
484
|
-
}, {
|
|
485
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
486
|
-
message: string;
|
|
487
|
-
schemaVersion: 1;
|
|
488
|
-
requestId: string;
|
|
489
|
-
retryable: boolean;
|
|
490
|
-
retryAfterMs?: number | undefined;
|
|
491
|
-
param?: string | undefined;
|
|
492
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
493
|
-
providerError?: {
|
|
494
|
-
provider: string;
|
|
495
|
-
code?: string | undefined;
|
|
496
|
-
message?: string | undefined;
|
|
497
|
-
status?: number | undefined;
|
|
498
|
-
} | undefined;
|
|
499
|
-
}>;
|
|
500
|
-
}, "strip", z.ZodTypeAny, {
|
|
501
|
-
type: "error";
|
|
502
|
-
error: {
|
|
503
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
504
|
-
message: string;
|
|
505
|
-
schemaVersion: 1;
|
|
506
|
-
requestId: string;
|
|
507
|
-
retryable: boolean;
|
|
508
|
-
retryAfterMs?: number | undefined;
|
|
509
|
-
param?: string | undefined;
|
|
510
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
511
|
-
providerError?: {
|
|
512
|
-
provider: string;
|
|
513
|
-
code?: string | undefined;
|
|
514
|
-
message?: string | undefined;
|
|
515
|
-
status?: number | undefined;
|
|
516
|
-
} | undefined;
|
|
517
|
-
};
|
|
518
|
-
schemaVersion: 1;
|
|
519
|
-
requestId: string;
|
|
520
|
-
sequence: number;
|
|
521
|
-
}, {
|
|
522
|
-
type: "error";
|
|
523
|
-
error: {
|
|
524
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
525
|
-
message: string;
|
|
526
|
-
schemaVersion: 1;
|
|
527
|
-
requestId: string;
|
|
528
|
-
retryable: boolean;
|
|
529
|
-
retryAfterMs?: number | undefined;
|
|
530
|
-
param?: string | undefined;
|
|
531
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
532
|
-
providerError?: {
|
|
533
|
-
provider: string;
|
|
534
|
-
code?: string | undefined;
|
|
535
|
-
message?: string | undefined;
|
|
536
|
-
status?: number | undefined;
|
|
537
|
-
} | undefined;
|
|
538
|
-
};
|
|
539
|
-
schemaVersion: 1;
|
|
540
|
-
requestId: string;
|
|
541
|
-
sequence: number;
|
|
542
|
-
}>;
|
|
305
|
+
message: z.ZodOptional<z.ZodString>;
|
|
306
|
+
}, z.core.$strict>>;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
}, z.core.$strip>;
|
|
543
309
|
/**
|
|
544
310
|
* Why generation stopped.
|
|
545
311
|
*
|
|
@@ -550,7 +316,14 @@ export declare const inferenceStreamErrorEventSchema: z.ZodObject<{
|
|
|
550
316
|
* so collapsing it here would have made the terminal event less specific than
|
|
551
317
|
* the stream that produced it.
|
|
552
318
|
*/
|
|
553
|
-
export declare const inferenceFinishReasonSchema: z.ZodEnum<
|
|
319
|
+
export declare const inferenceFinishReasonSchema: z.ZodEnum<{
|
|
320
|
+
length: "length";
|
|
321
|
+
cancelled: "cancelled";
|
|
322
|
+
content_filter: "content_filter";
|
|
323
|
+
refusal: "refusal";
|
|
324
|
+
stop: "stop";
|
|
325
|
+
tool_calls: "tool_calls";
|
|
326
|
+
}>;
|
|
554
327
|
/**
|
|
555
328
|
* The successful terminal event.
|
|
556
329
|
*
|
|
@@ -558,452 +331,211 @@ export declare const inferenceFinishReasonSchema: z.ZodEnum<["stop", "length", "
|
|
|
558
331
|
* direct handle on the exact amount charged rather than a telemetry estimate.
|
|
559
332
|
*/
|
|
560
333
|
export declare const inferenceStreamDoneEventSchema: z.ZodObject<{
|
|
561
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
562
334
|
schemaVersion: z.ZodLiteral<1>;
|
|
563
335
|
type: z.ZodLiteral<"done">;
|
|
564
336
|
requestId: z.ZodString;
|
|
565
337
|
sequence: z.ZodNumber;
|
|
566
338
|
generationId: z.ZodOptional<z.ZodString>;
|
|
567
|
-
finishReason: z.ZodEnum<
|
|
339
|
+
finishReason: z.ZodEnum<{
|
|
340
|
+
length: "length";
|
|
341
|
+
cancelled: "cancelled";
|
|
342
|
+
content_filter: "content_filter";
|
|
343
|
+
refusal: "refusal";
|
|
344
|
+
stop: "stop";
|
|
345
|
+
tool_calls: "tool_calls";
|
|
346
|
+
}>;
|
|
568
347
|
receiptId: z.ZodOptional<z.ZodString>;
|
|
569
348
|
completedAt: z.ZodString;
|
|
570
|
-
},
|
|
571
|
-
type: "done";
|
|
572
|
-
schemaVersion: 1;
|
|
573
|
-
requestId: string;
|
|
574
|
-
completedAt: string;
|
|
575
|
-
sequence: number;
|
|
576
|
-
finishReason: "length" | "cancelled" | "content_filter" | "refusal" | "stop" | "tool_calls";
|
|
577
|
-
receiptId?: string | undefined;
|
|
578
|
-
generationId?: string | undefined;
|
|
579
|
-
}, {
|
|
580
|
-
type: "done";
|
|
581
|
-
schemaVersion: 1;
|
|
582
|
-
requestId: string;
|
|
583
|
-
completedAt: string;
|
|
584
|
-
sequence: number;
|
|
585
|
-
finishReason: "length" | "cancelled" | "content_filter" | "refusal" | "stop" | "tool_calls";
|
|
586
|
-
receiptId?: string | undefined;
|
|
587
|
-
generationId?: string | undefined;
|
|
588
|
-
}>;
|
|
349
|
+
}, z.core.$strip>;
|
|
589
350
|
/**
|
|
590
351
|
* Every event a normalized stream can carry.
|
|
591
352
|
*
|
|
592
353
|
* Discriminated on `type`, so a consumer that meets an unknown event fails at
|
|
593
354
|
* the parse instead of falling into a default branch that treats it as output.
|
|
594
355
|
*/
|
|
595
|
-
export declare const inferenceStreamEventSchema: z.ZodDiscriminatedUnion<
|
|
596
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
356
|
+
export declare const inferenceStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
597
357
|
schemaVersion: z.ZodLiteral<1>;
|
|
598
358
|
type: z.ZodLiteral<"start">;
|
|
599
359
|
requestId: z.ZodString;
|
|
600
360
|
sequence: z.ZodNumber;
|
|
601
361
|
generationId: z.ZodOptional<z.ZodString>;
|
|
602
|
-
/** Always revision-pinned, even when the request named only the model. */
|
|
603
362
|
resolvedModelReference: z.ZodString;
|
|
604
363
|
servingProvider: z.ZodString;
|
|
605
364
|
startedAt: z.ZodString;
|
|
606
|
-
},
|
|
607
|
-
type: "start";
|
|
608
|
-
schemaVersion: 1;
|
|
609
|
-
requestId: string;
|
|
610
|
-
resolvedModelReference: string;
|
|
611
|
-
servingProvider: string;
|
|
612
|
-
sequence: number;
|
|
613
|
-
startedAt: string;
|
|
614
|
-
generationId?: string | undefined;
|
|
615
|
-
}, {
|
|
616
|
-
type: "start";
|
|
617
|
-
schemaVersion: 1;
|
|
618
|
-
requestId: string;
|
|
619
|
-
resolvedModelReference: string;
|
|
620
|
-
servingProvider: string;
|
|
621
|
-
sequence: number;
|
|
622
|
-
startedAt: string;
|
|
623
|
-
generationId?: string | undefined;
|
|
624
|
-
}>, z.ZodObject<{
|
|
625
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
365
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
626
366
|
schemaVersion: z.ZodLiteral<1>;
|
|
627
367
|
type: z.ZodLiteral<"delta">;
|
|
628
368
|
requestId: z.ZodString;
|
|
629
369
|
sequence: z.ZodNumber;
|
|
630
|
-
/** Which output of a multi-output response this chunk belongs to. */
|
|
631
370
|
outputIndex: z.ZodNumber;
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
channel: z.ZodEnum<["output_text", "reasoning", "refusal", "output_audio_transcript"]>;
|
|
371
|
+
channel: z.ZodEnum<{
|
|
372
|
+
reasoning: "reasoning";
|
|
373
|
+
refusal: "refusal";
|
|
374
|
+
output_text: "output_text";
|
|
375
|
+
output_audio_transcript: "output_audio_transcript";
|
|
376
|
+
}>;
|
|
639
377
|
text: z.ZodString;
|
|
640
|
-
},
|
|
641
|
-
type: "delta";
|
|
642
|
-
channel: "reasoning" | "refusal" | "output_text" | "output_audio_transcript";
|
|
643
|
-
schemaVersion: 1;
|
|
644
|
-
requestId: string;
|
|
645
|
-
text: string;
|
|
646
|
-
sequence: number;
|
|
647
|
-
outputIndex: number;
|
|
648
|
-
}, {
|
|
649
|
-
type: "delta";
|
|
650
|
-
channel: "reasoning" | "refusal" | "output_text" | "output_audio_transcript";
|
|
651
|
-
schemaVersion: 1;
|
|
652
|
-
requestId: string;
|
|
653
|
-
text: string;
|
|
654
|
-
sequence: number;
|
|
655
|
-
outputIndex: number;
|
|
656
|
-
}>, z.ZodObject<{
|
|
378
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
657
379
|
schemaVersion: z.ZodLiteral<1>;
|
|
658
380
|
type: z.ZodLiteral<"audio">;
|
|
659
381
|
requestId: z.ZodString;
|
|
660
382
|
sequence: z.ZodNumber;
|
|
661
383
|
outputIndex: z.ZodNumber;
|
|
662
|
-
mediaType: z.ZodEnum<
|
|
384
|
+
mediaType: z.ZodEnum<{
|
|
385
|
+
"audio/mpeg": "audio/mpeg";
|
|
386
|
+
"audio/wav": "audio/wav";
|
|
387
|
+
"audio/ogg": "audio/ogg";
|
|
388
|
+
"audio/aac": "audio/aac";
|
|
389
|
+
"audio/flac": "audio/flac";
|
|
390
|
+
"audio/pcm": "audio/pcm";
|
|
391
|
+
}>;
|
|
663
392
|
data: z.ZodString;
|
|
664
|
-
},
|
|
665
|
-
type: "audio";
|
|
666
|
-
schemaVersion: 1;
|
|
667
|
-
data: string;
|
|
668
|
-
requestId: string;
|
|
669
|
-
mediaType: "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "audio/pcm";
|
|
670
|
-
sequence: number;
|
|
671
|
-
outputIndex: number;
|
|
672
|
-
}, {
|
|
673
|
-
type: "audio";
|
|
674
|
-
schemaVersion: 1;
|
|
675
|
-
data: string;
|
|
676
|
-
requestId: string;
|
|
677
|
-
mediaType: "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "audio/pcm";
|
|
678
|
-
sequence: number;
|
|
679
|
-
outputIndex: number;
|
|
680
|
-
}>, z.ZodObject<{
|
|
681
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
393
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
682
394
|
schemaVersion: z.ZodLiteral<1>;
|
|
683
395
|
type: z.ZodLiteral<"tool_call">;
|
|
684
396
|
requestId: z.ZodString;
|
|
685
397
|
sequence: z.ZodNumber;
|
|
686
398
|
toolCallId: z.ZodString;
|
|
687
|
-
/** Present on the first event of a call. */
|
|
688
399
|
name: z.ZodOptional<z.ZodString>;
|
|
689
400
|
argumentsDelta: z.ZodOptional<z.ZodString>;
|
|
690
401
|
complete: z.ZodBoolean;
|
|
691
|
-
},
|
|
692
|
-
type: "tool_call";
|
|
693
|
-
schemaVersion: 1;
|
|
694
|
-
requestId: string;
|
|
695
|
-
toolCallId: string;
|
|
696
|
-
sequence: number;
|
|
697
|
-
complete: boolean;
|
|
698
|
-
name?: string | undefined;
|
|
699
|
-
argumentsDelta?: string | undefined;
|
|
700
|
-
}, {
|
|
701
|
-
type: "tool_call";
|
|
702
|
-
schemaVersion: 1;
|
|
703
|
-
requestId: string;
|
|
704
|
-
toolCallId: string;
|
|
705
|
-
sequence: number;
|
|
706
|
-
complete: boolean;
|
|
707
|
-
name?: string | undefined;
|
|
708
|
-
argumentsDelta?: string | undefined;
|
|
709
|
-
}>, z.ZodObject<{
|
|
710
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
402
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
711
403
|
schemaVersion: z.ZodLiteral<2>;
|
|
712
404
|
type: z.ZodLiteral<"usage">;
|
|
713
405
|
requestId: z.ZodString;
|
|
714
406
|
sequence: z.ZodNumber;
|
|
715
|
-
/** Exact deployment whose metering produced these partial units. */
|
|
716
407
|
deploymentId: z.ZodString;
|
|
717
408
|
units: z.ZodArray<z.ZodObject<{
|
|
718
|
-
unit: z.ZodEnum<
|
|
409
|
+
unit: z.ZodEnum<{
|
|
410
|
+
input_tokens: "input_tokens";
|
|
411
|
+
cached_input_tokens: "cached_input_tokens";
|
|
412
|
+
output_tokens: "output_tokens";
|
|
413
|
+
reasoning_tokens: "reasoning_tokens";
|
|
414
|
+
requests: "requests";
|
|
415
|
+
images: "images";
|
|
416
|
+
audio_input_milliseconds: "audio_input_milliseconds";
|
|
417
|
+
audio_output_milliseconds: "audio_output_milliseconds";
|
|
418
|
+
video_milliseconds: "video_milliseconds";
|
|
419
|
+
characters: "characters";
|
|
420
|
+
embeddings: "embeddings";
|
|
421
|
+
audio_input_tokens: "audio_input_tokens";
|
|
422
|
+
cached_audio_input_tokens: "cached_audio_input_tokens";
|
|
423
|
+
audio_output_tokens: "audio_output_tokens";
|
|
424
|
+
session_milliseconds: "session_milliseconds";
|
|
425
|
+
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
426
|
+
}>;
|
|
719
427
|
quantity: z.ZodNumber;
|
|
720
|
-
},
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
usageSource: z.ZodEnum<["provider_reported", "oxy_measured", "estimated"]>;
|
|
728
|
-
}, "strip", z.ZodTypeAny, {
|
|
729
|
-
type: "usage";
|
|
730
|
-
schemaVersion: 2;
|
|
731
|
-
requestId: string;
|
|
732
|
-
deploymentId: string;
|
|
733
|
-
sequence: number;
|
|
734
|
-
units: {
|
|
735
|
-
unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds" | "input_transcription_milliseconds";
|
|
736
|
-
quantity: number;
|
|
737
|
-
}[];
|
|
738
|
-
usageSource: "provider_reported" | "oxy_measured" | "estimated";
|
|
739
|
-
}, {
|
|
740
|
-
type: "usage";
|
|
741
|
-
schemaVersion: 2;
|
|
742
|
-
requestId: string;
|
|
743
|
-
deploymentId: string;
|
|
744
|
-
sequence: number;
|
|
745
|
-
units: {
|
|
746
|
-
unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds" | "input_transcription_milliseconds";
|
|
747
|
-
quantity: number;
|
|
748
|
-
}[];
|
|
749
|
-
usageSource: "provider_reported" | "oxy_measured" | "estimated";
|
|
750
|
-
}>, z.ZodObject<{
|
|
751
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
428
|
+
}, z.core.$strict>>;
|
|
429
|
+
usageSource: z.ZodEnum<{
|
|
430
|
+
provider_reported: "provider_reported";
|
|
431
|
+
oxy_measured: "oxy_measured";
|
|
432
|
+
estimated: "estimated";
|
|
433
|
+
}>;
|
|
434
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
752
435
|
schemaVersion: z.ZodLiteral<1>;
|
|
753
436
|
type: z.ZodLiteral<"route_switch">;
|
|
754
437
|
requestId: z.ZodString;
|
|
755
438
|
sequence: z.ZodNumber;
|
|
756
|
-
reason: z.ZodEnum<
|
|
757
|
-
|
|
439
|
+
reason: z.ZodEnum<{
|
|
440
|
+
rate_limited: "rate_limited";
|
|
441
|
+
deployment_unavailable: "deployment_unavailable";
|
|
442
|
+
provider_error: "provider_error";
|
|
443
|
+
provider_timeout: "provider_timeout";
|
|
444
|
+
provider_overloaded: "provider_overloaded";
|
|
445
|
+
capacity: "capacity";
|
|
446
|
+
policy_preference: "policy_preference";
|
|
447
|
+
}>;
|
|
448
|
+
detail: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
758
449
|
scope: z.ZodLiteral<"deployment">;
|
|
759
450
|
modelReference: z.ZodString;
|
|
760
451
|
toProvider: z.ZodString;
|
|
761
452
|
toDeploymentId: z.ZodOptional<z.ZodString>;
|
|
762
|
-
},
|
|
763
|
-
scope: "deployment";
|
|
764
|
-
modelReference: string;
|
|
765
|
-
toProvider: string;
|
|
766
|
-
toDeploymentId?: string | undefined;
|
|
767
|
-
}, {
|
|
768
|
-
scope: "deployment";
|
|
769
|
-
modelReference: string;
|
|
770
|
-
toProvider: string;
|
|
771
|
-
toDeploymentId?: string | undefined;
|
|
772
|
-
}>, z.ZodObject<{
|
|
453
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
773
454
|
scope: z.ZodLiteral<"model">;
|
|
774
|
-
/**
|
|
775
|
-
* The UNPINNED model line the customer asked for (`<publisher>/<model>`,
|
|
776
|
-
* never `@revision`). A request that pinned a revision asked for exactly
|
|
777
|
-
* those weights and is served or refused, never substituted — so for such
|
|
778
|
-
* a request there is no value that satisfies this field, and the event
|
|
779
|
-
* cannot be constructed at all.
|
|
780
|
-
*/
|
|
781
455
|
requestedModelId: z.ZodString;
|
|
782
456
|
fromModelReference: z.ZodString;
|
|
783
457
|
toModelReference: z.ZodString;
|
|
784
458
|
toProvider: z.ZodString;
|
|
785
|
-
/** Literal `true`: an unauthorized cross-model switch cannot be reported. */
|
|
786
459
|
authorizedByPolicy: z.ZodLiteral<true>;
|
|
787
|
-
},
|
|
788
|
-
scope: "model";
|
|
789
|
-
authorizedByPolicy: true;
|
|
790
|
-
toProvider: string;
|
|
791
|
-
requestedModelId: string;
|
|
792
|
-
fromModelReference: string;
|
|
793
|
-
toModelReference: string;
|
|
794
|
-
}, {
|
|
795
|
-
scope: "model";
|
|
796
|
-
authorizedByPolicy: true;
|
|
797
|
-
toProvider: string;
|
|
798
|
-
requestedModelId: string;
|
|
799
|
-
fromModelReference: string;
|
|
800
|
-
toModelReference: string;
|
|
801
|
-
}>]>;
|
|
460
|
+
}, z.core.$strict>], "scope">;
|
|
802
461
|
occurredAt: z.ZodString;
|
|
803
|
-
},
|
|
804
|
-
type: "route_switch";
|
|
805
|
-
schemaVersion: 1;
|
|
806
|
-
reason: "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "capacity" | "policy_preference";
|
|
807
|
-
occurredAt: string;
|
|
808
|
-
requestId: string;
|
|
809
|
-
detail: {
|
|
810
|
-
scope: "deployment";
|
|
811
|
-
modelReference: string;
|
|
812
|
-
toProvider: string;
|
|
813
|
-
toDeploymentId?: string | undefined;
|
|
814
|
-
} | {
|
|
815
|
-
scope: "model";
|
|
816
|
-
authorizedByPolicy: true;
|
|
817
|
-
toProvider: string;
|
|
818
|
-
requestedModelId: string;
|
|
819
|
-
fromModelReference: string;
|
|
820
|
-
toModelReference: string;
|
|
821
|
-
};
|
|
822
|
-
sequence: number;
|
|
823
|
-
}, {
|
|
824
|
-
type: "route_switch";
|
|
825
|
-
schemaVersion: 1;
|
|
826
|
-
reason: "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "capacity" | "policy_preference";
|
|
827
|
-
occurredAt: string;
|
|
828
|
-
requestId: string;
|
|
829
|
-
detail: {
|
|
830
|
-
scope: "deployment";
|
|
831
|
-
modelReference: string;
|
|
832
|
-
toProvider: string;
|
|
833
|
-
toDeploymentId?: string | undefined;
|
|
834
|
-
} | {
|
|
835
|
-
scope: "model";
|
|
836
|
-
authorizedByPolicy: true;
|
|
837
|
-
toProvider: string;
|
|
838
|
-
requestedModelId: string;
|
|
839
|
-
fromModelReference: string;
|
|
840
|
-
toModelReference: string;
|
|
841
|
-
};
|
|
842
|
-
sequence: number;
|
|
843
|
-
}>, z.ZodObject<{
|
|
844
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
462
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
845
463
|
schemaVersion: z.ZodLiteral<1>;
|
|
846
464
|
type: z.ZodLiteral<"error">;
|
|
847
465
|
requestId: z.ZodString;
|
|
848
466
|
sequence: z.ZodNumber;
|
|
849
|
-
|
|
850
|
-
error: z.ZodEffects<z.ZodObject<{
|
|
467
|
+
error: z.ZodObject<{
|
|
851
468
|
schemaVersion: z.ZodLiteral<1>;
|
|
852
|
-
code: z.ZodEnum<
|
|
853
|
-
|
|
469
|
+
code: z.ZodEnum<{
|
|
470
|
+
rate_limited: "rate_limited";
|
|
471
|
+
internal_error: "internal_error";
|
|
472
|
+
service_unavailable: "service_unavailable";
|
|
473
|
+
cancelled: "cancelled";
|
|
474
|
+
invalid_request: "invalid_request";
|
|
475
|
+
authentication_failed: "authentication_failed";
|
|
476
|
+
permission_denied: "permission_denied";
|
|
477
|
+
insufficient_scope: "insufficient_scope";
|
|
478
|
+
model_not_found: "model_not_found";
|
|
479
|
+
unsupported_modality: "unsupported_modality";
|
|
480
|
+
context_length_exceeded: "context_length_exceeded";
|
|
481
|
+
request_too_large: "request_too_large";
|
|
482
|
+
output_limit_exceeded: "output_limit_exceeded";
|
|
483
|
+
idempotency_conflict: "idempotency_conflict";
|
|
484
|
+
insufficient_balance: "insufficient_balance";
|
|
485
|
+
spending_limit_exceeded: "spending_limit_exceeded";
|
|
486
|
+
quota_exceeded: "quota_exceeded";
|
|
487
|
+
byok_credential_invalid: "byok_credential_invalid";
|
|
488
|
+
policy_violation: "policy_violation";
|
|
489
|
+
commercial_permission_denied: "commercial_permission_denied";
|
|
490
|
+
no_route_available: "no_route_available";
|
|
491
|
+
upstream_content_filtered: "upstream_content_filtered";
|
|
492
|
+
deployment_unavailable: "deployment_unavailable";
|
|
493
|
+
provider_error: "provider_error";
|
|
494
|
+
provider_timeout: "provider_timeout";
|
|
495
|
+
provider_overloaded: "provider_overloaded";
|
|
496
|
+
provider_credential_invalid: "provider_credential_invalid";
|
|
497
|
+
provider_billing_refused: "provider_billing_refused";
|
|
498
|
+
}>;
|
|
499
|
+
message: z.ZodString;
|
|
854
500
|
retryable: z.ZodBoolean;
|
|
855
501
|
requestId: z.ZodString;
|
|
856
502
|
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
857
503
|
param: z.ZodOptional<z.ZodString>;
|
|
858
|
-
upstreamCategory: z.ZodOptional<z.ZodEnum<
|
|
504
|
+
upstreamCategory: z.ZodOptional<z.ZodEnum<{
|
|
505
|
+
unknown: "unknown";
|
|
506
|
+
authentication: "authentication";
|
|
507
|
+
invalid_request: "invalid_request";
|
|
508
|
+
rate_limit: "rate_limit";
|
|
509
|
+
quota: "quota";
|
|
510
|
+
timeout: "timeout";
|
|
511
|
+
overloaded: "overloaded";
|
|
512
|
+
server_error: "server_error";
|
|
513
|
+
content_filter: "content_filter";
|
|
514
|
+
}>>;
|
|
859
515
|
providerError: z.ZodOptional<z.ZodObject<{
|
|
860
516
|
provider: z.ZodString;
|
|
861
517
|
status: z.ZodOptional<z.ZodNumber>;
|
|
862
518
|
code: z.ZodOptional<z.ZodString>;
|
|
863
|
-
message: z.ZodOptional<z.
|
|
864
|
-
},
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
message?: string | undefined;
|
|
868
|
-
status?: number | undefined;
|
|
869
|
-
}, {
|
|
870
|
-
provider: string;
|
|
871
|
-
code?: string | undefined;
|
|
872
|
-
message?: string | undefined;
|
|
873
|
-
status?: number | undefined;
|
|
874
|
-
}>>;
|
|
875
|
-
}, "strip", z.ZodTypeAny, {
|
|
876
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
877
|
-
message: string;
|
|
878
|
-
schemaVersion: 1;
|
|
879
|
-
requestId: string;
|
|
880
|
-
retryable: boolean;
|
|
881
|
-
retryAfterMs?: number | undefined;
|
|
882
|
-
param?: string | undefined;
|
|
883
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
884
|
-
providerError?: {
|
|
885
|
-
provider: string;
|
|
886
|
-
code?: string | undefined;
|
|
887
|
-
message?: string | undefined;
|
|
888
|
-
status?: number | undefined;
|
|
889
|
-
} | undefined;
|
|
890
|
-
}, {
|
|
891
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
892
|
-
message: string;
|
|
893
|
-
schemaVersion: 1;
|
|
894
|
-
requestId: string;
|
|
895
|
-
retryable: boolean;
|
|
896
|
-
retryAfterMs?: number | undefined;
|
|
897
|
-
param?: string | undefined;
|
|
898
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
899
|
-
providerError?: {
|
|
900
|
-
provider: string;
|
|
901
|
-
code?: string | undefined;
|
|
902
|
-
message?: string | undefined;
|
|
903
|
-
status?: number | undefined;
|
|
904
|
-
} | undefined;
|
|
905
|
-
}>, {
|
|
906
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
907
|
-
message: string;
|
|
908
|
-
schemaVersion: 1;
|
|
909
|
-
requestId: string;
|
|
910
|
-
retryable: boolean;
|
|
911
|
-
retryAfterMs?: number | undefined;
|
|
912
|
-
param?: string | undefined;
|
|
913
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
914
|
-
providerError?: {
|
|
915
|
-
provider: string;
|
|
916
|
-
code?: string | undefined;
|
|
917
|
-
message?: string | undefined;
|
|
918
|
-
status?: number | undefined;
|
|
919
|
-
} | undefined;
|
|
920
|
-
}, {
|
|
921
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
922
|
-
message: string;
|
|
923
|
-
schemaVersion: 1;
|
|
924
|
-
requestId: string;
|
|
925
|
-
retryable: boolean;
|
|
926
|
-
retryAfterMs?: number | undefined;
|
|
927
|
-
param?: string | undefined;
|
|
928
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
929
|
-
providerError?: {
|
|
930
|
-
provider: string;
|
|
931
|
-
code?: string | undefined;
|
|
932
|
-
message?: string | undefined;
|
|
933
|
-
status?: number | undefined;
|
|
934
|
-
} | undefined;
|
|
935
|
-
}>;
|
|
936
|
-
}, "strip", z.ZodTypeAny, {
|
|
937
|
-
type: "error";
|
|
938
|
-
error: {
|
|
939
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
940
|
-
message: string;
|
|
941
|
-
schemaVersion: 1;
|
|
942
|
-
requestId: string;
|
|
943
|
-
retryable: boolean;
|
|
944
|
-
retryAfterMs?: number | undefined;
|
|
945
|
-
param?: string | undefined;
|
|
946
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
947
|
-
providerError?: {
|
|
948
|
-
provider: string;
|
|
949
|
-
code?: string | undefined;
|
|
950
|
-
message?: string | undefined;
|
|
951
|
-
status?: number | undefined;
|
|
952
|
-
} | undefined;
|
|
953
|
-
};
|
|
954
|
-
schemaVersion: 1;
|
|
955
|
-
requestId: string;
|
|
956
|
-
sequence: number;
|
|
957
|
-
}, {
|
|
958
|
-
type: "error";
|
|
959
|
-
error: {
|
|
960
|
-
code: "rate_limited" | "internal_error" | "service_unavailable" | "cancelled" | "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused";
|
|
961
|
-
message: string;
|
|
962
|
-
schemaVersion: 1;
|
|
963
|
-
requestId: string;
|
|
964
|
-
retryable: boolean;
|
|
965
|
-
retryAfterMs?: number | undefined;
|
|
966
|
-
param?: string | undefined;
|
|
967
|
-
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
968
|
-
providerError?: {
|
|
969
|
-
provider: string;
|
|
970
|
-
code?: string | undefined;
|
|
971
|
-
message?: string | undefined;
|
|
972
|
-
status?: number | undefined;
|
|
973
|
-
} | undefined;
|
|
974
|
-
};
|
|
975
|
-
schemaVersion: 1;
|
|
976
|
-
requestId: string;
|
|
977
|
-
sequence: number;
|
|
978
|
-
}>, z.ZodObject<{
|
|
979
|
-
/** See `version.ts`: each stream event is a whole message on the wire. */
|
|
519
|
+
message: z.ZodOptional<z.ZodString>;
|
|
520
|
+
}, z.core.$strict>>;
|
|
521
|
+
}, z.core.$strip>;
|
|
522
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
980
523
|
schemaVersion: z.ZodLiteral<1>;
|
|
981
524
|
type: z.ZodLiteral<"done">;
|
|
982
525
|
requestId: z.ZodString;
|
|
983
526
|
sequence: z.ZodNumber;
|
|
984
527
|
generationId: z.ZodOptional<z.ZodString>;
|
|
985
|
-
finishReason: z.ZodEnum<
|
|
528
|
+
finishReason: z.ZodEnum<{
|
|
529
|
+
length: "length";
|
|
530
|
+
cancelled: "cancelled";
|
|
531
|
+
content_filter: "content_filter";
|
|
532
|
+
refusal: "refusal";
|
|
533
|
+
stop: "stop";
|
|
534
|
+
tool_calls: "tool_calls";
|
|
535
|
+
}>;
|
|
986
536
|
receiptId: z.ZodOptional<z.ZodString>;
|
|
987
537
|
completedAt: z.ZodString;
|
|
988
|
-
},
|
|
989
|
-
type: "done";
|
|
990
|
-
schemaVersion: 1;
|
|
991
|
-
requestId: string;
|
|
992
|
-
completedAt: string;
|
|
993
|
-
sequence: number;
|
|
994
|
-
finishReason: "length" | "cancelled" | "content_filter" | "refusal" | "stop" | "tool_calls";
|
|
995
|
-
receiptId?: string | undefined;
|
|
996
|
-
generationId?: string | undefined;
|
|
997
|
-
}, {
|
|
998
|
-
type: "done";
|
|
999
|
-
schemaVersion: 1;
|
|
1000
|
-
requestId: string;
|
|
1001
|
-
completedAt: string;
|
|
1002
|
-
sequence: number;
|
|
1003
|
-
finishReason: "length" | "cancelled" | "content_filter" | "refusal" | "stop" | "tool_calls";
|
|
1004
|
-
receiptId?: string | undefined;
|
|
1005
|
-
generationId?: string | undefined;
|
|
1006
|
-
}>]>;
|
|
538
|
+
}, z.core.$strip>], "type">;
|
|
1007
539
|
export type InferenceStreamStartEvent = z.infer<typeof inferenceStreamStartEventSchema>;
|
|
1008
540
|
export type InferenceStreamDeltaEvent = z.infer<typeof inferenceStreamDeltaEventSchema>;
|
|
1009
541
|
export type InferenceStreamAudioEvent = z.infer<typeof inferenceStreamAudioEventSchema>;
|