# 🤖 ChatGPT Setup Guide - Step by Step

## 📍 ChatGPT Mein Kaun Sa URL Add Karna Hai?

### ✅ **Main URL (Required):**

```
https://mcp.illumemedia.app/api.php
```

Yeh **API endpoint URL** hai jo ChatGPT Custom GPT mein add karna hai.

---

## 🚀 Complete Setup Steps

### **Step 1: ChatGPT.com Par Jao**

1. **ChatGPT Plus account** required hai
2. **https://chat.openai.com** par login karo
3. Left sidebar mein **"Explore GPTs"** click karo
4. **"Create a GPT"** button click karo

### **Step 2: Configure Tab**

1. **Name**: `Charity Search API` (ya kuch bhi)
2. **Description**: `Search and retrieve charity information from database`

### **Step 3: Actions Section (Important!)**

1. **"Actions"** tab click karo
2. **"Create new action"** button click karo
3. **"Import from URL"** option select karo
4. **Schema URL** mein yeh add karo:

```
https://mcp.illumemedia.app/openapi.yaml
```

**Ya phir:**

**"Import from file"** select karo aur `openapi.yaml` file upload karo (project folder se)

### **Step 4: API URL Setup**

**Authentication:**
- **Type**: `None` (public API hai)

**API Base URL:**
```
https://mcp.illumemedia.app
```

**Ya direct endpoint:**
```
https://mcp.illumemedia.app/api.php
```

### **Step 5: Save & Test**

1. **"Save"** button click karo
2. **"Test"** section mein test karo:
   - "Search charities in California"
   - "Get charities page 1"

---

## 📋 URLs Summary

### **For Custom GPT Actions:**

| Field | URL |
|-------|-----|
| **Schema URL** | `https://mcp.illumemedia.app/openapi.yaml` |
| **API Base URL** | `https://mcp.illumemedia.app` |
| **API Endpoint** | `https://mcp.illumemedia.app/api.php` |

### **For Direct API Calls:**

```
Get charities:
https://mcp.illumemedia.app/api.php?action=get_charities&page=1&perPage=10

Search charities:
https://mcp.illumemedia.app/api.php?action=search_charities&state=CA&page=1&perPage=10
```

---

## 🎯 Quick Setup (Copy-Paste)

### **Option 1: Schema URL (Recommended)**

ChatGPT Actions mein:
```
Schema URL: https://mcp.illumemedia.app/openapi.yaml
```

### **Option 2: Manual Schema Upload**

1. Project folder se `openapi.yaml` file download karo
2. ChatGPT Actions mein **"Import from file"** select karo
3. File upload karo

---

## ✅ Verification

Setup ke baad test karo:

1. **ChatGPT mein prompt:**
   ```
   Search for charities in California
   ```

2. **Expected response:**
   - ChatGPT API call karega
   - Charity data return karega
   - Results show honge

---

## 🔧 Troubleshooting

### **Problem: Schema not loading**

**Solution:**
- `openapi.yaml` file directly upload karo (URL se import na karo)
- File path verify karo: `D:\src\openapi.yaml`

### **Problem: API not responding**

**Solution:**
- Test karo: `https://mcp.illumemedia.app/api.php?action=test`
- Agar response aaye, to API working hai

### **Problem: CORS errors**

**Solution:**
- `.htaccess` file server par uploaded hai?
- CORS headers properly set hain?

---

## 📝 Important Notes

1. ✅ **HTTPS required** - HTTP kaam nahi karega
2. ✅ **No authentication** - Public API hai
3. ✅ **CORS enabled** - Browser requests allowed
4. ✅ **OpenAPI 3.0** - Standard format

---

## 🎉 That's It!

Agar sab kuch sahi se setup kiya, to ChatGPT ab charity data search kar sakta hai!

**Test Command:**
```
"Find charities in New York"
```

---

**Need Help?**
- Check `README_PHP.md` for detailed docs
- Check `DEPLOYMENT.md` for server setup
- Check `TEST_URLS.md` for testing URLs

