@oxy.so/contracts 4.5.0 → 4.6.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.
@@ -74,9 +74,9 @@ export { embeddingVectorSchema, embeddingUsageSchema, embeddingSuccessSchema, em
74
74
  export type { EmbeddingVector, EmbeddingUsage, EmbeddingSuccess, EmbeddingFailure, EmbeddingResponse, } from './inference/embeddings';
75
75
  export { priceVersionStatusSchema, priceVersionSchema, priceSnapshotSchema, } from './inference/priceVersion';
76
76
  export type { PriceVersionStatus, PriceVersion, PriceSnapshot } from './inference/priceVersion';
77
- export { inferenceModalitySchema, reasoningEffortSchema, inferenceApiFormatSchema, realtimeSessionKindSchema, realtimeSessionTransportSchema, modelRealtimeCapabilitiesSchema, modelCapabilitiesSchema, modelLicenseSchema, modelProvenanceSchema, inferenceDataPolicySchema, availabilityScopeSchema, commercialPermissionSchema, modelDeprecationSchema, modelEvaluationResultSchema, modelSafetyMetadataSchema, modelPublisherSchema, catalogueModelSchema, modelRevisionSchema, inferenceProviderSchema, modelDeploymentSchema, routingProfileCandidateSchema, routingProfileSchema, cataloguePublisherSummarySchema, catalogueServingProviderSummarySchema, modelCatalogueEntrySchema, } from './inference/catalogue';
78
- export type { InferenceModality, ReasoningEffort, InferenceApiFormat, RealtimeSessionKind, RealtimeSessionTransport, ModelRealtimeCapabilities, ModelCapabilities, ModelLicense, ModelProvenance, InferenceDataPolicy, AvailabilityScope, CommercialPermission, ModelDeprecation, ModelEvaluationResult, ModelSafetyMetadata, ModelPublisher, CatalogueModel, ModelRevision, InferenceProvider, ModelDeployment, RoutingProfileCandidate, RoutingProfile, CataloguePublisherSummary, CatalogueServingProviderSummary, ModelCatalogueEntry, } from './inference/catalogue';
79
- export { routingTargetSchema, routingPolicyScopeSchema, routingFallbackPolicySchema, routingPolicySchema, routingPolicyReferenceSchema, authorizedRouteSchema, } from './inference/routingPolicy';
77
+ export { inferenceModalitySchema, reasoningEffortSchema, powerLevelSchema, modelPowerClassSchema, inferenceApiFormatSchema, realtimeSessionKindSchema, realtimeSessionTransportSchema, modelRealtimeCapabilitiesSchema, modelCapabilitiesSchema, modelLicenseSchema, modelProvenanceSchema, inferenceDataPolicySchema, availabilityScopeSchema, commercialPermissionSchema, modelDeprecationSchema, modelEvaluationResultSchema, modelSafetyMetadataSchema, modelPublisherSchema, catalogueModelSchema, modelRevisionSchema, inferenceProviderSchema, modelDeploymentSchema, routingProfileCandidateSchema, routingProfileSchema, cataloguePublisherSummarySchema, catalogueServingProviderSummarySchema, modelCatalogueEntrySchema, } from './inference/catalogue';
78
+ export type { InferenceModality, ReasoningEffort, PowerLevel, ModelPowerClass, InferenceApiFormat, RealtimeSessionKind, RealtimeSessionTransport, ModelRealtimeCapabilities, ModelCapabilities, ModelLicense, ModelProvenance, InferenceDataPolicy, AvailabilityScope, CommercialPermission, ModelDeprecation, ModelEvaluationResult, ModelSafetyMetadata, ModelPublisher, CatalogueModel, ModelRevision, InferenceProvider, ModelDeployment, RoutingProfileCandidate, RoutingProfile, CataloguePublisherSummary, CatalogueServingProviderSummary, ModelCatalogueEntry, } from './inference/catalogue';
79
+ export { routingTargetSchema, routingPolicyScopeSchema, routingFallbackPolicySchema, routingPolicySchema, routingPolicyReferenceSchema, effectiveSameModelDeployment, authorizedRouteSchema, } from './inference/routingPolicy';
80
80
  export type { RoutingTarget, RoutingPolicyScope, RoutingFallbackPolicy, RoutingPolicy, RoutingPolicyReference, AuthorizedRoute, } from './inference/routingPolicy';
81
81
  export { aliaReleaseArtifactSchema, aliaReleaseSignatureSchema, aliaModelReleaseManifestSchema, } from './inference/aliaModelRelease';
82
82
  export type { AliaReleaseArtifact, AliaReleaseSignature, AliaModelReleaseManifest, } from './inference/aliaModelRelease';
@@ -38,6 +38,30 @@ export declare const inferenceModalitySchema: z.ZodEnum<["text", "image", "audio
38
38
  * effort the resolved model does not advertise rather than dropping it.
39
39
  */
40
40
  export declare const reasoningEffortSchema: z.ZodEnum<["low", "medium", "high"]>;
41
+ /**
42
+ * A POWER LEVEL: the public name of a product-preset routing profile that asks
43
+ * Oxy to choose a model by capability tier instead of naming one (contract set
44
+ * 3.4.0). Ordered cheapest first; `auto` asks Oxy to pick the cheapest level
45
+ * that suffices for the request.
46
+ *
47
+ * - `instant` — very cheap, fast small models; no reasoning effort requested
48
+ * - `medium` — mid-size models, low reasoning effort
49
+ * - `high` — strong models, medium reasoning effort
50
+ * - `xhigh` — strong models, high reasoning effort
51
+ * - `pro` — frontier models, high reasoning effort
52
+ * - `ultra` — the heaviest frontier models, maximum reasoning effort
53
+ *
54
+ * A power level is a routing profile, never a model: its slug has no `/`, and
55
+ * the response always reports the concrete model that ran.
56
+ */
57
+ export declare const powerLevelSchema: z.ZodEnum<["auto", "instant", "medium", "high", "xhigh", "pro", "ultra"]>;
58
+ /**
59
+ * The reviewed capability tier of one MODEL, which power levels choose from.
60
+ * `xhigh` and `auto` are not classes: `xhigh` runs `high`-class models at a
61
+ * higher effort, and `auto` chooses a level. Reviewed catalogue data with a
62
+ * cited public benchmark source — never inferred from a model's name.
63
+ */
64
+ export declare const modelPowerClassSchema: z.ZodEnum<["instant", "medium", "high", "pro", "ultra"]>;
41
65
  /**
42
66
  * The public dialects a request can arrive in — `client.apiFormat` on the
43
67
  * envelope, and the list a deployment declares it can execute.
@@ -1212,6 +1236,18 @@ export declare const routingProfileSchema: z.ZodObject<{
1212
1236
  }>, "many">;
1213
1237
  /** A product preset (Alia's "fast" toggle) rather than a customer's own profile. */
1214
1238
  isProductPreset: z.ZodBoolean;
1239
+ /**
1240
+ * Present when this profile IS a power level (contract set 3.4.0). Its
1241
+ * `candidates` are then the currently servable models of the level's class,
1242
+ * and may change between reads; cross-model failover among them is
1243
+ * authorized by the profile and reported with a `route_switch` event.
1244
+ */
1245
+ powerLevel: z.ZodOptional<z.ZodEnum<["auto", "instant", "medium", "high", "xhigh", "pro", "ultra"]>>;
1246
+ /**
1247
+ * The reasoning effort a power level asks for when the request names none,
1248
+ * applied only on a model that advertises it. Absent: none is requested.
1249
+ */
1250
+ reasoningEffort: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
1215
1251
  }, "strip", z.ZodTypeAny, {
1216
1252
  displayName: string;
1217
1253
  schemaVersion: 1;
@@ -1224,6 +1260,8 @@ export declare const routingProfileSchema: z.ZodObject<{
1224
1260
  }[];
1225
1261
  isProductPreset: boolean;
1226
1262
  description?: string | undefined;
1263
+ powerLevel?: "medium" | "high" | "auto" | "instant" | "xhigh" | "pro" | "ultra" | undefined;
1264
+ reasoningEffort?: "low" | "medium" | "high" | undefined;
1227
1265
  }, {
1228
1266
  displayName: string;
1229
1267
  schemaVersion: 1;
@@ -1236,6 +1274,8 @@ export declare const routingProfileSchema: z.ZodObject<{
1236
1274
  }[];
1237
1275
  isProductPreset: boolean;
1238
1276
  description?: string | undefined;
1277
+ powerLevel?: "medium" | "high" | "auto" | "instant" | "xhigh" | "pro" | "ultra" | undefined;
1278
+ reasoningEffort?: "low" | "medium" | "high" | undefined;
1239
1279
  }>;
1240
1280
  /** The publisher fields a customer sees beside a model. */
1241
1281
  export declare const cataloguePublisherSummarySchema: z.ZodObject<{
@@ -1729,6 +1769,12 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
1729
1769
  knownLimitations?: string[] | undefined;
1730
1770
  }>>;
1731
1771
  modelCardUrl: z.ZodOptional<z.ZodString>;
1772
+ /**
1773
+ * The reviewed power class this model serves in, when one has been reviewed
1774
+ * (contract set 3.4.0). Absent means the model is callable by name only and
1775
+ * no power level chooses it.
1776
+ */
1777
+ powerClass: z.ZodOptional<z.ZodEnum<["instant", "medium", "high", "pro", "ultra"]>>;
1732
1778
  }, "strip", z.ZodTypeAny, {
1733
1779
  displayName: string;
1734
1780
  capabilities: {
@@ -1830,6 +1876,7 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
1830
1876
  per: number;
1831
1877
  }[];
1832
1878
  } | undefined;
