/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; /** * Provider type (openai, anthropic, google, moonshot, glm, deepseek, xai, azure, vertex, bedrock, custom) */ export enum Provider { Openai = "openai", Anthropic = "anthropic", Google = "google", Moonshot = "moonshot", Glm = "glm", Deepseek = "deepseek", Xai = "xai", Azure = "azure", Vertex = "vertex", Bedrock = "bedrock", Custom = "custom", } export type NameProviderApiKeySupportedModel = { /** * Model identifier */ id: string; /** * Human-readable name */ displayName?: string | undefined; /** * Adapter family (openai|anthropic|inference) */ family?: string | undefined; /** * Role list: exec, eval, opt */ roles?: Array | undefined; /** * 'discovered' | 'manual' */ source?: string | undefined; }; export type NameProviderApiKey = { /** * Display name for this provider configuration */ name: string; /** * Provider type (openai, anthropic, google, moonshot, glm, deepseek, xai, azure, vertex, bedrock, custom) */ provider?: Provider | undefined; /** * The entry's single secret, when sent in this top-level slot. OPTIONAL because the secret's wire name is per-entry — ten entries call it 'apiKey', Google Vertex calls it 'serviceAccountKey'. Send it here or as the correspondingly-named key in credentialFields. */ apiKey?: string | undefined; /** * Per-entry credential material keyed by the catalog wire names for this provider. GET /providers/catalog declares which fields each entry accepts. The secret is extracted and encrypted; only the non-secret remainder is stored. */ credentialFields?: { [k: string]: string } | undefined; /** * Which hosted model family a gateway configuration targets. Required for gateways hosting more than one (Azure, Google Vertex); derived for single-family gateways (AWS Bedrock); not accepted for direct providers. */ hostedFamily?: string | undefined; /** * Custom base URL for the provider API */ baseUrl?: string | undefined; /** * Model name mappings (e.g., {"gpt-4": "custom-gpt-4"}) */ modelOverrides?: { [k: string]: string } | undefined; /** * Set as default provider for this scope */ isDefault?: boolean | undefined; /** * Declared models this provider serves */ supportedModels?: Array | undefined; /** * API version string, e.g. '2024-08-01-preview' */ apiVersion?: string | undefined; /** * Additional metadata */ metadata?: { [k: string]: any } | undefined; }; /** @internal */ export const Provider$outboundSchema: z.ZodMiniEnum = z.enum( Provider, ); /** @internal */ export type NameProviderApiKeySupportedModel$Outbound = { id: string; displayName?: string | undefined; family?: string | undefined; roles?: Array | undefined; source?: string | undefined; }; /** @internal */ export const NameProviderApiKeySupportedModel$outboundSchema: z.ZodMiniType< NameProviderApiKeySupportedModel$Outbound, NameProviderApiKeySupportedModel > = z.object({ id: z.string(), displayName: z.optional(z.string()), family: z.optional(z.string()), roles: z.optional(z.array(z.string())), source: z.optional(z.string()), }); export function nameProviderApiKeySupportedModelToJSON( nameProviderApiKeySupportedModel: NameProviderApiKeySupportedModel, ): string { return JSON.stringify( NameProviderApiKeySupportedModel$outboundSchema.parse( nameProviderApiKeySupportedModel, ), ); } /** @internal */ export type NameProviderApiKey$Outbound = { name: string; provider: string; apiKey?: string | undefined; credentialFields?: { [k: string]: string } | undefined; hostedFamily?: string | undefined; baseUrl?: string | undefined; modelOverrides?: { [k: string]: string } | undefined; isDefault: boolean; supportedModels?: | Array | undefined; apiVersion?: string | undefined; metadata?: { [k: string]: any } | undefined; }; /** @internal */ export const NameProviderApiKey$outboundSchema: z.ZodMiniType< NameProviderApiKey$Outbound, NameProviderApiKey > = z.object({ name: z.string(), provider: z._default(Provider$outboundSchema, Provider.Openai), apiKey: z.optional(z.string()), credentialFields: z.optional(z.record(z.string(), z.string())), hostedFamily: z.optional(z.string()), baseUrl: z.optional(z.string()), modelOverrides: z.optional(z.record(z.string(), z.string())), isDefault: z._default(z.boolean(), false), supportedModels: z.optional( z.array(z.lazy(() => NameProviderApiKeySupportedModel$outboundSchema)), ), apiVersion: z.optional(z.string()), metadata: z.optional(z.record(z.string(), z.any())), }); export function nameProviderApiKeyToJSON( nameProviderApiKey: NameProviderApiKey, ): string { return JSON.stringify( NameProviderApiKey$outboundSchema.parse(nameProviderApiKey), ); }