📚 Kandungan (Contents)
PintarRPH Web Sekolah Rendah (KSSR) · Sekolah Menengah (KSSM)
Documentation Configuration Gemini Api Setup

Gemini Api Setup

How to Get Your Google Gemini API Key for PintarRPH Web

This guide will help you obtain a Google Gemini API key for PintarRPH Web. Setting up a personal key is optional — PintarRPH uses a built-in AI system so you can generate RPH and RPT immediately without any API key. Add your own key here if you prefer to use your personal Google AI quota.

Platform: https://pintarrph.com


What You'll Need

  • A Google account (Gmail)
  • A web browser (Chrome, Firefox, Edge, Safari, etc.)

Note: The Gemini API has a generous free tier that is suitable for most teachers. You will not need to provide payment information for the free tier.


Video Tutorial

A video tutorial is available on the Gemini API key setup page within PintarRPH. Go to "Tetapan" (Settings) → "Kunci API Gemini" to watch the embedded YouTube guide.


Step-by-Step Guide

Step 1: Go to Google AI Studio

  1. Open your web browser
  2. Go to: https://aistudio.google.com/app/apikey
  3. Sign in with your Google account (Gmail)

Step 2: Create API Key

  1. Click the "Get API key" or "Create API key" button
  2. You will see a dialog with options:
    - "Create API key in new project" (recommended for first-time users)
    - "Create API key in existing project" (if you already have a Google Cloud project)
  3. Choose "Create API key in new project"
  4. Wait a few seconds while Google creates your project

Step 3: Copy Your API Key

  1. Your new API key will be displayed in a dialog box
  2. It looks something like this:
    AIzaSyBxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  3. Click "Copy" to copy the API key to your clipboard
  4. IMPORTANT: Save this key somewhere safe! (See security tips below)

Step 4: Configure API Key in PintarRPH Web

  1. Log in to PintarRPH Web:
    - Open your browser and go to https://pintarrph.com
    - Log in with your PintarRPH account

  2. Go to Settings:
    - Click on "Tetapan Sistem" (Settings) in the navigation menu

  3. Find the API key section:
    - Look for the section "Kunci API Gemini"
    - You will see 5 numbered key fields:

Key Feature Group Behaviour
Key 1 Jana RPH Primary key; other empty fields fall back to this
Key 2 Jana RPH Custom Separate quota for custom topic generation
Key 3 Jana RPT Dedicated key for annual plan generation
Key 4 Ekstrak Buku Teks & SK/SP Dedicated key for textbook/DSKP extraction
Key 5 Muat Naik Kalendar Dedicated key for calendar upload
  1. Paste your API key into Key 1 (required minimum):
    - Click in the Key 1 text field
    - Paste your API key (Ctrl + V or Cmd + V)
    - Example: AIzaSyBxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    - Keys 2-5 are optional. Any empty field automatically falls back to Key 1.

  2. Optionally add separate keys for other feature groups:
    - Paste different API keys in Keys 2-5 if you have them
    - This prevents quota from being shared across features
    - Get additional free keys at Google AI Studio (you can create multiple projects)

  3. Optionally configure the model:
    - Find the "Gemini Model" field
    - Default is gemini-2.5-flash (good balance of speed and quality)
    - Change if needed

  4. Save your configuration:
    - Click the "Simpan Konfigurasi" (Save Configuration) button
    - Wait for the confirmation message
    - Your API key is now active immediately -- no restart required

Automatic fallback for RPH: If Key 1 runs out of quota (Error 429), the system automatically switches to another available RPH key -- no interruption needed.

Starting from v2.29.0, each key slot (1–5) has a "Semak" (Check) button next to it. Click it to verify the key is valid without generating anything or using any AI quota — it makes a lightweight metadata call directly to Google.

When to use it:
- Before saving a new key — paste the key into a slot, click "Semak" first, then click "Simpan Konfigurasi" only if it shows "Kunci sah" (Key valid).
- After a generation fails with "API key not valid" — leave the field empty and click "Semak" on each slot to find out which stored key is broken. This is much faster than guess-and-check with full RPH/RPT generations.

Possible results:
- Kunci sah — the key is valid and ready to use.
- Kunci ini tidak sah atau telah dibatalkan — the key is invalid, revoked, or the GCP project was deleted. Create a new one at aistudio.google.com/apikey.
- Kunci sah, tetapi kuota telah dicapai — the key is valid but has hit its daily/per-minute quota. Try again later, or use a different slot.
- Tidak dapat sambung ke Google — network issue on your side. Check your internet connection and retry.


