AI Studio API
Authentication and account
Create an API key, authenticate requests, and read account details.
API playground
Send a real request to this site and inspect the HTTP response immediately.
Response
Send a request to view its response here.Header permintaan yang diperlukan
Buat Kunci API setelah masuk, lalu sertakan di setiap permintaan API.
Authorization: Bearer YOUR_API_KEYThe example domain is automatically resolved from NEXT_PUBLIC_SITE_URL. Replace only YOUR_API_KEY with the key generated in your account.
GET
/api/auth/userDapatkan profil akun Anda, kredit yang tersisa, dan ringkasan keanggotaan.
Header Permintaan
Authorization: Bearer YOUR_API_KEYParameter Permintaan
Tidak ada parameter permintaan.
Permintaan
curl -X GET "https://freesoragenerator.com/api/auth/user" \
-H "Authorization: Bearer YOUR_API_KEY"Contoh Tanggapan
{
"success": true,
"data": {
"user": {
"id": "user-id",
"email": "developer@example.com",
"role": "user",
"name": "Developer",
"image": null,
"authType": "apikey"
},
"credits": 120,
"membership": {
"isVip": false,
"level": "none",
"planTitle": null
}
}
}Contoh Kesalahan
{
"success": false,
"error": "User not authenticated"
}