1879
+ powerClass?: "medium" | "high" | "instant" | "pro" | "ultra" | undefined;
1833
1880
  }, {
1834
1881
  displayName: string;
1835
1882
  capabilities: {
@@ -1931,9 +1978,12 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
1931
1978
  per: number;
1932
1979
  }[];
1933
1980
  } | undefined;
1981
+ powerClass?: "medium" | "high" | "instant" | "pro" | "ultra" | undefined;
1934
1982
  }>;
1935
1983
  export type InferenceModality = z.infer<typeof inferenceModalitySchema>;
1936
1984
  export type ReasoningEffort = z.infer<typeof reasoningEffortSchema>;
1985
+ export type PowerLevel = z.infer<typeof powerLevelSchema>;
1986
+ export type ModelPowerClass = z.infer<typeof modelPowerClassSchema>;
1937
1987
  export type InferenceApiFormat = z.infer<typeof inferenceApiFormatSchema>;
1938
1988
  export type RealtimeSessionKind = z.infer<typeof realtimeSessionKindSchema>;
1939
1989
  export type RealtimeSessionTransport = z.infer<typeof realtimeSessionTransportSchema>;
@@ -96,17 +96,32 @@ export declare const routingPolicyScopeSchema: z.ZodDiscriminatedUnion<"kind", [
96
96
  */
97
97
  export declare const routingFallbackPolicySchema: z.ZodObject<{
98
98
  disabled: z.ZodBoolean;
99
- sameModelDeployment: z.ZodBoolean;
99
+ /**
100
+ * Same-model deployment failover. OPTIONAL since contract set 3.4.0, and
101
+ * absent means ON unless `disabled` is set: serving the same weights from
102
+ * another deployment of the same revision is an availability decision, not
103
+ * a substitution. A policy opts out with an explicit `false` (or
104
+ * `disabled: true`). See `effectiveSameModelDeployment`.
105
+ */
106
+ sameModelDeployment: z.ZodOptional<z.ZodBoolean>;
100
107
  authorizedCrossModel: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
101
108
  }, "strict", z.ZodTypeAny, {
102
109
  disabled: boolean;
103
- sameModelDeployment: boolean;
104
110
  authorizedCrossModel: string[];
111
+ sameModelDeployment?: boolean | undefined;
105
112
  }, {
106
113
  disabled: boolean;
107
- sameModelDeployment: boolean;
114
+ sameModelDeployment?: boolean | undefined;
108
115
  authorizedCrossModel?: string[] | undefined;
109
116
  }>;
117
+ /**
118
+ * Whether a fallback block authorizes same-model deployment failover: an
119
+ * explicit `sameModelDeployment` wins; absent means on unless `disabled`.
120
+ */
121
+ export declare function effectiveSameModelDeployment(fallback: {
122
+ readonly disabled: boolean;
123
+ readonly sameModelDeployment?: boolean;
124
+ }): boolean;
110
125
  /**
111
126
  * A versioned routing policy.
112
127
  *
@@ -206,17 +221,32 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
206
221
  requireCommercialUseRights: z.ZodBoolean;
207
222
  fallback: z.ZodObject<{
208
223
  disabled: z.ZodBoolean;
209
- sameModelDeployment: z.ZodBoolean;
224
+ /**
225
+ * Same-model deployment failover. OPTIONAL since contract set 3.4.0, and
226
+ * absent means ON unless `disabled` is set: serving the same weights from
227
+ * another deployment of the same revision is an availability decision, not
228
+ * a substitution. A policy opts out with an explicit `false` (or
229
+ * `disabled: true`). See `effectiveSameModelDeployment`.
230
+ */
231
+ sameModelDeployment: z.ZodOptional<z.ZodBoolean>;
210
232
  authorizedCrossModel: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
211
233
  }, "strict", z.ZodTypeAny, {
212
234
  disabled: boolean;
213
- sameModelDeployment: boolean;
214
235
  authorizedCrossModel: string[];
236
+ sameModelDeployment?: boolean | undefined;
215
237
  }, {
216
238
  disabled: boolean;
217
- sameModelDeployment: boolean;
239
+ sameModelDeployment?: boolean | undefined;
218
240
  authorizedCrossModel?: string[] | undefined;
219
241
  }>;
