Skip to content

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 min read
Advanced
Actions: OpenAPI Spec ile API Entegrasyonu

Actions = "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.0
info:
title: Weather API
description: 2026 hava durumu servisi
version: 1.0.0
servers:
- url: https://api.weather.example.com
paths:
/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-Key
OpenAPI 3.1 spec — basit hava durumu API'si için.
💡 OpenAPI yazımı best practice
(1) operationId net:
getCurrentWeather
(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.
Public API (örn. Wikipedia). Hiçbir kimlik doğrulama gerekmez.

Yaygın Actions örnekleri#

APIUse 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
NotionSayfa ekle / güncelle
GitHubIssue/PR oluştur
SlackMesaj 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...

Related Content