API Reference

Authentication

Most API endpoints require authentication. Include your session cookie or use the NextAuth session. For programmatic access, use the agent API endpoint with an API key.

# Using session cookie (browser)
fetch('/api/checkin', {
  method: 'POST',
  credentials: 'include'
})

# Using agent API
POST /api/agent
Content-Type: application/json

{
  "action": "checkin",
  "gameId": "genshin"
}

API Endpoints

MethodEndpointAuth
GET/api/gamesNo
POST/api/auth/registerNo
GET/api/user/accountsYes
POST/api/user/accountsYes
PUT/api/user/accounts/:idYes
DELETE/api/user/accounts/:idYes
POST/api/checkinYes
POST/api/checkin/:gameIdYes
GET/api/checkin/historyYes
GET/api/games/:gameId/statusYes
POST/api/agentYes

Examples

Link a Game Account

POST /api/user/accounts
Content-Type: application/json

{
  "gameId": "genshin",
  "ltokenV2": "v2_CAISDG...",
  "ltuidV2": "123456789"
}

// Response
{
  "account": {
    "id": "clx...",
    "gameId": "genshin",
    "uid": "800000001",
    "nickname": "Traveler"
  }
}

Trigger Check-in

POST /api/checkin
Content-Type: application/json

// Response
{
  "results": [
    {
      "gameId": "genshin",
      "status": "success",
      "message": "Successfully checked in for Genshin Impact"
    },
    {
      "gameId": "starrail",
      "status": "already_claimed",
      "message": "Already checked in today for Honkai: Star Rail"
    }
  ]
}