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"
}