242
+ /**
243
+ * The routing profiles (power levels) this scope may target, by exact id
244
+ * (contract set 3.4.0). Empty means no restriction. A request naming a
245
+ * profile outside a non-empty list is refused with `policy_violation`, and
246
+ * `auto` only climbs to levels on the list. Concrete model targets are
247
+ * governed by the other controls, not by this list.
248
+ */
249
+ allowedRoutingProfileIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
220
250
  /** Whether the customer's own provider credentials may or must be used. */
221
251
  byokPreference: z.ZodEnum<["disabled", "prefer", "require"]>;
222
252
  /** Enterprise reserved capacity rather than shared endpoints. */
@@ -254,9 +284,10 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
254
284
  requireCommercialUseRights: boolean;
255
285
  fallback: {
256
286
  disabled: boolean;
257
- sameModelDeployment: boolean;
258
287
  authorizedCrossModel: string[];
288
+ sameModelDeployment?: boolean | undefined;
259
289
  };
290
+ allowedRoutingProfileIds: string[];
260
291
  byokPreference: "disabled" | "prefer" | "require";
261
292
  defaultTarget?: {
262
293
  kind: "model";
@@ -290,7 +321,7 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
290
321
  requireCommercialUseRights: boolean;
291
322
  fallback: {
292
323
  disabled: boolean;
293
- sameModelDeployment: boolean;
324
+ sameModelDeployment?: boolean | undefined;
294
325
  authorizedCrossModel?: string[] | undefined;
295
326
  };
296
327
  byokPreference: "disabled" | "prefer" | "require";
@@ -316,6 +347,7 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
316
347
  amount: string;
317
348
  } | undefined;
