Documentation menu
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.

GET
GET

Only same-origin /api/* paths are allowed.

Leave blank to use your current signed-in browser session. The key is never saved.

Response
Send a request to view its response here.

Tiêu đề yêu cầu bắt buộc

Tạo một khóa API sau khi đăng nhập, sau đó bao gồm nó trong mọi yêu cầu API.

Authorization: Bearer YOUR_API_KEY

The 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

Nhận thông tin hồ sơ tài khoản, số dư tín dụng còn lại và tóm tắt thành viên của bạn.

Tiêu đề Yêu cầu

Authorization: Bearer YOUR_API_KEY

Tham số yêu cầu

Không có tham số yêu cầu.

Yêu cầu
curl -X GET "https://freesoragenerator.com/api/auth/user" \
  -H "Authorization: Bearer YOUR_API_KEY"
Ví dụ về phản hồi
{
  "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
    }
  }
}
Ví dụ về lỗi
{
  "success": false,
  "error": "User not authenticated"
}