# Copy this file to .env and fill in your key. .env is git-ignored. # # The AI tutor speaks the OpenAI-compatible "chat completions" API, so it works # with many providers. Set three variables: # # AI_API_KEY your provider API key # AI_BASE_URL the provider's base URL (usually ends in /v1) # AI_MODEL the model name to use # # ---- Provider quick reference ----------------------------------------------- # # OpenAI # AI_BASE_URL=https://api.openai.com/v1 # AI_MODEL=gpt-4o-mini # Get a key: https://platform.openai.com/api-keys # Model list: https://platform.openai.com/docs/models # # DeepSeek # AI_BASE_URL=https://api.deepseek.com/v1 # AI_MODEL=deepseek-chat # Get a key: https://platform.deepseek.com/api_keys # Docs/models: https://api-docs.deepseek.com # # SiliconFlow # AI_BASE_URL=https://api.siliconflow.cn/v1 # AI_MODEL=deepseek-ai/DeepSeek-V3 # Get a key: https://cloud.siliconflow.cn/account/ak # Model list: https://cloud.siliconflow.cn/models # # OpenRouter (single key, hundreds of models) # AI_BASE_URL=https://openrouter.ai/api/v1 # AI_MODEL=deepseek/deepseek-chat # Get a key: https://openrouter.ai/keys # Model list: https://openrouter.ai/models # # Google Gemini (via its OpenAI-compatible endpoint) # AI_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai # AI_MODEL=gemini-2.5-flash # Get a key: https://aistudio.google.com/apikey # # ---- Troubleshooting -------------------------------------------------------- # 401 / 403 Unauthorized -> AI_API_KEY is wrong or doesn't match AI_BASE_URL # 404 Not Found -> AI_BASE_URL is off (most providers need a trailing # /v1), or AI_MODEL doesn't exist for this provider # "no such model" -> check the provider's model list (links above) for # the exact model string, they are case-sensitive # decode errors -> AI_BASE_URL points somewhere that isn't an # OpenAI-compatible chat endpoint # The app prints the active "model via host" on startup so you can confirm it. # ----------------------------------------------------------------------------- AI_API_KEY=your-api-key-here AI_BASE_URL=https://api.openai.com/v1 AI_MODEL=gpt-4o-mini # Shortcut: if you set only GOOGLE (a Gemini key) and leave the AI_* vars unset, # the app defaults to Google's Gemini endpoint with gemini-2.5-flash. # GOOGLE=your-gemini-api-key-here