318
349
  allowedLicenseIds?: string[] | undefined;
350
+ allowedRoutingProfileIds?: string[] | undefined;
319
351
  }>, {
320
352
  updatedAt: string;
321
353
  schemaVersion: 2;
@@ -348,9 +380,10 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
348
380
  requireCommercialUseRights: boolean;
349
381
  fallback: {
350
382
  disabled: boolean;
351
- sameModelDeployment: boolean;
352
383
  authorizedCrossModel: string[];
384
+ sameModelDeployment?: boolean | undefined;
353
385
  };
386
+ allowedRoutingProfileIds: string[];
354
387
  byokPreference: "disabled" | "prefer" | "require";
355
388
  defaultTarget?: {
356
389
  kind: "model";
@@ -384,7 +417,7 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
384
417
  requireCommercialUseRights: boolean;
385
418
  fallback: {
386
419
  disabled: boolean;
387
- sameModelDeployment: boolean;
420
+ sameModelDeployment?: boolean | undefined;
388
421
  authorizedCrossModel?: string[] | undefined;
389
422
  };
390
423
  byokPreference: "disabled" | "prefer" | "require";
@@ -410,6 +443,7 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
410
443
  amount: string;
411
444
  } | undefined;
412
445
  allowedLicenseIds?: string[] | undefined;
446
+ allowedRoutingProfileIds?: string[] | undefined;
413
447
  }>;
414
448
  /**
415
449
  * The reference a request records: which policy, at which of the customer's own
@@ -99,4 +99,4 @@
99
99
  * change to, say, the catalogue reject every in-flight inference request; the
100
100
  * per-shape `schemaVersion` is what a message is validated against.
101
101
  */
102
- export declare const INFERENCE_CONTRACT_VERSION = "3.3.0";
102
+ export declare const INFERENCE_CONTRACT_VERSION = "3.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "4.5.0",
3
+ "version": "4.6.0",
4
4
  "description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",