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
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/games | List all supported games | No |
| POST | /api/auth/register | Register a new account | No |
| GET | /api/user/accounts | List linked game accounts | Yes |
| POST | /api/user/accounts | Link a new game account | Yes |
| PUT | /api/user/accounts/:id | Update a linked account | Yes |
| DELETE | /api/user/accounts/:id | Unlink a game account | Yes |
| POST | /api/checkin | Check in all linked accounts | Yes |
| POST | /api/checkin/:gameId | Check in for a specific game | Yes |
| GET | /api/checkin/history | Get check-in history | Yes |
| GET | /api/games/:gameId/status | Get game account status | Yes |
| POST | /api/agent | Agent-facing API for skill | Yes |
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"
}
]
}