Skip to main content

Documentation 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.

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 a .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
GEMINI_API_KEY=your_gemini_api_key

# Used by: Resume Analyzer (initialises a separate GoogleGenAI instance)
GOOGLE_API_KEY=your_google_api_key

# Optional — defaults to gemini-2.5-flash if not set
GOOGLE_AI_MODEL=gemini-2.5-flash

# Cloudflare Workers AI
# Used by: Image Generator (FLUX.1 Schnell)
CLOUDFLARE_ID=your_cloudflare_account_id
CLOUDFLARE_API_KEY=your_cloudflare_api_key

# ImageKit
# Used by: Background Remover
NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY=your_imagekit_public_key
IMAGEKIT_PRIVATE_KEY=your_imagekit_private_key
NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT=https://ik.imagekit.io/your_imagekit_id
Never commit .env.local to version control. It is already listed in Next.js’s default .gitignore, but verify this before pushing to a public repository. Exposing your Gemini, Cloudflare, or ImageKit secrets can result in unexpected charges and unauthorised API usage.

Google Gemini

Used by: Text Summarizer, Cold Email Writer, Email Template Generator, Code Explainer, Flowchart Generator, Resume Analyzer

Obtaining your keys

  1. Go to Google AI Studio and sign in with your Google account.
  2. Click Create API key and copy the generated value.
  3. Set that value as both GEMINI_API_KEY and GOOGLE_API_KEY in .env.local. Both variables point to the same Google AI Studio key — they are separated in the codebase because the Resume Analyzer initialises its own GoogleGenAI instance with an explicit apiKey parameter, while the other tools rely on the SDK picking up GEMINI_API_KEY from the environment automatically.

Model selection

The optional GOOGLE_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:
https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ID}/ai/run/@cf/black-forest-labs/flux-1-schnell

Obtaining your credentials

  1. Log in to the Cloudflare Dashboard and navigate to Workers & Pages → Overview.
  2. Your Account ID is shown in the right-hand sidebar — this is your CLOUDFLARE_ID.
  3. To generate an API token, go to My Profile → API Tokens → Create Token. Use the Workers AI template, which grants the workers_ai:run permission, then copy the token value as CLOUDFLARE_API_KEY.
CLOUDFLARE_ID is your account ID (a 32-character hex string), not your zone ID or any other identifier. CLOUDFLARE_API_KEY must be an API Token (not a Global API Key) scoped to Workers AI. Using a Global API Key instead of a scoped token is a common source of 401 Unauthorized errors.

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:
const imagekit = new ImageKit({
  publicKey: process.env.NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY!,
  privateKey: process.env.IMAGEKIT_PRIVATE_KEY!,
  urlEndpoint: process.env.NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT!,
});

Obtaining your credentials

  1. Create a free account at ImageKit.io and open the Developer Options page.
  2. Copy your Public KeyNEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY
  3. Copy your Private KeyIMAGEKIT_PRIVATE_KEY
  4. Copy your URL EndpointNEXT_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

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.
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://
Fix: Open your ImageKit dashboard and copy the URL Endpoint value verbatim. It should look exactly like https://ik.imagekit.io/abc123xyz.
This error means the CLOUDFLARE_API_KEY value is either invalid or lacks the required permission.Common causes:
  • You copied the Global API Key from your profile instead of creating a scoped API Token
  • The API token was created with insufficient permissions (needs workers_ai:run)
  • The token was revoked or expired
Fix: Go to Cloudflare Dashboard → My Profile → API Tokens, create a new token using the Workers AI template, and update CLOUDFLARE_API_KEY in .env.local. Also verify CLOUDFLARE_ID is your Account ID (found on the Workers & Pages overview page), not a zone or project ID.
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.

Build docs developers (and LLMs) love