Config: add MiniMax direct API authentication option
Makes apiKey optional in ModelProviderConfig so MiniMax can use auth profiles or environment variables (MINIMAX_API_KEY) instead of requiring explicit config. Changes: - src/config/types.ts: apiKey changed from required to optional - src/config/zod-schema.ts: use z.string().min(1).optional() for validation - src/commands/configure.ts: add minimax-api auth choice in wizard - src/commands/onboard-auth.ts: MiniMax provider omits apiKey (uses env/auth) - patches/@mariozechner__pi-ai@0.42.1.patch: map minimax → MINIMAX_API_KEY Auth Resolution Order (unchanged): 1. Auth profiles (highest priority) 2. Environment variables (MINIMAX_API_KEY, etc.) 3. Custom provider apiKey from models.json (lowest priority)
This commit is contained in:
@@ -1201,7 +1201,7 @@ export type ModelDefinitionConfig = {
|
||||
|
||||
export type ModelProviderConfig = {
|
||||
baseUrl: string;
|
||||
apiKey: string;
|
||||
apiKey?: string;
|
||||
api?: ModelApi;
|
||||
headers?: Record<string, string>;
|
||||
authHeader?: boolean;
|
||||
|
||||
@@ -40,7 +40,7 @@ const ModelDefinitionSchema = z.object({
|
||||
|
||||
const ModelProviderSchema = z.object({
|
||||
baseUrl: z.string().min(1),
|
||||
apiKey: z.string().min(1),
|
||||
apiKey: z.string().min(1).optional(),
|
||||
api: ModelApiSchema.optional(),
|
||||
headers: z.record(z.string(), z.string()).optional(),
|
||||
authHeader: z.boolean().optional(),
|
||||
|
||||
Reference in New Issue
Block a user