Skip to main content

AI Setup

Enable AI-powered features by connecting your Event Schedule instance to Google Gemini and OpenAI.

Overview

Event Schedule supports two AI providers: Google Gemini and OpenAI. Configuring just one key enables all AI features - text and image generation. If both keys are configured, Gemini handles text and OpenAI handles images. These features are optional - Event Schedule works without them, but they can save significant time when creating and managing events.

Optional Setup

AI features are entirely optional. If you don't configure API keys, Event Schedule will work normally with all non-AI features. AI-related buttons and options will either be hidden or show a message prompting you to configure the API keys.

AI Features

The following text-based features are available (uses Gemini if configured, otherwise OpenAI):

AI Import

Paste unstructured text (email, message, flyer text) and AI will automatically extract event details like title, date, time, location, and description to create an event.

Scan Agenda

Upload a photo or screenshot of an event agenda, poster, or flyer. AI reads the image and extracts event information to create multiple events at once.

AI Text on Event Graphics

When generating event graphics for social media sharing, AI creates engaging promotional text tailored to the event.

Automatic Translations

AI-powered translation of event details, schedule names, sub-schedule names, and custom fields into multiple languages.

AI Details Generator

Generate short descriptions and full descriptions for your schedules and events using AI, based on the name and context.

The following image generation features are available (uses OpenAI if configured, otherwise Gemini Imagen):

AI Flyer Generation

Generate professional event flyer images from event details. Customize the style with optional instructions.

AI Style Generation (Images)

Generate cohesive profile images, header images, and background images for your schedule branding. Works alongside Gemini-powered accent color and font selection.

Get a Gemini API Key

Follow these steps to get a Gemini API key from Google:

  1. Go to Google AI Studio
  2. Sign in with your Google account
  3. Click Create API Key
  4. Select or create a Google Cloud project
  5. Copy the generated API key
Free Tier

Google Gemini offers a free tier with generous rate limits that is sufficient for most selfhosted instances. Check Google's pricing page for current limits and pricing.

Get an OpenAI API Key

Follow these steps to get an OpenAI API key for image generation:

  1. Go to OpenAI Platform
  2. Sign in or create an OpenAI account
  3. Click Create new secret key
  4. Give it a name (e.g., "Event Schedule") and copy the key
Pricing

OpenAI image generation is a paid API. Each image costs a small amount based on size and quality. Check OpenAI's pricing page for current rates.

Configuration

Add your API keys to the .env file:

.env
GEMINI_API_KEY=your-gemini-api-key-here
OPENAI_API_KEY=your-openai-api-key-here

# Optional: choose which provider handles text and image requests
# Options: gemini, openai (defaults: text=gemini, image=openai)
AI_TEXT_PROVIDER=gemini
AI_IMAGE_PROVIDER=openai

# Optional: choose specific AI models (defaults shown)
# Translation models are used for batch translation tasks
# Content models are used for interactive features (event parsing, AI details, style generation, blog posts)
GEMINI_TRANSLATION_MODEL=gemini-2.5-flash
GEMINI_CONTENT_MODEL=gemini-2.5-pro
GEMINI_IMAGE_MODEL=imagen-4.0-ultra-generate-001
OPENAI_TRANSLATION_MODEL=gpt-4o
OPENAI_CONTENT_MODEL=o3
OPENAI_IMAGE_MODEL=gpt-image-1.5

After adding the keys, clear the config cache:

bash
php artisan config:clear

That's it. AI features will be automatically available throughout the application once the keys are configured. Configuring just one key enables all AI features - the system automatically falls back to the available provider. If both keys are configured, Gemini handles text and OpenAI handles images by default. Use AI_TEXT_PROVIDER and AI_IMAGE_PROVIDER to change this. Translation and content models are configured separately so you can use a cheaper/faster model for batch translations and a more capable model for interactive content creation tasks.

Troubleshooting

"Add GEMINI_API_KEY to the .env file" message

  • Verify the key is set in your .env file
  • Run php artisan config:clear to refresh the configuration

"Add OPENAI_API_KEY to the .env file" message

  • Verify the key is set in your .env file
  • Run php artisan config:clear to refresh the configuration
  • This key is required for AI image generation features (flyers, style images)

AI text requests failing or timing out

  • Check that your server can make outbound HTTPS connections to generativelanguage.googleapis.com
  • Verify your API key is valid and not expired at Google AI Studio
  • Check storage/logs/laravel.log for specific error messages

AI image generation failing

  • Check that your server can make outbound HTTPS connections to api.openai.com
  • Verify your OpenAI API key is valid at OpenAI Platform
  • Ensure your OpenAI account has available credits
  • Some prompts may be rejected by OpenAI's content policy - try adjusting your style instructions

Rate limit errors

  • Both APIs have rate limits. If you're hitting them, wait a few minutes and try again.
  • For Gemini, the free tier has generous limits. Check Google's pricing page for details.
  • For OpenAI, rate limits depend on your account tier. Check your account limits for details.