Configure Kirby Copilot globally in your config.php file. This sets default options that apply to all plugin instances, including AI provider settings, generation parameters, and default behavior for view buttons and sections.
Kirby Copilot supports multiple AI providers. You must configure at least one provider with valid credentials for the plugin to function.
All provider configurations are nested under the johannschopplich.copilot key:
return [
'johannschopplich.copilot' => [
'provider' => 'openai', // Choose your primary provider
'providers' => [
'openai' => [
'apiKey' => 'YOUR_API_KEY',
'model' => 'o4-mini'
]
]
]
];
Kirby Copilot supports four AI providers:
openai) – GPT models (default)google) – Gemini modelsanthropic) – Claude modelsmistral) – Mistral modelsConfigure OpenAI GPT models for content generation:
return [
'johannschopplich.copilot' => [
'provider' => 'openai',
'providers' => [
'openai' => [
'apiKey' => env('OPENAI_API_KEY'),
'model' => 'o4-mini'
]
]
]
];
Models with a balanced performance and cost are recommended for structured content generation:
gpt-5gpt-5-minio4-minireasoningEffort objectGPT-5 and GPT-5 Mini are designed as reasoning models with different underlying architecture. The reasoningEffort parameter allows you to control the depth of reasoning applied during content generation.
Default: medium
return [
'johannschopplich.copilot' => [
'provider' => 'openai',
'providers' => [
'openai' => [
'apiKey' => env('OPENAI_API_KEY'),
'model' => 'gpt-5-mini',
// Set provider-specific options
'options' => [
'reasoningEffort' => 'medium' // 'minimal' | 'low' | 'medium' | 'high'
]
]
]
]
];
Configure Google Gemini models. We recommend them for generating structured data like blocks and layouts:
return [
'johannschopplich.copilot' => [
'provider' => 'google',
'providers' => [
'google' => [
'apiKey' => env('GOOGLE_API_KEY'),
'model' => 'gemini-2.5-flash' // or 'gemini-2.5-pro'
]
]
]
];
Configure Anthropic Claude models:
return [
'johannschopplich.copilot' => [
'provider' => 'anthropic',
'providers' => [
'anthropic' => [
'apiKey' => env('ANTHROPIC_API_KEY'),
'model' => 'claude-sonnet-4-5-20250929'
]
]
]
];
Configure Mistral models with optional custom base URL:
return [
'johannschopplich.copilot' => [
'provider' => 'mistral',
'providers' => [
'mistral' => [
'apiKey' => env('MISTRAL_API_KEY'),
'model' => 'mistral-large-latest',
// Optionally, set the base URL of a custom Mistral API instance
'baseUrl' => 'https://api.mistral.ai'
]
]
]
];
temperature FloatControls the randomness and creativity of generated content. Higher values produce more creative but less predictable results.
temperature parameter obsolete. Use reasoningEffort instead.Default: 0.5Range: 0.0 (deterministic) to 1.0 (highly creative)
return [
'johannschopplich.copilot' => [
'temperature' => 0.8 // More creative
]
];
systemPrompt StringThe systemPrompt is probably the most important configuration option besides the model. It is the structural foundation of the generated content and complements the prompt that is provided by the user (userPrompt property).
Global system prompt that defines how the AI should structure and approach content generation. This can be overridden by view button props or section configuration.
return [
'johannschopplich.copilot' => [
'systemPrompt' => 'You are a professional content writer. Create engaging, well-structured content that is SEO-friendly and user-focused.'
]
];
excludedBlocks ArraySpecify block types to exclude from structured data generation in blocks and layout fields. This is useful for custom block types for which AI generation is not desired.
Default: [] (no blocks excluded)
return [
'johannschopplich.copilot' => [
'excludedBlocks' => ['custom-form', 'widget', 'advertisement'],
]
];
You can set global defaults that apply to both view buttons and sections. These can be overridden in individual blueprints.
For detailed descriptions of each configuration option, see the View Button & Section Configuration page. The following options can be set globally:
systemPrompt – Default system prompt for all generationsuserPrompt – Default user promptlogLevel – Default logging level for debuggingreturn [
'johannschopplich.copilot' => [
// AI Provider
'provider' => 'google',
'providers' => [
'google' => [
'apiKey' => env('GOOGLE_API_KEY'),
'model' => 'gemini-2.5-flash'
]
],
// Generation Settings
'temperature' => 0.7,
// Global Defaults
'logLevel' => 'info',
'excludedBlocks' => ['custom-form']
]
];
return [
'johannschopplich.copilot' => [
'providers' => [
'openai' => [
'apiKey' => env('OPENAI_API_KEY'), // Use environment variables
]
]
]
];
Global configuration serves as the foundation, with more specific configurations overriding global defaults:
config.php)return [
'johannschopplich.copilot' => [
'logLevel' => 'warn',
'systemPrompt' => 'Global prompt…'
]
];
sections:
copilot:
type: copilot
field: content
logLevel: debug # Overrides global
# systemPrompt inherited from global
buttons:
copilot:
logLevel: debug # Overrides both global
return [
'johannschopplich.copilot' => [
// Primary AI Provider
'provider' => 'google',
'providers' => [
'google' => [
'apiKey' => env('GOOGLE_API_KEY'),
'model' => 'gemini-2.5-flash'
],
'openai' => [
'apiKey' => env('OPENAI_API_KEY'),
'model' => 'gpt-5-mini'
]
],
// Generation Settings
'temperature' => 0.6,
// Global Defaults
'excludedBlocks' => [
'contact-form',
'newsletter-signup',
'advertisement'
]
]
];