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