Verify It's Working

  1. Go to the RPT or RPH generation page
  2. Try generating a plan
  3. If it works, you are all set!
  4. If you get an error, check the troubleshooting section below

Security & Best Practices

Keep Your API Key Safe

DO:
- Keep it private like a password
- Store it in a secure password manager
- Delete it from browser downloads folder after saving

DON'T:
- Share it with others
- Post it online or in screenshots
- Commit it to GitHub or version control
- Email it to yourself

If Your Key Is Compromised

If you accidentally exposed your API key:

  1. Go to: https://aistudio.google.com/app/apikey
  2. Find your key in the list
  3. Click the trash icon to delete it
  4. Create a new API key
  5. Go to Settings in PintarRPH Web, paste the new key into Key 1 (and any other affected fields), and click "Simpan Konfigurasi"

Free Tier Limits

Google Gemini API free tier includes generous rate limits.

Free Tier Quota (as of 2026):
- 20 requests per day (RPD) for gemini-2.5-flash
- 5 requests per minute (RPM) for gemini-2.5-flash

PintarRPH App Limits (aligned with free tier):
- 20 RPT per day
- 20 RPH per day

For typical teaching plan generation:
- RPH Weekly: 2 calls per teaching day (e.g., 5 days = 10 calls)
- RPT Annual: ~2 calls per plan
- DSKP, BukuText, Calendar: 0 calls (pre-bundled / auto-configured)

The app limit matches the Gemini free tier to ensure sustainable operation.

Want to understand API usage in detail?
See: GEMINI_API_USAGE.md for a complete breakdown of how each feature uses the API.

If You Exceed Free Tier

You will get an error message like: "Rate limit exceeded" or "Quota exceeded"

Solutions:
1. Wait a minute and try again (if you hit the per-minute limit)
2. Wait until tomorrow (if you hit the daily limit)
3. Upgrade to paid tier (optional, only if you need more)


Troubleshooting

"Invalid API Key" Error

  1. Copy the key again from Google AI Studio -- make sure you get all characters
  2. Trim any spaces: the key should start with "AIza"
  3. Create a new API key if the old one was deleted

"API Key Not Set" Error

  1. Go to Settings (Tetapan Sistem) in PintarRPH Web
  2. Check if your API key is entered in the Key 1 field
  3. Make sure the key is complete (starts with "AIza")
  4. Click "Simpan Konfigurasi" to save

"Rate Limit Exceeded" Error

  1. Wait 1 minute (if you hit the per-minute limit)
  2. Wait until tomorrow (if you hit the daily limit)
  3. Generate plans in smaller batches
  4. Consider adding separate keys to Keys 2-5 to spread quota across features

"Model Not Available" Error

  1. Check the Gemini Model setting in Settings
  2. Default is gemini-2.5-flash -- change if needed
  3. Verify your API key is still valid at https://aistudio.google.com/app/apikey

Quick Summary

  1. Go to https://aistudio.google.com/app/apikey
  2. Sign in with your Google account
  3. Click "Create API key in new project"
  4. Copy the API key
  5. Log in to PintarRPH Web at https://pintarrph.com
  6. Go to Settings (Tetapan Sistem)
  7. Paste your API key into the Key 1 field under "Kunci API Gemini"
  8. Click "Simpan Konfigurasi" (Save Configuration)
  9. Start generating teaching plans!

Checklist

  • [ ] Created Google account (if you do not have one)
  • [ ] Visited Google AI Studio
  • [ ] Created API key in new project
  • [ ] Copied and saved API key securely
  • [ ] Logged in to PintarRPH Web
  • [ ] Opened Settings (Tetapan Sistem)
  • [ ] Pasted API key into Key 1 field
  • [ ] Clicked "Simpan Konfigurasi" to save
  • [ ] Tested by generating a plan
  • [ ] Verified it works without errors


Need Help?

Gemini API Issues

Google AI Studio:
- Visit: https://ai.google.dev/gemini-api/docs
- Check: https://ai.google.dev/gemini-api/docs/api-key

PintarRPH Support:
- Email: [email protected]
- Include: Error message and screenshots


Last Updated: April 2026
Platform: PintarRPH Web (https://pintarrph.com)
Gemini Model: gemini-2.5-flash
PintarRPH Desktop Version: 2.48.3