Skip to main content

Variable: GatewayRoutingConfigSchema

const GatewayRoutingConfigSchema: ZodObject<{
retry: ZodOptional<ZodObject<{
attempts: ZodOptional<ZodNumber>;
on_status_codes: ZodOptional<ZodArray<ZodNumber, "many">>;
}, "strip", ZodType<GatewayJsonValue, ZodTypeDef, GatewayJsonValue>, {
attempts?: number;
on_status_codes?: number[];
}, {
attempts?: number;
on_status_codes?: number[];
}>>;
cache: ZodOptional<ZodObject<{
mode: ZodOptional<ZodType<GatewayOpenValue<"semantic" | "simple">, ZodTypeDef, GatewayOpenValue<"semantic" | "simple">>>;
max_age: ZodOptional<ZodNumber>;
}, "strip", ZodType<GatewayJsonValue, ZodTypeDef, GatewayJsonValue>, {
mode?: GatewayOpenValue<"semantic" | "simple">;
max_age?: number;
}, {
mode?: GatewayOpenValue<"semantic" | "simple">;
max_age?: number;
}>>;
strategy: ZodOptional<ZodObject<{
mode: ZodType<GatewayOpenValue<"fallback" | "loadbalance" | "single">, ZodTypeDef, GatewayOpenValue<"fallback" | "loadbalance" | "single">>;
}, "strip", ZodType<GatewayJsonValue, ZodTypeDef, GatewayJsonValue>, {
mode: GatewayOpenValue<"fallback" | "loadbalance" | "single">;
}, {
mode: GatewayOpenValue<"fallback" | "loadbalance" | "single">;
}>>;
targets: ZodOptional<ZodArray<ZodObject<{
provider: ZodOptional<ZodString>;
virtual_key: ZodOptional<ZodString>;
}, "strip", ZodType<GatewayJsonValue, ZodTypeDef, GatewayJsonValue>, {
provider?: string;
virtual_key?: string;
}, {
provider?: string;
virtual_key?: string;
}>, "many">>;
provider: ZodOptional<ZodString>;
virtual_key: ZodOptional<ZodString>;
}, "strip", ZodType<GatewayJsonValue, ZodTypeDef, GatewayJsonValue>, {
retry?: {
attempts?: number;
on_status_codes?: number[];
};
cache?: {
mode?: GatewayOpenValue<"semantic" | "simple">;
max_age?: number;
};
strategy?: {
mode: GatewayOpenValue<"fallback" | "loadbalance" | "single">;
};
targets?: {
provider?: string;
virtual_key?: string;
}[];
provider?: string;
virtual_key?: string;
}, {
retry?: {
attempts?: number;
on_status_codes?: number[];
};
cache?: {
mode?: GatewayOpenValue<"semantic" | "simple">;
max_age?: number;
};
strategy?: {
mode: GatewayOpenValue<"fallback" | "loadbalance" | "single">;
};
targets?: {
provider?: string;
virtual_key?: string;
}[];
provider?: string;
virtual_key?: string;
}>;

Defined in: src/models/ai-gateway-routing.ts:174

Portkey-backed routing fields observed in concrete examples, with a JSON extension point for Prisma- or provider-specific configuration.