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.رأس الطلب المطلوب
قم بإنشاء مفتاح API بعد تسجيل الدخول، ثم قم بتضمينه في كل طلب 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/userاحصل على ملف حسابك، والرصيد المتبقي، وملخص العضوية.
رؤوس الطلب
Authorization: Bearer YOUR_API_KEYمعلمات الطلب
لا توجد معلمات طلب.
طلب
curl -X GET "https://freesoragenerator.com/api/auth/user" \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
{
"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
}
}
}مثال على خطأ
{
"success": false,
"error": "User not authenticated"
}