Actions: OpenAPI Spec ile API Entegrasyonu
Custom GPT'nin dış API çağırması: OpenAPI 3.1 spec yazma, parametre, response handling.
Şükrü Yusuf KAYA
11 dakikalık okuma
İleriActions = "GPT'nin elleri"#
Knowledge: GPT okuyabilir.
Actions: GPT bir şeyler yapabilir — API'ye istek atar.
Örnekler:
- CRM'den müşteri kaydı çek
- Hava durumu API'sinden veri al
- Stripe ile ödeme oluştur
- GitHub'a issue aç
- Notion'a sayfa ekle
yaml
openapi: 3.1.0info: title: Weather API description: 2026 hava durumu servisi version: 1.0.0servers: - url: https://api.weather.example.compaths: /current: get: operationId: getCurrentWeather summary: Belirtilen şehir için anlık hava durumu parameters: - name: city in: query required: true schema: type: string description: Şehir adı (örn. "İstanbul") - name: units in: query required: false schema: type: string enum: [metric, imperial] default: metric responses: '200': description: Başarılı yanıt content: application/json: schema: type: object properties: city: { type: string } temperature: { type: number, description: "Derece (Celsius)" } condition: { type: string } humidity: { type: integer } wind_kmh: { type: number } '404': description: Şehir bulunamadı security: - ApiKeyAuth: []components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-API-KeyOpenAPI 3.1 spec — basit hava durumu API'si için.
💡 OpenAPI yazımı best practice
(1) operationId net: (camelCase, eylem-içerik). GPT bu adı kullanır. (2) description detaylı: GPT ne zaman bu fonksiyonu çağıracağına bunlardan karar verir. (3) parametre description: format, örnek değer, sınır. (4) response schema: GPT yanıt verisini nasıl yorumlayacağını öğrenir. (5) error responses: 4xx, 5xx tanımla.
getCurrentWeatherPublic API (örn. Wikipedia). Hiçbir kimlik doğrulama gerekmez.
Yaygın Actions örnekleri#
| API | Use case |
|---|---|
| Weather | "İstanbul'da hava nasıl?" |
| Calendar (Google/Outlook) | Toplantı oluştur |
| CRM (HubSpot/Salesforce) | Lead bilgisi çek |
| Stripe | Ödeme oluştur, müşteri sorgula |
| Notion | Sayfa ekle / güncelle |
| GitHub | Issue/PR oluştur |
| Slack | Mesaj gönder |
| Custom DB (kendi backend'in) | İşletme verisi |
Özet#
✓ Actions = GPT'nin API çağırma yeteneği
✓ OpenAPI 3.1 spec ile tanımlanır
✓ Auth: None / API Key / OAuth
✓ operationId + description = GPT'nin fonksiyonu doğru çağırması için kritik
Sıradaki ders: Authentication detayları (API Key, OAuth).
Yorumlar & Soru-Cevap
(0)Yorum yazmak için giriş yap.
Yorumlar yükleniyor...
İlgili İçerikler
Modül 1: Başlangıç ve Temeller
ChatGPT Nedir? Tarihçe, Evrim ve Bugünün Manzarası
Öğrenmeye BaşlaModül 1: Başlangıç ve Temeller
Hesap Açma ve Plan Karşılaştırması: Free, Plus, Pro, Team, Enterprise
Öğrenmeye BaşlaModül 1: Başlangıç ve Temeller