Skip to main content

Variable: GatewayUserApiKeyCreateRequestSchema

const GatewayUserApiKeyCreateRequestSchema: ZodObject<{
name: ZodString;
description: ZodOptional<ZodString>;
scopes: ZodArray<ZodType<GatewayOpenValue<
| "agents.invoke"
| "completions.write"
| "logs.write"
| "mcp.invoke"
| "prompts.render">, ZodTypeDef, GatewayOpenValue<
| "agents.invoke"
| "completions.write"
| "logs.write"
| "mcp.invoke"
| "prompts.render">>, "many">;
rate_limits: ZodOptional<ZodNullable<ZodArray<ZodObject<{
type: ZodType<GatewayOpenValue<"requests" | "tokens">, ZodTypeDef, GatewayOpenValue<"requests" | "tokens">>;
unit: ZodType<GatewayOpenValue<"rpd" | "rph" | "rpm" | "rps" | "rpw">, ZodTypeDef, GatewayOpenValue<"rpd" | "rph" | "rpm" | "rps" | "rpw">>;
value: ZodNumber;
}, "strict", ZodTypeAny, {
type: GatewayOpenValue<"requests" | "tokens">;
unit: GatewayOpenValue<"rpd" | "rph" | "rpm" | "rps" | "rpw">;
value: number;
}, {
type: GatewayOpenValue<"requests" | "tokens">;
unit: GatewayOpenValue<"rpd" | "rph" | "rpm" | "rps" | "rpw">;
value: number;
}>, "many">>>;
usage_limits: ZodOptional<ZodNullable<ZodEffects<ZodEffects<ZodObject<{
credit_limit: ZodOptional<ZodNumber>;
type: ZodOptional<ZodEnum<[..., ...]>>;
alert_threshold: ZodOptional<ZodNumber>;
periodic_reset: ZodOptional<ZodNullable<ZodEnum<...>>>;
periodic_reset_days: ZodOptional<ZodNullable<ZodNumber>>;
next_usage_reset_at: ZodOptional<ZodNullable<ZodString>>;
}, "strict", ZodTypeAny, {
credit_limit?: number;
type?: "cost" | "tokens";
alert_threshold?: number;
periodic_reset?: "monthly" | "weekly" | null;
periodic_reset_days?: number | null;
next_usage_reset_at?: string | null;
}, {
credit_limit?: number;
type?: "cost" | "tokens";
alert_threshold?: number;
periodic_reset?: "monthly" | "weekly" | null;
periodic_reset_days?: number | null;
next_usage_reset_at?: string | null;
}>, {
[key: string]: any;
}, {
[key: string]: any;
}>, {
[key: string]: any;
}, {
[key: string]: any;
}>>>;
defaults: ZodOptional<ZodNullable<ZodObject<{
metadata: ZodOptional<ZodRecord<ZodString, ZodType<GatewayJsonValue, ZodTypeDef, GatewayJsonValue>>>;
config_id: ZodOptional<ZodString>;
allow_config_override: ZodOptional<ZodBoolean>;
}, "strip", ZodType<GatewayJsonValue, ZodTypeDef, GatewayJsonValue>, {
metadata?: Record<string, GatewayJsonValue>;
config_id?: string;
allow_config_override?: boolean;
}, {
metadata?: Record<string, GatewayJsonValue>;
config_id?: string;
allow_config_override?: boolean;
}>>>;
alert_emails: ZodOptional<ZodArray<ZodString, "many">>;
expires_at: ZodOptional<ZodNullable<ZodString>>;
rotation_policy: ZodOptional<ZodNullable<ZodEffects<ZodEffects<ZodObject<{
rotation_period: ZodOptional<ZodNullable<ZodEnum<...>>>;
next_rotation_at: ZodOptional<ZodNullable<ZodString>>;
key_transition_period_ms: ZodOptional<ZodNumber>;
}, "strict", ZodTypeAny, {
rotation_period?: "monthly" | "weekly" | null;
next_rotation_at?: string | null;
key_transition_period_ms?: number;
}, {
rotation_period?: "monthly" | "weekly" | null;
next_rotation_at?: string | null;
key_transition_period_ms?: number;
}>, {
[key: string]: any;
}, {
[key: string]: any;
}>, {
[key: string]: any;
}, {
[key: string]: any;
}>>>;
organisation_id: ZodString;
workspace_id: ZodString;
type: ZodString;
user_id: ZodString;
}, "strict", ZodTypeAny, {
name: string;
description?: string;
scopes: GatewayOpenValue<
| "agents.invoke"
| "completions.write"
| "logs.write"
| "mcp.invoke"
| "prompts.render">[];
rate_limits?: | {
type: GatewayOpenValue<"requests" | "tokens">;
unit: GatewayOpenValue<"rpd" | "rph" | "rpm" | "rps" | "rpw">;
value: number;
}[]
| null;
usage_limits?: | {
[key: string]: any;
}
| null;
defaults?: | {
metadata?: Record<string, GatewayJsonValue>;
config_id?: string;
allow_config_override?: boolean;
}
| null;
alert_emails?: string[];
expires_at?: string | null;
rotation_policy?: | {
[key: string]: any;
}
| null;
organisation_id: string;
workspace_id: string;
type: string;
user_id: string;
}, {
name: string;
description?: string;
scopes: GatewayOpenValue<
| "agents.invoke"
| "completions.write"
| "logs.write"
| "mcp.invoke"
| "prompts.render">[];
rate_limits?: | {
type: GatewayOpenValue<"requests" | "tokens">;
unit: GatewayOpenValue<"rpd" | "rph" | "rpm" | "rps" | "rpw">;
value: number;
}[]
| null;
usage_limits?: | {
[key: string]: any;
}
| null;
defaults?: | {
metadata?: Record<string, GatewayJsonValue>;
config_id?: string;
allow_config_override?: boolean;
}
| null;
alert_emails?: string[];
expires_at?: string | null;
rotation_policy?: | {
[key: string]: any;
}
| null;
organisation_id: string;
workspace_id: string;
type: string;
user_id: string;
}>;

Defined in: src/models/ai-gateway-requests.ts:293