AI360 relies on three external AI services — Google Gemini, Cloudflare Workers AI, and ImageKit — each requiring its own set of API credentials. All variables are loaded at runtime from aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/ai360/llms.txt
Use this file to discover all available pages before exploring further.
.env.local file that you create at the project root. None of the values are bundled into the client build except those prefixed with NEXT_PUBLIC_, which are intentionally exposed to the browser for ImageKit’s client-side SDK.
Complete .env.local reference
Google Gemini
Used by: Text Summarizer, Cold Email Writer, Email Template Generator, Code Explainer, Flowchart Generator, Resume AnalyzerObtaining your keys
- Go to Google AI Studio and sign in with your Google account.
- Click Create API key and copy the generated value.
- Set that value as both
GEMINI_API_KEYandGOOGLE_API_KEYin.env.local. Both variables point to the same Google AI Studio key — they are separated in the codebase because the Resume Analyzer initialises its ownGoogleGenAIinstance with an explicitapiKeyparameter, while the other tools rely on the SDK picking upGEMINI_API_KEYfrom the environment automatically.
Model selection
The optionalGOOGLE_AI_MODEL variable lets you override the default model used by the Resume Analyzer. If omitted, the app defaults to gemini-2.5-flash. Only Gemini models available in your Google AI Studio project are valid values.
The
@google/genai SDK (v1.28+) reads GEMINI_API_KEY from the environment automatically when no apiKey is passed to new GoogleGenAI({}). You still need to set GOOGLE_API_KEY separately because the Resume Analyzer passes it explicitly: new GoogleGenAI({ apiKey: process.env.GOOGLE_API_KEY }).Cloudflare Workers AI
Used by: Image Generator (/api/utilities/image-generator)
The Image Generator calls Cloudflare’s REST inference API at:
Obtaining your credentials
- Log in to the Cloudflare Dashboard and navigate to Workers & Pages → Overview.
- Your Account ID is shown in the right-hand sidebar — this is your
CLOUDFLARE_ID. - To generate an API token, go to My Profile → API Tokens → Create Token. Use the Workers AI template, which grants the
workers_ai:runpermission, then copy the token value asCLOUDFLARE_API_KEY.
ImageKit
Used by: Background Remover (/api/utilities/background-remover)
The Background Remover uploads the source image to ImageKit and then applies the bgremove transformation via ImageKit’s URL-based image processing pipeline. The SDK is initialised in lib/imagekit.ts using all three variables:
Obtaining your credentials
- Create a free account at ImageKit.io and open the Developer Options page.
- Copy your Public Key →
NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY - Copy your Private Key →
IMAGEKIT_PRIVATE_KEY - Copy your URL Endpoint →
NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT
The URL endpoint must follow the exact format
https://ik.imagekit.io/your_imagekit_id — do not include a trailing slash. The your_imagekit_id segment is the unique ID shown on your ImageKit dashboard, not your email or display name. An incorrect endpoint causes uploads to fail with a 400 Bad Request from the ImageKit API.Troubleshooting common configuration errors
Any AI tool returns HTTP 500 with no useful message
Any AI tool returns HTTP 500 with no useful message
A missing or empty environment variable is the most common cause. Next.js does not throw at startup when a variable is undefined — the error surfaces at request time when the SDK attempts to use the value.Fix: Confirm that
.env.local exists at the project root (not inside app/ or src/), that every required variable is present and has a non-empty value, and then restart the dev server (Ctrl+C then npm run dev). Changes to .env.local are only picked up on server restart.Background Remover fails with an ImageKit URL endpoint error
Background Remover fails with an ImageKit URL endpoint error
This almost always means
NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT is malformed. Common mistakes include:- Trailing slash:
https://ik.imagekit.io/myid/→ remove the/ - Wrong ID segment: using your email address or display name instead of the ImageKit-generated ID
- HTTP instead of HTTPS: ImageKit requires
https://
https://ik.imagekit.io/abc123xyz.Image Generator returns 401 Unauthorized from Cloudflare
Image Generator returns 401 Unauthorized from Cloudflare
Resume Analyzer always returns score 0 for all categories
Resume Analyzer always returns score 0 for all categories
The Resume Analyzer uses
GOOGLE_API_KEY — not GEMINI_API_KEY — to authenticate. If GOOGLE_API_KEY is missing the SDK call fails silently and the route returns the createErrorFeedback() fallback object with all scores set to 0.Fix: Ensure GOOGLE_API_KEY is explicitly set in .env.local with a valid Google AI Studio key. You can use the same key value as GEMINI_API_KEY.